@font-face {
  font-family: 'Qube Sans';
  src: url('/assets/fonts/QubeSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: block;
}

:root {
  --grund: #F6F3EB;
  --schrift: #33363A;
  --grau: #666A70;
  --linie: #D9D5CA;
  --tuerkis: #0B7C8C;
  --blau: #2B62A8;
  --gruen: #2F7D32;
  --karte: #FFFFFF;
  --feld: #F6F3EB;
  --dunkel: #2E3135;
  --radius: 16px;
  --sys: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --kopf: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--kopf) + 8px); overflow-x: clip; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--schrift);
  font-family: var(--sys);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: clip;
}
body.gesperrt { overflow: hidden; }
a { color: var(--tuerkis); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--tuerkis); outline-offset: 2px; }
[hidden] { display: none !important; }

.sprung { position: absolute; left: -9999px; top: 8px; background: var(--karte); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.sprung:focus { left: 16px; }

/* ---------- Kopf ---------- */
.kopf {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: var(--kopf);
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--grund) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--schrift); font-weight: 700; font-size: 24px; margin-right: auto; }
.marke img { width: 40px; height: 40px; }
.menueknopf { width: 48px; height: 48px; border: 0; background: none; display: grid; align-content: center; gap: 6px; padding: 0 10px; cursor: pointer; border-radius: 10px; }
.menueknopf span { display: block; height: 3px; background: var(--schrift); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menueknopf[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.menueknopf[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menueknopf[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
.menue {
  position: absolute; right: 12px; top: calc(var(--kopf) - 4px);
  background: var(--karte); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.14);
  padding: 8px; display: grid; min-width: 220px;
}
.menue a, .menue button, .linkzeile a, .linkzeile button {
  display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px;
  text-decoration: none; color: var(--schrift); background: none; border: 0; cursor: pointer; text-align: left; font-size: 17px;
}
.menue a:hover, .menue button:hover { background: var(--feld); }
.linkzeile { display: none; gap: 4px; }
.linkzeile a, .linkzeile button { color: var(--grau); }
.linkzeile a:hover, .linkzeile button:hover { color: var(--schrift); }

/* ---------- Bühne ---------- */
.oben { padding: 0; }
.buehne {
  position: relative;
  height: calc(100vw - 24px);
  max-height: 62vh;
  margin: 4px 4px 0;
  display: grid; place-items: center;
  outline: none;
  border-radius: var(--radius);
}
.buehne:focus-visible { box-shadow: 0 0 0 3px var(--tuerkis) inset; }
.greif {
  position: relative;
  touch-action: none;
  cursor: grab;
  transform-style: preserve-3d;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.greif.zieht { cursor: grabbing; }
.koerper { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.schatten {
  position: absolute; left: 50%; height: 26px; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(80,70,50,.20), rgba(80,70,50,0));
  pointer-events: none;
}
.flaeche {
  position: absolute;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  --licht: #E9EBEC;
  cursor: pointer;
}
.flaeche svg { display: block; width: 100%; height: 100%; overflow: visible; }
.flaeche .grund { fill: var(--licht); stroke: #A3A8AB; stroke-width: .22; stroke-linejoin: round; transition: fill .25s; }
.flaeche text { font-family: 'Qube Sans', 'Liberation Sans', Arial, sans-serif; font-weight: 700; fill: var(--schrift); transition: fill .25s; }
.flaeche text.frage { font-size: var(--schrift); }
.flaeche text.code { font-size: var(--code); fill: var(--gruppe); }
.flaeche .logo-hell { fill: #47CBEC; }
.flaeche .logo-grau { fill: #878E94; }
.flaeche.gewaehlt .grund { fill: var(--gruppe); }
.flaeche.gewaehlt text { fill: #fff; opacity: 1; }
.flaeche.gewaehlt .logo-hell, .flaeche.gewaehlt .logo-grau { fill: #fff; }
.flaeche.zurueck svg { opacity: .78; }

.steuerung { display: grid; justify-items: center; gap: 8px; padding: 4px 16px 16px; }
.wuerfeln {
  min-width: 140px; min-height: 38px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--schrift); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
}
.wuerfeln:active { transform: translateY(1px); }
.hinweis { margin: 0; color: var(--grau); font-size: 16px; }
.codeleiste, .gruppennamen { display: none; }

/* ---------- Karte ---------- */
.karten-spalte { display: contents; }
.leerkarte { display: none; }
.karte {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-height: calc(100dvh - var(--kopf) - 8px);
  height: 44dvh;
  background: var(--karte);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.16);
  display: flex; flex-direction: column;
  transform: translateY(0);
  transition: transform .32s cubic-bezier(.2,.8,.2,1), height .28s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.karte.voll { height: calc(100dvh - var(--kopf) - 8px); }
.karte.einfahren { transform: translateY(100%); }
.karte .griff { flex: none; height: 28px; border: 0; background: none; width: 100%; cursor: grab; display: grid; place-items: center; touch-action: none; }
.karte .griff::before { content: ''; width: 44px; height: 5px; border-radius: 3px; background: var(--linie); }
.karte .inhalt { overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 20px; flex: 1; }
.etikett { display: inline-block; padding: 4px 16px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 16px; background: var(--g, var(--blau)); }
.karte h2 { font-size: 22px; line-height: 1.3; margin: 12px 0 8px; }
.karte h3 { font-size: 17px; margin: 18px 0 6px; color: var(--g, var(--blau)); }
.karte p { margin: 0 0 10px; }
.worte { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.worte li { background: var(--feld); border-radius: 12px; padding: 10px 14px; }
.kartenfuss { display: flex; gap: 6px; align-items: center; margin-top: 22px; padding: 14px 0 6px; border-top: 1px solid var(--linie); }
.kartenfuss button, .knopf-leise {
  min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--linie); background: var(--karte); cursor: pointer; font-size: 16px; white-space: nowrap;
}
.kartenfuss .vorige, .kartenfuss .naechste { min-width: 44px; padding: 0; font-size: 22px; line-height: 1; }
.kartenfuss .teilen { margin-left: auto; }
.karte .schliessen-oben { position: absolute; right: 10px; top: 4px; width: 44px; height: 44px; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--grau); }

/* ---------- Abschnitte ---------- */
.abschnitt { padding: 28px 16px; border-top: 1px solid var(--linie); margin: 0 16px; padding-left: 0; padding-right: 0; }
.abschnitt h2 { font-size: 24px; line-height: 1.25; margin: 0 0 10px; }
.zeile-klein { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--grau); font-size: 15px; margin: 0 0 4px; }
.pate { color: var(--grau); font-size: 15px; }
.gruppen-liste { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.gruppen-liste li { display: grid; grid-template-columns: 48px 1fr; gap: 0 12px; align-items: start; }
.gruppen-liste .buchstabe { grid-row: span 2; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 22px; }
.gruppen-liste strong { font-size: 18px; }
.gruppen-liste span { color: var(--grau); }
.dreischritt { margin: 16px 0 0; }

.arbeit .unterzeile { color: var(--grau); margin: -4px 0 16px; }
.kacheln { display: grid; gap: 12px; }
.kachel {
  display: block; position: relative; padding: 16px 16px 16px 22px; border-radius: var(--radius);
  background: var(--karte); text-decoration: none; color: var(--schrift);
}
.kachel::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 5px; border-radius: 0 3px 3px 0; background: var(--g); }
.kachel strong { display: block; font-size: 18px; margin-bottom: 4px; }
.kachel .text { color: var(--grau); font-size: 15px; display: block; }
.kachel .kurz { display: none; }
.kachel.dunkel { background: var(--dunkel); color: #fff; }
.kachel.dunkel::before { display: none; }
.kachel.dunkel .marke-tc { color: #3FC1D1; font-weight: 700; letter-spacing: .06em; font-size: 18px; display: block; margin-bottom: 4px; }
.kachel.dunkel .text { color: #fff; font-weight: 700; }
.kachel.dunkel .los { color: #3FC1D1; font-weight: 700; display: block; margin-top: 6px; }
.weitere { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }

.fragenliste ol { list-style: none; padding: 0; margin: 0; }
.fragenliste h3 { font-size: 17px; margin: 18px 0 6px; }
.fragenliste li button {
  display: grid; grid-template-columns: 48px 1fr; gap: 12px; width: 100%; text-align: left; align-items: baseline;
  min-height: 44px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--linie); background: none; cursor: pointer;
}
.fragenliste li .c { font-weight: 700; color: var(--g); }

.fuss { padding: 24px 16px calc(32px + env(safe-area-inset-bottom)); text-align: center; color: var(--grau); font-size: 15px; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.fuss a { color: var(--grau); }

/* ---------- Blätter (Kontakt, App) ---------- */
.blatt-schleier { position: fixed; inset: 0; background: rgba(30,32,35,.35); z-index: 44; }
.blatt {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--karte); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.2);
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.blatt.einfahren { transform: translateY(100%); }
.blatt .kopfzeile { display: flex; justify-content: flex-end; position: sticky; top: 0; height: 0; z-index: 1; margin-right: -12px; }
.blatt .zu { width: 44px; height: 44px; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--grau); }
.person { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; margin-top: 8px; padding-right: 32px; }
.person img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--feld); }
.person h2 { margin: 0; font-size: 22px; }
.person p { margin: 0; color: var(--grau); }
.reist { background: var(--feld); border-radius: 12px; padding: 10px 14px; margin: 14px 0 0; }
.reist b { color: var(--g); }
.kontakt .reist, .kontakt .unterblatt { background: var(--karte); }
.wege { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 8px; }
.weg {
  display: grid; place-items: center; text-align: center; min-height: 64px; padding: 8px; border-radius: 14px;
  border: 2px solid var(--tuerkis); color: var(--tuerkis); background: var(--karte); font-weight: 700; text-decoration: none; cursor: pointer; font-size: 17px;
}
.weg[aria-expanded="true"] { background: var(--tuerkis); color: #fff; }
.weg.platzhalter { border-style: dashed; opacity: .6; }
.frist { color: var(--grau); font-size: 15px; margin: 4px 0 16px; }
.unterblatt { background: var(--feld); border-radius: 14px; padding: 14px; margin: 0 0 16px; display: grid; gap: 10px; }
.unterblatt h3 { margin: 0; font-size: 18px; }
.unterblatt label { display: grid; gap: 4px; font-size: 15px; color: var(--grau); }
.unterblatt input[type="text"], .unterblatt textarea, .unterblatt select {
  font: inherit; color: var(--schrift); border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px; background: var(--karte); min-height: 44px; width: 100%;
}
.unterblatt textarea { min-height: 120px; resize: vertical; }
.unterblatt .haken { display: grid; grid-template-columns: 28px 1fr; align-items: start; color: var(--schrift); }
.unterblatt .haken input { width: 22px; height: 22px; margin: 2px 0 0; }
.knopf {
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--tuerkis); color: #fff; font-weight: 700; cursor: pointer; font-size: 17px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.knopf.zweit { background: var(--karte); color: var(--tuerkis); border: 2px solid var(--tuerkis); }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.uhr { font-variant-numeric: tabular-nums; font-weight: 700; }
.vermerk { font-size: 15px; color: var(--grau); margin: 0; }
.stufe1 { font-size: 15px; color: #8A5A00; background: #FFF4D6; border-radius: 10px; padding: 8px 12px; margin: 0; }
.bestellung h3 { font-size: 20px; margin: 8px 0 8px; }
.varianten { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.varianten li { border: 1px solid var(--linie); border-radius: 12px; padding: 10px 14px; }
.varianten strong { display: block; }
.varianten span { color: var(--grau); font-size: 15px; }

.app-hinweis h2 { margin: 8px 40px 8px 0; font-size: 22px; }
.app-vorschau { display: grid; justify-items: center; gap: 6px; width: 92px; margin: 8px 0 12px; font-size: 13px; }
.app-vorschau img { width: 60px; height: 60px; border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.schritte { padding-left: 22px; margin: 0 0 16px; display: grid; gap: 6px; }

.offline { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 35; background: var(--dunkel); color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.meldung { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; visibility: hidden; z-index: 60; background: var(--dunkel); color: #fff; border-radius: 999px; padding: 10px 18px; transition: transform .25s, opacity .25s, visibility .25s; pointer-events: none; font-size: 16px; }
.meldung.sichtbar { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.karte .inhalt:focus, .karte h2:focus { outline: none; }

/* ---------- Rechtstexte ---------- */
.rechtstext { max-width: 760px; }
.rechtstext h2 { font-size: 28px; margin: 8px 0 8px; }
.rechtstext h3 { font-size: 19px; margin: 26px 0 6px; }
.rechtstext blockquote { margin: 16px 0; padding: 12px 16px; background: var(--karte); border-radius: 12px; }
.rechtstext code { font-size: 15px; }
.rechtstext ul { padding-left: 22px; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  :root { --kopf: 72px; }
  .kopf { padding: 0 40px; }
  .linkzeile { display: flex; }
  .menueknopf, .menue { display: none !important; }
  .oben { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; padding: 24px 40px 32px; max-width: 1360px; margin: 0 auto; align-items: start; }
  .buehne { height: min(60vh, 560px); max-height: none; margin: 0; }
  .karten-spalte { display: block; position: sticky; top: calc(var(--kopf) + 16px); }
  .leerkarte, .karte {
    position: static; height: auto; max-height: calc(100vh - var(--kopf) - 48px); transform: none !important;
    border-radius: 22px; box-shadow: 0 6px 24px rgba(0,0,0,.06); background: var(--karte);
  }
  .leerkarte { display: block; padding: 28px 32px; }
  .leerkarte[hidden] { display: none; }
  .karte .griff { display: none; }
  .karte .inhalt { padding: 28px 32px 16px; }
  .karte h2 { font-size: 26px; }
  .abschnitt { margin: 0 max(40px, calc((100% - 1280px) / 2)); }
  .steuerung .hinweis { display: none; }
  .codeleiste { display: flex; justify-content: center; gap: 4px; }
  .codeleiste .gruppe { display: flex; gap: 4px; }
  .codeleiste .gruppe + .gruppe { margin-left: 8px; }
  .code-knopf { --g: var(--blau); width: 46px; height: 44px; border-radius: 10px; border: 2px solid var(--g); background: var(--karte); color: var(--g); font-weight: 700; font-size: 16px; cursor: pointer; padding: 0; }
  .code-knopf[aria-pressed="true"] { background: var(--g); color: #fff; }
  .gruppennamen { display: grid; grid-template-columns: 4fr 4fr 3fr; width: 100%; max-width: 560px; text-align: center; font-weight: 700; font-size: 16px; }
  .name { display: grid; grid-template-columns: 1fr 1.6fr; gap: 32px; }
  .gruppen-liste { grid-template-columns: repeat(3, 1fr); }
  .kacheln { grid-template-columns: repeat(4, 1fr); }
  .kachel .lang { display: none; }
  .kachel .kurz { display: block; }
  .blatt { left: 50%; right: auto; bottom: auto; top: 50%; width: min(620px, calc(100vw - 48px)); transform: translate(-50%, -50%); border-radius: 22px; max-height: calc(100vh - 48px); }
  .blatt.einfahren { transform: translate(-50%, -46%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
