
@font-face { font-family: 'Fredoka Variable'; font-style: normal; font-display: swap; font-weight: 300 700; src: url('/fonts/fredoka.woff2') format('woff2-variations'); }
@font-face { font-family: 'Nunito Variable'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url('/fonts/nunito.woff2') format('woff2-variations'); }
/*
 * Design-Tokens – 25+ FoggyGames
 * Kräftig und verspielt, aber flach: satte Farben, keine Glanzlichter, keine Verläufe.
 * Marke: Violett · Kategorien: Minze (Brett), Lila (Puzzle), Orange (Action), Pink (Duell) · Akzent: Sonnengelb.
 * Kontraste nach WCAG 2.2 geprüft (Werte in Kommentaren, Prüfung: scripts/check-contrast.mjs).
 */
:root {
  color-scheme: light;

  /* Flächen & Text – kühles, helles Grundweiß */
  --bg: #f3f4fb;
  --surface: #ffffff;
  --surface-2: #eceef8;
  --surface-3: #dfe2f1;
  --border: #e2e5f2;
  --border-strong: #a9aecb;
  --text: #1c1a3a; /* 15,2:1 auf --bg */
  --text-muted: #5b5f80; /* 5,6:1 auf --bg */

  /* Marke: Violett. Buttons haben eine feste „Unterkante“ (--accent-deep) statt Glanz. */
  --accent: #6a4cff; /* Weiß darauf 5,1:1 */
  --accent-strong: #5b3df5; /* 5,6:1 – Text & Links */
  --accent-deep: #4a2fd6; /* Unterkante der Knubbel-Buttons */
  --accent-soft: #ece8ff;
  --on-accent: #ffffff;

  /* Sonnengelb: Daily Challenge, Premium, Highlights – immer mit dunkler Schrift (10,3:1) */
  --sun: #ffc22e;
  --sun-deep: #d99a00;
  --on-sun: #1c1a3a;
  --coral: #ff5f4a;

  --success: #0b8257; /* 4,9:1 */
  --success-solid: #22c493;
  --warning: #a35f00; /* 5,0:1 */
  --danger: #d62e4a; /* 4,8:1 */
  --danger-soft: #ffe1e6;
  --flame: #ff7a1a;
  --overlay: rgb(28 26 58 / 0.5);

  /* Kategorien: kräftige Farbe (-solid) · helle Fläche · Schrift auf der Fläche (je ≥ 5,7:1) */
  --cat-board-solid: #2ccb98;
  --cat-board: #ddf7ee;
  --cat-board-ink: #0b6b4d;
  --cat-puzzle-solid: #8e6cff;
  --cat-puzzle: #ece6ff;
  --cat-puzzle-ink: #4b2db8;
  --cat-action-solid: #ff9a2e;
  --cat-action: #ffebd6;
  --cat-action-ink: #8a4300;
  --cat-duel-solid: #ff5e93;
  --cat-duel: #ffe1ec;
  --cat-duel-ink: #a4134b;

  /* Spieler: farbenblind-sicheres Blau/Orange, immer zusätzlich mit Form (P1 ●, P2 ▲) */
  --p1: #2f6bff;
  --p1-stroke: #1b47b8;
  --p2: #ff8a1f;
  --p2-stroke: #a84e00;

  /* Stimmung der Spiel-Detailansicht je Schwierigkeit (Verlauf a → b, Schrift ink) */
  --mood-easy-a: #d4f6e9;
  --mood-easy-b: #c6ecff;
  --mood-easy-ink: #0a5a43;
  --mood-medium-a: #fff3b0;
  --mood-medium-b: #ffe066;
  --mood-medium-ink: #6b3a00;
  --mood-hard-a: #ffd6cf;
  --mood-hard-b: #ffbccd;
  --mood-hard-ink: #8e1030;
  --mood-expert-a: #2a1c66;
  --mood-expert-b: #4b1a73;
  --mood-expert-ink: #f4eeff;

  /* Diagramme (Dataviz-Validator: Helligkeitsband + ≥ 3:1 zur Fläche) */
  --chart-bar: #6a4cff;
  --chart-grid: #e2e5f2;

  /* Spiel-Icons sind themenunabhängig (wie App-Icons auf dem Homescreen) */
  --icon-ink: #1c1a3a;
  --icon-paper: #ffffff;
  --icon-dark: #2e2c52;
  --icon-accent: #ff5f4a;
  --icon-p1: #2f6bff;
  --icon-p2: #ffb020;
  --icon-red: #ff4d6d;
  --icon-orange: #ff9a2e;
  --icon-leaf: #3ccb7f;
  --icon-board: #4fd8aa;
  --icon-puzzle: #a58bff;
  --icon-action: #ffbb52;
  --icon-duel: #ff85ad;

  /* Form & Tiefe – weiche, leicht violett getönte Schatten */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgb(40 30 120 / 0.06), 0 3px 8px rgb(40 30 120 / 0.07);
  --shadow-2: 0 2px 4px rgb(40 30 120 / 0.07), 0 10px 24px rgb(40 30 120 / 0.12);
  --shadow-3: 0 6px 14px rgb(40 30 120 / 0.1), 0 20px 48px rgb(40 30 120 / 0.18);
  --shadow-press: inset 0 2px 0 rgb(40 30 120 / 0.08);

  /* Abstände (4er-Raster) & Touch */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --touch-min: 48px; /* ≥ 44 pt (Apple) bzw. 48 dp (Android) */
  --gutter: 16px;
  --content-max: 720px;

  /* Typografie: Fredoka (rund, verspielt) für Überschriften, Nunito für Text */
  --font-display: 'Fredoka Variable', 'Nunito Variable', ui-rounded, system-ui, sans-serif;
  --font-body: 'Nunito Variable', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;

  /* Bewegung – kleine Bounces */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Safe Areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Layout */
  --tabbar-h: 64px;
  --banner-h: 52px;
}

