/*
 * Design-Tokens der Anwendung (REQ-010 AK-31, AK-32). EINZIGE QUELLE für Farben, Schriften und
 * Abstände der Anwendung. Außerhalb dieser Datei stehen in CSS, JS und Templates keine Farbwerte.
 *
 * Herkunft: docs/design/ci-design-tokens.md, Abschnitt 5 (Dora), übernommen von Dave in REQ-010,
 * Schritt 0. Werte unverändert; ein PHPUnit-Test (TokensTest) vergleicht jede Custom Property mit
 * der Token-Datei. Eigene Token-Kopien, z. B. in den Gestaltungs-Mockups (REQ-012), sind nicht
 * maßgeblich. Änderungen an Werten macht Dora in der Token-Datei und hier zugleich.
 *
 * Abweichung: PT Mono liegt als vollständige WOFF2 vor (ptmono-400.woff2 statt
 * ptmono-latin-400.woff2), weil die OFL von PT Mono reservierte Schriftnamen hat und eine Teilmenge
 * als geänderte Fassung gelten kann (offene Frage an Dora und das Team, siehe REQ-010,
 * Umsetzungsstatus). Sen und Permanent Marker sind auf Latin reduziert.
 * Ergänzt 2026-10-05 (Dora, E-79): "Marker Fallback", --font-display, --color-ai, --border-ai.
 * Ergänzt 2026-10-05 (Dora, REQ-010 Schritt 13): Bewegungs-Tokens --dur-*, --ease-* (Werte aus
 * REQ-002-gestaltung.md, Abschnitt 9), weil components.css sie nutzt.
 * Einbindung: tokens.css, base.css, layout.css, components.css (in dieser Reihenfolge).
 * Schriften und Lizenzen: ../fonts/ (Sen-OFL.txt, PTMono-OFL.txt, PermanentMarker-LICENSE.txt).
 */
