/* Schriften lokal (keine Verbindung zu Google beim Laden der Seite) – SIL Open Font License */
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/press-start-2p-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/nunito-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/nunito-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 900; font-display: swap; src: url('/fonts/nunito-latin-900-normal.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/chakra-petch-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/chakra-petch-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/chakra-petch-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/chakra-petch-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #080b22;
  --bg-2: #10153a;
  --panel: #151b47;
  --panel-2: #1c2459;
  --line: #2b3577;
  --text: #eef0ff;
  --muted: #9aa3d9;
  --tile: #1b2fa6;
  --tile-2: #13237e;
  --gold: #ffc93c;
  --twitch: #9146ff;
  --ok: #2ed47a;
  --bad: #ff5470;
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Press Start 2P', 'Courier New', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #1a2370 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; }
.display { font-family: var(--display); letter-spacing: .02em; font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
.narrow { max-width: 520px; }

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.card h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font: inherit; font-weight: 700; padding: 11px 16px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform .06s ease, filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.gold { background: var(--gold); color: #1b1300; border-color: transparent; }
.btn.twitch { background: var(--twitch); color: #fff; border-color: transparent; }
.btn.ok { background: var(--ok); color: #03260f; border-color: transparent; }
.btn.bad { background: var(--bad); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.big { padding: 15px 20px; font-size: 1.1rem; width: 100%; }
.btn.sm { padding: 6px 10px; font-size: .85rem; border-radius: 8px; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; width: 100%; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 201, 60, .18); }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
input[type=checkbox] { width: auto; accent-color: var(--gold); }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: .95rem; margin: 0; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 44px; height: 44px; border-radius: 10px; background: var(--tile); color: var(--gold);
  display: grid; place-items: center; font-family: var(--display); font-size: 1.5rem; box-shadow: inset 0 -4px 0 rgba(0,0,0,.3);
}
.brand b { font-family: var(--display); font-size: 1.6rem; font-weight: 400; letter-spacing: .03em; }

.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); padding: 4px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.pill.tw { border-color: var(--twitch); color: #cdb4ff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot.off { background: #555c8a; }

.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--panel-2); flex: none; }
.avatar.ph { display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: var(--gold); }

/* Board */
.board { display: grid; gap: 8px; grid-auto-flow: column; }
.board .col { display: grid; gap: 8px; grid-template-rows: auto; align-content: start; }
.board .cat {
  background: var(--tile-2); border-radius: 8px; height: 72px; overflow: hidden; padding: 8px; display: grid; place-items: center;
  text-align: center; font-weight: 800; text-transform: uppercase; font-size: .85rem; letter-spacing: .03em; hyphens: auto; overflow-wrap: break-word;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.3);
}
.board .tile {
  background: linear-gradient(180deg, var(--tile), var(--tile-2)); border: 0; border-radius: 8px; min-height: 64px;
  color: var(--gold); font-family: var(--display); font-size: 2rem; text-shadow: 0 3px 0 rgba(0,0,0,.45);
  cursor: default; box-shadow: inset 0 -4px 0 rgba(0,0,0,.3); transition: transform .1s ease, filter .15s;
}
.board .tile.click { cursor: pointer; }
.board .tile.click:hover { transform: scale(1.03); filter: brightness(1.2); }
.board .tile.used { background: #0d1440; color: transparent; text-shadow: none; box-shadow: none; }
.board .tile.empty { background: #0f1645; color: #4a5394; font-size: 1rem; font-family: var(--font); font-weight: 700; }

/* Timer */
.timer { height: 10px; border-radius: 99px; background: var(--bg-2); overflow: hidden; border: 1px solid var(--line); }
.timer > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ff8a3c); transition: width .1s linear; }
.timer.low > i { background: var(--bad); }

/* Leaderboard */
.lb { list-style: none; margin: 0; padding: 0; }
.lb li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.lb li:last-child { border-bottom: 0; }
.lb .rk { width: 26px; text-align: right; font-weight: 800; color: var(--muted); }
.lb li:nth-child(1) .rk { color: var(--gold); }
.lb .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb .sc { font-weight: 800; font-variant-numeric: tabular-nums; }
.lb li.me { background: rgba(255, 201, 60, .1); border-radius: 8px; }

.neg { color: var(--bad); }
.pos { color: var(--ok); }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #000c; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; pointer-events: none;
  transition: all .2s ease; z-index: 99; max-width: calc(100% - 32px); width: max-content;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: var(--bad); }

.media img, .media video { max-width: 100%; max-height: 50vh; border-radius: 10px; display: block; margin: 0 auto; }
.media audio { width: 100%; }

@media (max-width: 700px) {
  .board .tile { font-size: 1.3rem; min-height: 46px; }
  .board .cat { font-size: .6rem; height: 56px; padding: 4px; word-break: break-word; }
  .board { gap: 4px; } .board .col { gap: 4px; }
}

.privacy { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; color: var(--muted); line-height: 1.5; }
.privacy b { color: var(--text); }
.legal { text-align: center; padding: 12px 16px 28px; font-size: .9rem; color: var(--muted); }
.legal a { color: var(--text); font-weight: 600; }

/* LED-Rangliste (Overlays) */
.ledlb { display: flex; flex-direction: column; gap: 8px; }
.ledrow { display: flex; align-items: center; gap: 10px; }
.ledrow .rk { width: 28px; flex: none; text-align: right; font-weight: 800; color: var(--muted); font-size: 1.15rem; }
.ledrow .slot { flex: 1; min-width: 0; display: flex; }
.ledrow .slot canvas { display: block; max-width: 100%; }
.ledrow .sc { min-width: 70px; flex: none; text-align: right; font-weight: 800; font-size: 1.3rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.ledrow .sc.neg { color: var(--bad); }
.ledrow .sc.bump { animation: ledbump .6s ease; }
@keyframes ledbump { 30% { transform: scale(1.3); } }
.ledempty { color: var(--muted); margin: 0; }