/* Tablet (beide Seiten ≥ 600 px): mehr Rand. Die Schrift wächst über html (base.css). */
@media (min-width: 600px) and (min-height: 600px) {
  :root {
    --gutter: 24px;
  }
}

/* Android: Cordova polstert Status- und Navigationsleiste nativ (AndroidEdgeToEdge=false).
   Meldet die WebView trotzdem Insets (Android 15+), würde der Abstand doppelt gerechnet.
   Stattdessen misst das eigene Plugin, wie weit die Leisten die WebView wirklich überdecken
   (normalerweise 0; ohne native Polsterung die Höhe der Navigationsleiste, siehe main.tsx). */
:root[data-insets='native'] {
  --safe-top: var(--covered-top, 0px);
  --safe-bottom: var(--covered-bottom, 0px);
  --safe-left: var(--covered-left, 0px);
  --safe-right: var(--covered-right, 0px);
}

/* Dunkel: tiefes Nachtblau, kein reines Schwarz */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #14142b;
    --surface: #1e1e3c;
    --surface-2: #2a2a4d;
    --surface-3: #36365c;
    --border: #33345a;
    --border-strong: #6e70a0;
    --text: #f2f1ff; /* 16,1:1 */
    --text-muted: #aaacd3; /* 8,2:1 */
    --accent: #7055ff; /* Weiß darauf 4,7:1 */
    --accent-strong: #a593ff; /* Text auf dunklem Grund */
    --accent-deep: #4b33c9;
    --accent-soft: #2d2766;
    --on-accent: #ffffff;
    --sun: #ffc22e;
    --sun-deep: #c68a00;
    --on-sun: #1c1a3a;
    --coral: #ff7a66;
    --success: #5fe0b0;
    --success-solid: #22c493;
    --warning: #ffc266;
    --danger: #ff7d8f;
    --danger-soft: #4d1d2a;
    --flame: #ff8c3a;
    --overlay: rgb(5 5 20 / 0.65);
    --cat-board: #14473a;
    --cat-board-ink: #9ff0d5;
    --cat-puzzle: #33275f;
    --cat-puzzle-ink: #d3c6ff;
    --cat-action: #4d3416;
    --cat-action-ink: #ffd3a3;
    --cat-duel: #4d1d33;
    --cat-duel-ink: #ffc2d8;
    --p1: #6e9bff;
    --p1-stroke: #dce6ff;
    --p2: #ffa650;
    --p2-stroke: #ffd9b3;

    --mood-easy-a: #10463a;
    --mood-easy-b: #123a5c;
    --mood-easy-ink: #c9f7e7;
    --mood-medium-a: #4a3b0a;
    --mood-medium-b: #5c4709;
    --mood-medium-ink: #fff0b0;
    --mood-hard-a: #4d1622;
    --mood-hard-b: #4a1238;
    --mood-hard-ink: #ffd0da;
    --mood-expert-a: #170f3d;
    --mood-expert-b: #320c48;
    --mood-expert-ink: #efe6ff;
    --chart-bar: #8c74ff;
    --chart-grid: #33345a;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.35);
    --shadow-2: 0 6px 16px rgb(0 0 0 / 0.4);
    --shadow-3: 0 12px 32px rgb(0 0 0 / 0.5);
    --shadow-press: inset 0 2px 0 rgb(0 0 0 / 0.25);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #14142b;
  --surface: #1e1e3c;
  --surface-2: #2a2a4d;
  --surface-3: #36365c;
  --border: #33345a;
  --border-strong: #6e70a0;
  --text: #f2f1ff;
  --text-muted: #aaacd3;
  --accent: #7055ff;
  --accent-strong: #a593ff;
  --accent-deep: #4b33c9;
  --accent-soft: #2d2766;
  --on-accent: #ffffff;
  --sun: #ffc22e;
  --sun-deep: #c68a00;
  --on-sun: #1c1a3a;
  --coral: #ff7a66;
  --success: #5fe0b0;
  --success-solid: #22c493;
  --warning: #ffc266;
  --danger: #ff7d8f;
  --danger-soft: #4d1d2a;
  --flame: #ff8c3a;
  --overlay: rgb(5 5 20 / 0.65);
  --cat-board: #14473a;
  --cat-board-ink: #9ff0d5;
  --cat-puzzle: #33275f;
  --cat-puzzle-ink: #d3c6ff;
  --cat-action: #4d3416;
  --cat-action-ink: #ffd3a3;
  --cat-duel: #4d1d33;
  --cat-duel-ink: #ffc2d8;
  --p1: #6e9bff;
  --p1-stroke: #dce6ff;
  --p2: #ffa650;
  --p2-stroke: #ffd9b3;

  --mood-easy-a: #10463a;
  --mood-easy-b: #123a5c;
  --mood-easy-ink: #c9f7e7;
  --mood-medium-a: #4a3b0a;
  --mood-medium-b: #5c4709;
  --mood-medium-ink: #fff0b0;
  --mood-hard-a: #4d1622;
  --mood-hard-b: #4a1238;
  --mood-hard-ink: #ffd0da;
  --mood-expert-a: #170f3d;
  --mood-expert-b: #320c48;
  --mood-expert-ink: #efe6ff;
  --chart-bar: #8c74ff;
  --chart-grid: #33345a;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.35);
  --shadow-2: 0 6px 16px rgb(0 0 0 / 0.4);
  --shadow-3: 0 12px 32px rgb(0 0 0 / 0.5);
  --shadow-press: inset 0 2px 0 rgb(0 0 0 / 0.25);
}

