/*
 * Elio Campus – Stil nach Elio (src/ui/theme.ts): warmes Creme als Fläche,
 * Navy als Leitfarbe, Pastelltöne für die Bereiche, Schrift Inter.
 * Kontraste wie in Elio: Text 4,5 : 1, Zeichen und Ränder 3 : 1.
 */

@font-face { font-family: 'Inter'; src: url('schriften/Inter_400Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('schriften/Inter_600SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('schriften/Inter_700Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --bg: #FAF5EE;
  --bg-alt: #F4EDE3;
  --bg-aussen: #E9E0D3;
  --flaeche: #FFFFFF;
  --flaeche-leise: #FBF8F3;
  --mulde: #EFEAE2;
  --navy: #1B4B7E;
  --navy-tief: #123A64;
  --text: #22303C;
  --text-leise: #5A6875;
  --zeichen-leise: #7A8793;
  --rand: #ECE4D9;
  --rand-bedien: #958B7E;
  --akzent: #935F17;
  --fehler: #BB362E;
  --erfolg: #517145;
  --auf-farbe: #FFFFFF;
  --schatten: 0 1px 2px rgba(140, 123, 102, .10), 0 6px 18px rgba(140, 123, 102, .10);
  --orange: #F19238;

  --rose-fg: #A74950; --rose-bg: #F8E5E4; --rose-soft: #FDF2F1;
  --teal-fg: #3E716A; --teal-bg: #E1EFEC; --teal-soft: #F1F8F6;
  --blue-fg: #3E6C9B; --blue-bg: #E3EDF7; --blue-soft: #F2F7FC;
  --purple-fg: #725F95; --purple-bg: #EEE8F5; --purple-soft: #F7F4FA;
  --amber-fg: #8F611A; --amber-bg: #FBEBD8; --amber-soft: #FDF6EC;
  --green-fg: #5E6D55; --green-bg: #E7EEE2; --green-soft: #F3F7F0;
  --coral-fg: #AA4B2B; --coral-bg: #FBE7DD; --coral-soft: #FDF4EF;
  --navy-fg: #1B4B7E; --navy-bg: #E2EAF3; --navy-soft: #F1F5F9;
  --red-fg: #BB362E; --red-bg: #FBE3E1; --red-soft: #FDF1F0;

  --radius: 18px;
  --radius-klein: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171D;
    --bg-alt: #181E26;
    --bg-aussen: #0B0F14;
    --flaeche: #1C232C;
    --flaeche-leise: #212932;
    --mulde: #242C36;
    --navy: #94BBE6;
    --navy-tief: #B7D2F0;
    --text: #E7ECF1;
    --text-leise: #A9B4BF;
    --zeichen-leise: #72808C;
    --rand: #2C3540;
    --rand-bedien: #747D89;
    --akzent: #E3AC5F;
    --fehler: #F2908A;
    --erfolg: #9BC98A;
    --auf-farbe: #10151B;
    --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .25);

    --rose-fg: #F0A2A6; --rose-bg: #3A2426; --rose-soft: #2A1F21;
    --teal-fg: #95CDC3; --teal-bg: #1B332F; --teal-soft: #18262A;
    --blue-fg: #9DC0E6; --blue-bg: #1E2D3E; --blue-soft: #1A2330;
    --purple-fg: #C4B3E3; --purple-bg: #2E2740; --purple-soft: #232030;
    --amber-fg: #E8BC7A; --amber-bg: #3A2D19; --amber-soft: #2A2319;
    --green-fg: #B1C9A2; --green-bg: #27301F; --green-soft: #1F251C;
    --coral-fg: #F2A98E; --coral-bg: #3B261D; --coral-soft: #2B201B;
    --navy-fg: #94BBE6; --navy-bg: #1D2C3F; --navy-soft: #18222E;
    --red-fg: #F2908A; --red-bg: #3D2221; --red-soft: #2C1D1D;
    color-scheme: dark;
  }
}

