/* ================================================================
   Design Tokens — guess2gether
   Die EINZIGE Stelle fuer Farben, Schrift, Abstaende, Radien, Schatten
   und Bewegung (CLAUDE.md, Leitplanke 6). Wie die Bausteine daraus
   aussehen, steht in ui.css; hier stehen nur die Werte.

   Die Idee: eine Kneipe bei Nacht. Tintenschwarzer Grund mit einem
   Hauch Violett, darauf zwei Leuchtfarben -- Limette fuer "richtig",
   Orange fuer "falsche Stelle". Auf den Leuchtfarben steht dunkle
   Schrift: weiss auf Limette war mit 1,2:1 nicht zu lesen und brauchte
   deshalb frueher eine schwarze Kontur um jeden Buchstaben.
   ================================================================ */

/* Bricolage Grotesque, variabel (400-800), nur der lateinische Satz --
   vendored, kein CDN (Leitplanke 8). Lizenz: SIL OFL 1.1, liegt daneben. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/BricolageGrotesque-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* ------------------------------------------------------------------
     Grund und Flaechen
  ------------------------------------------------------------------ */
  --color-bg:             #0e0d13;
  --color-bg-glow-1:      rgba(204, 255, 102, 0.09);  /* Limette, oben links */
  --color-bg-glow-2:      rgba(255, 153, 51, 0.08);   /* Orange, unten rechts */
  --color-surface:        #17161e;
  --color-surface-raised: #211f2a;
  --color-empty:          #121118;
  --color-overlay-bg:     rgba(8, 7, 12, 0.8);
  --color-border:         #312f3b;
  --color-border-strong:  #5a5766;

  /* ------------------------------------------------------------------
     Schrift
     Kontrast auf --color-bg: text 17:1, muted 8:1, faint 4,6:1.
  ------------------------------------------------------------------ */
  --color-text:       #f5f3ee;
  --color-text-muted: #aaa6b6;
  --color-text-faint: #7f7b8c;

  /* ------------------------------------------------------------------
     Die Spielfarben. Jede hat ihre Schriftfarbe gleich dabei.
       correct  Limette / dunkle Schrift  15:1
       present  Orange  / dunkle Schrift   8:1
       absent   Schiefer / helle Schrift   5:1
  ------------------------------------------------------------------ */
  --color-correct:    #ccff66;
  --color-on-correct: #141b06;
  --color-present:    #ff9933;
  --color-on-present: #2a1400;
  --color-absent:     #2c2a36;
  --color-on-absent:  #a29eae;

  /* Kacheln vor der Wertung */
  --color-tile-bg:            rgba(255, 255, 255, 0.025);
  --color-tile-border:        #34323f;
  --color-tile-bg-active:     #1d1c26;
  --color-tile-border-active: #8a8698;

  /* Neutrale Knoepfe */
  --color-key-bg: #2a2833;

  /* Rueckmeldungen */
  --color-error:   #ff5c8a;
  --color-success: var(--color-correct);
  --color-warning: var(--color-present);
  --color-error-soft:   rgba(255, 92, 138, 0.12);
  --color-correct-soft: rgba(204, 255, 102, 0.12);
  --color-present-soft: rgba(255, 153, 51, 0.14);

  /* "Buy me a coffee": Violett -- die eine Farbe, die im Spiel sonst nichts
     bedeutet, also faellt sie auf, ohne mit Limette oder Orange zu streiten.
     Kontrast auf --color-bg: 8:1. */
  --color-coffee:      #b79cff;
  --color-coffee-soft: rgba(183, 156, 255, 0.14);
  --color-on-coffee:   #170f2e;
  --glow-coffee:       0 8px 24px -10px rgba(183, 156, 255, 0.7);

  /* QR-Code: braucht echtes Weiss, sonst liest ihn keine Kamera. */
  --color-qr-bg: #ffffff;

  /* Testlauf-Band: soll auffallen, nicht gefallen. */
  --color-testbanner-bg:   #ffb020;
  --color-testbanner-text: #1a1206;

  /* Konfetti auf der Leinwand (bar.js liest diese Namen). */
  --color-confetti-1: #ffffff;
  --color-confetti-2: #ff6b9d;
  --color-confetti-3: #66ccff;

  /* ------------------------------------------------------------------
     Typografie
  ------------------------------------------------------------------ */
  --font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system,
                 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-xs:   0.75rem;
  --font-size-sm:   0.875rem;
  --font-size-base: 1rem;
  --font-size-md:   1.125rem;
  --font-size-lg:   1.375rem;
  --font-size-xl:   1.75rem;
  --font-size-2xl:  2.5rem;
  --font-size-key:  0.875rem;
  --font-size-tile: 2rem;        /* Altname; Kacheln rechnen aus --tile-size */
  --font-weight-regular: 400;
  --font-weight-medium:  500;
  --font-weight-bold:    700;
  --font-weight-black:   800;
  --line-height-tight: 1.15;
  --line-height-body:  1.5;
  --tracking-caps: 0.14em;       /* fuer kleine Versal-Etiketten */
  --tracking-code: 0.32em;       /* Beitrittscode, Wortschlange */

  /* ------------------------------------------------------------------
     Abstaende, Radien, Linien
  ------------------------------------------------------------------ */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --radius-sm:   0.5rem;
  --radius-md:   0.875rem;
  --radius-lg:   1.25rem;
  --radius-pill: 999px;
  --border-w:    1px;

  /* ------------------------------------------------------------------
     Brett
  ------------------------------------------------------------------ */
  --tile-size:      3.5rem;      /* 56px */
  --tile-gap:       0.375rem;
  --tile-border-w:  2px;
  --tile-radius-ratio: 0.17;     /* Rundung als Anteil der Kachel */
  --tile-font-ratio:   0.54;     /* Buchstabe als Anteil der Kachel */
  --board-max-w:    21rem;

  /* Altnamen der frueheren Bildschirmtastatur -- nur noch fuer Seiten, die
     sie lesen (Rechtstexte, Monitoring). */
  --key-height: 3.5rem;
  --key-min-w:  2.625rem;
  --key-gap:    0.375rem;

  /* Kleinste Tippflaeche (WCAG 2.5.5: 44px) */
  --touch-target-min: 2.75rem;

  /* ------------------------------------------------------------------
     Schatten und Leuchten
  ------------------------------------------------------------------ */
  --shadow-card:  0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  --shadow-pop:   0 12px 32px -8px rgba(0, 0, 0, 0.6);
  --glow-correct: 0 0 1.4em -0.35em rgba(204, 255, 102, 0.55);
  --glow-present: 0 0 1.4em -0.35em rgba(255, 153, 51, 0.5);
  --glow-button:  0 8px 28px -8px rgba(204, 255, 102, 0.55);
  --focus-ring:   0 0 0 3px rgba(204, 255, 102, 0.35);

  /* ------------------------------------------------------------------
     Bewegung
  ------------------------------------------------------------------ */
  --ease-out:   cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast:   0.15s;
  --dur-pop:    0.14s;
  --dur-flip:   0.5s;
  --flip-stagger: 0.11s;         /* Versatz von Kachel zu Kachel */

}

/* ------------------------------------------------------------------
   Groessen je Bildschirm
------------------------------------------------------------------ */

/* Handy: die Kachel richtet sich nach der Breite, damit fuenf nebeneinander
   auch bei 320px passen. */
@media (max-width: 520px) {
  :root {
    /* Nicht groesser als 3rem: sechs Reihen muessen ueber die offene
       Handytastatur passen. */
    --tile-size:   clamp(2.6rem, 13.5vw, 3rem);
    --tile-gap:    0.3125rem;
    --key-height:  3.125rem;
    --key-min-w:   2rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --tile-size: 3.75rem;
  }
}