@font-face {
  font-family: "Sen";
  src: url("../fonts/sen-latin-var.woff2") format("woff2-variations"),
       url("../fonts/sen-latin-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PT Mono";
  src: url("../fonts/ptmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Permanent Marker";
  src: url("../fonts/permanentmarker-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: optional;
}
/* Ersatz für Permanent Marker (E-79): Sen Bold aus derselben Datei, Laufweite angeglichen */
@font-face {
  font-family: "Marker Fallback";
  src: url("../fonts/sen-latin-var.woff2") format("woff2-variations"),
       url("../fonts/sen-latin-var.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  size-adjust: 108%;
  font-display: swap;
}

:root {
  /* --- Markenfarben (Logo) --- */
  --ci-cyan: #199cd9;          /* nur Flächen, 2,9:1 auf Papier */
  --ci-magenta: #e51380;       /* nicht auf der Spielfläche */
  --ci-yellow: #fbea26;        /* nur Fläche hinter Tinte */
  --ci-cyan-ink: #0a74b0;      /* 4,8:1 Papier, 5,1:1 Weiß */
  --ci-magenta-ink: #c4106d;   /* 5,4:1 Papier */

  /* --- Pastell (Website) --- */
  --ci-pastel-blue: #abceee;
  --ci-pastel-blue-light: #d0e0f8;
  --ci-pastel-yellow: #fffada;
  --ci-pastel-yellow-note: #f8f0a0;
  --ci-pastel-pink: #e9b3d3;
  --ci-pastel-pink-light: #f0d8e8;

  /* --- Neutral --- */
  --ci-ink: #242422;           /* 14,6:1 Papier */
  --ci-ink-soft: #3c3c3b;
  --ci-ink-muted: #575756;     /* 6,8:1 Papier; nicht auf Pastell */
  --ci-gray: #878787;          /* nur Deko */
  --ci-gray-light: #dadada;
  --ci-gray-lighter: #ededed;
  --ci-paper: #f8f8f8;
  --ci-paper-shade: #ececec;
  --ci-white: #ffffff;

  /* --- Semantik App (Namen wie REQ-002) --- */
  --color-bg: var(--ci-paper);
  --color-surface: var(--ci-white);
  --color-surface-neighbor: var(--ci-paper-shade);
  --color-ink: var(--ci-ink);
  --color-ink-muted: var(--ci-ink-muted);
  --color-scribble: var(--ci-ink);
  --color-accent: var(--ci-cyan-ink);        /* Griffe, Wegweiser, Ziele */
  --color-accent-soft: var(--ci-pastel-blue); /* Zielfläche beim Ziehen */
  --color-focus: var(--ci-cyan-ink);
  --color-halo-light: var(--ci-white);       /* Doppelkontur unter Hinweisen */
  --color-paper-sheet: var(--ci-pastel-yellow);
  --color-paper-sheet-back: var(--ci-pastel-blue);
  --color-paper-edge: var(--ci-ink);         /* 14,8:1 auf dem Blatt */
  --color-red-sheet: #c8352a;                /* 4,9:1 Papier, 5,0:1 Blatt */
  --color-red-sheet-back: #e3786d;
  --color-red-edge: #5e1510;
  --color-ready: #1a7f5a;                    /* nicht CI, s. offene Frage 2 */
  --color-waiting: var(--ci-ink-muted);
  --color-offline: #767675;                  /* 4,3:1 Papier, 4,5:1 Weiß, 3,9:1 #ececec (≥ 3:1, B-01) */
  --color-overlay: rgb(36 36 34 / 0.45);
  --color-ai: var(--ci-pastel-pink);         /* nur KI-Symbol und Band, nie Fläche (E-79) */

  /* --- Falt-Engine (REQ-003 AK-11, AK-30; REQ-010 AK-31): setzt jede --fold-*-Property aus
     packages/fold-engine/src/fold-engine.css, damit dort kein Ersatzwert greift --- */
  --fold-normal-front: var(--color-paper-sheet);
  --fold-normal-back: var(--color-paper-sheet-back);
  --fold-normal-edge: var(--color-paper-edge);
  --fold-red-front: var(--color-red-sheet);
  --fold-red-back: var(--color-red-sheet-back);
  --fold-red-edge: var(--color-red-edge);
  --fold-accent: var(--color-accent);
  --fold-halo: var(--color-halo-light);
  --fold-shadow: var(--color-ink);
  --fold-edge-opacity: .7;
  --fold-edge-width: 1.2px;

  /* --- Schrift --- */
  --font-ui: "Sen", system-ui, sans-serif;
  --font-display: "Permanent Marker", "Marker Fallback", "Sen", system-ui, sans-serif;
  --font-numeric: "PT Mono", ui-monospace, monospace;
  --fs-1: 0.875rem;  /* 14 */
  --fs-2: 1rem;      /* 16 */
  --fs-3: 1.25rem;   /* 20 */
  --fs-4: 1.5rem;    /* 24, kleinste Marker-Größe */
  --fs-5: 1.75rem;   /* 28 */
  --fs-6: 2rem;      /* 32 */
  --fs-7: 2.5rem;    /* 40 */
  --fs-8: 3.5rem;    /* 56 */
  --font-timer: var(--fs-6);
  --font-counter: var(--fs-5);
  --lh-ui: 1.4;
  --lh-display: 1.1;
  --lh-numeric: 1;

  /* --- Abstände, Formen (aus REQ-002 übernommen) --- */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;
  --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --radius: 12px;               /* Fallback, wenn kein Scribble-Rahmen */
  --border: 2px;
  --border-scribble: 3px;
  --border-ready: 5px;
  --border-ai: 6px;             /* KI-Band oben an der Moderator-Kachel (E-79) */
  --hit-min: 44px;
  --scale-neighbor: 0.45;

  /* --- Straßenansicht (REQ-005) --- */
  --tile-h: 128px;              /* Höhe einer Stationskachel */
  --street-gap: 6px;            /* Abstand zwischen den Kacheln */
  --street-margin: 20px;        /* Abstand Kopfleiste bis Straße */

  /* --- Scribble --- */
  --texture-paper: url("../img/paper-tile.webp"); /* 384 px, 18 KB, nahtlos aus paper-bg-50.png */
  --texture-opacity: 0.5;
  --shadow-note: 2px 3px 6px rgb(36 36 34 / 0.18);
  --rotate-note: 1.5deg;        /* Vorzeichen fest je Element */
  --fill-offset: 2px;           /* versetzte Icon-Füllung */

  /* --- Bewegung (REQ-002-gestaltung.md, Abschnitt 9, unverändert) --- */
  --dur-snap: 110ms;
  --dur-fallback: 280ms;
  --dur-handover: 350ms;
  --dur-drop: 220ms;
  --dur-ship: 900ms;
  --ease-out: cubic-bezier(.33, 1, .68, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

@media (prefers-contrast: more) {
  :root { --texture-opacity: 0; --border-scribble: 3px; }
}