.ton-rose { --ton-fg: var(--rose-fg); --ton-bg: var(--rose-bg); --ton-soft: var(--rose-soft); }
.ton-teal { --ton-fg: var(--teal-fg); --ton-bg: var(--teal-bg); --ton-soft: var(--teal-soft); }
.ton-blue { --ton-fg: var(--blue-fg); --ton-bg: var(--blue-bg); --ton-soft: var(--blue-soft); }
.ton-purple { --ton-fg: var(--purple-fg); --ton-bg: var(--purple-bg); --ton-soft: var(--purple-soft); }
.ton-amber { --ton-fg: var(--amber-fg); --ton-bg: var(--amber-bg); --ton-soft: var(--amber-soft); }
.ton-green { --ton-fg: var(--green-fg); --ton-bg: var(--green-bg); --ton-soft: var(--green-soft); }
.ton-coral { --ton-fg: var(--coral-fg); --ton-bg: var(--coral-bg); --ton-soft: var(--coral-soft); }
.ton-navy { --ton-fg: var(--navy-fg); --ton-bg: var(--navy-bg); --ton-soft: var(--navy-soft); }
.ton-red { --ton-fg: var(--red-fg); --ton-bg: var(--red-bg); --ton-soft: var(--red-soft); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 .8em; }
a { color: var(--navy); }
img, video { max-width: 100%; }
button { font: inherit; }
.leise { color: var(--text-leise); font-size: .92rem; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 6px; }

.symbol { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.symbol.klein { width: 1em; height: 1em; vertical-align: -.15em; }

.sprung {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--navy); color: var(--auf-farbe); padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600;
}
.sprung:focus { top: 12px; }

/* ------------------------------------------------------------------ Rahmen */

.rahmen { min-height: 100vh; }
.leiste {
  background: var(--flaeche);
  border-right: 1px solid var(--rand);
  display: flex; flex-direction: column;
  padding: 22px 14px 14px;
}
.leiste-logo { display: flex; align-items: flex-end; gap: 6px; text-decoration: none; padding: 0 8px 18px; }
.leiste-logo img { height: 52px; width: auto; }
.campus-wort {
  font-weight: 700; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--akzent); padding-bottom: 8px;
}
.leiste-titel { font-size: .82rem; font-weight: 600; letter-spacing: .08em; color: var(--text-leise); margin: 0 10px 8px; }
.leiste-liste { list-style: none; margin: 0; padding: 0; }
.leiste-liste a {
  display: flex; align-items: center; gap: 14px;
  min-height: 46px; padding: 8px 14px; border-radius: 14px;
  color: var(--text); text-decoration: none; font-weight: 400;
}
.leiste-liste a .symbol { color: var(--zeichen-leise); width: 22px; height: 22px; }
.leiste-liste a:hover { background: var(--bg); }
.leiste-liste a.aktiv { background: var(--navy-bg); color: var(--navy); font-weight: 600; }
.leiste-liste a.aktiv .symbol { color: var(--navy); }
.leiste-person {
  margin-top: auto; display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--rand); padding: 16px 6px 4px;
}
.leiste-name { display: flex; flex-direction: column; font-weight: 600; color: var(--navy); font-size: .95rem; line-height: 1.25; min-width: 0; }
.leiste-name small { color: var(--text-leise); font-weight: 400; font-size: .8rem; }
.leiste-person form { margin-left: auto; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--rose-bg); color: var(--rose-fg); font-weight: 700; font-size: .9rem;
}

.knopf-symbol {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--navy); cursor: pointer;
}
.knopf-symbol:hover { background: var(--bg); }
.knopf-symbol .symbol { width: 24px; height: 24px; }

