/* Grundlagen für alle Seiten: Schrift, Farben (dunkel als Standard, hell umschaltbar), gemeinsame Bausteine. */
@font-face { font-family: "DejaVu Sans"; src: url("/static/fonts/DejaVuSans.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DejaVu Sans"; src: url("/static/fonts/DejaVuSans-Bold.ttf") format("truetype"); font-weight: 700 900; font-display: swap; }

:root {
  --dlrg-rot: #e30613;      /* Logo-Hintergrund, Zeitleiste */
  --dlrg-gelb: #ffed00;     /* Schrift auf Rot */
  --radius: 10px;
  --font: "DejaVu Sans", "Noto Sans", Arial, sans-serif;

  /* Dunkel (Standard) */
  --bg: #12171e;
  --flaeche: #1a212b;
  --flaeche-2: #253040;
  --line: #2f3a49;
  --ink: #eef1f5;
  --mute: #9aa4b2;
  --blass: #5d6877;
  --richtig: #4cc27a;
  --richtig-bg: #1d3a29;
  --falsch: #ff6b6b;
  --falsch-bg: #3d2024;
  --fokus: #6ea8fe;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --flaeche: #ffffff;
  --flaeche-2: #eef0f3;
  --line: #d9dee5;
  --ink: #1b2430;
  --mute: #5b6675;
  --blass: #9aa4b2;
  --richtig: #2e7d4f;
  --richtig-bg: #e3f1e8;
  --falsch: #c62828;
  --falsch-bg: #fdecee;
  --fokus: #1f5fa8;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; }
button { font-family: var(--font); cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }

.leise { color: var(--mute); }

/* Logo: steht immer auf Rot, nie verzerrt */
.logo { display: inline-flex; align-items: center; background: var(--dlrg-rot); border-radius: 8px; padding: 6px 12px; }
.logo img { display: block; height: 100%; width: auto; }

/* Knöpfe */
.knopf { border: 1px solid var(--line); background: var(--flaeche); color: var(--ink); border-radius: var(--radius);
         font: 700 16px var(--font); padding: 10px 18px; white-space: nowrap; text-decoration: none; display: inline-block; }
.knopf:hover:not(:disabled) { border-color: var(--mute); }
.knopf.primaer { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.knopf:disabled { opacity: .4; }

/* Antwortzeile: Buchstabe + Text, bei Auflösung mit Balken und Anzahl */
.zeile { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
         background: var(--flaeche); border: 1px solid var(--line); border-radius: var(--radius);
         padding: 14px 18px; font: 700 18px var(--font); color: var(--ink); overflow: hidden; }
.zeile > * { position: relative; }
.zeile .buchstabe { flex: none; width: 1.8em; height: 1.8em; border-radius: 6px; background: var(--flaeche-2);
                    display: flex; align-items: center; justify-content: center; font-weight: 800; }
.zeile .text { flex: 1; min-width: 0; }
.zeile .anzahl { flex: none; color: var(--mute); font-variant-numeric: tabular-nums; }
.zeile .fuellung { position: absolute; left: 0; top: 0; bottom: 0; background: var(--flaeche-2); transition: width .6s ease-out; }
.zeile.richtig { border: 2px solid var(--richtig); }
.zeile.richtig .fuellung { background: var(--richtig-bg); }
.zeile.richtig .buchstabe { background: var(--richtig); color: var(--bg); }
.zeile.richtig .anzahl { color: var(--richtig); }
.zeile.blass { color: var(--blass); }

/* Hinweis bei Verbindungsverlust – nie eine weiße Seite */
.verbindung { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 50;
              background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: var(--radius);
              font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.3); width: max-content; max-width: calc(100% - 32px); text-align: center; }

.meldung { background: var(--falsch-bg); border-left: 4px solid var(--falsch); padding: 10px 12px; font-size: 16px; }
.meldung.info { background: var(--flaeche-2); border-left-color: var(--mute); }
