/* Design-Tokens und Grundbausteine (siehe docs/DESIGN.md). Orientierung: Twitch (grau-schwarze Flächen, lila Akzent).
   Nur Desktop: keine Handy-Ansicht, Mindestbreite 1024 px. Dunkel ist Standard, Hell per data-theme="light". */
/* Archivo, selbst gehostet (OFL, siehe fonts/README.txt). Variable Breitenachse: Überschriften breit, Zahlen schmal. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(/shared/fonts/archivo-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(/shared/fonts/archivo-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0b0d11; --panel: #14181e; --panel-2: #1c2129; --panel-3: #262c36; --ink: #eef1f5; --ink-2: #9aa5b5; --line: #2b323d;
  --accent: #9147ff; --accent-hover: #7c33ee; --on-accent: #ffffff; --accent-text: #bf94ff;
  /* Signalgrün (ersetzt das frühere Gelb): Antworten, Zielmarke, „fertig“, Live */
  --signal: #3ddc97; --on-signal: #052e1b; --ok: #3ddc97;
  --live: #eb0400; --bad: #ff6b6b; --focus: #bf94ff;
  /* Radien nach Hierarchie: Steuerelemente < Panels < Kacheln < Popup */
  --radius: 10px; --radius-lg: 16px; --radius-xl: 22px; --radius-2xl: 28px;
  /* Archivo hat eine Breitenachse: Überschriften breit (font-stretch 112 %), Zahlen schmal (75 %). Fallback ohne Achse. */
  --font: "Archivo", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f4f7; --panel: #ffffff; --panel-2: #eef1f5; --panel-3: #e2e7ee; --ink: #0d1117; --ink-2: #525c6b; --line: #d6dce5;
  --accent: #772ce8; --accent-hover: #5c16c5; --on-accent: #ffffff; --accent-text: #6a21d6;
  --signal: #0b8f5b; --on-signal: #ffffff; --ok: #0b8f5b;
  --live: #d40300; --bad: #c62828; --focus: #772ce8;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { min-width: 1024px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); min-height: 100vh; }
h1, h2, h3 { font-weight: 800; line-height: 1.15; margin: 0; font-stretch: 112%; }
h1 { font-size: 26px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; font-stretch: 75%; font-weight: 800; }
.muted { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--accent-text); }
code { background: var(--panel-2); padding: 1px 5px; border-radius: var(--radius); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Eingaben */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.hint { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
input, select, textarea {
  width: 100%; height: 36px; padding: 6px 10px; background: var(--panel-2); color: var(--ink);
  border: 2px solid transparent; border-radius: var(--radius); font: inherit; transition: border-color .12s, background-color .12s;
}
input:hover { border-color: var(--line); }
input:focus { outline: none; border-color: var(--accent); background: var(--bg); }
input::placeholder { color: var(--ink-2); opacity: .8; }
input:disabled, select:disabled, button:disabled { opacity: .5; cursor: not-allowed; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.field { margin-bottom: 16px; }
.err { color: var(--bad); font-size: 13px; margin-top: 8px; min-height: 1.4em; }

/* Knöpfe: ein primärer pro Ansicht */
button, .btn {
  height: 36px; padding: 0 12px; border-radius: var(--radius); border: 0;
  background: var(--panel-3); color: var(--ink); font: 600 13px var(--font); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap;
  transition: background-color .12s, transform .12s;
}
button:hover:not(:disabled), .btn:hover { background: color-mix(in srgb, var(--panel-3) 80%, var(--ink) 20%); }
button:active:not(:disabled) { transform: translateY(1px); }
button.primary { background: var(--accent); color: var(--on-accent); }
button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.danger { color: var(--bad); }
button.ghost { background: transparent; }
button.ghost:hover:not(:disabled), .btn.ghost:hover { background: var(--panel-3); }
button.small { height: 30px; padding: 0 10px; font-size: 12.5px; }
button.icon, .btn.icon { padding: 0; width: 36px; }
button svg, .btn svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Passwortfeld mit Auge (gedrückt halten = anzeigen), siehe shared/pw.js */
.pwwrap { position: relative; }
.pwwrap input { padding-right: 44px; }
.pweye { background: transparent; color: var(--ink-2); width: 34px; height: 30px; padding: 0; border-radius: var(--radius); }
.pwwrap .pweye { position: absolute; right: 3px; top: 3px; }
.pweye:hover:not(:disabled) { background: var(--panel-3); color: var(--ink); }
.pweye.on { color: var(--accent-text); background: var(--panel-3); }
.pwreveal { display: inline-flex; align-items: center; gap: 6px; }

/* Flächen */
/* Flächen trennen sich über Helligkeitsstufen, nicht über Rahmen (Twitch-Dashboard); im hellen Design reicht der Kontrast nicht, dort ein Haarrahmen */
.panel { background: var(--panel); border-radius: var(--radius-lg); }
:root[data-theme="light"] .panel { box-shadow: 0 0 0 1px var(--line); }
.panel > .ph { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.panel > .pb { padding: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel-3); border-left: 4px solid var(--ok);
  padding: 10px 16px; border-radius: var(--radius); box-shadow: 0 4px 18px rgba(0,0,0,.4); z-index: 100; font-weight: 600; }
.toast.bad { border-left-color: var(--bad); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