.kopf {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-bottom: 1px solid var(--rand); background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.kopf-logo { display: flex; align-items: flex-end; gap: 4px; text-decoration: none; margin-right: auto; }
.kopf-logo img { height: 36px; width: auto; }
.kopf-logo .campus-wort { font-size: .68rem; padding-bottom: 5px; }
.kopf-titel { display: none; margin: 0 auto 0 0; font-size: 1.7rem; font-weight: 700; color: var(--navy); }
.rollen-pille {
  display: none; align-items: center; gap: 8px;
  background: var(--rose-bg); color: var(--rose-fg); font-weight: 600; font-size: .92rem;
  padding: 8px 16px; border-radius: 999px;
}
.kopf .avatar { width: 38px; height: 38px; }

.inhalt { padding: 24px 18px 40px; max-width: 1240px; outline: none; }
.inhalt-allein { outline: none; }

/* Am Handy: Seitenleiste als Blatt über dem Inhalt. */
@media (max-width: 999px) {
  .leiste {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); z-index: 50;
    transform: translateX(-102%); transition: transform 220ms ease; box-shadow: 0 0 40px rgba(20, 32, 44, .25);
    overflow-y: auto;
  }
  .leiste.offen { transform: none; }
  body.menue-offen::after { content: ''; position: fixed; inset: 0; background: rgba(20, 32, 44, .35); z-index: 40; }
  /* Ohne JavaScript bleibt die Leiste einfach unter dem Kopf stehen. */
  html:not(.js) .leiste { position: static; transform: none; width: auto; box-shadow: none; border-right: 0; border-bottom: 1px solid var(--rand); }
  html:not(.js) .menue-knopf { display: none; }
}
@media (prefers-reduced-motion: reduce) { .leiste { transition: none; } }

@media (min-width: 1000px) {
  .rahmen { display: grid; grid-template-columns: 270px 1fr; }
  .leiste { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .kopf { padding: 22px 36px; }
  .kopf-logo, .menue-knopf { display: none; }
  .kopf-titel { display: block; }
  .rollen-pille { display: inline-flex; }
  .inhalt { padding: 36px 36px 48px; }
}

/* ------------------------------------------------------------------ Bausteine */

.karte {
  background: var(--flaeche); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--schatten);
  margin-bottom: 18px;
}
.karte h2 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.karte h2 .symbol { color: var(--akzent); }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--navy); color: var(--auf-farbe); font-weight: 600; text-decoration: none; font-size: 1rem;
}
.knopf:hover { background: var(--navy-tief); }
.knopf-gross { min-height: 56px; width: 100%; font-size: 1.08rem; }
.knopf-zweit { background: var(--flaeche); color: var(--navy); border: 1.5px solid var(--rand-bedien); }
.knopf-zweit:hover { background: var(--navy-bg); }
.knopf-zweit[aria-pressed="true"] { background: var(--teal-bg); color: var(--teal-fg); border-color: var(--teal-fg); }

.eingabe {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid var(--rand-bedien); background: var(--flaeche); color: var(--text); font: inherit; font-size: 16px;
}

.meldung {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  background: var(--blue-bg); color: var(--blue-fg); border-radius: var(--radius-klein); padding: 12px 14px; margin: 0 0 18px;
}
.meldung p { margin: 0; }
.meldung.fehler { background: var(--rose-bg); color: var(--fehler); }
.meldung.erfolg { background: var(--green-bg); color: var(--erfolg); }

.pfad { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; color: var(--text-leise); margin-bottom: 18px; }
.pfad a { color: var(--text-leise); }

/* ------------------------------------------------------------------ Start */

.begruessung h1 { margin-bottom: .2em; }
.begruessung p { color: var(--text-leise); font-size: 1.08rem; max-width: 60ch; }
.abschnitt-titel { font-size: 1.2rem; margin: 26px 0 14px; }

.start-raster { display: grid; gap: 8px 32px; }
@media (min-width: 1200px) { .start-raster { grid-template-columns: 1fr 340px; align-items: start; } .start-seite { margin-top: 60px; } }

