/* ==========================================================================
   Gleichzeitig – Stylesheet
   Farben als Tokens; Light/Dark folgt der Systemeinstellung.
   ========================================================================== */

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* Light Mode */
  --page: #ffffff;
  --card: #f4f4f3;
  --tile: #e9e9e8;
  --option: #e6e6e5;
  --fg: #111111;
  --body: #333333;
  --body2: #2b2b2b;
  --muted: #555555;
  --faint: #636363;
  --link: #444444;
  --primary: #111111;
  --on-primary: #ffffff;
  --line: #dcdcdc;
  --line-strong: #c2c2c2;
  --track: #d4d4d4;
  --seg-on: #111111;
  --picked-border: #6f6f6f;
  --mood-border: #b5b5b5;

  --radius: 6px;
  --max: 430px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #111111;
    --card: #0a0a0a;
    --tile: #1c1c1c;
    --option: #222222;
    --fg: #f2f2f2;
    --body: #d4d4d4;
    --body2: #e6e6e6;
    --muted: #b3b3b3;
    --faint: #9a9a9a;
    --link: #c4c4c4;
    --primary: #f2f2f2;
    --on-primary: #111111;
    --line: #2a2a2a;
    --line-strong: #3a3a3a;
    --track: #333333;
    --seg-on: #e6e6e6;
    --picked-border: #8a8a8a;
    --mood-border: #555555;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--page);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: var(--max);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

button { font: inherit; color: inherit; }
a { color: var(--fg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
main:focus { outline: none; }

.faint { color: var(--faint); font-size: 12px; }

/* --- Kopfzeile ----------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; font-size: 17px; letter-spacing: 0.14em; }

.icon-btn {
  width: 44px; height: 44px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: transparent;
  display: grid; place-items: center;
  padding: 0;
  cursor: pointer;
}

/* --- Fortschritt --------------------------------------------------------- */

.progress { padding: 18px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.progress[hidden] { display: none; } /* sonst überschreibt display:flex das hidden-Attribut */
.progress__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.progress__bar { display: grid; grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr)); gap: 6px; }
.progress__bar span { height: 3px; border-radius: 2px; background: var(--track); }
.progress__bar span.on { background: var(--seg-on); }

/* --- Karte & Typografie -------------------------------------------------- */

.card {
  margin: 20px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card--center { text-align: center; align-items: center; }

.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }

.title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.3;
  color: var(--fg);
}

.title--lg { font-size: 27px; line-height: 1.25; }
.title--xl { font-size: 40px; line-height: 1.2; }

.text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--body); }
.small { margin: 0; font-size: 14px; line-height: 1.55; color: var(--body); }
.meta { margin: 0; font-size: 12px; line-height: 1.5; color: var(--faint); }

/* Quellenzeile in der Auflösung: ganze Zeile ist Link, mind. 44 px hoch.
   Nur der Titel ist unterstrichen. */
.source-link { display: flex; align-items: center; min-height: 44px; text-decoration: none; }
.source-link__title { color: var(--fg); text-decoration: underline; }

.divider { border-top: 1px solid var(--line); padding-top: 16px; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack--tight { gap: 4px; }
.head { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }

/* --- Buttons ------------------------------------------------------------- */

.btn {
  min-height: 52px;
  border-radius: 4px;
  border: none;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.btn--ghost {
  min-height: 44px;
  background: transparent;
  color: var(--link);
  font-size: 14px;
  font-weight: 400;
}

.btn--outline {
  min-height: 44px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-strong);
  font-size: 15px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}

.linklike {
  min-height: 44px;
  padding: 0 4px;
  border: none;
  background: transparent;
  color: var(--link);
  text-decoration: underline;
  font-size: 13px;
  cursor: pointer;
}

/* --- Antworten ----------------------------------------------------------- */

.option {
  min-height: 56px;
  width: 100%;
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 17px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  background: var(--option);
  color: var(--fg);
  border: 1px solid var(--option);
}

.option[disabled] { cursor: default; }
.revealed .option { min-height: 48px; justify-content: space-between; text-align: left; }
.option.is-correct { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.option.is-picked { background: transparent; border-color: var(--picked-border); }
.option.is-dim { color: var(--muted); } /* statt opacity: Kontrast ≥ 4,5:1 */
.option__tag { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }

/* --- Schätzskala --------------------------------------------------------- */

.scale { position: relative; height: 70px; }
.scale__track { position: absolute; top: 33px; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--track); }
.scale__dot { position: absolute; top: 28px; width: 14px; height: 14px; border-radius: 7px; transform: translateX(-50%); }
.scale__dot--true { background: var(--fg); }
.scale__dot--guess { border: 2px solid var(--faint); background: var(--card); }
.scale__label { position: absolute; transform: translateX(-50%); font-size: 13px; white-space: nowrap; }
.scale__label--true { top: 0; font-weight: 600; color: var(--fg); }
.scale__label--guess { top: 52px; color: var(--muted); }

/* --- Abschluss ----------------------------------------------------------- */

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--tile); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.tile__num { font-family: var(--font-serif); font-size: 24px; color: var(--fg); }
.tile__text { font-size: 12px; line-height: 1.4; color: var(--muted); }

.moods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mood {
  min-height: 44px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--mood-border);
}
.mood[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

.good { display: flex; flex-direction: column; gap: 6px; padding: 16px 0; border-top: 1px solid var(--line); }
.good__num { font-family: var(--font-serif); font-size: 24px; line-height: 1.15; color: var(--fg); }
.good__text { font-size: 15px; line-height: 1.45; color: var(--body2); }
.good__caveat { font-size: 13px; line-height: 1.45; color: var(--muted); }

.action {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--tile);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--fg);
}
a.action:hover { border-color: var(--line-strong); }
.action__head { display: flex; justify-content: space-between; align-items: baseline; }
.action__ext { font-size: 16px; line-height: 1; color: var(--fg); } /* ↗ = Link, öffnet extern */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.action__time { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.action__title { font-size: 17px; font-weight: 600; line-height: 1.35; }
.action__text { font-size: 14px; line-height: 1.5; color: var(--body); }

.goodbye { flex: 1; margin: 20px; padding: 48px 24px 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px; text-align: center; }
.goodbye .small { max-width: 300px; color: var(--muted); }

/* --- Info, Quellen, Rechtliches ------------------------------------------ */

.list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--body); }
.subhead { margin: 0; font-size: 15px; font-weight: 600; color: var(--fg); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.legal-links { display: flex; justify-content: center; gap: 24px; }

.source { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; min-height: 44px; text-decoration: none; color: var(--fg); }
.source__use { font-size: 12px; color: var(--faint); }
.source__title { font-size: 15px; font-weight: 500; line-height: 1.4; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.source__meta { font-size: 13px; line-height: 1.4; color: var(--muted); }

.legal-text { white-space: pre-line; }
.placeholder { color: var(--faint); }