/* Reduzierte Bewegung: per System oder Einstellung (data-motion setzt src/core/state/theme.ts) */
:root[data-motion='reduce'] {
  --dur-fast: 0ms;
  --dur-base: 0ms;
  --dur-slow: 0ms;
  --ease-bounce: linear;
}

/* Farbpaletten aus dem Shop (data-palette am <html>, gesetzt aus inventory.equipped.theme).
   Dieselben Werte gelten für die Shop-Vorschau (.palette-preview[data-palette]); „foggy“ stellt dort
   den Standard wieder her, falls gerade eine andere Palette aktiv ist. */
.palette-preview[data-palette='foggy'] {
  --bg: #f3f4fb;
  --surface: #ffffff;
  --surface-2: #eceef8;
  --surface-3: #dfe2f1;
  --border: #e2e5f2;
  --accent: #6a4cff;
  --accent-strong: #5b3df5;
  --accent-deep: #4a2fd6;
  --accent-soft: #ece8ff;
}
:root[data-theme='dark'] .palette-preview[data-palette='foggy'] {
  --bg: #14142b;
  --surface: #1e1e3c;
  --surface-2: #2a2a4d;
  --surface-3: #36365c;
  --border: #33345a;
  --accent: #7055ff;
  --accent-strong: #a593ff;
  --accent-deep: #4b33c9;
  --accent-soft: #2d2766;
}
:root[data-palette='mint'],
.palette-preview[data-palette='mint'] {
  --bg: #eefaf5;
  --surface-2: #e1f3ea;
  --surface-3: #cfe9dc;
  --border: #d3eadf;
  --accent: #0e8561;
  --accent-strong: #0a6e50;
  --accent-deep: #075a41;
  --accent-soft: #d9f4e8;
}
:root[data-palette='sunset'],
.palette-preview[data-palette='sunset'] {
  --bg: #fff3ea;
  --surface-2: #fce6d6;
  --surface-3: #f6d5bf;
  --border: #f4dccb;
  --accent: #c9441c;
  --accent-strong: #b03a16;
  --accent-deep: #8f2d10;
  --accent-soft: #ffe3d6;
}
:root[data-palette='ocean'],
.palette-preview[data-palette='ocean'] {
  --bg: #edf5ff;
  --surface-2: #dfecfb;
  --surface-3: #cbddf3;
  --border: #d3e2f5;
  --accent: #2358e6;
  --accent-strong: #1c47c0;
  --accent-deep: #17399a;
  --accent-soft: #dde8ff;
}
:root[data-theme='dark'][data-palette='mint'],
:root[data-theme='dark'] .palette-preview[data-palette='mint'] {
  --bg: #0f2420;
  --surface: #173129;
  --surface-2: #214037;
  --surface-3: #2c5043;
  --border: #274b3e;
  --accent: #0d7f5d;
  --accent-strong: #6fe3bd;
  --accent-deep: #096247;
  --accent-soft: #1c4a3b;
}
:root[data-theme='dark'][data-palette='sunset'],
:root[data-theme='dark'] .palette-preview[data-palette='sunset'] {
  --bg: #2a1520;
  --surface: #3a1d2c;
  --surface-2: #4b2639;
  --surface-3: #5c3047;
  --border: #583349;
  --accent: #c9441c;
  --accent-strong: #ffa07f;
  --accent-deep: #a33614;
  --accent-soft: #5a2a2c;
}
:root[data-theme='dark'][data-palette='ocean'],
:root[data-theme='dark'] .palette-preview[data-palette='ocean'] {
  --bg: #0f1d3a;
  --surface: #172a52;
  --surface-2: #203868;
  --surface-3: #2a4a85;
  --border: #2c4a80;
  --accent: #3a68ee;
  --accent-strong: #8fb3ff;
  --accent-deep: #2548b8;
  --accent-soft: #223f7c;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: var(--fs-md); line-height: 1.6; }
a { color: var(--accent-strong); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, .brand__name { font-family: var(--font-display); font-weight: 700; line-height: 1.2; margin: 0; }
.icon { display: block; flex: none; }
.wrap { max-width: var(--content-max); margin: 0 auto; padding: var(--space-4) var(--gutter) var(--space-7); display: flex; flex-direction: column; gap: var(--space-4); }

.top { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; }
.brand { display: flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 0; color: var(--text); text-decoration: none; }
.brand__tile { width: 40px; height: 40px; border-radius: 9px; overflow: hidden; flex: none; }
.brand__tile svg { width: 100%; height: 100%; display: block; }
.brand__name { font-size: var(--fs-xl); white-space: nowrap; }
.brand__num { color: var(--accent-strong); }

.segmented { display: flex; padding: 4px; gap: 4px; border-radius: var(--radius-pill); background: var(--surface-2); }
.segmented a { min-height: 36px; min-width: 48px; padding: 0 var(--space-3); display: grid; place-items: center; border-radius: var(--radius-pill); color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.segmented a[aria-current] { background: var(--surface); color: var(--accent-strong); font-weight: 800; box-shadow: var(--shadow-1); }

.hero { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); padding: var(--space-5) var(--space-4); border-radius: var(--radius-xl); background: var(--accent); color: var(--on-accent); box-shadow: 0 5px 0 var(--accent-deep); margin-bottom: 5px; }
.hero__tile { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: var(--radius-lg); box-shadow: 0 0 0 3px rgb(255 255 255 / 0.35); }
.hero__text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hero__eyebrow { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sun); }
.hero h1 { font-size: clamp(1.5rem, 7vw, 2.25rem); hyphens: auto; overflow-wrap: break-word; }
.hero__meta { font-size: var(--fs-sm); opacity: 0.9; }
.hero__lead { margin: 0; font-size: var(--fs-sm); opacity: 0.92; }

.tone-board { background: var(--cat-board-solid); color: #fff; }
.tone-puzzle { background: var(--cat-puzzle-solid); color: #fff; }
.tone-action { background: var(--cat-action-solid); color: #fff; }
.tone-duel { background: var(--cat-duel-solid); color: #fff; }
.tone-sun { background: var(--sun); color: var(--on-sun); }

.chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; text-decoration: none; }
.chip[aria-current] { background: var(--accent); color: var(--on-accent); }

.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.draft { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--sun); color: var(--on-sun); font-weight: 700; box-shadow: 0 4px 0 var(--sun-deep); margin-bottom: 4px; }

.sec { padding: var(--space-4) var(--space-4) var(--space-3); }
.sec__head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.sec__num { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-strong); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); }
.sec h2 { font-size: var(--fs-lg); }
.sec p { margin: 0 0 var(--space-3); color: var(--text); overflow-wrap: anywhere; }


.list { overflow: hidden; }
.row { display: flex; align-items: center; gap: var(--space-3); min-height: 72px; padding: var(--space-3) var(--space-4); color: var(--text); text-decoration: none; font-weight: 400; }
.row + .row { border-top: 1px solid var(--border); }
.row:active { background: var(--surface-2); }
.row__icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); }
.row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row__title { font-weight: 700; }
.row__subtitle { color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.4; }
.row__chev { color: var(--text-muted); }

.back { display: inline-flex; align-items: center; gap: var(--space-2); align-self: flex-start; min-height: 40px; padding: 0 var(--space-4) 0 var(--space-3); border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow-1); color: var(--text); font-weight: 700; font-size: var(--fs-sm); text-decoration: none; }

.foot { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin-top: var(--space-4); color: var(--text-muted); font-size: var(--fs-sm); text-align: center; }
.foot .brand__tile { width: 32px; height: 32px; border-radius: 7px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-1) var(--space-3); }
.foot nav a { font-weight: 600; }
@media (min-width: 640px) { .hero { flex-direction: row; align-items: center; padding: var(--space-6) var(--space-5); } }