.kacheln { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.kachel {
  position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%;
  background: var(--ton-bg); border-radius: var(--radius); padding: 18px 18px 16px; text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.kachel:hover { transform: translateY(-2px); box-shadow: var(--schatten); }
.kachel-symbol {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%; background: var(--ton-fg); color: var(--auf-farbe); margin-bottom: 12px;
}
.kachel-symbol .symbol { width: 24px; height: 24px; }
.kachel-symbol.gross { width: 64px; height: 64px; margin: 0; }
.kachel-symbol.gross .symbol { width: 32px; height: 32px; }
.kachel-pfeil { position: absolute; top: 28px; right: 18px; color: var(--ton-fg); }
.kachel-titel { color: var(--ton-fg); font-weight: 700; font-size: 1.12rem; }
.kachel-text { color: var(--text-leise); font-size: .93rem; }
.kachel-fuss { margin-top: auto; padding-top: 12px; color: var(--ton-fg); font-size: .86rem; font-weight: 600; display: flex; flex-direction: column; gap: 8px; }

.fortschritt-balken { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--ton-fg, var(--navy)) 18%, transparent); overflow: hidden; }
.fortschritt-balken span { display: block; height: 100%; width: 0; background: var(--ton-fg, var(--navy)); border-radius: 3px; }
.kachel .fortschritt:not([hidden]) { display: flex; flex-direction: column; gap: 4px; }

.ueberblick { background: var(--green-soft); }
.weiter a { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text); padding: 6px 0; }
.weiter img { width: 92px; height: 58px; object-fit: cover; object-position: top; border-radius: 10px; background: var(--mulde); }
.weiter strong { display: block; color: var(--navy); }
.suche-treffer { list-style: none; margin: 10px 0 0; padding: 0; }
.suche-treffer li a { display: block; padding: 10px 4px; border-bottom: 1px solid var(--rand); text-decoration: none; color: var(--navy); font-weight: 600; }
.suche-treffer li a small { display: block; color: var(--text-leise); font-weight: 400; }

/* ------------------------------------------------------------------ Bereich */

.bereich-kopf {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--ton-bg); border-radius: var(--radius); padding: 22px; margin-bottom: 26px;
}
.bereich-kopf h1 { color: var(--ton-fg); }
.bereich-kopf p { max-width: 70ch; }
@media (max-width: 560px) { .bereich-kopf { flex-direction: column; } }

.lektionen { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.lektion-karte {
  display: flex; gap: 18px; align-items: center;
  background: var(--flaeche); border-radius: var(--radius); padding: 12px; text-decoration: none; color: var(--text); box-shadow: var(--schatten);
}
.lektion-karte:hover .lektion-titel { text-decoration: underline; }
.vorschau { position: relative; flex: none; width: 168px; height: 105px; border-radius: 12px; overflow: hidden; background: var(--mulde); }
.vorschau img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.vorschau.hoch img { object-position: center 12%; }
.vorschau-leer { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--zeichen-leise); }
.laufzeit {
  position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(18, 30, 44, .82); color: #fff; font-size: .78rem; font-weight: 600; padding: 3px 8px; border-radius: 999px;
}
.lektion-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lektion-nummer { color: var(--text-leise); font-size: .85rem; font-weight: 600; }
.gesehen-zeichen { color: var(--erfolg); margin-left: 6px; }
.lektion-titel { color: var(--navy); font-weight: 700; font-size: 1.08rem; }
.lektion-kurz { color: var(--text-leise); font-size: .93rem; }
@media (max-width: 560px) {
  .lektion-karte { flex-direction: column; align-items: stretch; }
  .vorschau { width: 100%; height: 170px; }
}

/* ------------------------------------------------------------------ Lektion */

.lektion-kopf { margin-bottom: 20px; max-width: 75ch; }
.lektion-kopf .lektion-nummer { color: var(--ton-fg); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin-bottom: 6px; }
.lektion-einleitung { font-size: 1.08rem; color: var(--text-leise); }

.lektion-raster { display: grid; gap: 24px; align-items: start; }
/* Querformat (am Rechner aufgenommen): das Video über die volle Breite, damit
   die Oberfläche darin lesbar bleibt; die Karten darunter nebeneinander. */
.lektion-raster.ist-quer .spieler { max-width: 1120px; }
@media (min-width: 900px) {
  .lektion-raster.ist-quer .text-spalte {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start;
  }
  .lektion-raster.ist-quer .text-spalte .karte { margin-bottom: 0; }
  .lektion-raster.ist-quer .erledigt-zeile { grid-column: 1 / -1; margin: 0; }
}
@media (min-width: 1100px) {
  .lektion-raster.ist-hoch { grid-template-columns: auto minmax(0, 1fr); }
}
@media (min-width: 760px) and (max-width: 1099px) {
  .lektion-raster.ist-hoch { grid-template-columns: auto minmax(0, 1fr); }
}

