/* Scrollschlau Web – „Nachtschicht mit Textmarker“.
   Zwei Welten: Nacht (Startseite, Kopfbereiche) und Papier (Arbeitsbereiche).
   Textmarker-Gelb steht nur für Verdientes und Geschafftes.
   Briefing: docs/design/2026-10-02-redesign-brief.md */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque.woff2?v=6") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans.woff2?v=6") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Farben ------------------------------------------------------------------------------ */

:root {
  --night: #14123a;
  --night-2: #221a5c;
  --paper: #f6f5fb;
  --sheet: #ffffff;
  --sheet-2: #eceaf6;
  --line: #dcd9ec;
  --field-line: #8a86b3;
  --ink: #17143f;
  --ink-2: #5d5a85;
  --iris: #4f3ff0;
  --on-iris: #ffffff;
  --iris-soft: #e6e3ff;
  --marker: #ffe14a;
  --marker-ink: #3a3000;
  --mint: #12805c;
  --coral: #c8323a;
  --shadow-tint: rgba(79, 63, 240, .28);

  --radius-lg: 20px;
  --radius: 12px;
  --font-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --font-text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 40px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #100e2c;
    --sheet: #1a1745;
    --sheet-2: #252158;
    --line: #35307a;
    --field-line: #6c66b4;
    --ink: #f1efff;
    --ink-2: #b3aee0;
    --iris: #9d93ff;
    --on-iris: #14123a;
    --iris-soft: #2b2670;
    --mint: #5fd6ae;
    --coral: #ff8f8f;
    --shadow-tint: rgba(6, 4, 30, .6);
  }
}

/* Nacht: dunkle Flächen unabhängig vom Systemmodus (Startseite, Kopfzeilen). */
.night, .topbar {
  --paper: #14123a;
  --sheet: #221a5c;
  --sheet-2: #2b2470;
  --line: #3a3486;
  --field-line: #6e68ba;
  --ink: #f1efff;
  --ink-2: #b9b4e6;
  --iris: #a69dff;
  --on-iris: #14123a;
  --iris-soft: #2f2a7a;
  --mint: #5fd6ae;
  --coral: #ff8f8f;
  --shadow-tint: rgba(6, 4, 30, .6);
  color: var(--ink);
  color-scheme: dark;
}

/* Helles Papier unabhängig vom Systemmodus (Fragekarte auf der Startseite). */
.daylight {
  --paper: #f6f5fb;
  --sheet: #ffffff;
  --sheet-2: #eceaf6;
  --line: #dcd9ec;
  --field-line: #8a86b3;
  --ink: #17143f;
  --ink-2: #5d5a85;
  --iris: #4f3ff0;
  --on-iris: #ffffff;
  --iris-soft: #e6e3ff;
  --mint: #12805c;
  --coral: #c8323a;
  --shadow-tint: rgba(79, 63, 240, .28);
  color: var(--ink);
  color-scheme: light;
}

/* Abgeleitete Töne werden je Welt neu berechnet. */
:root, .night, .topbar, .daylight {
  --mint-soft: color-mix(in srgb, var(--mint) 14%, var(--sheet));
  --coral-soft: color-mix(in srgb, var(--coral) 13%, var(--sheet));
  --marker-wash: color-mix(in srgb, var(--marker) 42%, var(--sheet));
  --mint-ink: color-mix(in srgb, var(--mint) 68%, var(--ink));
  --coral-ink: color-mix(in srgb, var(--coral) 72%, var(--ink));
  --shadow: 0 1px 0 color-mix(in srgb, var(--line) 60%, transparent), 0 24px 48px -24px var(--shadow-tint);
  /* Rand des Textmarker-Balkens: mindestens 3:1 zur hellen Balkenspur. */
  --marker-edge: color-mix(in srgb, var(--marker-ink) 55%, var(--marker));
}

/* ---- Grundlagen -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
html[data-state="guest"] { background: var(--night); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-stretch: 88%;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.75rem, 2.4vw + 1.1rem, 2.5rem); line-height: 1.08; font-weight: 800; }
h2 { font-size: 1.375rem; line-height: 1.18; font-weight: 750; }
h3 { font-size: 1.125rem; line-height: 1.25; font-weight: 700; }
p { text-wrap: pretty; }
a { color: var(--iris); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--marker); color: var(--marker-ink); }

/* ---- Raster und Hilfsklassen ------------------------------------------------------------- */

