/* =====================================================================
   BEFORA Design System v4
   Eine Datei für alle Seiten von befora.de/befora_game
   Regeln: keine Gedankenstriche in Texten, Schriften lokal (fonts/fonts.css)
   ===================================================================== */
@import url("../../fonts/fonts.css");

:root {
  /* Flächen */
  --bg: #0b0b16;
  --bg-2: #10101e;
  --surface: #161628;
  --surface-2: #1d1d34;
  --surface-3: #262642;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  /* Text (alle Stufen mit Kontrast >= 4.5:1 auf --surface) */
  --text: #f5f5fb;
  --text-2: #c3c3d8;
  --text-3: #9a9ab5;
  /* Marke */
  --brand: #e63946;
  --brand-2: #ff6b5b;
  --gold: #fbbf24;
  --gold-2: #f59e0b;
  --ok: #34d399;
  --bad: #f87171;
  --info: #60a5fa;
  --warn: #fbbf24;
  /* Spielfarben */
  --c-krimi: #e63946;
  --c-werwolf: #8b5cf6;
  --c-imposter: #f97316;
  --c-quiz: #3b82f6;
  --c-mindlink: #ec4899;
  --c-goldenbuzz: #fbbf24;
  /* Akzent der aktuellen Seite (wird pro Spiel überschrieben) */
  --accent: var(--brand);
  --accent-ink: #fff;
  /* Form */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Crimson Text', Georgia, serif;
  --top-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

[data-game="krimi"] { --accent: var(--c-krimi); }
[data-game="werwolf"] { --accent: var(--c-werwolf); }
[data-game="imposter"] { --accent: var(--c-imposter); }
[data-game="quiz"] { --accent: var(--c-quiz); }
[data-game="mindlink"] { --accent: var(--c-mindlink); }
[data-game="goldenbuzz"] { --accent: var(--c-goldenbuzz); --accent-ink: #1a1306; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(139, 92, 246, .10), transparent 60%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg, video, canvas { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 900; }
h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 80%, #fff); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap-sm { max-width: 640px; }
.wrap-md { max-width: 860px; }
.stack > * + * { margin-top: var(--gap, 12px); }
.row { display: flex; gap: var(--gap, 10px); align-items: center; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.row-center { justify-content: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: var(--gap, 12px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(var(--min, 220px), 1fr)); }
@media (max-width: 640px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .grid-2.collapse, .grid-3.collapse { grid-template-columns: 1fr; } }
.center { text-align: center; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: .875rem; }
.tiny { font-size: .8rem; }
.big { font-size: 1.15rem; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.accent { color: var(--accent); }
.gold { color: var(--gold); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.nowrap { white-space: nowrap; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 600; }

/* ---------- Kopfzeile ---------- */
.bf-top {
  position: sticky; top: 0; z-index: 50;
  height: var(--top-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
  background: rgba(11, 11, 22, .82);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.bf-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 900; letter-spacing: .14em; font-size: 1.05rem; }
.bf-logo b { background: linear-gradient(135deg, var(--brand), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bf-logo .bf-logo-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), #9b1d2a); color: #fff; font-size: .95rem; letter-spacing: 0; box-shadow: 0 4px 14px rgba(230, 57, 70, .35); }
.bf-top-title { font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.bf-nav { display: flex; gap: 2px; margin-left: 12px; }
.bf-nav a { text-decoration: none; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .93rem; }
.bf-nav a:hover, .bf-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
@media (max-width: 860px) { .bf-nav { display: none; } }
.bf-user { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; font-weight: 700; font-size: .9rem; max-width: 180px; }
.bf-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-menu { position: absolute; right: 12px; top: calc(var(--top-h) - 4px); min-width: 230px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; animation: pop .16s ease; }
.bf-menu a, .bf-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; border-radius: 10px; text-align: left; text-decoration: none; cursor: pointer; font-weight: 600; color: var(--text); }
.bf-menu a:hover, .bf-menu button:hover { background: var(--surface-2); }
.bf-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--surface-2); --b-fg: var(--text); --b-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px;
  border-radius: 14px; border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg);
  font-weight: 800; font-size: 1rem; line-height: 1.1; text-decoration: none; text-align: center;
  cursor: pointer; user-select: none;
  transition: transform .08s ease, filter .15s ease, background .15s ease, box-shadow .15s ease, opacity .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.btn-primary { --b-bg: var(--accent); --b-fg: var(--accent-ink); --b-bd: transparent; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-brand { --b-bg: linear-gradient(135deg, var(--brand), #b81d2c); --b-fg: #fff; --b-bd: transparent; background: linear-gradient(135deg, var(--brand), #b81d2c); box-shadow: 0 8px 22px rgba(230, 57, 70, .3); }
.btn-gold { --b-bg: linear-gradient(135deg, #fcd34d, var(--gold-2)); --b-fg: #241a02; --b-bd: transparent; background: linear-gradient(135deg, #fcd34d, var(--gold-2)); box-shadow: 0 8px 22px rgba(245, 158, 11, .3); }
.btn-ghost { --b-bg: transparent; --b-bd: var(--line-2); }
.btn-soft { --b-bg: color-mix(in srgb, var(--accent) 16%, transparent); --b-fg: color-mix(in srgb, var(--accent) 70%, #fff); --b-bd: color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-danger { --b-bg: rgba(248, 113, 113, .14); --b-fg: #fca5a5; --b-bd: rgba(248, 113, 113, .4); }
.btn-ok { --b-bg: rgba(52, 211, 153, .16); --b-fg: #6ee7b7; --b-bd: rgba(52, 211, 153, .4); }
.btn-text { --b-bg: transparent; --b-bd: transparent; padding: 8px 10px; min-height: 40px; color: var(--text-2); }
.btn-sm { min-height: 38px; padding: 7px 12px; font-size: .9rem; border-radius: 11px; }
.btn-lg { min-height: 58px; padding: 14px 24px; font-size: 1.12rem; border-radius: 18px; }
.btn-xl { min-height: 68px; padding: 16px 28px; font-size: 1.25rem; border-radius: 20px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 42px; min-height: 42px; height: 42px; padding: 0; border-radius: 12px; font-size: 1.15rem; }
.btn-icon.btn-sm { width: 36px; height: 36px; min-height: 36px; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card-tight { padding: 14px; }
.card-glass { background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(10px); }
.card-accent { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface)); }
.card-click { cursor: pointer; transition: transform .12s ease, border-color .15s, background .15s; text-align: left; width: 100%; color: inherit; font: inherit; }
.card-click:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card-click:active { transform: scale(.985); }
.card-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; margin-bottom: 10px; }
.section-label { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 70%, #fff); margin-bottom: 8px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- Chips & Badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: .85rem; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.chip-accent { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: color-mix(in srgb, var(--accent) 60%, #fff); }
.chip-gold { background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .4); color: #fcd34d; }
.chip-ok { background: rgba(52, 211, 153, .14); border-color: rgba(52, 211, 153, .4); color: #6ee7b7; }
.chip-bad { background: rgba(248, 113, 113, .14); border-color: rgba(248, 113, 113, .4); color: #fca5a5; }
.chip-btn { cursor: pointer; }
.chip-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); color: var(--text); }

/* ---------- Formulare ---------- */
.field { display: block; }
.field > span, .label { display: block; font-size: .85rem; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  background: var(--bg-2); color: var(--text);
  border: 1.5px solid var(--line-2); border-radius: 12px;
  font-size: 1rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 100px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c3c3d8' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.select option { background: #161628; color: #f5f5fb; }
.input-code { text-transform: uppercase; letter-spacing: .3em; font-weight: 900; text-align: center; font-size: 1.4rem; }
.help { font-size: .82rem; color: var(--text-3); margin-top: 5px; }

/* Segment-Auswahl */
.seg { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; }
.seg button { flex: 1 1 auto; min-height: 40px; padding: 6px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font-weight: 800; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent); }

/* Schalter */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; padding: 10px 0; }
.switch input { appearance: none; flex: 0 0 auto; width: 52px; height: 30px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.switch input:checked { background: var(--accent); border-color: transparent; }
.switch input:checked::after { transform: translateX(22px); }
.switch .switch-text b { display: block; font-weight: 700; }
.switch .switch-text small { color: var(--text-3); font-size: .82rem; }

/* Zahl +/- */
.stepper { display: inline-flex; align-items: center; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--text); font-size: 1.3rem; font-weight: 800; cursor: pointer; }
.stepper button:hover { background: var(--surface-2); }
.stepper output { min-width: 48px; text-align: center; font-weight: 900; font-size: 1.1rem; }

/* ---------- Avatare & Spieler ---------- */
.avatar { --av: var(--accent); flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--av); color: #fff; font-weight: 900; font-size: .95rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.avatar-sm { width: 28px; height: 28px; font-size: .75rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 2.2rem; }
.plist { display: grid; gap: 8px; }
.pitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; min-height: 56px; }
.pitem .pname { font-weight: 800; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem.is-me { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.pitem.is-off { opacity: .55; }
.pitem.is-dead { opacity: .5; text-decoration: line-through; }
.pick { cursor: pointer; transition: border-color .12s, background .12s, transform .08s; width: 100%; text-align: left; color: inherit; font: inherit; }
.pick:hover { border-color: var(--line-2); }
.pick:active { transform: scale(.985); }
.pick[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* ---------- Bildschirme ---------- */
.wrap.screen { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.screen { min-height: calc(100dvh - var(--top-h)); padding: 20px 0 calc(32px + var(--safe-b)); animation: fadeUp .28s ease; }
.screen-center { display: flex; flex-direction: column; justify-content: center; }
.hero-game { text-align: center; padding: 18px 0 8px; }
.hero-icon { font-size: 4.2rem; line-height: 1; filter: drop-shadow(0 10px 24px color-mix(in srgb, var(--accent) 45%, transparent)); margin-bottom: 10px; }
.hero-game h1 { margin-bottom: 6px; }
.hero-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.mode-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mode-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.mode-card .mode-ico { font-size: 1.9rem; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); flex: 0 0 auto; }
.mode-card h3 { margin: 0 0 4px; }
.mode-card p { margin: 0; color: var(--text-2); font-size: .92rem; }
.sticky-actions { position: sticky; bottom: 0; z-index: 20; padding: 12px 0 calc(12px + var(--safe-b)); background: linear-gradient(180deg, transparent, var(--bg) 35%); }

/* Phasenleiste im Spiel */
.gamebar { display: flex; align-items: center; gap: 10px; padding: 10px 0 14px; }
.gamebar .phase { font-weight: 900; font-size: 1.05rem; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff)); border-radius: inherit; transition: width .3s ease; }

/* ---------- Modal / Sheet ---------- */
.bf-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(4, 4, 10, .72); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .18s ease; }
.bf-modal { width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 22px; animation: pop .2s ease; }
.bf-modal-wide { max-width: 720px; }
.bf-modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bf-modal-head h3 { margin: 0; font-size: 1.25rem; flex: 1; }
.bf-modal-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.bf-modal-actions .btn { flex: 1 1 140px; }
@media (max-width: 560px) {
  .bf-overlay.sheet { align-items: flex-end; padding: 0; }
  .bf-overlay.sheet .bf-modal { border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; padding-bottom: calc(22px + var(--safe-b)); animation: slideUp .24s ease; }
}

/* ---------- Toast ---------- */
.bf-toasts { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.bf-toast { pointer-events: auto; padding: 13px 16px; border-radius: 14px; background: #24243c; border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 700; display: flex; gap: 10px; align-items: center; animation: slideUp .22s ease; }
.bf-toast.ok { border-color: rgba(52, 211, 153, .5); }
.bf-toast.bad { border-color: rgba(248, 113, 113, .55); }
.bf-toast.gold { border-color: rgba(251, 191, 36, .55); }

/* ---------- Geräteübergabe & Aufdecken ---------- */
.bf-handover { position: fixed; inset: 0; z-index: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: radial-gradient(800px 500px at 50% 30%, color-mix(in srgb, var(--accent) 22%, var(--bg)), var(--bg)); animation: fade .2s ease; }
.bf-handover .ho-label { font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); font-weight: 800; }
.bf-handover .ho-name { font-size: clamp(2.2rem, 9vw, 4rem); font-weight: 900; margin: 10px 0 6px; }
.bf-handover .ho-hint { color: var(--text-2); max-width: 360px; }
.reveal { position: relative; border-radius: var(--r-xl); min-height: 260px; display: grid; place-items: center; padding: 26px; text-align: center; background: var(--surface); border: 2px dashed var(--line-2); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: pan-y; overflow: hidden; }
.reveal.hold { touch-action: none; }
.reveal.open { user-select: text; -webkit-user-select: text; cursor: default; }
.reveal .reveal-cover { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; background: repeating-linear-gradient(45deg, var(--surface-2) 0 14px, var(--surface) 14px 28px); transition: opacity .2s; font-weight: 800; color: var(--text-2); }
.reveal .reveal-cover .big-ico { font-size: 3rem; }
.reveal.open { border-style: solid; border-color: var(--accent); }
.reveal.open .reveal-cover { opacity: 0; pointer-events: none; }
.secret-word { font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 900; line-height: 1.05; }

/* ---------- Timer ---------- */
.timer { --p: 1; position: relative; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--surface-3) 0); }
.timer::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.timer b { position: relative; font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer.warn { background: conic-gradient(var(--bad) calc(var(--p) * 360deg), var(--surface-3) 0); animation: pulse 1s infinite; }
.timer-sm { width: 56px; height: 56px; } .timer-sm::before { inset: 5px; } .timer-sm b { font-size: 1.1rem; }
.timebar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.timebar > i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; }

/* ---------- Punkte / Rangliste ---------- */
.board-list { display: grid; gap: 8px; }
.board-row { display: grid; grid-template-columns: 34px auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.board-row .rank { font-weight: 900; color: var(--text-3); text-align: center; }
.board-row.r1 { border-color: rgba(251, 191, 36, .6); background: linear-gradient(90deg, rgba(251, 191, 36, .14), var(--surface-2)); }
.board-row.r1 .rank { color: var(--gold); }
.board-row .pts { font-weight: 900; font-variant-numeric: tabular-nums; }
.delta { font-weight: 900; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; border: 0; background: none; color: var(--text-2); font-weight: 800; padding: 9px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }

/* ---------- Leerer Zustand / Laden ---------- */
.empty { text-align: center; padding: 28px 16px; color: var(--text-2); }
.empty .empty-ico { font-size: 2.4rem; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; min-height: 56px; }
.loader { width: 34px; height: 34px; border: 3.5px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 24px auto; }

/* ---------- Code / QR / Einladung ---------- */
.code-big { font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 900; letter-spacing: .28em; padding-left: .28em; font-variant-numeric: tabular-nums; }
.qr { background: #fff; padding: 10px; border-radius: 14px; width: 168px; height: 168px; display: grid; place-items: center; }
.qr svg, .qr img { width: 100%; height: 100%; }

/* ---------- Fußzeile ---------- */
.bf-foot { margin-top: 48px; padding: 28px 0 calc(28px + var(--safe-b)); border-top: 1px solid var(--line); color: var(--text-3); font-size: .9rem; }
.bf-foot a { color: var(--text-2); text-decoration: none; }
.bf-foot a:hover { color: var(--text); text-decoration: underline; }
.bf-foot .row { --gap: 18px; }

/* ---------- Konfetti ---------- */
.bf-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 1100; }

/* ---------- Animationen ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { transform: scale(1.05); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes bounceIn { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
.anim-pop { animation: pop .25s ease both; }
.anim-bounce { animation: bounceIn .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.anim-shake { animation: shake .4s ease; }
.anim-pulse { animation: pulse 1.2s ease infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Werbung (nur Free, nur mit Einwilligung) ---------- */
.ad-slot:empty { display: none; }
.ad-slot { margin: 24px auto; max-width: 728px; min-height: 0; }

/* Erneutes Rendern derselben Phase ohne Animation */
.no-anim, .no-anim * { animation: none !important; }
.no-anim .spin, .no-anim .loader { animation: spin .7s linear infinite !important; }