.spieler { margin: 0; }
.spieler video { display: block; width: 100%; height: auto; background: #0d1620; border-radius: var(--radius); box-shadow: var(--schatten); }
.spieler.hoch video {
  width: auto; max-width: 100%; max-height: min(78vh, 760px); margin: 0 auto;
  border: 10px solid #1A1D24; border-radius: 34px; background: #1A1D24;
}
.spieler figcaption { margin-top: 10px; text-align: center; }
.spieler-leer {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 260px; border-radius: var(--radius); background: var(--mulde); color: var(--text-leise);
}
.spieler-leer .symbol { width: 40px; height: 40px; }
video::cue { font-family: Inter, system-ui, sans-serif; font-size: .95em; line-height: 1.35; background: rgba(18, 30, 44, .85); color: #fff; }

.kapitel-liste { list-style: none; margin: 0; padding: 0; }
.kapitel-knopf {
  display: flex; gap: 12px; align-items: baseline; width: 100%; text-align: left;
  min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer;
}
.kapitel-knopf:hover { background: var(--bg); }
.kapitel-knopf.aktiv { background: var(--ton-bg); color: var(--ton-fg); font-weight: 600; }
.kapitel-zeit { font-variant-numeric: tabular-nums; color: var(--text-leise); font-size: .88rem; min-width: 2.6em; }
.kapitel-knopf.aktiv .kapitel-zeit { color: inherit; }

.schritte { margin: 0; padding-left: 0; list-style: none; counter-reset: schritt; }
.schritte li { counter-increment: schritt; position: relative; padding: 6px 0 10px 44px; }
.schritte li::before {
  content: counter(schritt); position: absolute; left: 0; top: 4px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--ton-bg); color: var(--ton-fg);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
}
.tipps { background: var(--amber-soft); }
.tipps ul { margin: 0; padding-left: 1.2em; }
.tipps li { margin-bottom: 8px; }
.erledigt-zeile { margin: 6px 0 18px; }

.blaettern { display: flex; justify-content: space-between; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.blaettern-link {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); font-weight: 600;
  background: var(--flaeche); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--schatten); max-width: 100%;
}
.blaettern-link small { display: block; color: var(--text-leise); font-weight: 400; font-size: .82rem; }
.blaettern-link.weiter { margin-left: auto; text-align: right; }

/* ------------------------------------------------------------------ Anmelden */

.anmelde-buehne {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(circle at 15% 20%, var(--amber-bg), transparent 45%),
              radial-gradient(circle at 85% 80%, var(--blue-bg), transparent 45%), var(--bg-aussen);
}
.anmelde-karte {
  width: min(100%, 460px); background: var(--flaeche); border-radius: 26px; padding: 34px 30px 28px;
  box-shadow: 0 20px 50px rgba(20, 32, 44, .16); text-align: center;
}
.anmelde-logo { height: 76px; width: auto; }
.campus-zeile { margin: -2px 0 18px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--akzent); font-size: .85rem; }
.anmelde-karte h1 { font-size: 1.6rem; }
.anmelde-karte > p { color: var(--text-leise); }
.anmelde-karte form { margin: 22px 0 18px; }
.anmelde-hinweise { list-style: none; margin: 0; padding: 0; text-align: left; font-size: .9rem; color: var(--text-leise); }
.anmelde-hinweise li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rand); }
.anmelde-hinweise .symbol { color: var(--navy); margin-top: 2px; }
.ohne-rahmen .fuss { display: none; }

/* ------------------------------------------------------------------ Hilfe, Fuß */

.hilfe { max-width: 78ch; }
.hilfe h2 { margin-top: 1.6em; }
.fuss { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--rand); color: var(--text-leise); font-size: .85rem; }
.fuss p { margin: 0 0 4px; }
.leer { text-align: center; padding: 60px 0; }