.shell { max-width: var(--wrap); margin: 0 auto; padding: 40px var(--gutter) 72px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.stack { display: grid; gap: 16px; align-content: start; }
.stack-lg { display: grid; gap: 40px; align-content: start; }
.stack > *, .stack-lg > * { min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.tabular { font-variant-numeric: tabular-nums; }
/* Beschriftung in normaler Schreibweise – keine Versalien. */
.label { display: block; font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.lead { font-size: 1.125rem; line-height: 1.5; color: var(--ink-2); max-width: 56ch; }
/* Textmarker-Strich hinter Text: für Geschafftes. */
.mark { background: linear-gradient(var(--marker-wash), var(--marker-wash)) no-repeat 0 85% / 100% 62%; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding-inline: .15em; margin-inline: -.15em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Wortmarke und Kopfzeile ------------------------------------------------------------- */

.wordmark {
  font-family: var(--font-display);
  font-stretch: 84%;
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  white-space: nowrap;
}
.wordmark b { font-weight: inherit; position: relative; }
.wordmark b::after {
  content: "";
  position: absolute;
  left: 1px;
  right: -3px;
  bottom: -.3em;
  height: .2em;
  border-radius: 2px 5px 3px 6px;
  background: var(--marker);
  transform: rotate(-1.6deg);
}

.topbar { position: sticky; top: 0; z-index: 10; background: var(--night); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: var(--wrap); margin: 0 auto; padding: 12px var(--gutter); min-height: 64px; display: flex; align-items: center; gap: 12px; }
@media (max-width: 600px) {
  .topbar-inner { gap: 8px; }
  .topbar .wordmark { font-size: 1.1875rem; }
  .topbar .hide-s { display: none; }
}
@media (max-width: 420px) { .topbar .hide-xs { display: none; } }

.pill { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 4px 13px; border-radius: 999px; background: var(--sheet-2); color: var(--ink); font-weight: 650; font-size: .9375rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill.gold { background: var(--marker); color: var(--marker-ink); }
.pill.accent { background: var(--iris-soft); color: var(--ink); }
.coin { flex: none; width: .9em; height: .9em; border-radius: 50%; background: var(--marker); border: 1.5px solid var(--marker-ink); box-shadow: inset 0 0 0 2px var(--marker), inset 0 0 0 3.5px color-mix(in srgb, var(--marker-ink) 45%, transparent); display: inline-block; }

.tabs { display: flex; gap: 4px; overflow-x: auto; max-width: var(--wrap); margin: 0 auto; padding: 0 calc(var(--gutter) - 12px); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 12px 12px; border-bottom: 3px solid transparent; color: var(--ink-2); font-weight: 600; cursor: pointer; white-space: nowrap; border-radius: 0; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"], .tabs button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--iris); }
.tabs button:focus-visible { outline-offset: -3px; }

/* ---- Flächen ----------------------------------------------------------------------------- */

.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.card.raised { box-shadow: var(--shadow); }
.card.tint { background: var(--iris-soft); border-color: transparent; }

/* ---- Bedienelemente ---------------------------------------------------------------------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border-radius: var(--radius); border: 1.5px solid transparent;
  background: var(--iris); color: var(--on-iris);
  font-weight: 650; line-height: 1.2; text-decoration: none; text-align: center;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .08s;
}
.button:hover { background: color-mix(in srgb, var(--iris) 88%, var(--ink)); }
.button:active { transform: translateY(1px); }
.button.tonal { background: var(--iris-soft); color: var(--ink); }
.button.tonal:hover { background: color-mix(in srgb, var(--iris) 22%, var(--iris-soft)); }
.button.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.button.ghost:hover { background: transparent; border-color: var(--iris); }
.button.gold, .button.marker { background: var(--marker); color: var(--marker-ink); }
.button.gold:hover, .button.marker:hover { background: #ffea7a; }
.button.danger { background: var(--coral-soft); color: var(--coral-ink); }
.button.danger:hover { background: color-mix(in srgb, var(--coral) 22%, var(--sheet)); }
.button.block { width: 100%; }
.button.small { min-height: 38px; padding: 0 14px; font-size: .9375rem; }
.button.large { min-height: 56px; padding: 0 28px; font-size: 1.0625rem; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.link-button { border: 0; background: none; padding: 0; color: var(--iris); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.link-button:hover { text-decoration-thickness: 2.5px; }
summary.link-button { display: inline-block; list-style: none; padding: 4px 0; }
summary.link-button::-webkit-details-marker { display: none; }
details[open] > summary.link-button { margin-bottom: 14px; }

.field { display: grid; gap: 6px; }
.field label { font-size: .9375rem; font-weight: 600; }
.field small { color: var(--ink-2); font-size: .8125rem; }
.input, select.input {
  width: 100%; min-height: 46px; padding: 0 14px;
  border-radius: var(--radius); border: 1.5px solid var(--field-line);
  background: var(--sheet); color: var(--ink);
  transition: border-color .15s;
}
.input::placeholder { color: var(--ink-2); opacity: 1; }
.input:hover { border-color: var(--iris); }
.input:focus, .input:focus-visible { outline: 2px solid var(--iris); outline-offset: 0; border-color: transparent; border-radius: var(--radius); }
.input.auto { width: auto; min-width: 180px; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%237d78b4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

.message { padding: 12px 16px; border-radius: var(--radius); font-size: .9375rem; line-height: 1.45; }
.message.error { background: var(--coral-soft); color: var(--coral-ink); }
.message.ok { background: var(--mint-soft); color: var(--mint-ink); }
.message.info { background: var(--sheet-2); color: var(--ink-2); }
.message.small { font-size: .8125rem; }

.segmented { display: inline-flex; padding: 4px; border-radius: var(--radius); background: var(--sheet-2); gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: none; min-height: 36px; padding: 0 14px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: .9375rem; cursor: pointer; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px color-mix(in srgb, var(--iris) 22%, transparent); }

.chip { display: inline-flex; align-items: center; white-space: nowrap; padding: 3px 11px; border-radius: 999px; font-size: .8125rem; font-weight: 600; line-height: 1.4; background: var(--sheet-2); color: var(--ink-2); }
.chip.accent { background: var(--iris-soft); color: var(--ink); }
.chip.done { background: var(--marker); color: var(--marker-ink); }
.chip.right { background: var(--mint-soft); color: var(--mint-ink); }
.chip.wrong { background: var(--coral-soft); color: var(--coral-ink); }

/* Fortschritt wird mit dem Textmarker gezogen. */
.bar { height: 10px; border-radius: 999px; background: var(--sheet-2); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--marker); box-shadow: inset 0 0 0 1.5px var(--marker-edge); transition: width .4s ease; }

kbd { font: inherit; font-size: .8125rem; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--sheet-2); color: var(--ink-2); }

/* ---- Rangliste und Tabellen -------------------------------------------------------------- */

.board { width: 100%; border-collapse: collapse; }
.board th { text-align: left; font-size: .8125rem; color: var(--ink-2); font-weight: 600; padding: 6px 12px 10px; }
.board td { padding: 11px 12px; border-top: 1px solid var(--line); }
.board td:first-child, .board th:first-child { width: 64px; }
.board td:last-child, .board th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.board tr.self td { background: var(--iris-soft); font-weight: 650; border-top-color: transparent; }
.board tr.self + tr td { border-top-color: transparent; }
.board tr.self td:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.board tr.self td:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.rank { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px; font-family: var(--font-display); font-weight: 750; font-size: .9375rem; background: var(--sheet-2); font-variant-numeric: tabular-nums; }
.rank.top { background: var(--marker); color: var(--marker-ink); }
.board-scroll { max-height: 520px; overflow: auto; }

/* ---- Lernplan ---------------------------------------------------------------------------- */

.topic { border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); overflow: hidden; }
.topic > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 12px; }
.topic > summary::-webkit-details-marker { display: none; }
.topic > summary:hover { background: color-mix(in srgb, var(--sheet-2) 55%, transparent); }
.topic > summary:focus-visible { outline-offset: -3px; border-radius: var(--radius); }
.topic > summary::after { content: ""; flex: none; width: 8px; height: 8px; border: solid var(--ink-2); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform .2s; margin-left: 4px; }
.topic[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.topic ul { list-style: none; margin: 0; padding: 0 18px 10px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.check input {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 22px; height: 22px; margin: 1px 0 0;
  border: 1.5px solid color-mix(in srgb, var(--ink-2) 60%, var(--line)); border-radius: 7px; background: var(--sheet); cursor: pointer;
}
.check input:hover { border-color: var(--iris); }
.check input:checked {
  background: var(--marker) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 10.5 3.2 3.2L15 6.8' fill='none' stroke='%233a3000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
  border-color: var(--marker);
}
.check input:checked + span { background: var(--marker-wash); border-radius: 6px; padding: 1px 7px; margin: -1px -7px; }

/* ---- Lernkarten -------------------------------------------------------------------------- */

.flashcard { min-height: 300px; display: grid; align-content: center; gap: 18px; text-align: center; padding: 40px 32px; cursor: pointer; user-select: none; }
.flashcard .face { font-family: var(--font-display); font-stretch: 88%; font-size: clamp(1.375rem, 1.2vw + 1.1rem, 1.75rem); line-height: 1.2; font-weight: 700; letter-spacing: -.015em; text-wrap: balance; }
.flashcard .answer { font-size: 1.125rem; line-height: 1.5; color: var(--ink); border-top: 1px solid var(--line); padding-top: 18px; }
.ratings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ratings button { display: grid; gap: 2px; padding: 11px 6px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--sheet); cursor: pointer; font-weight: 650; }
.ratings button small { color: var(--ink-2); font-weight: 500; font-size: .8125rem; }
.ratings button:hover { border-color: var(--iris); }
@media (max-width: 460px) { .ratings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Quiz und Prüfung -------------------------------------------------------------------- */

.question { font-family: var(--font-display); font-stretch: 88%; font-size: clamp(1.25rem, .8vw + 1.05rem, 1.5rem); line-height: 1.22; font-weight: 700; letter-spacing: -.015em; text-wrap: balance; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  padding: 13px 16px; border-radius: var(--radius); border: 1.5px solid var(--line);
  background: var(--sheet); color: var(--ink); line-height: 1.4; cursor: pointer;
  transition: border-color .12s, background-color .12s;
}
.option:hover:not(:disabled) { border-color: var(--iris); }
.option .letter { flex: none; width: 28px; height: 28px; margin-top: -1px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet-2); color: var(--ink-2); font-weight: 700; font-size: .8125rem; transition: background-color .12s, color .12s; }
.option[aria-pressed="true"] { border-color: var(--iris); background: var(--iris-soft); }
.option[aria-pressed="true"] .letter { background: var(--iris); color: var(--on-iris); }
.option.right { border-color: var(--mint); background: var(--mint-soft); }
.option.right .letter { background: var(--marker); color: var(--marker-ink); }
.option.wrong { border-color: var(--coral); background: var(--coral-soft); }
.option.wrong .letter { background: var(--coral); color: var(--sheet); }
.option:disabled { cursor: default; }
.option:disabled:not(.right):not(.wrong) { color: var(--ink-2); }

.context { border-left: 3px solid var(--iris); border-radius: 0 var(--radius) var(--radius) 0; background: var(--sheet-2); padding: 12px 16px; color: var(--ink-2); }
.context strong { color: var(--ink); display: block; margin-bottom: 2px; }
.navigator { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.navigator button { height: 38px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--sheet); color: var(--ink); font-weight: 650; font-size: .875rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.navigator button:hover { border-color: var(--iris); }
.navigator button.done { background: var(--iris-soft); border-color: transparent; }
.navigator button.right { background: var(--mint-soft); border-color: transparent; color: var(--mint-ink); }
.navigator button.wrong { background: var(--coral-soft); border-color: transparent; color: var(--coral-ink); }
.navigator button[aria-current="true"] { outline: 2px solid var(--iris); outline-offset: 1px; }
.timer { font-family: var(--font-display); font-stretch: 88%; font-size: 1.375rem; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--coral); }
.exam-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
@media (max-width: 860px) { .exam-layout { grid-template-columns: minmax(0, 1fr); } }
.score { font-family: var(--font-display); font-stretch: 88%; font-size: 3.75rem; font-weight: 800; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }

.glossary dt { font-weight: 650; }
.glossary dd { margin: 4px 0 0; color: var(--ink-2); }
.glossary .entry { padding: 16px 0; border-top: 1px solid var(--line); }
.glossary .entry:first-child { border-top: 0; padding-top: 0; }
.glossary .entry:last-child { padding-bottom: 0; }

/* ---- Dialog, Hinweis, Fuß ---------------------------------------------------------------- */

dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; background: var(--sheet); color: var(--ink); width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 32px 80px -24px rgba(8, 5, 40, .7); }
dialog::backdrop { background: rgba(20, 18, 58, .74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog h2 { font-size: 1.75rem; }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.dialog-close:hover { background: var(--sheet-2); }
.dialog-close::before, .dialog-close::after { content: ""; position: absolute; left: 12px; right: 12px; top: 19px; height: 2px; border-radius: 2px; background: var(--ink-2); transform: rotate(45deg); }
.dialog-close::after { transform: rotate(-45deg); }
.dialog-close:focus-visible { border-radius: 50%; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: .9375rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.footer { color: var(--ink-2); font-size: .875rem; padding: 28px 0 0; border-top: 1px solid var(--line); margin-top: 56px; }
.skeleton { color: var(--ink-2); padding: 56px 20px; text-align: center; }

/* Chips und Pillen wachsen in Rasterspalten nicht auf volle Breite. */
.stack > .chip, .stack > .pill, .stack > .segmented, .stack-lg > .segmented { justify-self: start; }

/* ---- Weg zur Vollversion (Cockpit, Lernplattform, Freischalt-Dialog) --------------------- */

/* Der echte Stand: verdiente Coins als Textmarker-Balken, darunter das Tempo in einem Satz. */
.way { display: grid; gap: 8px; width: 100%; }
.way-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; color: var(--ink-2); font-weight: 600; }
.way-figure b { font-family: var(--font-display); font-stretch: 86%; font-weight: 800; font-size: 1.75rem; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.way-figure .coin { align-self: center; font-size: 1.125rem; }
.way-pace { color: var(--ink-2); max-width: 46ch; }
.way-title { margin: 0; font-family: var(--font-display); font-stretch: 88%; font-size: 1.0625rem; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.bar.started > i { min-width: 8px; }
.card.tint .bar { background: var(--sheet); }

.gains { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gains li { position: relative; padding-left: 26px; font-weight: 600; }
.gains li::before, .gains li::after { content: ""; position: absolute; left: 2px; top: .72em; width: 14px; height: 2.5px; border-radius: 2px; background: var(--iris); }
.gains li::after { transform: rotate(90deg); }

dialog.offer { width: min(520px, calc(100vw - 32px)); }
dialog.offer h2 { font-size: 1.5rem; padding-right: 36px; }
dialog.offer .way { padding: 16px 18px 18px; border-radius: var(--radius); background: var(--sheet-2); }
dialog.offer .way .bar { background: var(--sheet); }
.offer-actions { margin-top: 4px; }
.offer-actions .button { flex: 1 1 auto; }

/* ==== Startseite (Nacht) ================================================================== */

/* Die Startseite steht im HTML und ist sichtbar, solange nicht das Cockpit übernimmt. */
html[data-state="app"] #guest { display: none; }
html[data-state="guest"] body > #loading { display: none; }

.landing { background: var(--night); overflow-x: clip; }
.guest-notice { margin: 0; padding: 10px var(--gutter); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; background: var(--night-2); color: var(--ink-2); font-size: .9375rem; border-bottom: 1px solid var(--line); }
.landing h2 { font-size: clamp(1.75rem, 2.2vw + 1.1rem, 2.5rem); line-height: 1.06; font-weight: 800; letter-spacing: -.01em; }
.landing h3 { font-size: 1.375rem; }

.landing-nav { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.landing-nav .wordmark { font-size: 1.5rem; }
.landing-nav nav { display: flex; align-items: center; gap: 22px; }
.landing .link-button { color: var(--ink); }
.landing-nav .button.ghost { background: rgba(20, 18, 58, .5); border-color: rgba(241, 239, 255, .35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.landing-nav .button.ghost:hover { background: rgba(20, 18, 58, .5); border-color: var(--ink); }

/* Hero: Überschrift links, Bild rechts dahinter, die Fragekarte liegt darüber. */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); padding-top: 28px; padding-bottom: 72px; }
.hero-copy { position: relative; z-index: 2; display: grid; gap: 22px; justify-items: start; align-content: start; }
.hero h1 { font-size: clamp(2.5rem, 3.3vw + 1.7rem, 4.5rem); font-stretch: 86%; font-weight: 800; line-height: 1; letter-spacing: -.005em; }
.hero .lead { font-size: clamp(1.0625rem, .4vw + 1rem, 1.25rem); max-width: 34em; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; margin-top: 6px; }
.hero-stage { position: relative; z-index: 1; display: grid; }
.hero-art {
  width: 170%; max-width: none; margin: -6% 0 0 -52%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 62%, transparent 96%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 62%, transparent 96%);
  pointer-events: none; user-select: none;
}
.sample { position: relative; z-index: 2; margin-top: -46%; }

@media (min-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; padding-top: clamp(24px, 5vh, 64px); padding-bottom: 112px; }
  .hero-copy { padding-top: clamp(32px, 9vh, 104px); }
  /* Die Überschrift endet vor der hellen Kante des Telefons: Die liegt bei rund 47 % der Inhaltsbreite. */
  .hero h1 { font-size: min(4.5rem, 6.48vw - 9px); }
  .hero .lead { max-width: 26em; }
  .hero-stage { align-content: start; justify-items: end; }
  .hero-art {
    position: absolute; top: clamp(-250px, -15vw, -150px); right: -2%; width: 215%; margin: 0;
    -webkit-mask-image: linear-gradient(to right, transparent 3%, #000 30%, #000 82%, transparent 100%), linear-gradient(to bottom, rgba(0, 0, 0, .3) 8%, #000 24%, #000 68%, transparent 97%);
    mask-image: linear-gradient(to right, transparent 3%, #000 30%, #000 82%, transparent 100%), linear-gradient(to bottom, rgba(0, 0, 0, .3) 8%, #000 24%, #000 68%, transparent 97%);
    -webkit-mask-composite: source-in; mask-composite: intersect;
  }
  .sample { width: min(100%, 430px); margin-top: clamp(96px, 16vh, 180px); }
}

/* Die Fragekarte: helles Papier im dunklen Zimmer. */
.sample { background: var(--sheet); border-radius: var(--radius-lg); padding: 24px; display: grid; gap: 16px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 40px 90px -30px rgba(120, 100, 255, .75), 0 14px 30px -18px rgba(8, 5, 40, .8); }
.sample-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sample-head h2 { font-family: var(--font-text); font-stretch: 100%; font-size: .9375rem; font-weight: 600; letter-spacing: 0; line-height: 1.4; color: var(--ink-2); }
.sample .question { font-size: clamp(1.25rem, .6vw + 1.1rem, 1.4375rem); }
.sample .option { padding: 11px 14px; }
.sample .option.right > span:last-child { background: linear-gradient(var(--marker), var(--marker)) no-repeat 0 80% / 0% 68%; padding-inline: .2em; margin-inline: -.2em; -webkit-box-decoration-break: clone; box-decoration-break: clone; animation: marker-sweep .5s .1s ease-out forwards; }
.sample:empty { display: none; }
.sample-hint { min-height: 46px; display: grid; align-items: center; color: var(--ink-2); font-size: .9375rem; }
.sample-result { display: grid; gap: 14px; }
.sample-result p strong { font-weight: 700; }
.sample-next { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.sample .link-button { color: var(--iris); }
@keyframes marker-sweep { to { background-size: 100% 68%; } }

/* Abschnitte unter dem Hero */
.band { padding-block: clamp(48px, 6vw, 88px); }
.band-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 5vw, 56px); }

.desk-grid { display: grid; gap: clamp(24px, 4vw, 48px); }
/* Bühne: Das Schreibtischbild gibt die Stimmung, davor steht das echte Cockpit als Bildschirmfoto. */
.desk-stage { display: grid; justify-items: center; }
.desk-art { border-radius: var(--radius-lg); width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% 60%; }
.desk-shot { position: relative; width: 94%; margin-top: -24%; border-radius: var(--radius); box-shadow: 0 0 0 1px rgba(241, 239, 255, .3), 0 40px 90px -30px rgba(120, 100, 255, .75), 0 14px 30px -18px rgba(8, 5, 40, .8); }
.features { display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.features > div { padding: 18px 0 22px; border-top: 1px solid var(--line); display: grid; gap: 4px; align-content: start; }
.features dt { font-family: var(--font-display); font-stretch: 88%; font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em; }
.features dd { color: var(--ink-2); max-width: 44ch; }
@media (min-width: 760px) {
  .desk-art { aspect-ratio: 21 / 9; object-position: 50% 52%; }
  .desk-shot { width: 84%; margin-top: -19%; border-radius: var(--radius-lg); }
}

.shelf { background: linear-gradient(to bottom, var(--night), var(--night-2) 30%, var(--night-2) 70%, var(--night)); }
.libraries { display: grid; gap: 0; }
.library { display: grid; gap: 24px; padding: 32px 0; border-top: 1px solid var(--line); }
.library:last-child { border-bottom: 1px solid var(--line); }
.library-cover { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 3 / 2; background: linear-gradient(140deg, #2f2a7a, var(--night)); display: grid; place-items: center; }
.library-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 52%; }
.library-cover span { font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-size: 3.75rem; color: var(--ink-2); }
.library-body { display: grid; gap: 18px; align-content: center; }
.library-body h3 { font-size: clamp(1.5rem, 1.2vw + 1.2rem, 2rem); line-height: 1.05; font-weight: 800; }
.library-body > p { color: var(--ink-2); max-width: 62ch; }
.scope { display: grid; gap: 14px 32px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.scope dt { font-weight: 650; }
.scope dd { color: var(--ink-2); }
.library-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; }
.library-foot .price { display: flex; align-items: flex-start; gap: 12px; flex: 1 1 320px; max-width: 60ch; margin-right: auto; }
.library-foot .price .small { padding-top: 5px; }
.hero-note { color: var(--ink-2); font-size: .9375rem; }
@media (min-width: 760px) {
  .library { grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 40px; padding: 40px 0; align-items: center; }
  .library-cover { aspect-ratio: 1; }
  .library-cover img { object-position: 50% 50%; }
}

.sequence { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 32px; counter-reset: step; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.sequence li { counter-increment: step; border-top: 1px solid var(--line); padding: 20px 0 32px; display: grid; gap: 8px; align-content: start; }
.sequence li::before { content: counter(step); font-family: var(--font-display); font-stretch: 88%; font-weight: 800; font-size: 3.75rem; line-height: 1; letter-spacing: -.03em; color: var(--iris); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.sequence p { color: var(--ink-2); max-width: 40ch; }
@media (max-width: 560px) {
  .sequence li { grid-template-columns: 3.25rem minmax(0, 1fr); column-gap: 8px; padding: 18px 0 22px; }
  .sequence li::before { grid-row: 1 / span 2; font-size: 2.5rem; margin: 0; }
  .sequence li > * { grid-column: 2; }
}

.closing { padding-top: clamp(16px, 3vw, 40px); padding-bottom: clamp(56px, 8vw, 104px); }
.closing-panel { background: var(--night-2); border-radius: var(--radius-lg); padding: clamp(32px, 6vw, 80px); display: grid; gap: 18px; justify-items: start; }
.closing-panel h2 { font-size: clamp(2rem, 3.2vw + 1.2rem, 3.75rem); font-stretch: 86%; line-height: 1; letter-spacing: -.005em; max-width: 14em; }
.landing-footer { padding-bottom: 40px; color: var(--ink-2); font-size: .875rem; }
.landing-footer > div { border-top: 1px solid var(--line); padding-top: 28px; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: baseline; justify-content: space-between; }
.landing-footer p { max-width: 62ch; }
.landing-footer .wordmark { font-size: 1.125rem; }

@media (max-width: 480px) {
  .landing-nav .button { display: none; }
  .sample { padding: 20px 18px; }
}

/* Der eine inszenierte Moment: der Hero baut sich beim Laden auf. */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .lead, .hero-actions { animation: hero-rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .hero .lead { animation-delay: .1s; }
  .hero-actions { animation-delay: .18s; }
  .hero-art { animation: hero-art 1.4s ease-out both; }
  .sample { animation: hero-card .8s .35s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes hero-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes hero-art { from { opacity: 0; transform: scale(1.05); } }
@keyframes hero-card { from { opacity: 0; transform: translateY(36px) rotate(1.5deg); } }

/* Konto-Dialog */
.auth { padding: 32px 28px 28px; }
.auth .stack { gap: 18px; }
.auth-switch { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .sample .option.right > span:last-child { background-size: 100% 68%; }
}

/* Linkzeile zu den Rechtsseiten im Fuß von Startseite, Cockpit und Lernplattform. */
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 12px 0 0; padding: 0; list-style: none; font-size: .875rem; flex-basis: 100%; }
.legal-links a { color: inherit; }
