/* Kieferduell – styles. Three themes as CSS custom properties on [data-theme]:
   klinik (A, light), gameshow (B, default), modern (C). */

/* ============================================================ themes */
:root, [data-theme="gameshow"] {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font);
  --bg: radial-gradient(520px 380px at 50% 0%, #3a1d9a 0%, transparent 70%), radial-gradient(900px 700px at 110% 110%, #3a0f6b 0%, transparent 60%), linear-gradient(180deg, #1b1050 0%, #120b3a 60%, #0d0830 100%);
  --bg-solid: #120b3a;
  --text: #ffffff; --text-2: #c9b8ff; --text-3: #8f84c7;
  --surface: rgba(255,255,255,.07); --surface-2: rgba(255,255,255,.12); --line: rgba(255,255,255,.12); --line-2: rgba(255,255,255,.22);
  --accent: #ffd34d; --accent-2: #ff4fb8; --accent-fg: #3a1d00;
  --primary-bg: linear-gradient(180deg, #ffe066, #ffb800); --primary-fg: #3a1d00; --primary-sh: 0 6px 0 #a86a00, 0 0 30px rgba(255,200,0,.4);
  --secondary-bg: linear-gradient(180deg, #4a8dff, #1f63e6); --secondary-fg: #fff; --secondary-sh: 0 6px 0 #123f9c, 0 0 26px rgba(47,123,255,.35);
  --ghost-bg: rgba(255,255,255,.1); --ghost-fg: #fff; --ghost-border: 2px solid rgba(255,255,255,.3);
  --ok: #1fcf6b; --ok-2: #3cf08f; --bad: #ff3b5c; --bad-2: #ff8ea2; --warn: #ffc21a;
  --card-bg: #fff; --card-fg: #1a0d4d; --card-sh: 0 6px 0 #c9bdf5, 0 14px 30px rgba(0,0,0,.35); --card-em: #e8203f;
  --r-sm: 12px; --r: 18px; --r-lg: 22px; --r-btn: 20px;
  --w-strong: 900; --w-bold: 800; --w-med: 700;
  --ls-title: -.02em;
  --tile-a: linear-gradient(180deg, #ff5470, #e8203f); --tile-a-sh: #a3122a; --tile-a-fg: #fff; --tile-a-solid: #ff3b5c;
  --tile-b: linear-gradient(180deg, #4a8dff, #1f63e6); --tile-b-sh: #123f9c; --tile-b-fg: #fff; --tile-b-solid: #2f7bff;
  --tile-c: linear-gradient(180deg, #ffd03d, #f7b500); --tile-c-sh: #a87400; --tile-c-fg: #2a1a00; --tile-c-solid: #ffc21a;
  --tile-d: linear-gradient(180deg, #2fe07c, #14b55a); --tile-d-sh: #0b7a3b; --tile-d-fg: #fff; --tile-d-solid: #1fcf6b;
  --timer-track: rgba(255,255,255,.12); --timer-h: 16px;
  --timer-ok: linear-gradient(90deg, #1fcf6b, #8be04a); --timer-warn: linear-gradient(90deg, #1fcf6b, #ffc21a 70%, #ff8a1f); --timer-danger: linear-gradient(90deg, #ff8a1f, #ff3b5c);
  --timer-glow: 0 0 14px rgba(255,194,26,.7); --timer-label: #ffd34d;
  --wheel-1: #ffc21a; --wheel-1-fg: #2a1400; --wheel-2: #2f7bff; --wheel-2-fg: #fff;
  --wheel-3: #1fcf6b; --wheel-3-fg: #05341a; --wheel-4: #ff3b5c; --wheel-4-fg: #fff;
  --wheel-rim: #2a1670; --wheel-rim-stroke: #ffd34d; --wheel-stroke: #1a0d4d; --wheel-peg: #fff6c9; --wheel-peg-2: #ffb300;
  --wheel-hub: #ffd34d; --wheel-hub-fg: #3a1d00; --wheel-glow: 0 0 70px 10px rgba(255,79,184,.35), 0 0 120px 30px rgba(47,123,255,.25);
  --pointer: #ffd34d; --pointer-edge: #fff;
  --av-me-bg: linear-gradient(180deg, #ffd34d, #ffaa00); --av-me-fg: #3a1d00;
  --pod-1: linear-gradient(180deg, #ffd34d, #f2a900); --pod-1-fg: #5a3500;
  --pod-2: linear-gradient(180deg, #c9d3ff, #8c9ae6); --pod-2-fg: #26306e;
  --pod-3: linear-gradient(180deg, #ffb27a, #e07a3a); --pod-3-fg: #5a2400;
  --focus: 0 0 0 3px rgba(255,211,77,.8);
  color-scheme: dark;
}
[data-theme="klinik"] {
  --font-display: var(--font);
  --bg: radial-gradient(900px 500px at 85% 0%, #EEF3FA 0%, transparent 60%), #F5F7FA;
  --bg-solid: #F5F7FA;
  --text: #16233A; --text-2: #4A5872; --text-3: #8592A8;
  --surface: #ffffff; --surface-2: #EEF4FB; --line: #E3E8EF; --line-2: #DCE8F6;
  --accent: #1F5FAF; --accent-2: #4C86CF; --accent-fg: #fff;
  --primary-bg: #1F5FAF; --primary-fg: #fff; --primary-sh: 0 8px 18px -8px rgba(31,95,175,.6);
  --secondary-bg: #fff; --secondary-fg: #1F5FAF; --secondary-sh: none;
  --ghost-bg: #fff; --ghost-fg: #1F5FAF; --ghost-border: 1px solid #DCE8F6;
  --ok: #2E8B57; --ok-2: #2E8B57; --bad: #C8463D; --bad-2: #C8463D; --warn: #C2843B;
  --card-bg: transparent; --card-fg: #16233A; --card-sh: none; --card-em: #1F5FAF;
  --r-sm: 10px; --r: 14px; --r-lg: 16px; --r-btn: 14px;
  --w-strong: 700; --w-bold: 700; --w-med: 600;
  --ls-title: -.02em;
  --tile-a: #2F6DB5; --tile-a-sh: transparent; --tile-a-fg: #fff; --tile-a-solid: #2F6DB5;
  --tile-b: #2E8C83; --tile-b-sh: transparent; --tile-b-fg: #fff; --tile-b-solid: #2E8C83;
  --tile-c: #C2843B; --tile-c-sh: transparent; --tile-c-fg: #fff; --tile-c-solid: #C2843B;
  --tile-d: #7A64B0; --tile-d-sh: transparent; --tile-d-fg: #fff; --tile-d-solid: #7A64B0;
  --timer-track: #E2E8F0; --timer-h: 8px;
  --timer-ok: linear-gradient(90deg, #1F5FAF, #4C86CF); --timer-warn: linear-gradient(90deg, #C2843B, #D9A05B); --timer-danger: linear-gradient(90deg, #C8463D, #DE6B62);
  --timer-glow: none; --timer-label: #16233A;
  --wheel-1: #C8875A; --wheel-1-fg: #fff; --wheel-2: #3E6FB0; --wheel-2-fg: #fff;
  --wheel-3: #4F9A94; --wheel-3-fg: #fff; --wheel-4: #B5677A; --wheel-4-fg: #fff;
  --wheel-rim: #ffffff; --wheel-rim-stroke: #E3E8EF; --wheel-stroke: #ffffff; --wheel-peg: #C9D3E0; --wheel-peg-2: #C9D3E0;
  --wheel-hub: #ffffff; --wheel-hub-fg: #1F5FAF; --wheel-glow: 0 20px 40px -14px rgba(22,35,58,.35);
  --pointer: #16233A; --pointer-edge: #16233A;
  --av-me-bg: #1F5FAF; --av-me-fg: #fff;
  --pod-1: #1F5FAF; --pod-1-fg: #fff;
  --pod-2: #DCE8F6; --pod-2-fg: #174A8A;
  --pod-3: #EEF4FB; --pod-3-fg: #174A8A;
  --focus: 0 0 0 3px rgba(31,95,175,.35);
  color-scheme: light;
}
[data-theme="modern"] {
  --font-display: "Inter Display", var(--font);
  --bg: radial-gradient(420px 300px at 50% -60px, rgba(46,230,214,.16), transparent 70%), radial-gradient(900px 600px at 100% 110%, #15201F 0%, transparent 60%), #0E0F12;
  --bg-solid: #0E0F12;
  --text: #F4F6F8; --text-2: #8D939E; --text-3: #5C626C;
  --surface: rgba(255,255,255,.055); --surface-2: rgba(255,255,255,.085); --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --accent: #2EE6D6; --accent-2: #8B7CFF; --accent-fg: #04211F;
  --primary-bg: linear-gradient(180deg, #46F0E1, #1FD3C3); --primary-fg: #04211F; --primary-sh: 0 10px 30px -8px rgba(46,230,214,.6), inset 0 1px 0 rgba(255,255,255,.5);
  --secondary-bg: rgba(255,255,255,.08); --secondary-fg: #F4F6F8; --secondary-sh: inset 0 0 0 1px rgba(255,255,255,.14);
  --ghost-bg: rgba(255,255,255,.04); --ghost-fg: #F4F6F8; --ghost-border: 1px solid rgba(255,255,255,.14);
  --ok: #32D74B; --ok-2: #32D74B; --bad: #FF453A; --bad-2: #FF6B61; --warn: #F5C84B;
  --card-bg: transparent; --card-fg: #F4F6F8; --card-sh: none; --card-em: #2EE6D6;
  --r-sm: 12px; --r: 18px; --r-lg: 22px; --r-btn: 18px;
  --w-strong: 600; --w-bold: 600; --w-med: 500;
  --ls-title: -.03em;
  --tile-a: #4EA8FF; --tile-a-sh: transparent; --tile-a-fg: #0B0C0F; --tile-a-solid: #4EA8FF;
  --tile-b: #FF8A5B; --tile-b-sh: transparent; --tile-b-fg: #0B0C0F; --tile-b-solid: #FF8A5B;
  --tile-c: #8B7CFF; --tile-c-sh: transparent; --tile-c-fg: #0B0C0F; --tile-c-solid: #8B7CFF;
  --tile-d: #7BD88F; --tile-d-sh: transparent; --tile-d-fg: #0B0C0F; --tile-d-solid: #7BD88F;
  --timer-track: rgba(255,255,255,.08); --timer-h: 6px;
  --timer-ok: linear-gradient(90deg, #16C2B3, #2EE6D6); --timer-warn: linear-gradient(90deg, #C9A227, #F5C84B); --timer-danger: linear-gradient(90deg, #E0322A, #FF453A);
  --timer-glow: 0 0 14px rgba(46,230,214,.55); --timer-label: #F4F6F8;
  --wheel-1: #F5C84B; --wheel-1-fg: #1a1505; --wheel-2: #2EE6D6; --wheel-2-fg: #04211F;
  --wheel-3: #8B7CFF; --wheel-3-fg: #0B0C0F; --wheel-4: #FF5C8A; --wheel-4-fg: #0B0C0F;
  --wheel-rim: #16181D; --wheel-rim-stroke: rgba(255,255,255,.14); --wheel-stroke: #0E0F12; --wheel-peg: rgba(255,255,255,.55); --wheel-peg-2: rgba(255,255,255,.3);
  --wheel-hub: #0E0F12; --wheel-hub-fg: #F4F6F8; --wheel-glow: 0 0 60px -6px rgba(46,230,214,.35);
  --pointer: #2EE6D6; --pointer-edge: #F4F6F8;
  --av-me-bg: rgba(46,230,214,.14); --av-me-fg: #2EE6D6;
  --pod-1: linear-gradient(180deg, rgba(46,230,214,.24), rgba(255,255,255,.02)); --pod-1-fg: #2EE6D6;
  --pod-2: linear-gradient(180deg, rgba(201,209,219,.2), rgba(255,255,255,.02)); --pod-2-fg: #C9D1DB;
  --pod-3: linear-gradient(180deg, rgba(245,200,75,.2), rgba(255,255,255,.02)); --pod-3-fg: #F5C84B;
  --focus: 0 0 0 3px rgba(46,230,214,.55);
  color-scheme: dark;
}

/* ============================================================ base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  min-height: 100%; font-family: var(--font); color: var(--text); background: var(--bg-solid);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--bg); pointer-events: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; touch-action: manipulation; }
button:disabled { cursor: default; }
input, select, textarea { font-size: 16px; } /* no zoom on iOS focus */
:focus-visible { outline: none; box-shadow: var(--focus); }
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; flex: none; }
.mode-ico { --wheel-icon-bg: var(--bg-solid); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
a { color: var(--accent); }

#app { min-height: 100vh; min-height: 100dvh; }

/* ============================================================ phone screen layout */
.screen {
  position: relative; width: 100%; max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) calc(env(safe-area-inset-right, 0px) + 18px) calc(env(safe-area-inset-bottom, 0px) + 18px) calc(env(safe-area-inset-left, 0px) + 18px);
  display: flex; flex-direction: column;
}
.screen.center { justify-content: center; }
.grow { flex: 1 1 auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.mt-s { margin-top: 8px; } .mt { margin-top: 16px; } .mt-l { margin-top: 24px; }
.center-text { text-align: center; }
.muted { color: var(--text-2); }
.fine { font-size: 12.5px; color: var(--text-3); font-weight: var(--w-med); text-align: center; line-height: 1.4; }

/* topline (phone header) */
.topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; margin-bottom: 10px; }
.topline .mid { flex: 1; display: flex; justify-content: center; min-width: 0; }
.iconbtn {
  width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none;
  background: var(--surface); color: var(--text-2); font-size: 20px; border: 1px solid var(--line);
}
.iconbtn:active { transform: scale(.94); }
.iconbtn.on { color: var(--accent); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-weight: var(--w-strong); font-size: 15px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.miniscore { font-weight: var(--w-strong); font-size: 15px; padding: 7px 11px; border-radius: 12px; background: var(--surface); color: var(--accent); white-space: nowrap; }

/* titles */
.h1 { font-family: var(--font-display); font-size: 28px; font-weight: var(--w-strong); letter-spacing: var(--ls-title); line-height: 1.12; }
.h2 { font-family: var(--font-display); font-size: 21px; font-weight: var(--w-strong); letter-spacing: var(--ls-title); line-height: 1.2; }
.h3 { font-size: 13px; font-weight: var(--w-bold); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.sub { font-size: 15px; color: var(--text-2); font-weight: 500; line-height: 1.4; margin-top: 6px; }
.eyebrow { font-size: 12px; font-weight: var(--w-bold); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }

/* ============================================================ buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 12px 18px;
  border-radius: var(--r-btn); font-size: 18px; font-weight: var(--w-strong); letter-spacing: .01em; line-height: 1.15; text-align: center;
  background: var(--secondary-bg); color: var(--secondary-fg); box-shadow: var(--secondary-sh);
  transition: transform .08s ease, box-shadow .08s ease, opacity .2s;
}
.btn .ico { font-size: 1.15em; }
.btn:active:not(:disabled) { transform: translateY(3px); }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--primary-bg); color: var(--primary-fg); box-shadow: var(--primary-sh); }
.btn-ghost { background: var(--ghost-bg); color: var(--ghost-fg); border: var(--ghost-border); box-shadow: none; }
.btn-lg { min-height: 64px; font-size: 22px; }
.btn-sm { min-height: 44px; font-size: 15px; padding: 8px 14px; width: auto; }
.btn-danger { background: transparent; color: var(--bad); border: 1px solid currentColor; box-shadow: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
[data-theme="klinik"] .btn { font-weight: 600; }
[data-theme="klinik"] .btn:not(.btn-primary):not(.btn-danger) { border: 1px solid var(--line-2); }
[data-theme="modern"] .btn { font-weight: 600; letter-spacing: -.01em; }
[data-theme="gameshow"] .btn:active:not(:disabled) { box-shadow: 0 2px 0 rgba(0,0,0,.4); }

/* ============================================================ cards / chips */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
[data-theme="klinik"] .card { box-shadow: 0 1px 2px rgba(22,35,58,.05), 0 4px 14px -6px rgba(22,35,58,.10); border-color: #EDF0F4; }
[data-theme="modern"] .card { backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
[data-theme="gameshow"] .card { border-width: 1.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: var(--w-bold); padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.chip.cat { --c: var(--accent); }
[data-theme="gameshow"] .chip.cat { background: color-mix(in srgb, var(--c) 20%, transparent); color: #fff; border: 2px solid var(--c); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 40%, transparent); font-weight: 900; }
[data-theme="klinik"] .chip.cat { background: #EEF4FB; color: #174A8A; border: none; font-weight: 600; }
[data-theme="modern"] .chip.cat { font-weight: 500; }

/* ============================================================ avatars */
.av {
  --av: #8b5cff;
  width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: var(--w-strong); font-size: 15px;
  position: relative; flex: none; background: var(--av); color: #fff; letter-spacing: .02em;
}
.av.sm { width: 30px; height: 30px; font-size: 11px; }
.av.lg { width: 64px; height: 64px; font-size: 21px; }
.av.xl { width: 92px; height: 92px; font-size: 30px; }
.av-me { background: var(--av-me-bg); color: var(--av-me-fg); }
.av-ghost, .av-bot { border: 2px dashed rgba(255,255,255,.65); }
.av-badge { position: absolute; right: -7px; bottom: -6px; width: 20px; height: 20px; font-size: 20px; line-height: 0; }
.av.sm .av-badge { width: 15px; height: 15px; font-size: 15px; right: -5px; bottom: -4px; }
[data-theme="gameshow"] .av-me { box-shadow: 0 0 0 3px rgba(255,211,77,.35); }
[data-theme="gameshow"] .av-other { background: linear-gradient(180deg, color-mix(in srgb, var(--av) 75%, #fff), var(--av)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--av) 35%, transparent); }
[data-theme="klinik"] .av-other { background: color-mix(in srgb, var(--av) 70%, #5a6a80); }
[data-theme="klinik"] .av-ghost, [data-theme="klinik"] .av-bot { background: #E8ECF2; color: #4A5872; border: 1.5px dashed #9AA6B8; }
[data-theme="modern"] .av { font-weight: 600; }
[data-theme="modern"] .av-me { box-shadow: inset 0 0 0 1.5px #2EE6D6; }
[data-theme="modern"] .av-other { background: color-mix(in srgb, var(--av) 16%, transparent); color: color-mix(in srgb, var(--av) 70%, #fff); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--av) 70%, transparent); }
[data-theme="modern"] .av-ghost, [data-theme="modern"] .av-bot { border: 1.5px dashed rgba(185,178,255,.6); background: rgba(139,124,255,.14); color: #B9B2FF; box-shadow: none; }

/* ============================================================ scorebar (duel) */
.scorebar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
[data-theme="klinik"] .scorebar { box-shadow: 0 1px 2px rgba(22,35,58,.05), 0 4px 14px -6px rgba(22,35,58,.10); }
.scorebar .pl { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.scorebar .pl.opp { flex-direction: row-reverse; text-align: right; }
.scorebar .pl > div { min-width: 0; }
.scorebar .pn { font-size: 12.5px; font-weight: var(--w-med); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scorebar .ps-line { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.scorebar .ps-line .kind-tag { margin: 0; }
.scorebar .ps { font-size: 22px; font-weight: var(--w-strong); line-height: 1.1; font-variant-numeric: tabular-nums; }
.scorebar .me .ps { color: var(--accent); }
[data-theme="klinik"] .scorebar .ps { font-size: 20px; }
[data-theme="modern"] .scorebar .ps { font-size: 23px; letter-spacing: -.5px; color: var(--text); }
.scorebar .pl.done .av::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); }
.vs { flex: none; font-weight: 900; font-size: 13px; color: #fff; background: #ff3b5c; border-radius: 10px; padding: 5px 7px; box-shadow: 0 3px 0 #a3122a; transform: rotate(-6deg); }
[data-theme="klinik"] .vs { background: var(--bg-solid); color: var(--text-3); box-shadow: none; transform: none; font-weight: 700; font-size: 12px; }
[data-theme="modern"] .vs { background: none; box-shadow: none; transform: none; color: var(--text-3); letter-spacing: 2px; font-weight: 600; font-size: 11px; }
.kind-tag { display: inline-block; white-space: nowrap; vertical-align: 2px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: #B9B2FF; background: rgba(139,124,255,.16); padding: 1px 6px; border-radius: 6px; margin-left: 4px; }
[data-theme="klinik"] .kind-tag { color: #4A5872; background: #EEF1F5; }

/* duel layout spacing */
.duel-score { margin-bottom: 12px; }
.timer-slot { margin-top: 2px; }

/* ============================================================ timer bar */
.timer { display: flex; align-items: center; gap: 10px; }
.timer-track { flex: 1; height: var(--timer-h); border-radius: 999px; background: var(--timer-track); overflow: hidden; position: relative; }
[data-theme="gameshow"] .timer-track { box-shadow: inset 0 2px 4px rgba(0,0,0,.35); }
.timer-fill { height: 100%; width: 100%; border-radius: 999px; background: var(--timer-ok); box-shadow: var(--timer-glow); will-change: width; }
.timer[data-level="warn"] .timer-fill { background: var(--timer-warn); }
.timer[data-level="danger"] .timer-fill { background: var(--timer-danger); box-shadow: 0 0 14px color-mix(in srgb, var(--bad) 70%, transparent); }
.timer-label { font-weight: var(--w-strong); font-size: 17px; color: var(--timer-label); min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timer[data-level="danger"] .timer-label { color: var(--bad); }
.timer.pulse .timer-track { animation: tpulse 1s ease-in-out infinite; }
.timer.pulse .timer-label { animation: tlabel 1s ease-in-out infinite; }
@keyframes tpulse { 0%,100% { transform: scaleY(1); } 15% { transform: scaleY(1.45); } }
@keyframes tlabel { 0%,100% { transform: scale(1); } 15% { transform: scale(1.22); } }
[data-theme="modern"] .timer-track { overflow: visible; }
[data-theme="modern"] .timer-fill { position: relative; }
[data-theme="modern"] .timer-fill::after { content: ""; position: absolute; right: -1px; top: -3px; width: 2px; height: calc(var(--timer-h) + 6px); border-radius: 2px; background: #fff; box-shadow: 0 0 8px #fff; }
[data-theme="klinik"] .timer-label { font-size: 14px; font-weight: 700; }
.timer.stopped .timer-fill { transition: width .3s; }

/* ============================================================ question (phone) */
.qcard {
  background: var(--card-bg); color: var(--card-fg); border-radius: var(--r-lg); padding: 18px 18px; font-size: 20px; font-weight: var(--w-bold);
  line-height: 1.3; box-shadow: var(--card-sh); overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto;
}
[data-theme="klinik"] .qcard { padding: 4px 2px; font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
[data-theme="modern"] .qcard { padding: 4px 0; font-family: var(--font-display); font-size: 23px; font-weight: 600; letter-spacing: -.5px; line-height: 1.22; }
.qmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 10px; }

.answers { display: flex; flex-direction: column; gap: 11px; margin-top: 14px; }
.ans {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 66px; width: 100%; text-align: left;
  border-radius: var(--r); padding: 10px 44px 10px 12px; font-size: 16px; font-weight: var(--w-bold); line-height: 1.22;
  overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; transition: transform .1s, filter .25s, opacity .25s, box-shadow .2s, background .2s;
}
.ans .badge { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 19px; font-weight: 900; }
.ans .badge .ico { font-size: 20px; }
.ans .badge .letter { display: none; }
.ans .txt { flex: 1; min-width: 0; }
.ans .txt small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; opacity: .95; }
.ans .end { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 900; font-size: 18px; opacity: .55; }
.ans:active:not(:disabled) { transform: translateY(3px); }
.ans:disabled { cursor: default; }
.ans .end .ico { font-size: 22px; }

/* gameshow tiles: coloured, shapes, 3D edge */
[data-theme="gameshow"] .ans { color: var(--fg); background: var(--bgc); box-shadow: 0 5px 0 var(--sh); }
[data-theme="gameshow"] .ans .badge { background: rgba(0,0,0,.18); }
[data-theme="gameshow"] .ans.sel { box-shadow: 0 5px 0 var(--sh), 0 0 0 3px #fff, 0 0 24px rgba(255,255,255,.4); }
[data-theme="gameshow"] .answers.locked .ans:not(.sel) { filter: saturate(.35) brightness(.55); }
[data-theme="gameshow"] .ans.dim { filter: saturate(.35) brightness(.55); box-shadow: 0 5px 0 rgba(0,0,0,.4); }
[data-theme="gameshow"] .ans.correct { background: linear-gradient(180deg, #36e886, #14b55a); color: #fff; filter: none; box-shadow: 0 5px 0 #0b7a3b, 0 0 0 3px #b9ffd6, 0 0 28px rgba(31,207,107,.8); }
[data-theme="gameshow"] .ans.correct .badge { background: rgba(255,255,255,.25); }
[data-theme="gameshow"] .ans.wrongsel { background: linear-gradient(180deg, #ff5470, #d81838); color: #fff; filter: none; box-shadow: 0 5px 0 #8a0c22, 0 0 0 3px #ffc2cc; }
[data-theme="gameshow"] .ans.correct .end, [data-theme="gameshow"] .ans.wrongsel .end { opacity: 1; }
.ans.a0 { --bgc: var(--tile-a); --sh: var(--tile-a-sh); --fg: var(--tile-a-fg); --solid: var(--tile-a-solid); }
.ans.a1 { --bgc: var(--tile-b); --sh: var(--tile-b-sh); --fg: var(--tile-b-fg); --solid: var(--tile-b-solid); }
.ans.a2 { --bgc: var(--tile-c); --sh: var(--tile-c-sh); --fg: var(--tile-c-fg); --solid: var(--tile-c-solid); }
.ans.a3 { --bgc: var(--tile-d); --sh: var(--tile-d-sh); --fg: var(--tile-d-fg); --solid: var(--tile-d-solid); }

/* klinik tiles: white cards with letter badge */
[data-theme="klinik"] .ans { background: #fff; color: var(--text); font-weight: 500; font-size: 15.5px; border: 1px solid #EDF0F4; box-shadow: 0 1px 2px rgba(22,35,58,.05), 0 4px 14px -6px rgba(22,35,58,.10); padding-right: 40px; min-height: 60px; }
[data-theme="klinik"] .ans .badge { width: 32px; height: 32px; border-radius: 10px; background: #EEF4FB; color: #1F5FAF; font-size: 15px; font-weight: 700; }
[data-theme="klinik"] .ans .badge .ico { display: none; }
[data-theme="klinik"] .ans .badge .letter { display: inline; }
[data-theme="klinik"] .ans .end { display: none; }
[data-theme="klinik"] .ans.sel { border: 1.5px solid #1F5FAF; box-shadow: 0 0 0 4px rgba(31,95,175,.10); }
[data-theme="klinik"] .ans.sel .badge { background: #1F5FAF; color: #fff; }
[data-theme="klinik"] .answers.locked .ans:not(.sel), [data-theme="klinik"] .ans.dim { opacity: .55; }
[data-theme="klinik"] .ans.correct { background: #E9F6EF; border: 1.5px solid #2E8B57; opacity: 1; }
[data-theme="klinik"] .ans.correct .badge { background: #2E8B57; color: #fff; }
[data-theme="klinik"] .ans.wrongsel { background: #FCEDEC; border: 1.5px solid #C8463D; opacity: 1; }
[data-theme="klinik"] .ans.wrongsel .badge { background: #C8463D; color: #fff; }
[data-theme="klinik"] .ans.correct .end, [data-theme="klinik"] .ans.wrongsel .end { display: block; opacity: 1; color: inherit; }
[data-theme="klinik"] .ans.correct .end { color: #2E8B57; } [data-theme="klinik"] .ans.wrongsel .end { color: #C8463D; }
[data-theme="klinik"] .ans .txt small { color: var(--text-2); letter-spacing: .04em; }

/* modern tiles: glass with outlined letter */
[data-theme="modern"] .ans { background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); color: var(--text); font-weight: 500; font-size: 15.5px; padding-right: 40px; }
[data-theme="modern"] .ans .badge { width: 32px; height: 32px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); color: var(--text-2); font-size: 14px; font-weight: 600; }
[data-theme="modern"] .ans .badge .ico { display: none; }
[data-theme="modern"] .ans .badge .letter { display: inline; }
[data-theme="modern"] .ans .end { display: none; }
[data-theme="modern"] .ans.sel { border-color: rgba(46,230,214,.6); background: rgba(46,230,214,.08); }
[data-theme="modern"] .ans.sel .badge { background: #2EE6D6; color: #04211F; border-color: #2EE6D6; }
[data-theme="modern"] .answers.locked .ans:not(.sel), [data-theme="modern"] .ans.dim { opacity: .5; }
[data-theme="modern"] .ans.correct { background: rgba(50,215,75,.12); border-color: rgba(50,215,75,.6); opacity: 1; }
[data-theme="modern"] .ans.correct .badge { background: #32D74B; color: #04210a; border-color: #32D74B; }
[data-theme="modern"] .ans.wrongsel { background: rgba(255,69,58,.12); border-color: rgba(255,69,58,.6); opacity: 1; }
[data-theme="modern"] .ans.wrongsel .badge { background: #FF453A; color: #fff; border-color: #FF453A; }
[data-theme="modern"] .ans.correct .end, [data-theme="modern"] .ans.wrongsel .end { display: block; opacity: 1; }
[data-theme="modern"] .ans.correct .end { color: #32D74B; } [data-theme="modern"] .ans.wrongsel .end { color: #FF453A; }
[data-theme="modern"] .ans .txt small { color: var(--text-2); }

/* opponent indicator chip */
.opp-ind {
  display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 14px; font-weight: var(--w-med); color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line); padding: 6px 12px 6px 6px; border-radius: 999px; min-height: 42px;
  transition: background .3s, border-color .3s;
}
.opp-ind .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-ind b { color: var(--text); font-weight: var(--w-bold); }
.opp-ind .ok { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; flex: none; background: var(--ok); color: #05341a; transform: scale(0); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.opp-ind.done { background: color-mix(in srgb, var(--ok) 13%, transparent); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.opp-ind.done .ok { transform: scale(1); }
.opp-ind.pop { animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
.opp-ind .thinking { display: inline-flex; gap: 3px; margin-left: 2px; }
.opp-ind .thinking i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .4; animation: dots 1.2s infinite; }
.opp-ind .thinking i:nth-child(2) { animation-delay: .2s; } .opp-ind .thinking i:nth-child(3) { animation-delay: .4s; }
.opp-ind.out { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
[data-theme="klinik"] .opp-ind { background: #fff; border-radius: 14px; }
[data-theme="klinik"] .opp-ind.done .ok { background: #E9F6EF; color: #2E8B57; }
@keyframes dots { 0%,100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ============================================================ reveal (phone) */
.verdict { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; font-size: 26px; font-weight: var(--w-strong); padding: 12px; border-radius: var(--r); margin-bottom: 14px; animation: verdictIn .45s cubic-bezier(.3,1.5,.5,1); }
.verdict .vx { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; color: #fff; flex: none; }
.verdict.ok { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--text); border: 2px solid color-mix(in srgb, var(--ok) 65%, transparent); }
.verdict.ok .vx { background: var(--ok); }
.verdict.bad { background: color-mix(in srgb, var(--bad) 20%, transparent); color: var(--text); border: 2px solid color-mix(in srgb, var(--bad) 60%, transparent); }
.verdict.bad .vx { background: var(--bad); }
[data-theme="gameshow"] .verdict.bad { color: #ffd0d8; } [data-theme="gameshow"] .verdict.ok { color: #d6ffe6; }
[data-theme="klinik"] .verdict { font-size: 20px; border-width: 1.5px; }
[data-theme="klinik"] .verdict.ok { background: #E9F6EF; color: #2E8B57; } [data-theme="klinik"] .verdict.bad { background: #FCEDEC; color: #C8463D; }
[data-theme="modern"] .verdict { font-size: 20px; border-width: 1px; }
@keyframes verdictIn { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.explain { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 14px; line-height: 1.45; font-weight: 500; color: var(--text); overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.explain .ex-h { display: flex; align-items: center; gap: 6px; font-weight: var(--w-strong); font-size: 13.5px; color: var(--accent); margin-bottom: 4px; }
[data-theme="gameshow"] .explain { color: #e6e0ff; border-width: 1.5px; }
[data-theme="klinik"] .explain { background: #F0F4FA; border-color: #E3EAF4; color: var(--text-2); }
[data-theme="klinik"] .explain .ex-h { color: #1F5FAF; font-weight: 600; }
[data-theme="modern"] .explain .ex-h { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 600; }

.pts { display: flex; gap: 10px; margin-top: 14px; }
.pt { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px; min-width: 0; }
.pt.opp { flex-direction: row-reverse; text-align: right; }
.pt .pn { font-size: 12px; font-weight: var(--w-med); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt > div { min-width: 0; }
.pv { font-size: 24px; font-weight: var(--w-strong); line-height: 1; font-variant-numeric: tabular-nums; color: var(--text-3); }
.pv.plus { color: var(--ok-2); }
[data-theme="gameshow"] .pv.plus { text-shadow: 0 0 14px rgba(31,207,107,.7); }

.fly { position: fixed; z-index: 50; pointer-events: none; font-weight: 900; font-size: 34px; color: var(--ok-2); text-shadow: 0 2px 0 rgba(0,0,0,.25), 0 0 18px color-mix(in srgb, var(--ok) 70%, transparent); white-space: nowrap; }
.fly.jackpot { color: var(--accent); font-size: 44px; text-shadow: 0 3px 0 rgba(0,0,0,.3), 0 0 26px color-mix(in srgb, var(--accent) 80%, transparent); }

/* ============================================================ wheel */
.wheel-head { text-align: center; margin-top: 14px; }
.wheel-title { font-family: var(--font-display); font-size: 30px; font-weight: 900; letter-spacing: .06em; color: var(--accent); }
[data-theme="gameshow"] .wheel-title { text-shadow: 0 3px 0 #a86a00, 0 0 24px rgba(255,211,77,.6); }
[data-theme="klinik"] .wheel-title { font-size: 20px; letter-spacing: 0; color: var(--text); font-weight: 700; }
[data-theme="modern"] .wheel-title { font-size: 12px; letter-spacing: .16em; color: var(--accent); font-weight: 600; }
.wheel-sub { font-size: 14px; font-weight: 600; color: var(--text-2); margin-top: 3px; }
[data-theme="modern"] .wheel-sub { font-size: 22px; color: var(--text); letter-spacing: -.4px; margin-top: 6px; }
.wheel-wrap { position: relative; width: min(86vw, 340px); aspect-ratio: 1; margin: 22px auto 0; }
.wheel-wrap .glow { position: absolute; inset: 3%; border-radius: 50%; box-shadow: var(--wheel-glow); }
.wheel-wrap svg.wheel { position: relative; width: 100%; height: 100%; display: block; overflow: visible; }
.wheel .seg-label { font-family: var(--font); font-weight: 900; }
[data-theme="modern"] .wheel .seg-label, [data-theme="klinik"] .wheel .seg-label { font-weight: 700; }
.wheel-pointer { position: absolute; left: 50%; top: -4%; width: 13%; aspect-ratio: 44/46; transform-origin: 50% 25%; transform: translateX(-50%); z-index: 3; }
.wheel-pointer svg { width: 100%; height: 100%; display: block; overflow: visible; }
[data-theme="gameshow"] .wheel-pointer svg { filter: drop-shadow(0 4px 0 #a86a00) drop-shadow(0 0 10px rgba(255,211,77,.9)); }
[data-theme="klinik"] .wheel-pointer { width: 8%; top: -3%; }
[data-theme="modern"] .wheel-pointer { width: 8%; top: -3%; }
[data-theme="modern"] .wheel-pointer svg { filter: drop-shadow(0 0 8px rgba(46,230,214,.9)); }
.wheel-hint { text-align: center; font-size: 14px; font-weight: 700; color: var(--text); margin-top: 18px; opacity: .85; display: flex; align-items: center; justify-content: center; gap: 8px; }
.wheel-hint .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: dots 1s infinite; }
.mode-banner { text-align: center; margin-top: 16px; animation: verdictIn .5s cubic-bezier(.3,1.5,.5,1); }
.mode-banner .mb-name { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 34px; font-weight: 900; letter-spacing: var(--ls-title); color: var(--accent); }
.mode-banner .mb-name .ico { font-size: .9em; }
.mode-banner .mb-sub { font-size: 14px; color: var(--text-2); font-weight: 600; margin-top: 4px; }
[data-theme="gameshow"] .mode-banner .mb-name { text-shadow: 0 3px 0 #a86a00, 0 0 24px rgba(255,211,77,.6); }
[data-theme="klinik"] .mode-banner .mb-name, [data-theme="modern"] .mode-banner .mb-name { font-weight: 700; color: var(--text); }
.count321 { font-size: 64px; font-weight: 900; color: var(--accent); text-align: center; animation: verdictIn .4s; }

.rounds-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.rounds-dots i { width: 26px; height: 6px; border-radius: 3px; background: var(--surface-2); }
.rounds-dots i.done { background: var(--ok); } .rounds-dots i.cur { background: var(--accent); }

/* mode flash over the first question */
.phase, .stage .phase { position: relative; }
.ctrl-phase { position: relative; }
/* intro: mode reveal + 3-2-1 between wheel stop and question 0 (overlays the wheel) */
.intro { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 16px;
  background: color-mix(in srgb, var(--bg-solid) 80%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: var(--r); animation: introFade .3s ease-out both; }
.intro-card { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: verdictIn .55s cubic-bezier(.3,1.5,.5,1) both; transition: transform .35s ease, opacity .35s ease; }
.intro-ico { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 54px; background: var(--mc); color: var(--mc-fg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mc) 35%, transparent), 0 10px 30px -8px var(--mc); margin-bottom: 8px; }
.intro-name { font-family: var(--font-display); font-size: 44px; line-height: 1.05; font-weight: var(--w-strong); letter-spacing: var(--ls-title); color: var(--text); overflow-wrap: anywhere; }
.intro-count { font-size: 20px; font-weight: var(--w-bold); color: var(--accent); }
.intro-rule { font-size: 16px; font-weight: 600; color: var(--text-2); max-width: 300px; line-height: 1.35; }
.intro-cd { min-height: 96px; display: grid; place-items: center; }
.intro-cd .n { font-size: 96px; line-height: 1; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; animation: cdPop .7s cubic-bezier(.2,1.4,.4,1) both; }
.intro-cd .n.go { font-size: 72px; font-family: var(--font-display); letter-spacing: var(--ls-title); color: var(--ok-2); }
.intro.counting .intro-card { transform: scale(.86); }
[data-theme="gameshow"] .intro-name { text-shadow: 0 3px 0 #a86a00, 0 0 24px rgba(255,211,77,.5); color: var(--accent); }
[data-theme="gameshow"] .intro-cd .n { text-shadow: 0 4px 0 #a86a00, 0 0 30px rgba(255,211,77,.6); }
.stage .intro { gap: 1.6em; border-radius: 1em; }
.stage .intro-ico { font-size: 4em; width: 1.75em; height: 1.75em; margin-bottom: .15em; }
.stage .intro-name { font-size: 5.2em; } .stage .intro-count { font-size: 2em; } .stage .intro-rule { font-size: 1.6em; max-width: 30em; }
.stage .intro-cd { min-height: 9em; } .stage .intro-cd .n { font-size: 9em; } .stage .intro-cd .n.go { font-size: 7em; }
@keyframes introFade { from { opacity: 0; } }
@keyframes cdPop { 0% { transform: scale(2.2); opacity: 0; } 35% { transform: scale(.92); opacity: 1; } 60% { transform: scale(1.04); } 100% { transform: scale(1); opacity: 1; } }

/* ============================================================ duel: searching / invite / ready / final */
.radar { position: relative; width: 210px; height: 210px; margin: 26px auto 10px; display: grid; place-items: center; }
.radar::before, .radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: radar 2.4s ease-out infinite; }
.radar::after { animation-delay: 1.2s; }
@keyframes radar { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.radar .av { width: 86px; height: 86px; font-size: 28px; }
.countdown-big { font-size: 15px; font-weight: 700; color: var(--text-2); text-align: center; margin-top: 8px; font-variant-numeric: tabular-nums; }
.countdown-big b { color: var(--accent); font-size: 20px; }
.code-box { text-align: center; padding: 18px; }
.code-box .code { font-size: 38px; font-weight: 900; letter-spacing: .18em; font-variant-numeric: tabular-nums; color: var(--accent); margin: 4px 0 2px; word-break: break-all; }
.code-box .url { font-size: 13px; color: var(--text-2); word-break: break-all; }
.qr-box { background: #fff; border-radius: 16px; padding: 10px; width: 190px; margin: 14px auto 0; }
.qr-box svg { width: 100%; height: auto; display: block; }

.vs-stage { display: flex; align-items: flex-start; justify-content: space-around; gap: 6px; margin: 30px 0 10px; }
.vs-stage .vs-big { margin-top: 26px; }
.vs-stage .side { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 42%; text-align: center; animation: slideL .55s cubic-bezier(.2,1.2,.4,1) both; }
.vs-stage .side.r { animation-name: slideR; }
.vs-stage .nm { font-weight: var(--w-strong); font-size: 18px; overflow-wrap: anywhere; line-height: 1.2; }
.vs-stage .st { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--surface); color: var(--text-2); }
.vs-stage .st.on { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok-2); }
.vs-big { font-size: 34px; padding: 8px 12px; border-radius: 14px; animation: vsPop .6s .3s cubic-bezier(.3,1.8,.5,1) both; }
@keyframes slideL { from { transform: translateX(-60px); opacity: 0; } }
@keyframes slideR { from { transform: translateX(60px); opacity: 0; } }
@keyframes vsPop { from { transform: scale(0) rotate(-30deg); } }

.final-hero { text-align: center; margin: 18px 0 8px; }
.final-hero .big { font-family: var(--font-display); font-size: 44px; font-weight: 900; letter-spacing: var(--ls-title); line-height: 1.05; animation: verdictIn .6s cubic-bezier(.3,1.5,.5,1); }
.final-hero.win .big { color: var(--accent); }
[data-theme="gameshow"] .final-hero.win .big { text-shadow: 0 4px 0 #a86a00, 0 0 30px rgba(255,211,77,.6); }
.final-hero.lose .big { color: var(--text-2); }
.final-hero.aborted .big { color: var(--text-2); font-size: 36px; }
.final-hero .crown { font-size: 54px; color: #ffd34d; display: block; margin: 0 auto 4px; width: 1em; height: 1em; }
[data-theme="klinik"] .final-hero .crown { color: #C2A24E; }
[data-theme="modern"] .final-hero .crown { color: #2EE6D6; }
.final-cards { display: flex; gap: 10px; margin-top: 18px; }
.final-card { flex: 1; text-align: center; padding: 16px 10px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.final-card.winner { border: 2px solid var(--accent); box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 30%, transparent); }
.final-card .nm { font-weight: var(--w-bold); font-size: 14px; margin-top: 8px; overflow-wrap: anywhere; }
.final-card .sc { font-size: 30px; font-weight: 900; margin-top: 4px; font-variant-numeric: tabular-nums; }
.final-card .meta { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.35; }

/* ============================================================ home */
.brand { display: flex; align-items: center; gap: 10px; }
.logo-badge { font-weight: 900; font-size: 15px; background: var(--primary-bg); color: var(--primary-fg); padding: 8px 10px; border-radius: 12px; letter-spacing: .02em; }
[data-theme="gameshow"] .logo-badge { box-shadow: 0 4px 0 #a86a00; }
[data-theme="modern"] .logo-badge { border-radius: 10px; font-weight: 700; box-shadow: none; }
.brand .bt { font-family: var(--font-display); font-weight: 900; font-size: 20px; letter-spacing: var(--ls-title); }
[data-theme="klinik"] .brand .bt, [data-theme="modern"] .brand .bt { font-weight: 700; }
.home-hero { margin: 18px 0 18px; }
.home-actions { display: flex; flex-direction: column; gap: 14px; }
.action { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; min-height: 76px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.action .ai { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; flex: none; background: var(--surface-2); color: var(--accent); }
.action .at { font-weight: var(--w-strong); font-size: 17px; line-height: 1.2; }
.action .as { font-size: 13px; color: var(--text-2); margin-top: 2px; font-weight: 500; }
.action > div { min-width: 0; flex: 1; }
.action:active { transform: translateY(2px); }
.action.primary { background: var(--primary-bg); color: var(--primary-fg); box-shadow: var(--primary-sh); border: none; min-height: 92px; }
.action.primary .ai { background: rgba(0,0,0,.12); color: inherit; }
.action.primary .as { color: inherit; opacity: .8; }
[data-theme="gameshow"] .action.secondary { background: var(--secondary-bg); color: #fff; box-shadow: var(--secondary-sh); border: none; }
[data-theme="gameshow"] .action.secondary .ai { background: rgba(0,0,0,.15); color: #fff; }
[data-theme="gameshow"] .action.secondary .as { color: #fff; opacity: .85; }
[data-theme="klinik"] .action { box-shadow: 0 1px 2px rgba(22,35,58,.05), 0 4px 14px -6px rgba(22,35,58,.10); border-color: #EDF0F4; }
[data-theme="klinik"] .action .ai { background: #EEF4FB; color: #1F5FAF; }
[data-theme="klinik"] .action.primary .ai { background: rgba(255,255,255,.18); color: #fff; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.home-grid .action { flex-direction: column; align-items: flex-start; min-height: 108px; gap: 10px; }
.home-grid .action .at { font-size: 15.5px; }
.home-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px; min-height: 80px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: var(--w-bold); text-align: center; line-height: 1.2; color: var(--text); }
.mini .ico { font-size: 24px; color: var(--accent); }
[data-theme="klinik"] .mini { background: #fff; border-color: #EDF0F4; }
.code-entry { display: flex; gap: 8px; }
.input {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1.5px solid var(--line-2); color: var(--text);
  font-size: 17px; font-weight: 600; outline: none;
}
.input::placeholder { color: var(--text-3); font-weight: 500; }
.input:focus { border-color: var(--accent); box-shadow: var(--focus); }
[data-theme="klinik"] .input { background: #fff; }
.code-entry .input { text-transform: uppercase; letter-spacing: .12em; }
.code-entry .input::placeholder { text-transform: none; letter-spacing: 0; }
.code-entry .btn { width: auto; min-width: 104px; }

/* language toggle */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); gap: 2px; }
.seg button { padding: 7px 12px; border-radius: 9px; font-size: 13.5px; font-weight: var(--w-bold); color: var(--text-2); min-height: 34px; }
.seg button.on { background: var(--surface-2); color: var(--text); }
[data-theme="gameshow"] .seg button.on { background: linear-gradient(180deg, #8b5cff, #6a3df0); color: #fff; box-shadow: 0 3px 0 #3f1fa8; }
[data-theme="klinik"] .seg button.on { background: #1F5FAF; color: #fff; }
[data-theme="modern"] .seg button.on { background: rgba(255,255,255,.12); }
.seg.wide { display: flex; width: 100%; } .seg.wide button { flex: 1; }

/* ============================================================ login */
.login-top { display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.login-hero { margin: 18px 0 18px; }
.field-label { display: block; font-size: 13px; font-weight: var(--w-bold); color: var(--text-2); margin: 0 0 7px 2px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 6px 0 12px; }
.pin-dots i { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-2); transition: background .15s, transform .15s, border-color .15s; }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key { min-height: 58px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: 25px; font-weight: var(--w-bold); color: var(--text); display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.key:active { transform: scale(.95); background: var(--surface-2); }
.key.fn { font-size: 15px; color: var(--text-2); background: transparent; border-color: transparent; }
.key.fn .ico { font-size: 26px; }
[data-theme="gameshow"] .key { box-shadow: 0 4px 0 rgba(0,0,0,.35); border-width: 1.5px; }
[data-theme="gameshow"] .key.fn { box-shadow: none; }
[data-theme="klinik"] .key { background: #fff; border-color: #EDF0F4; box-shadow: 0 1px 2px rgba(22,35,58,.06); }
[data-theme="klinik"] .key.fn { background: transparent; box-shadow: none; }
.pin-explain { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--text-2); margin-top: 14px; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.pin-explain .ico { font-size: 18px; color: var(--accent); margin-top: 1px; }
.err { color: var(--bad-2); font-size: 14px; font-weight: 700; text-align: center; min-height: 20px; margin: 8px 0 2px; }
[data-theme="klinik"] .err { color: var(--bad); }

/* ============================================================ scores / stats / settings */
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { flex: 1; min-height: 40px; padding: 6px 4px; border-radius: 10px; font-size: 13.5px; font-weight: var(--w-bold); color: var(--text-2); line-height: 1.15; }
.tabs button.on { background: var(--primary-bg); color: var(--primary-fg); }
[data-theme="gameshow"] .tabs button.on { box-shadow: 0 3px 0 #a86a00; }
[data-theme="modern"] .tabs button.on { background: rgba(255,255,255,.12); color: var(--text); }
.subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-size: 13.5px; font-weight: var(--w-bold); background: var(--surface); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; min-height: 38px; }
.subtabs button.on { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.list { display: flex; flex-direction: column; gap: 8px; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; font-weight: var(--w-bold); min-height: 56px; }
.lrow .lrank { width: 26px; text-align: center; font-weight: 900; color: var(--text-3); font-size: 16px; flex: none; font-variant-numeric: tabular-nums; }
.lrow .lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .lname small { display: block; font-size: 12px; color: var(--text-2); font-weight: 500; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.lrow .lpts { font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.lrow .lpts small { display: block; font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.lrow.top1 .lrank { color: #ffd34d; } .lrow.top2 .lrank { color: #c9d3ff; } .lrow.top3 .lrank { color: #ffb27a; }
[data-theme="klinik"] .lrow.top1 .lrank { color: #C2A24E; } [data-theme="klinik"] .lrow.top2 .lrank { color: #8592A8; } [data-theme="klinik"] .lrow.top3 .lrank { color: #C8875A; }
.lrow.me { background: color-mix(in srgb, var(--accent) 14%, transparent); border: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); }
[data-theme="klinik"] .lrow { background: #fff; border-color: #EDF0F4; }
[data-theme="klinik"] .lrow.me { background: #EEF4FB; border: 1.5px solid #DCE8F6; }
[data-theme="modern"] .lrow { background: transparent; border: none; border-bottom: 1px solid var(--line); border-radius: 0; font-weight: 500; }
[data-theme="modern"] .lrow.me { background: rgba(46,230,214,.07); border: 1px solid rgba(46,230,214,.25); border-radius: 14px; }
.empty { text-align: center; padding: 30px 14px; color: var(--text-2); font-weight: 600; font-size: 15px; line-height: 1.45; }

.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { text-align: center; padding: 14px 6px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.stat .v { font-size: 28px; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--text-2); font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; line-height: 1.2; }
.stat.w .v { color: var(--ok-2); } .stat.l .v { color: var(--bad-2); } .stat.d .v { color: var(--text-2); }
[data-theme="klinik"] .stat { background: #fff; border-color: #EDF0F4; }
.wld { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin-top: 12px; background: var(--surface-2); }
.wld i { display: block; height: 100%; }
.section { margin-top: 22px; }
.section > .h3 { margin-bottom: 10px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row .bl { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: var(--w-med); margin-bottom: 5px; line-height: 1.25; }
.bar-row .bl span:first-child { min-width: 0; overflow-wrap: anywhere; }
.bar-row .bl b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-row .bt { height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-row .bt i { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--accent)); width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.bar-row .bs { font-size: 12px; color: var(--text-3); margin-top: 3px; font-weight: 600; }
.weak { display: flex; flex-direction: column; gap: 8px; }
.weak .lrow { min-height: 50px; }
.best-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.best { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.best .ico { font-size: 24px; color: var(--accent); }
.best .bv { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.best .bk { font-size: 12px; color: var(--text-2); font-weight: 700; }
[data-theme="klinik"] .best { background: #fff; border-color: #EDF0F4; }

.theme-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-card { border-radius: 16px; padding: 4px; border: 2px solid var(--line); text-align: center; background: transparent; color: var(--text); min-width: 0; }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.theme-card .tn { font-size: 13px; font-weight: var(--w-bold); margin-top: 6px; }
.theme-card .td { font-size: 11px; color: var(--text-2); margin-bottom: 4px; }
.tprev { position: relative; height: 128px; border-radius: 12px; overflow: hidden; padding: 9px 7px; display: flex; flex-direction: column; gap: 5px; color: var(--text); text-align: left; background: var(--bg-solid); }
.tprev::before { content: ""; position: absolute; inset: 0; background: var(--bg); }
.tprev > * { position: relative; }
.tprev .tq { font-size: 9px; font-weight: var(--w-bold); background: var(--card-bg); color: var(--card-fg); border-radius: 6px; padding: 4px 5px; line-height: 1.2; box-shadow: var(--card-sh); }
.tprev[data-theme="klinik"] .tq, .tprev[data-theme="modern"] .tq { padding: 1px 0; box-shadow: none; }
.tprev .tbar { height: 4px; border-radius: 3px; background: var(--timer-track); overflow: hidden; }
.tprev .tbar i { display: block; height: 100%; width: 62%; background: var(--timer-ok); }
.tprev .ttiles { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tprev .ttiles i { height: 16px; border-radius: 5px; }
.tprev .tbtn { margin-top: auto; height: 16px; border-radius: 6px; background: var(--primary-bg); color: var(--primary-fg); font-size: 8px; font-weight: 800; display: grid; place-items: center; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row .sl { font-weight: var(--w-bold); font-size: 15px; }
.switch { position: relative; width: 54px; height: 32px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--ok); border-color: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--accent) var(--p, 80%), var(--surface-2) var(--p, 80%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; margin-top: -9px; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 8px; background: var(--surface-2); }
input[type=range]::-moz-range-progress { height: 8px; border-radius: 8px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: none; }

/* ============================================================ phone controller (rounds) */
.ctrl-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }
.ctrl-head .cn { font-size: 20px; font-weight: var(--w-strong); line-height: 1.15; overflow-wrap: anywhere; }
.ctrl-head .cr { font-size: 14px; font-weight: var(--w-bold); color: var(--accent); font-variant-numeric: tabular-nums; }
.ctrl-head > div { min-width: 0; flex: 1; }
.live { font-size: 12px; font-weight: 900; color: var(--bad-2); background: color-mix(in srgb, var(--bad) 15%, transparent); border: 1.5px solid color-mix(in srgb, var(--bad) 50%, transparent); padding: 5px 10px; border-radius: 999px; white-space: nowrap; flex: none; }
.live.off { color: var(--text-3); border-color: var(--line-2); background: transparent; }
.ctrl-q { text-align: center; font-size: 15px; font-weight: var(--w-strong); padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; line-height: 1.3; }
.ctrl-q span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.ctrl-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; flex: 1; min-height: 360px; margin-top: 12px; }
.cbtn { position: relative; border-radius: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; color: var(--fg); background: var(--bgc); transition: transform .08s; }
.cbtn .cshape { font-size: 72px; line-height: 0; }
.cbtn .cl { position: absolute; left: 16px; top: 12px; font-size: 22px; font-weight: 900; opacity: .65; }
.cbtn:active { transform: scale(.96) translateY(4px); }
.cbtn.a0 { --bgc: var(--tile-a); --sh: var(--tile-a-sh); --fg: var(--tile-a-fg); --solid: var(--tile-a-solid); }
.cbtn.a1 { --bgc: var(--tile-b); --sh: var(--tile-b-sh); --fg: var(--tile-b-fg); --solid: var(--tile-b-solid); }
.cbtn.a2 { --bgc: var(--tile-c); --sh: var(--tile-c-sh); --fg: var(--tile-c-fg); --solid: var(--tile-c-solid); }
.cbtn.a3 { --bgc: var(--tile-d); --sh: var(--tile-d-sh); --fg: var(--tile-d-fg); --solid: var(--tile-d-solid); }
[data-theme="gameshow"] .cbtn { box-shadow: 0 8px 0 var(--sh), 0 0 24px rgba(0,0,0,.25); }
[data-theme="gameshow"] .cbtn .cshape { filter: drop-shadow(0 4px 0 rgba(0,0,0,.18)); }
[data-theme="klinik"] .cbtn { box-shadow: 0 8px 16px -10px rgba(22,35,58,.5); border-radius: 18px; }
[data-theme="klinik"] .cbtn .cshape { opacity: .9; font-size: 60px; }
[data-theme="klinik"] .cbtn .cl { width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,.22); display: grid; place-items: center; opacity: 1; font-size: 22px; font-weight: 800; }
[data-theme="modern"] .cbtn { background: linear-gradient(135deg, color-mix(in srgb, var(--solid) 22%, transparent), color-mix(in srgb, var(--solid) 8%, transparent)); border: 1px solid color-mix(in srgb, var(--solid) 45%, transparent); color: var(--solid); border-radius: 24px; }
[data-theme="modern"] .cbtn .cl { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--solid); color: #0B0C0F; opacity: 1; font-weight: 700; box-shadow: 0 8px 24px -8px var(--solid); }
.ctrl-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 20px 6px; }
.ctrl-state .big-ico { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font-size: 64px; background: var(--surface); border: 2px solid var(--line-2); color: var(--accent); }
.ctrl-state .big-ico.ok { background: var(--ok); color: #fff; border-color: transparent; box-shadow: 0 0 40px color-mix(in srgb, var(--ok) 60%, transparent); animation: verdictIn .45s cubic-bezier(.3,1.5,.5,1); }
.ctrl-state .big-ico.bad { background: var(--bad); color: #fff; border-color: transparent; box-shadow: 0 0 40px color-mix(in srgb, var(--bad) 50%, transparent); animation: verdictIn .45s cubic-bezier(.3,1.5,.5,1); }
.ctrl-state .big-ico.sent { background: var(--bgc, var(--surface)); color: var(--fg, var(--text)); border: none; }
.ctrl-state .big-ico.sent.a0 { --bgc: var(--tile-a); --fg: var(--tile-a-fg); } .ctrl-state .big-ico.sent.a1 { --bgc: var(--tile-b); --fg: var(--tile-b-fg); }
.ctrl-state .big-ico.sent.a2 { --bgc: var(--tile-c); --fg: var(--tile-c-fg); } .ctrl-state .big-ico.sent.a3 { --bgc: var(--tile-d); --fg: var(--tile-d-fg); }
.ctrl-state .t1 { font-family: var(--font-display); font-size: 30px; font-weight: var(--w-strong); letter-spacing: var(--ls-title); line-height: 1.1; }
.ctrl-state .t2 { font-size: 16px; color: var(--text-2); font-weight: 600; line-height: 1.4; max-width: 300px; }
.ctrl-state .pts-big { font-size: 46px; font-weight: 900; color: var(--ok-2); font-variant-numeric: tabular-nums; }
.ctrl-state .rank-big { font-size: 20px; font-weight: 800; color: var(--accent); }
.ctrl-foot { text-align: center; font-size: 12px; color: var(--text-3); font-weight: 700; margin-top: 14px; }

/* flash overlay (controllers: visual instead of sound) */
#flash { position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0; }
#flash.on { animation: flash .6s ease-out; }
#flash.ok { background: radial-gradient(circle, color-mix(in srgb, var(--ok) 55%, transparent), color-mix(in srgb, var(--ok) 25%, transparent)); }
#flash.bad { background: radial-gradient(circle, color-mix(in srgb, var(--bad) 55%, transparent), color-mix(in srgb, var(--bad) 25%, transparent)); }
#flash.tap { background: rgba(255,255,255,.35); }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* toast */
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); transform: translate(-50%, 30px); opacity: 0; z-index: 100; max-width: min(92vw, 440px);
  padding: 12px 18px; border-radius: 14px; background: #111; color: #fff; font-weight: 700; font-size: 14.5px; box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: all .25s; pointer-events: none; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: #b3261e; }
#netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 95; text-align: center; font-size: 13px; font-weight: 700; padding: calc(env(safe-area-inset-top, 0px) + 4px) 10px 4px; background: #b3261e; color: #fff; transform: translateY(-100%); transition: transform .25s; }
#netbar.show { transform: none; }

/* confetti */
canvas.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }

/* ============================================================ presenter (beamer) – sized in em; 1em = 16px @1280×720 */
.stage {
  position: fixed; inset: 0; overflow: hidden; display: flex; flex-direction: column;
  font-size: min(1.25vw, 2.2222vh); padding: 1.6em 2.5em 1.5em;
}
.stage .ico { vertical-align: -.12em; }
.bm-top { display: flex; align-items: center; justify-content: space-between; gap: 1.2em; min-height: 4.6em; }
.bm-logo { display: flex; align-items: center; gap: .9em; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.bm-logo > div { min-width: 0; }
.bm-logo .logo-badge { font-size: 1.25em; padding: .5em .6em; border-radius: .7em; }
.bm-title { font-family: var(--font-display); font-size: 1.75em; font-weight: var(--w-strong); letter-spacing: var(--ls-title); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-sub { font-size: .875em; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-mid { display: flex; align-items: center; gap: .9em; flex: none; }
.bm-mid:empty { display: none; }
.bm-mid .chip { font-size: 1.15em; padding: .4em 1em; }
.bm-q { font-size: 1.25em; font-weight: var(--w-strong); color: var(--text-2); white-space: nowrap; display: inline-flex; align-items: center; gap: .35em; }
.bm-right { display: flex; align-items: center; gap: .7em; flex: none; }
.bm-join { display: flex; align-items: center; gap: .9em; background: #fff; color: #1a0d4d; border-radius: 1.1em; padding: .45em .45em .45em 1.1em; }
[data-theme="gameshow"] .bm-join { box-shadow: 0 .3em 0 #c9bdf5; }
[data-theme="klinik"] .bm-join { box-shadow: 0 1px 2px rgba(22,35,58,.05), 0 4px 14px -6px rgba(22,35,58,.10); border: 1px solid #EDF0F4; color: #16233A; }
[data-theme="modern"] .bm-join { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--line); }
.bm-join .pin-l { font-size: .7em; font-weight: 700; opacity: .7; white-space: nowrap; }
.bm-join .pin { font-size: 1.6em; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.bm-join .pin b { font-weight: 900; letter-spacing: .08em; color: #6a3df0; }
[data-theme="klinik"] .bm-join .pin b { color: #1F5FAF; }
[data-theme="modern"] .bm-join .pin b { color: #2EE6D6; }
.bm-join .qrmini { width: 5.25em; height: 5.25em; background: #fff; border-radius: .4em; padding: .15em; }
.bm-join .qrmini svg { width: 100%; height: 100%; display: block; }
.stage .iconbtn { width: 2.6em; height: 2.6em; font-size: 1.1em; border-radius: .75em; }
.bm-timer { display: flex; align-items: center; gap: 1em; margin: 1em 0 .9em; }
.bm-timer > .timer { flex: 1; }
.stage .timer { gap: 1em; }
.stage .timer-label { font-size: 2em; min-width: 3em; }
[data-theme="gameshow"] .stage .timer-label { text-shadow: 0 0 1em rgba(255,211,77,.6); }
[data-theme="gameshow"] .stage .timer-track { height: 1.6em; }
[data-theme="klinik"] .stage .timer-track { height: .65em; }
[data-theme="modern"] .stage .timer-track { height: .45em; }
[data-theme="modern"] .stage .timer-fill::after { height: 1.1em; top: -.32em; width: 3px; }
.bm-question {
  background: var(--card-bg); color: var(--card-fg); border-radius: .7em; padding: .55em .9em; font-size: 2.2em; font-weight: var(--w-strong); line-height: 1.2; text-align: center;
  box-shadow: var(--card-sh); overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto;
}
.bm-question.long { font-size: 1.85em; } .bm-question.xlong { font-size: 1.55em; }
.bm-question.compact { font-size: 1.5em; padding: .45em .9em; }
[data-theme="gameshow"] .bm-question { box-shadow: 0 .18em 0 #c9bdf5, 0 .5em 1em rgba(0,0,0,.35); }
[data-theme="klinik"] .bm-question { text-align: left; padding: .2em 0; font-weight: 700; letter-spacing: -.02em; }
[data-theme="modern"] .bm-question { text-align: left; padding: .2em 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -.03em; }
.bm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1em; margin-top: 1.4em; }
.btile { position: relative; display: flex; align-items: center; gap: .7em; min-height: 4em; border-radius: .85em; padding: .45em 2.3em .45em .6em; font-size: 1.6em; font-weight: var(--w-bold); line-height: 1.18; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; transition: filter .3s, opacity .3s, transform .3s; }
.btile .bshape { width: 2.4em; height: 2.4em; flex: none; border-radius: .6em; display: grid; place-items: center; font-size: 1em; font-weight: 900; }
.btile .bshape .ico { font-size: 1.15em; }
.btile .bshape .letter { display: none; }
.btile .btext { flex: 1; min-width: 0; }
.btile .bletter { position: absolute; right: .8em; top: 50%; transform: translateY(-50%); font-size: 1.15em; font-weight: 900; opacity: .5; }
.btile.small-text { font-size: 1.3em; }
.bm-grid.compact .btile { min-height: 3.1em; font-size: 1.4em; }
.bm-grid.compact .btile .bshape { width: 2em; height: 2em; }
.btile.a0 { --bgc: var(--tile-a); --sh: var(--tile-a-sh); --fg: var(--tile-a-fg); --solid: var(--tile-a-solid); }
.btile.a1 { --bgc: var(--tile-b); --sh: var(--tile-b-sh); --fg: var(--tile-b-fg); --solid: var(--tile-b-solid); }
.btile.a2 { --bgc: var(--tile-c); --sh: var(--tile-c-sh); --fg: var(--tile-c-fg); --solid: var(--tile-c-solid); }
.btile.a3 { --bgc: var(--tile-d); --sh: var(--tile-d-sh); --fg: var(--tile-d-fg); --solid: var(--tile-d-solid); }
[data-theme="gameshow"] .btile { background: var(--bgc); color: var(--fg); box-shadow: 0 .27em 0 var(--sh); }
[data-theme="gameshow"] .btile .bshape { background: rgba(0,0,0,.18); }
[data-theme="klinik"] .btile { background: var(--bgc); color: #fff; font-weight: 600; box-shadow: 0 8px 18px -10px rgba(22,35,58,.45); border-radius: 1em; }
[data-theme="klinik"] .btile .bshape { background: rgba(255,255,255,.2); border-radius: .5em; width: 2em; height: 2em; }
[data-theme="klinik"] .btile .bshape .ico { display: none; } [data-theme="klinik"] .btile .bshape .letter { display: inline; }
[data-theme="klinik"] .btile .bletter { display: none; }
[data-theme="klinik"] .btile { padding-right: 1em; }
[data-theme="modern"] .btile { background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); color: var(--text); font-weight: 600; letter-spacing: -.02em; }
[data-theme="modern"] .btile .bshape { background: var(--solid); color: #0B0C0F; border-radius: .6em; width: 2.1em; height: 2.1em; }
[data-theme="modern"] .btile .bshape .ico { display: none; } [data-theme="modern"] .btile .bshape .letter { display: inline; }
[data-theme="modern"] .btile .bletter { display: none; }
[data-theme="modern"] .btile { padding-right: 1em; }
/* reveal on beamer */
.bm-grid.revealed .btile.wrong { filter: saturate(.3) brightness(.6); }
[data-theme="klinik"] .bm-grid.revealed .btile.wrong { filter: none; opacity: .35; }
[data-theme="modern"] .bm-grid.revealed .btile.wrong { filter: none; opacity: .4; }
.bm-grid.revealed .btile.right { transform: scale(1.02); }
[data-theme="gameshow"] .bm-grid.revealed .btile.right { background: linear-gradient(180deg, #36e886, #14b55a); color: #fff; box-shadow: 0 .27em 0 #0b7a3b, 0 0 0 .18em #b9ffd6, 0 0 1.6em rgba(31,207,107,.8); }
[data-theme="klinik"] .bm-grid.revealed .btile.right { box-shadow: 0 0 0 .2em #fff, 0 0 0 .38em #2E8B57; }
[data-theme="modern"] .bm-grid.revealed .btile.right { background: rgba(50,215,75,.12); border-color: rgba(50,215,75,.7); box-shadow: 0 0 2em -.4em rgba(50,215,75,.6); }
.btile .dist { display: flex; align-items: center; gap: .5em; margin-left: auto; padding-left: .5em; flex: none; font-variant-numeric: tabular-nums; }
.btile .dist .dcount { font-size: 1.1em; font-weight: 900; min-width: 1.5em; text-align: right; }
.btile .dist .dcheck { font-size: 1.2em; }
.btile .dbar { position: absolute; left: 0; bottom: 0; height: .32em; border-radius: 0 .2em .2em 1.35em; background: rgba(255,255,255,.7); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
[data-theme="modern"] .btile .dbar { background: var(--solid); }
[data-theme="klinik"] .btile .dbar { background: rgba(255,255,255,.85); border-radius: 0 .2em .2em 1em; }
.bm-reveal { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; margin-top: .9em; align-items: start; }
.bm-reveal .bm-grid { grid-column: 1 / -1; }
.bm-reveal-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2em; margin-top: 1.2em; align-items: start; }
.bm-explain { background: var(--surface); border: 1px solid var(--line); border-radius: 1.2em; padding: 1em 1.3em; font-size: 1.3em; line-height: 1.42; font-weight: 500; overflow-wrap: break-word; }
.bm-explain .ex-h { display: flex; align-items: center; gap: .4em; font-weight: var(--w-strong); color: var(--accent); margin-bottom: .3em; font-size: .95em; }
[data-theme="klinik"] .bm-explain { background: #fff; border-color: #EDF0F4; color: var(--text-2); }
.bm-chart { display: flex; align-items: flex-end; justify-content: space-around; gap: .8em; padding: 1em 1.2em .8em; border-radius: 1.2em; background: var(--surface); border: 1px solid var(--line); min-height: 9em; }
[data-theme="klinik"] .bm-chart { background: #fff; border-color: #EDF0F4; }
.bm-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .3em; height: 100%; }
.bm-chart .cv { font-size: 1.4em; font-weight: 900; font-variant-numeric: tabular-nums; }
.bm-chart .cb { width: 100%; max-width: 4.2em; border-radius: .5em .5em .2em .2em; background: var(--bgc); height: .4em; transition: height 1s cubic-bezier(.2,.8,.2,1); box-shadow: inset 0 -.3em 0 rgba(0,0,0,.12); }
[data-theme="modern"] .bm-chart .cb { background: var(--solid); }
.bm-chart .cs { width: 2em; height: 2em; border-radius: .5em; display: grid; place-items: center; background: var(--bgc); color: var(--fg); font-size: .95em; font-weight: 900; }
[data-theme="modern"] .bm-chart .cs { background: var(--solid); color: #0B0C0F; }
.bm-chart .cs .letter { display: none; }
[data-theme="klinik"] .bm-chart .cs .ico, [data-theme="modern"] .bm-chart .cs .ico { display: none; }
[data-theme="klinik"] .bm-chart .cs .letter, [data-theme="modern"] .bm-chart .cs .letter { display: inline; }
.bm-chart .col.wrong { opacity: .45; }
.bm-chart .col.right .cv { color: var(--ok-2); }
.bm-chart .col.a0 { --bgc: var(--tile-a); --fg: var(--tile-a-fg); --solid: var(--tile-a-solid); } .bm-chart .col.a1 { --bgc: var(--tile-b); --fg: var(--tile-b-fg); --solid: var(--tile-b-solid); }
.bm-chart .col.a2 { --bgc: var(--tile-c); --fg: var(--tile-c-fg); --solid: var(--tile-c-solid); } .bm-chart .col.a3 { --bgc: var(--tile-d); --fg: var(--tile-d-fg); --solid: var(--tile-d-solid); }

.bm-foot { margin-top: auto; padding-top: 1em; display: flex; align-items: center; gap: 1.4em; }
.answered { display: flex; align-items: center; gap: .9em; font-size: 1.25em; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.answered b { font-size: 1.3em; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }
.answered-bar { flex: 1; height: .75em; border-radius: 99px; background: var(--timer-track); overflow: hidden; }
.answered-bar div { height: 100%; width: 0; background: linear-gradient(90deg, #8b5cff, #ff4fb8); border-radius: 99px; transition: width .4s; }
[data-theme="gameshow"] .answered-bar div { box-shadow: 0 0 .75em rgba(255,79,184,.7); }
[data-theme="klinik"] .answered-bar div { background: #2E8B57; }
[data-theme="modern"] .answered-bar div { background: linear-gradient(90deg, #16C2B3, #2EE6D6); }
.bm-hint { font-size: 1em; color: var(--text-3); font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: .5em; }
.kbd { display: inline-block; padding: .1em .5em; border-radius: .35em; border: 1px solid var(--line-2); background: var(--surface); font-size: .9em; font-weight: 800; color: var(--text-2); }
.stage .btn { width: auto; min-height: 2.8em; font-size: 1.3em; padding: .5em 1.6em; border-radius: .8em; }
.stage .btn-lg { font-size: 1.7em; min-height: 2.6em; padding: .4em 2em; }

/* host create */
.host-create { margin: auto; width: min(36em, 92%); text-align: center; display: flex; flex-direction: column; gap: 1.2em; align-items: stretch; }
.host-create .h1 { font-size: 2.6em; }
.host-create .sub { font-size: 1.2em; }
.host-create .seg { align-self: center; font-size: 1.1em; }
.host-create .seg button { font-size: 1em; padding: .5em 1.3em; }
.host-create .fine { font-size: .95em; }

/* host lobby */
.lobby { flex: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 2.4em; margin-top: 1em; min-height: 0; }
.lobby-left { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .8em; min-width: 0; }
.lobby-join { font-size: 1.4em; font-weight: 700; color: var(--text-2); }
.lobby-url { font-size: 1.5em; font-weight: 800; color: var(--text); word-break: break-all; max-width: 100%; }
.lobby-pin { font-size: 8.5em; font-weight: 900; letter-spacing: .08em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
[data-theme="gameshow"] .lobby-pin { text-shadow: 0 .06em 0 #a86a00, 0 0 .4em rgba(255,211,77,.5); }
[data-theme="klinik"] .lobby-pin { color: var(--text); font-weight: 800; }
.lobby-pin-l { font-size: 1.3em; font-weight: 800; letter-spacing: .3em; color: var(--text-2); text-transform: uppercase; }
.lobby-qr { width: 15em; height: 15em; background: #fff; border-radius: 1em; padding: .6em; }
.lobby-qr svg { width: 100%; height: 100%; display: block; }
.lobby-right { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lobby-count { display: flex; align-items: baseline; gap: .5em; font-size: 1.6em; font-weight: 800; }
.lobby-count b { font-size: 2em; color: var(--accent); font-variant-numeric: tabular-nums; }
.lobby-players { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: .7em; margin-top: 1em; overflow: hidden; min-height: 6em; }
.pchip { display: inline-flex; align-items: center; gap: .55em; padding: .35em 1em .35em .35em; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 1.2em; font-weight: 800; animation: chipIn .5s cubic-bezier(.3,1.6,.5,1) both; max-width: 100%; }
.pchip .av { width: 1.9em; height: 1.9em; font-size: .7em; }
.pchip .pcn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip.off { opacity: .45; }
[data-theme="klinik"] .pchip { background: #fff; border-color: #EDF0F4; box-shadow: 0 1px 2px rgba(22,35,58,.05); }
@keyframes chipIn { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.lobby-wait { color: var(--text-3); font-size: 1.3em; font-weight: 700; display: flex; align-items: center; gap: .6em; }
.lobby-actions { display: flex; align-items: center; gap: 1em; margin-top: 1em; }

/* host wheel */
.bm-wheel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.bm-wheel .wheel-wrap { width: min(23em, 52vh); margin: 1.4em auto 0; }
.bm-wheel .wheel-title { font-size: 2.5em; }
.bm-wheel .wheel-sub { font-size: 1.3em; }
[data-theme="klinik"] .bm-wheel .wheel-title { font-size: 2.2em; }
[data-theme="modern"] .bm-wheel .wheel-title { font-size: 1.1em; } [data-theme="modern"] .bm-wheel .wheel-sub { font-size: 2.2em; }
.bm-wheel .mode-banner .mb-name { font-size: 2.8em; }
.bm-wheel .mode-banner .mb-sub { font-size: 1.3em; }
.bm-wheel .mode-banner { margin-top: .6em; }

/* host leaderboard */
.bm-lb { flex: 1; display: flex; flex-direction: column; min-height: 0; margin-top: 1em; }
.bm-lb-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1em; margin-bottom: .9em; }
.bm-lb-next { display: flex; align-items: center; justify-content: flex-end; gap: .8em; }
.bm-lb-title { font-family: var(--font-display); font-size: 2.2em; font-weight: var(--w-strong); letter-spacing: var(--ls-title); text-align: center; color: var(--accent); }
.stage.ingame .bm-sub { display: none; }
.stage.ingame .bm-title { font-size: 1.5em; }
[data-theme="klinik"] .bm-lb-title { color: var(--text); }
.bm-lb-list { position: relative; display: flex; flex-direction: column; gap: .4em; width: min(52em, 100%); margin: 0 auto; }
.bm-lb .lrow { font-size: 1.25em; min-height: 2.3em; padding: .2em 1em; border-radius: .7em; gap: .8em; }
.bm-lb .lrow .av { width: 2em; height: 2em; font-size: .7em; }
.bm-lb .lrow .lrank { width: 1.8em; font-size: 1.05em; }
.bm-lb .lrow .delta { font-size: .8em; color: var(--ok-2); font-weight: 900; min-width: 4.5em; text-align: right; font-variant-numeric: tabular-nums; }
.bm-lb .lrow .move { font-size: .75em; font-weight: 900; min-width: 2.6em; text-align: right; display: inline-flex; align-items: center; justify-content: flex-end; gap: .15em; color: var(--text-3); }
.bm-lb .lrow .move.up { color: var(--ok-2); } .bm-lb .lrow .move.dn { color: var(--bad-2); }
.bm-lb .lrow .lpts { min-width: 4.5em; }
.bm-lb .lrow.out { opacity: .55; }

/* host podium */
.bm-podium { flex: 1; display: grid; grid-template-columns: 1.15fr 1fr; gap: 2.2em; min-height: 0; margin-top: 1em; }
.pp-left { display: flex; flex-direction: column; min-height: 0; }
.pp-h { font-family: var(--font-display); font-size: 2.1em; font-weight: 900; color: var(--accent); display: flex; align-items: center; gap: .4em; }
[data-theme="gameshow"] .pp-h { text-shadow: 0 .1em 0 #a86a00; }
[data-theme="klinik"] .pp-h { color: var(--text); font-weight: 700; }
[data-theme="modern"] .pp-h { color: var(--text); font-weight: 600; }
.pp-sub { font-size: 1.05em; color: var(--text-2); font-weight: 600; margin-top: .2em; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 1em; margin-top: auto; }
.pod { display: flex; flex-direction: column; align-items: center; width: 11em; min-width: 0; }
.pod .av { width: 3.6em; height: 3.6em; font-size: 1.2em; }
.pod.p1 .av { width: 4.6em; height: 4.6em; font-size: 1.5em; }
[data-theme="gameshow"] .pod .av { box-shadow: 0 0 0 .25em rgba(255,255,255,.25); }
[data-theme="gameshow"] .pod.p1 .av { box-shadow: 0 0 0 .3em #fff6c9, 0 0 2em rgba(255,211,77,.9); }
.pod .crown { font-size: 2.4em; color: #ffd34d; margin-bottom: -.25em; position: relative; z-index: 2; }
[data-theme="klinik"] .pod .crown { color: #C2A24E; font-size: 1.8em; margin-bottom: 0; }
[data-theme="modern"] .pod .crown { color: #2EE6D6; font-size: 1.6em; margin-bottom: 0; }
.pod-name { font-size: 1.15em; font-weight: 900; margin-top: .5em; text-align: center; max-width: 100%; line-height: 1.15; overflow: hidden; overflow-wrap: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } /* long names wrap to 2 lines */
.pod-pts { font-size: 1em; font-weight: 800; color: var(--accent); margin-bottom: .5em; font-variant-numeric: tabular-nums; }
[data-theme="klinik"] .pod-pts, [data-theme="modern"] .pod-pts { color: var(--text-2); font-weight: 600; }
.pod .block { width: 100%; border-radius: 1em 1em 0 0; display: grid; place-items: start center; padding-top: .3em; font-size: 2.9em; font-weight: 900; transform-origin: bottom; animation: podUp .9s cubic-bezier(.2,1.2,.4,1) both; }
.pod.p1 .block { height: 3.7em; background: var(--pod-1); color: var(--pod-1-fg); animation-delay: 1.3s; }
.pod.p2 .block { height: 2.6em; background: var(--pod-2); color: var(--pod-2-fg); animation-delay: .7s; }
.pod.p3 .block { height: 1.95em; background: var(--pod-3); color: var(--pod-3-fg); animation-delay: .2s; }
.pod.p1 > :not(.block) { animation: fadeUp .6s 1.9s both; } .pod.p2 > :not(.block) { animation: fadeUp .6s 1.3s both; } .pod.p3 > :not(.block) { animation: fadeUp .6s .8s both; }
[data-theme="gameshow"] .pod .block { box-shadow: inset 0 -.2em 0 rgba(0,0,0,.12); }
[data-theme="modern"] .pod .block { border: 1px solid color-mix(in srgb, var(--pod-1-fg) 40%, transparent); border-bottom: none; font-weight: 700; }
[data-theme="modern"] .pod.p2 .block { border-color: color-mix(in srgb, var(--pod-2-fg) 40%, transparent); }
[data-theme="modern"] .pod.p3 .block { border-color: color-mix(in srgb, var(--pod-3-fg) 40%, transparent); }
[data-theme="klinik"] .pod .block { border-radius: .75em .75em .25em .25em; font-size: 1.6em; padding-top: .45em; }
[data-theme="klinik"] .pod.p1 .block { height: 5.6em; } [data-theme="klinik"] .pod.p2 .block { height: 4.1em; } [data-theme="klinik"] .pod.p3 .block { height: 3em; }
@keyframes podUp { from { transform: scaleY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(1em); } }
.pp-right { display: flex; flex-direction: column; gap: .55em; justify-content: center; min-height: 0; overflow: hidden; }
.pp-right .lrow { font-size: 1.15em; min-height: 2.6em; padding: .3em .9em; border-radius: .8em; gap: .7em; }
.pp-right .lrow .av { width: 2em; height: 2em; font-size: .72em; }
.pp-actions { display: flex; gap: .8em; margin-top: .6em; }

/* phone-sized beamer fallback (presenter opened on a phone) */
@media (max-aspect-ratio: 1/1) {
  .stage { font-size: 2.6vw; padding: 1em; overflow-y: auto; position: relative; min-height: 100vh; }
  .lobby, .bm-podium, .bm-reveal-row { grid-template-columns: 1fr; }
  .bm-grid { grid-template-columns: 1fr; }
}

/* ============================================================ misc animations */
.pop-in { animation: chipIn .45s cubic-bezier(.3,1.6,.5,1) both; }
.fade-in { animation: fadeUp .35s ease-out both; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--accent); animation: rot .8s linear infinite; margin: 30px auto; }
@keyframes rot { to { transform: rotate(360deg); } }
.score-bump { animation: bump .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes bump { 40% { transform: scale(1.25); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .05s !important; }
  .radar::before, .radar::after { display: none; }
  .timer.pulse .timer-track, .timer.pulse .timer-label { animation: none !important; }
}

/* small phones */
@media (max-width: 370px) {
  .screen { padding-left: calc(env(safe-area-inset-left, 0px) + 12px); padding-right: calc(env(safe-area-inset-right, 0px) + 12px); }
  .qcard { font-size: 18px; } .ans { font-size: 15px; min-height: 58px; } .h1 { font-size: 24px; }
  .scorebar .ps { font-size: 19px; }
}
@media (max-height: 700px) {
  .ans { min-height: 56px; } .answers { gap: 8px; } .wheel-wrap { width: min(70vw, 280px); }
}

/* duel reveal: "Weiter" + end-of-game mistake review */
.next-row { margin-top: 16px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.next-row .next-btn[disabled] { opacity: .55; }
.next-row .next-wait { text-align: center; min-height: 1.2em; }
.review { margin-top: 18px; text-align: left; }
.review-h { display: flex; align-items: center; gap: 6px; font-weight: var(--w-strong); font-size: 16px; margin-bottom: 4px; }
.review > .fine, .rv-cat { text-align: left; }
.review > .fine { margin: 0 0 8px; }
.rv-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-top: 8px; }
.rv-item summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.rv-item summary::-webkit-details-marker { display: none; }
.rv-item .rv-n { flex: none; min-width: 22px; height: 22px; border-radius: 11px; display: inline-grid; place-items: center; font-size: 12px; background: var(--bad); color: #fff; }
.rv-item[open] summary { margin-bottom: 8px; }
.rv-cat { margin: 0 0 6px 32px; }
.rv-a { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 4px 0 4px 32px; line-height: 1.35; }
.rv-a svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.rv-a.bad { color: var(--bad-2, #c2475a); }
.rv-a.ok { color: var(--ok-2, #2e9e5b); font-weight: 600; }
.rv-item .explain { margin: 8px 0 2px 32px; }

/* ============================================================ game setup (topics & modes) */
.setup-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.setup-card .sc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.setup-card .h3 { font-size: 11.5px; }
.setup-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14.5px; font-weight: var(--w-bold); color: var(--text); line-height: 1.35; }
.setup-sum .sum-part { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.setup-sum .ico { color: var(--accent); flex: none; }
.setup-sum .sum-sep { color: var(--text-3); }
.setup-sum .chip { font-size: 13px; }
.linkbtn { color: var(--accent); font-weight: var(--w-bold); font-size: 14px; padding: 6px 4px; min-height: 36px; background: none; border: 0; }
.linkbtn + .linkbtn { margin-left: 8px; }

.setup-ed { display: flex; flex-direction: column; gap: 18px; text-align: left; }
.se-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 36px; }
.se-count { color: var(--text-2); letter-spacing: 0; margin-left: 4px; }
.se-hint { font-size: 12.5px; color: var(--text-2); font-weight: 500; line-height: 1.4; margin-top: 8px; min-height: 1em; }
.se-warn:empty { display: none; }
.se-warn { color: var(--warn); font-weight: var(--w-med); }
.se-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.se-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tick { position: relative; display: block; cursor: pointer; min-width: 0; }
.tick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tick .tk { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface); border: 2px solid var(--line); font-size: 13.5px; font-weight: var(--w-bold); color: var(--text-2); line-height: 1.2; transition: background .15s, border-color .15s, color .15s; }
.tick .tk > span { min-width: 0; overflow-wrap: anywhere; }
.tick input:checked + .tk { border-color: var(--accent); background: var(--surface-2); color: var(--text); }
.tick input:focus-visible + .tk { box-shadow: var(--focus); }
.mode-tick .tk { flex-wrap: wrap; }
.mode-tick .tk .ico { font-size: 20px; color: var(--accent); }
.mode-tick .tk small { flex-basis: 100%; font-size: 11.5px; font-weight: 600; color: var(--text-3); margin-top: -2px; }
.topic-tick .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; opacity: .45; transition: opacity .15s; }
.topic-tick input:checked + .tk { border-color: var(--c); }
.topic-tick input:checked + .tk .dot { opacity: 1; }
.se-topics.radio .topic-tick .dot { border-radius: 50%; box-shadow: inset 0 0 0 2px var(--bg-solid); }
@media (max-width: 360px) { .se-topics, .se-modes { grid-template-columns: 1fr; } }

/* setup screen footer */
.setup-foot { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg-solid) 30%); margin-top: 8px; }

/* host create: the editor inside the card */
.host-create .setup-ed { font-size: 1rem; }
.host-create.wide { width: min(52em, 94%); }

/* offer dialog */
.modal-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.55); animation: fadeIn .2s; }
.modal { width: min(420px, 100%); text-align: center; display: flex; flex-direction: column; gap: 6px; background: var(--bg-solid); }
.modal .setup-sum { justify-content: center; margin-top: 10px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* two wheels side by side (mode + topic) with a caption under each */
.wheel-pair { display: flex; justify-content: center; align-items: flex-start; gap: 4%; width: 100%; margin-top: 18px; }
.wheel-pair .wheel-cell { flex: 0 1 auto; width: min(86vw, 340px); display: flex; flex-direction: column; align-items: center; min-width: 0; }
.wheel-pair.n2 .wheel-cell { width: 48%; max-width: 340px; }
.wheel-pair .wheel-wrap { width: 100%; margin: 10px auto 0; }
.wheel-cap-h { font-size: 11.5px; font-weight: var(--w-bold); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.wheel-pair.n1 .wheel-cap-h { display: none; }
.wheel-cap { margin-top: 12px; min-height: 2.6em; max-width: 100%; padding: 4px 10px; border-radius: 10px; font-size: 15px; font-weight: var(--w-strong); line-height: 1.25; text-align: center; color: var(--text); border-bottom: 3px solid var(--cap, var(--line)); overflow-wrap: anywhere; transition: transform .2s; }
.wheel-pair.n2 .wheel-cap { font-size: 13px; }
.wheel-cell.landed .wheel-cap { transform: scale(1.08); color: var(--accent); }
.bm-wheel .wheel-pair { flex: 1; min-height: 0; }
.bm-wheel .wheel-pair .wheel-cell { width: min(23em, 52vh); }
.bm-wheel .wheel-pair.n2 .wheel-cell { width: min(21em, 46vh, 44%); }
.bm-wheel .wheel-cap { font-size: 2em; }
.bm-wheel .wheel-cap-h { font-size: 1.1em; }

/* intro: topic under the mode */
.intro-topic { margin-top: 2px; }
.intro-topic .chip { font-size: 15px; padding: 6px 12px; }

/* setup line on the VS screen / presenter lobby */
.setup-line { display: flex; justify-content: center; margin-top: 10px; }
.setup-line .setup-sum { justify-content: center; font-size: 13.5px; color: var(--text-2); }

/* high scores: topic filter */
.topic-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.topic-filter label { font-size: 13px; font-weight: var(--w-bold); color: var(--text-2); flex: none; }
.topic-filter select { flex: 1; min-width: 0; min-height: 40px; padding: 6px 10px; border-radius: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--line); font: inherit; font-size: 14px; font-weight: var(--w-med); }
.topic-filter select option { color: #000; }
.lpts small.partial { color: var(--text-3); }
.se-time button { padding-left: 4px; padding-right: 4px; font-variant-numeric: tabular-nums; }

/* ============================================================ question history, flags, admin */
.home-mini { grid-template-columns: repeat(2, 1fr); }
.qcard.compact { font-size: 16px; padding: 12px 14px; margin-bottom: 4px; }
[data-theme="klinik"] .qcard.compact, [data-theme="modern"] .qcard.compact { font-size: 17px; padding: 2px 0; }
.flag-row { display: flex; justify-content: center; margin-top: 10px; }
.flag-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: var(--w-bold); color: var(--text-2); background: var(--surface); border: 1px solid var(--line); margin-top: 8px; }
.flag-btn .ico { font-size: 15px; }
.flag-form { text-align: left; gap: 4px; }
.flag-form .h2, .flag-form .sub { text-align: center; }
.flag-form .field-label { margin-top: 10px; }
.flag-form textarea.input { min-height: 96px; resize: vertical; font-weight: 500; line-height: 1.4; }
.hist-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.hist-filters .topic-filter { margin: 0; }
.hist-item .rv-n { display: grid; place-items: center; }
.hist-item.ok .rv-n { background: var(--ok); }
.hist-item .rv-n .ico { width: 13px; height: 13px; }
.rv-item .flag-btn { margin-left: 32px; }
.adm-flag { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.adm-flag.done { opacity: .65; }
.adm-comment { font-size: 16px; font-weight: var(--w-bold); color: var(--text); }
.adm-q { font-size: 14.5px; font-weight: 600; color: var(--text-2); }
.adm-a { margin: 0; padding-left: 22px; font-size: 13.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; }
.adm-a li.right { color: var(--ok-2); font-weight: var(--w-bold); }
.adm-a .ico { vertical-align: -2px; }
.adm-flag a { color: var(--accent); }
.adm-flag code { font-size: 11px; opacity: .7; }

/* ============================================================ league */
.tier-badge { --tc: #b9773d; --tc2: #e9a96b; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 999px; font-size: 13px; font-weight: var(--w-strong); color: #2a1400; background: linear-gradient(180deg, var(--tc2), var(--tc)); box-shadow: 0 2px 0 rgba(0,0,0,.25); white-space: nowrap; flex: none; }
.tier-badge .ico { font-size: 17px; color: rgba(255,255,255,.85); filter: drop-shadow(0 1px 0 rgba(0,0,0,.25)); }
.tier-badge.silver { --tc: #9aa3ad; --tc2: #e6ebf0; color: #1d242c; }
.tier-badge.gold { --tc: #e0a800; --tc2: #ffe27a; color: #3a2600; }
.tier-badge.lg { font-size: 17px; padding: 8px 14px 8px 10px; }
.tier-badge.lg .ico { font-size: 24px; }
.league-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; color: var(--text); text-decoration: none; }
.league-card .lc-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.league-card .lc-txt b { font-size: 15px; }
.league-card .lc-txt small { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.league-card .lc-go { color: var(--text-3); }
.lc-news { flex-basis: 100%; font-weight: var(--w-strong); font-size: 15px; padding: 6px 10px; border-radius: 10px; text-align: center; animation: verdictIn .5s cubic-bezier(.3,1.5,.5,1); }
.lc-news.up { background: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok-2); }
.lc-news.down { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--bad-2); }
.lg-me { display: flex; align-items: center; gap: 14px; }
.lg-me-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lg-rank { font-size: 18px; font-weight: var(--w-strong); }
.lg-score { font-size: 15px; color: var(--accent); font-weight: var(--w-bold); }
.lg-zone { font-size: 13px; color: var(--text-2); font-weight: 600; }
.lg-zone.up { color: var(--ok-2); } .lg-zone.down { color: var(--bad-2); }
.lg-ends { margin: 12px 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.lg-tabs button small { opacity: .7; font-weight: 600; }
.lg-row.z-up { box-shadow: inset 4px 0 0 var(--ok); }
.lg-row.z-down { box-shadow: inset 4px 0 0 var(--bad); }
.lg-row.inactive { opacity: .6; }
.lg-row .lpts small .ico { width: 10px; height: 10px; vertical-align: -1px; }
.lg-row.z-up .lpts small { color: var(--ok-2); } .lg-row.z-down .lpts small { color: var(--bad-2); }
.lg-rules summary { cursor: pointer; list-style: none; }
.lg-rules ul { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-2); line-height: 1.4; }
.flag-form textarea.input { font-family: var(--font); font-size: 15px; }

/* ============================================================ difficulty */
.se-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.level-tick .tk { flex-direction: column; align-items: flex-start; gap: 2px; }
.level-tick .tk small { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.lv-stars { color: var(--accent); letter-spacing: 1px; font-size: 14px; white-space: nowrap; }
.lv-stars i { font-style: normal; opacity: .25; }
.qmeta-l { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.bm-mid .lv-stars { font-size: .9em; margin-left: .4em; }

/* ============================================================ presenter: speed bars + score bars */
.bm-race { display: grid; grid-template-columns: repeat(auto-fill, minmax(17em, 1fr)); gap: .35em 1.4em; margin-top: .8em; min-height: 0; overflow: hidden; font-size: 1em; }
.bm-race.dense { font-size: .82em; }
.bm-race.dense2 { font-size: .68em; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: .25em 1.1em; }
.race-row { display: grid; grid-template-columns: 7.5em 1fr 3.4em; align-items: center; gap: .6em; opacity: .45; transition: opacity .3s; }
.race-row.done { opacity: 1; }
.rr-n { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-n[data-rank]:not([data-rank=""])::before { content: attr(data-rank) ". "; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rr-track { height: .85em; border-radius: 99px; background: var(--timer-track); overflow: hidden; }
.rr-fill { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--av, var(--accent)); transition: width .6s cubic-bezier(.2,.9,.3,1); }
.rr-t { text-align: right; font-weight: 800; color: var(--text-2); }
.bm-lb-list.bars { width: 100%; display: grid; gap: .45em 1.6em; }
.bm-lb-list.bars.c1 { grid-template-columns: 1fr; width: min(64em, 100%); }
.bm-lb-list.bars.c2 { grid-template-columns: 1fr 1fr; }
.bm-lb-list.bars.c3 { grid-template-columns: 1fr 1fr 1fr; font-size: .72em; }
.bm-lb-list.bars .lrow .delta { min-width: 0; }
.bm-lb-more { text-align: center; margin-top: .6em; color: var(--text-2); font-weight: 700; }
.bm-lb { overflow: hidden; }
.bm-lb-list.bars .lrow { display: grid; grid-template-columns: 1.6em minmax(4em, 7.5em) minmax(4em, 1fr) 3.8em 2em 3.6em 4.4em; gap: .5em; padding-right: 1.1em; align-items: center; }
.bm-lb-list.bars.c2 .lrow, .bm-lb-list.bars.c3 .lrow { font-size: 1.05em; }
.bm-lb-list.bars .lrow .move { min-width: 0; }
.lb-track { height: .9em; border-radius: 99px; background: var(--timer-track); overflow: hidden; }
.lb-fill { display: block; height: 100%; border-radius: 99px; background: var(--av, var(--accent)); transition: width .9s cubic-bezier(.2,.9,.3,1); }
.lb-t { display: inline-flex; align-items: center; justify-content: flex-end; gap: .2em; font-size: .8em; font-weight: 800; font-variant-numeric: tabular-nums; }
.lb-t .ico { width: 1em; height: 1em; }
.lb-t.ok { color: var(--ok-2); } .lb-t.bad { color: var(--bad-2); } .lb-t.none { color: var(--text-3); }
.bm-lb-list.bars .lrow .lname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================ pictures + explanation pages */
.qimg { margin: 12px 0 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.qimg-box { position: relative; width: 100%; max-height: 34vh; border-radius: var(--r-sm); overflow: hidden; background: #fff; cursor: zoom-in; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.qimg-box img { display: block; width: 100%; height: 100%; object-fit: contain; }
.qimg.small .qimg-box { max-height: 22vh; }
.qimg-mark { position: absolute; width: calc(var(--r) * 2); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 4px solid #ff2d55; box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 14px rgba(255,45,85,.8); animation: markPulse 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes markPulse { 50% { transform: translate(-50%, -50%) scale(1.15); } }
.qimg-credit { font-size: 10.5px; color: var(--text-3); text-align: center; line-height: 1.3; }
.qimg-credit a { color: inherit; }
.figs { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.fig figcaption { font-size: 12.5px; color: var(--text-2); text-align: center; display: flex; flex-direction: column; gap: 2px; }
.explain-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: var(--w-bold); color: var(--accent); background: var(--surface); border: 1px solid var(--line); margin-top: 8px; }
.explain .explain-btn { display: flex; margin: 10px 0 0; }
.rv-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 32px; }
.rv-btns .flag-btn { margin-left: 0; }
.rv-item .qimg { margin-left: 32px; }
.modal-x { position: absolute; top: 10px; right: 10px; }
.modal { position: relative; max-height: calc(100vh - 32px); overflow-y: auto; }
.explain-modal .modal { width: min(640px, 100%); text-align: left; padding-top: 18px; }
.zoom-modal .modal { width: min(1100px, 100%); padding: 10px; }
.zoom-modal .qimg-box { max-height: calc(100vh - 80px); cursor: default; }
.explain-page { display: flex; flex-direction: column; gap: 10px; padding-right: 30px; }
.explain-page .h2 { text-align: left; }
.ep-q { font-size: 14.5px; line-height: 1.4; } .ep-q .rv-a { margin-left: 0; }
.ep-body { font-size: 15px; line-height: 1.55; color: var(--text); }
.ep-body p { margin: 0 0 10px; }
.ep-body ul { margin: 0 0 10px; padding-left: 20px; }
.ep-refs ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.bm-qimg { display: flex; justify-content: center; margin-top: .6em; }
.bm-qimg .qimg { margin: 0; width: min(34em, 60%); }
.bm-qimg .qimg-box { max-height: 30vh; }
.bm-explain .qimg-box { max-height: 26vh; }
