/* ============================================================
   bildschirmlos — Designsystem
   Warme Papier-Optik, hell & dunkel, barrierefrei.
   Keine externen Ressourcen. Nur Systemschriften.
   ============================================================ */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  /* Fläche & Tinte (hell) */
  --bg: #f6f1e6;
  --surface: #fdfbf4;
  --surface-2: #efe8d8;
  --line: #ddd3bf;
  --ink: #272217;
  --ink-soft: #5d5546;
  --ink-faint: #837a67;

  /* Akzent (Tannengrün) + neutraler Vergleichston für Marken/Balken.
     Paar validiert (CVD/Kontrast); Neutralton ist bewusst grau —
     Vergleichsbalken tragen immer direkte Textbeschriftung. */
  --accent: #1f7a4d;
  --accent-strong: #175c39;
  --accent-tint: #e0ebe0;
  --mark-neutral: #8d8371;

  /* Status — sparsam, nie ohne Text/Icon */
  --warn: #8a5a00;
  --bad: #a03c2e;
  --good: var(--accent);

  /* Typografie */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;

  /* Geometrie */
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(60, 50, 30, 0.06), 0 6px 24px rgba(60, 50, 30, 0.07);
  --maxw-text: 44rem;
  --maxw-wide: 66rem;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1e1b15;
  --surface: #27231b;
  --surface-2: #322d23;
  --line: #423b2d;
  --ink: #ede5d3;
  --ink-soft: #c0b6a0;
  --ink-faint: #99907c;
  --accent: #3f9e6b;
  --accent-strong: #5cb586;
  --accent-tint: #263a2e;
  --mark-neutral: #756c58;
  --warn: #d9a04a;
  --bad: #e08573;
  --good: var(--accent);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 24px rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1e1b15;
    --surface: #27231b;
    --surface-2: #322d23;
    --line: #423b2d;
    --ink: #ede5d3;
    --ink-soft: #c0b6a0;
    --ink-faint: #99907c;
    --accent: #3f9e6b;
    --accent-strong: #5cb586;
    --accent-tint: #263a2e;
    --mark-neutral: #756c58;
    --warn: #d9a04a;
    --bad: #e08573;
    --good: var(--accent);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 24px rgba(0, 0, 0, 0.25);
  }
}

/* ---------- Basis ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin-top: 1.6em;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-strong);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--accent-tint);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

/* ---------- Layout ---------- */

.container {
  max-width: var(--maxw-text);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container--wide {
  max-width: var(--maxw-wide);
}

main {
  padding: 2.5rem 0 4rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-s) 0;
  font-family: var(--font-sans);
}

.skip-link:focus {
  left: 0;
}

/* ---------- Header & Navigation ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  font-family: var(--font-sans);
}

.site-header__inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--accent-strong);
}

.brand svg {
  width: 1.35em;
  height: 1.35em;
  flex: none;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.site-nav a[aria-current] {
  color: var(--ink);
  background: var(--surface-2);
  font-weight: 600;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  width: 2.3rem;
  height: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink-faint);
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* ---------- Hero ---------- */

.hero {
  padding: 3.5rem 0 1rem;
  text-align: center;
}

.hero p.lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  text-wrap: balance;
}

.kicker {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.75rem;
}

/* ---------- Karten ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.1rem;
  padding: 0;
  margin: 1.5rem 0;
  list-style: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.15rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-faint);
}

.card h3 {
  margin: 0;
}

.card h3 a {
  color: var(--ink);
  text-decoration: none;
}

/* ganze Karte klickbar, Fokusring auf der Karte */
.card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.card:has(:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.card:has(:focus-visible) :focus-visible {
  outline: none;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

.card .card-emoji {
  font-size: 1.7rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.card-meta {
  margin-top: auto;
  padding-top: 0.7rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ---------- Pills / Tags ---------- */

.pill {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-strong);
  border: 1px solid transparent;
}

.pill--outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-faint);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.97rem;
  font-weight: 600;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease;
}

.btn:hover {
  border-color: var(--ink-faint);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

[data-theme="dark"] .btn--primary,
:root:not([data-theme="light"]) .btn--primary {
  color: #14201a;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .btn--primary {
    color: #fff;
  }
}

.btn--big {
  font-size: 1.1rem;
  padding: 0.85rem 1.8rem;
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}

.btn--ghost:hover {
  background: var(--accent-tint);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Formulare ---------- */

label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 0.4rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0.6rem 0;
}

input[type="text"],
input[type="number"],
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 0.5rem 0.75rem;
  max-width: 100%;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

legend {
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0 0.5rem;
}

/* ---------- Spiel-Rahmen ---------- */

.game-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 2.25rem);
  margin: 2rem 0;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.game-hud strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- Statistik-Kacheln (Ergebnisse) ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-tile {
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 1rem 1.1rem;
}

.stat-tile .stat-label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.3rem;
}

.stat-tile .stat-value {
  font-family: var(--font-sans);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: block;
}

.stat-tile .stat-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: block;
  margin-top: 0.25rem;
}

/* ---------- Vergleichsbalken (Schätzung vs. Wert) ----------
   Dünne Balken, 4px runde Enden, direkte Beschriftung.
   Identität über Beschriftung, nie nur über Farbe. */

.bar-compare {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.bar-compare .bar-item {
  display: grid;
  gap: 0.25rem;
}

.bar-compare .bar-label {
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.bar-compare .bar-label strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.bar-compare .bar-track {
  background: var(--surface-2);
  border-radius: 4px;
  height: 14px;
  overflow: hidden;
}

.bar-compare .bar-fill {
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--mark-neutral);
  min-width: 2px;
  transition: width 0.5s ease;
}

.bar-compare .bar-fill--accent {
  background: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .bar-compare .bar-fill {
    transition: none;
  }
}

/* ---------- Hinweise & Ergebnis-Boxen ---------- */

.notice {
  background: var(--accent-tint);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  padding: 0.9rem 1.2rem;
  margin: 1.5rem 0;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice--plain {
  background: var(--surface-2);
  border-left-color: var(--ink-faint);
}

/* ---------- Artikel ---------- */

.prose {
  max-width: var(--maxw-text);
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-style: italic;
}

.article-meta {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 2rem;
}

.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* „Passendes Spiel dazu“-Kasten */
.crosslink {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

.crosslink .crosslink-emoji {
  font-size: 1.6rem;
  line-height: 1.2;
}

.crosslink p {
  margin: 0;
  font-size: 0.97rem;
}

.crosslink .crosslink-kicker {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
}

/* ---------- Toast (sanfter Stupser) ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 0.9rem;
  align-items: center;
  max-width: min(92vw, 30rem);
  z-index: 50;
}

.toast button {
  font: inherit;
  font-weight: 700;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.site-footer__inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  justify-content: space-between;
  align-items: baseline;
}

.site-footer a {
  color: var(--ink-soft);
}

.site-footer a:hover {
  color: var(--ink);
}

.site-footer .footer-claim {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-faint);
}

/* ---------- Utilities ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.center {
  text-align: center;
}

.muted {
  color: var(--ink-soft);
}

.small {
  font-size: 0.9rem;
}

.mt-2 {
  margin-top: 2rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.actions--center {
  justify-content: center;
}

[hidden] {
  display: none !important;
}

/* ---------- Bewegung & Druck ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toast,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
