/* Тачборд — дизайн-система.
   По умолчанию светлый интерфейс приложения. Экран и телефон участника берут тему квиза
   через data-theme на <html>; шрифт — data-font, скругления — data-corners, размер — data-scale. */


:root {
  --bg: #f4f5fb; --bg2: #e9ebff; --bg3: #dff7fa;
  --card: #ffffff; --card2: #f1f2f9; --line: #e3e5ef;
  --fg: #171a2e; --muted: #6b7087; --on-accent: #ffffff; --opt-fg: #ffffff;
  --accent: #5b5cf0; --accent2: #0aa3b8; --gold: #e9a92b; --ok: #16a05a; --bad: #e5484d;
  --c0: #ef4d7f; --c1: #2f8cf5; --c2: #f0a51f; --c3: #22b573; --c4: #8b5cf6; --c5: #f0722a; --c6: #0ea5b7; --c7: #d946ef;
  --glow: 0 0 0;
  --r-s: 10px; --r-m: 16px; --r-l: 24px; --r-pill: 999px;
  --font: 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --scale: 1;
  --shadow: 0 10px 30px rgba(23, 26, 46, .08);
  --shadow-s: 0 1px 2px rgba(23, 26, 46, .06), 0 4px 14px rgba(23, 26, 46, .05);
  --dur: 1;
  color-scheme: light;
}

/* ---------- темы экрана ---------- */
[data-theme="fresh"] { --bg: #f4f6ff; --bg2: #dfe4ff; --bg3: #d6f7fb; --font-display: 'Unbounded', 'Manrope', sans-serif; }
[data-theme="cosmos"] { --bg: #0b0a1f; --bg2: #1b1450; --bg3: #2a1f6e; --card: rgba(255,255,255,.06); --card2: rgba(255,255,255,.1); --line: rgba(255,255,255,.12); --fg: #fff; --muted: #b3acd6; --accent: #8b6cff; --accent2: #4dd4ff; --gold: #ffcc4d; --ok: #7cf29a; --bad: #ff6b6b; --on-accent: #0b0a1f; --opt-fg: #0b0a1f;
  --c0: #ff5c8a; --c1: #4dd4ff; --c2: #ffcc4d; --c3: #7cf29a; --c4: #b98cff; --c5: #ff9f4d; --c6: #4dffd8; --c7: #ff7bf2; --glow: 0 0 40px; --shadow: 0 20px 60px rgba(0,0,0,.35); --font-display: 'Unbounded', 'Manrope', sans-serif; color-scheme: dark; }
[data-theme="neon"] { --bg: #050505; --bg2: #14001f; --bg3: #001a1a; --card: rgba(255,255,255,.06); --card2: rgba(255,255,255,.1); --line: rgba(255,255,255,.12); --fg: #fff; --muted: #9a9aa6; --accent: #39ff14; --accent2: #ff00e5; --gold: #ffee00; --ok: #39ff14; --bad: #ff2d55; --on-accent: #000; --opt-fg: #000;
  --c0: #ff00e5; --c1: #00f0ff; --c2: #ffee00; --c3: #39ff14; --c4: #b300ff; --c5: #ff7a00; --c6: #00ffb3; --c7: #ff2d55; --glow: 0 0 60px; --shadow: 0 20px 60px rgba(0,0,0,.5); --font-display: 'Unbounded', sans-serif; color-scheme: dark; }
[data-theme="ocean"] { --bg: #041a2e; --bg2: #073b5c; --bg3: #0b5f7a; --card: rgba(255,255,255,.07); --card2: rgba(255,255,255,.12); --line: rgba(255,255,255,.14); --fg: #f2fbff; --muted: #9dc3d6; --accent: #19c6d8; --accent2: #6ee7b7; --gold: #ffd166; --ok: #6ee7b7; --bad: #ff8080; --on-accent: #041a2e; --opt-fg: #041a2e;
  --c0: #19c6d8; --c1: #6ee7b7; --c2: #ffd166; --c3: #7aa7ff; --c4: #f78fb3; --c5: #ffa94d; --c6: #a5f3fc; --c7: #c4b5fd; --shadow: 0 20px 60px rgba(0,0,0,.35); --font-display: 'Unbounded', sans-serif; color-scheme: dark; }
[data-theme="sunset"] { --bg: #2a0a1e; --bg2: #6a1b3a; --bg3: #b8412a; --card: rgba(255,255,255,.07); --card2: rgba(255,255,255,.12); --line: rgba(255,255,255,.14); --fg: #fff6f0; --muted: #e6b8a8; --accent: #ff7a59; --accent2: #ffc45c; --gold: #ffd36e; --ok: #9ae66e; --bad: #ff6b6b; --on-accent: #2a0a1e; --opt-fg: #2a0a1e;
  --c0: #ff7a59; --c1: #ffc45c; --c2: #ff4f8b; --c3: #ffe08a; --c4: #f4a3ff; --c5: #ff9a3c; --c6: #ffb3c6; --c7: #c084fc; --shadow: 0 20px 60px rgba(0,0,0,.35); --font-display: 'Unbounded', sans-serif; color-scheme: dark; }
[data-theme="forest"] { --bg: #0d1f14; --bg2: #16402a; --bg3: #1f5e3a; --card: rgba(255,255,255,.07); --card2: rgba(255,255,255,.12); --line: rgba(255,255,255,.14); --fg: #f1faf3; --muted: #a9c9b3; --accent: #5ee39a; --accent2: #c7f464; --gold: #f5d76e; --ok: #5ee39a; --bad: #ff8a80; --on-accent: #0d1f14; --opt-fg: #0d1f14;
  --c0: #5ee39a; --c1: #c7f464; --c2: #f5d76e; --c3: #7dd3fc; --c4: #f9a8d4; --c5: #fdba74; --c6: #86efac; --c7: #a5b4fc; --shadow: 0 20px 60px rgba(0,0,0,.35); --font-display: 'Unbounded', sans-serif; color-scheme: dark; }
[data-theme="wedding"] { --bg: #fff8f3; --bg2: #ffe9dc; --bg3: #fbd3c1; --card: #fff; --card2: #fbefe7; --line: #efdcd0; --fg: #3a2520; --muted: #8c6a60; --accent: #c98a5b; --accent2: #d99a8f; --gold: #d4a94a; --ok: #3f9d6b; --bad: #d0554f; --on-accent: #fff; --opt-fg: #fff;
  --c0: #e0a9a0; --c1: #c98a5b; --c2: #d4a94a; --c3: #9fc5b4; --c4: #b8a4d6; --c5: #f0b48f; --c6: #8ec6d9; --c7: #e69ec4; --font-display: 'Literata', Georgia, serif; }
[data-theme="minimal"] { --bg: #ffffff; --bg2: #f4f4f7; --bg3: #ececf2; --card: #f7f7fa; --card2: #ececf2; --line: #e2e2ea; --fg: #111118; --muted: #666677; --accent: #2b2bff; --accent2: #111118; --gold: #e0a800; --ok: #1f9d55; --bad: #d92d20; --on-accent: #fff; --opt-fg: #fff;
  --c0: #2b2bff; --c1: #e0338b; --c2: #e0a800; --c3: #1f9d55; --c4: #7c3aed; --c5: #ea580c; --c6: #0891b2; --c7: #111118; }
[data-theme="candy"] { --bg: #fff1f7; --bg2: #ffe4f0; --bg3: #e4f0ff; --card: #fff; --card2: #fde8f2; --line: #f3d6e4; --fg: #2d1b4e; --muted: #7a6a94; --accent: #ff4fa3; --accent2: #6c5cff; --gold: #ffb020; --ok: #16b364; --bad: #ef4444; --on-accent: #fff; --opt-fg: #fff;
  --c0: #ff4fa3; --c1: #6c5cff; --c2: #ffb020; --c3: #16b364; --c4: #00b8d9; --c5: #ff7a45; --c6: #9b5cff; --c7: #ff5c5c; --font-display: 'Unbounded', sans-serif; }
[data-theme="retro"] { --bg: #f3e9d2; --bg2: #e8d7b4; --bg3: #d9bf8c; --card: #fbf5e6; --card2: #eee1c6; --line: #d9c9a8; --fg: #3b2a14; --muted: #7d6748; --accent: #d9662f; --accent2: #5c8a5a; --gold: #c9962b; --ok: #5c8a5a; --bad: #b3372f; --on-accent: #fff; --opt-fg: #fff;
  --c0: #d9662f; --c1: #5c8a5a; --c2: #c9962b; --c3: #4e7ba6; --c4: #a3466b; --c5: #e0a04a; --c6: #6f8f6d; --c7: #8b5a3c; --font-display: 'Literata', Georgia, serif; }
[data-theme="midnight"] { --bg: #05070d; --bg2: #0b1224; --bg3: #101c3a; --card: rgba(255,255,255,.06); --card2: rgba(255,255,255,.1); --line: rgba(255,255,255,.12); --fg: #e8eefc; --muted: #8b98b8; --accent: #3b82f6; --accent2: #22d3ee; --gold: #fbbf24; --ok: #34d399; --bad: #f87171; --on-accent: #05070d; --opt-fg: #05070d;
  --c0: #3b82f6; --c1: #22d3ee; --c2: #fbbf24; --c3: #34d399; --c4: #a78bfa; --c5: #fb923c; --c6: #67e8f9; --c7: #f472b6; --shadow: 0 20px 60px rgba(0,0,0,.4); --font-display: 'Unbounded', sans-serif; color-scheme: dark; }
[data-theme="birthday"] { --bg: #fffbea; --bg2: #ffe5a3; --bg3: #ffd1e3; --card: #fff; --card2: #fff3cc; --line: #f6e2a8; --fg: #3b2a00; --muted: #8a6d2a; --accent: #ff5f8f; --accent2: #7c3aed; --gold: #ffb020; --ok: #16b364; --bad: #ef4444; --on-accent: #fff; --opt-fg: #fff;
  --c0: #ff5f8f; --c1: #7c3aed; --c2: #ffb020; --c3: #16b364; --c4: #00b8d9; --c5: #ff7a45; --c6: #f43f5e; --c7: #3b82f6; --font-display: 'Unbounded', sans-serif; }
[data-theme="newyear"] { --bg: #06132b; --bg2: #0e2a5a; --bg3: #143a70; --card: rgba(255,255,255,.07); --card2: rgba(255,255,255,.12); --line: rgba(255,255,255,.16); --fg: #f4f8ff; --muted: #a9bde0; --accent: #ffd36e; --accent2: #7dd3fc; --gold: #ffd36e; --ok: #86efac; --bad: #fda4af; --on-accent: #06132b; --opt-fg: #06132b;
  --c0: #ffd36e; --c1: #7dd3fc; --c2: #f472b6; --c3: #86efac; --c4: #c4b5fd; --c5: #fb923c; --c6: #ffffff; --c7: #38bdf8; --glow: 0 0 40px; --shadow: 0 20px 60px rgba(0,0,0,.4); --font-display: 'Unbounded', sans-serif; color-scheme: dark; }
[data-theme="corporate"] { --bg: #f5f7fb; --bg2: #e3ebfb; --bg3: #eef2f8; --card: #fff; --card2: #eef2f8; --line: #dce3ef; --fg: #10203a; --muted: #5d6b84; --accent: #1d4ed8; --accent2: #0891b2; --gold: #d99a06; --ok: #15803d; --bad: #dc2626; --on-accent: #fff; --opt-fg: #fff;
  --c0: #1d4ed8; --c1: #0891b2; --c2: #d99a06; --c3: #15803d; --c4: #6d28d9; --c5: #ea580c; --c6: #0f766e; --c7: #be185d; }

/* акцент поверх темы */
[data-accent="gold"] { --accent: #e9a92b; --accent2: #f5c65d; --on-accent: #1a1400; }
[data-accent="cyan"] { --accent: #0aa3b8; --accent2: #5fd2e2; --on-accent: #fff; }
[data-accent="pink"] { --accent: #ef4d7f; --accent2: #ff8fb0; --on-accent: #fff; }
[data-accent="lime"] { --accent: #7cc32c; --accent2: #b9e66b; --on-accent: #1a2500; }
[data-accent="violet"] { --accent: #7c5cff; --accent2: #b9a4ff; --on-accent: #fff; }
[data-accent="orange"] { --accent: #f0722a; --accent2: #ffab6b; --on-accent: #fff; }
[data-accent="red"] { --accent: #e5484d; --accent2: #ff8a8e; --on-accent: #fff; }
[data-accent="white"] { --accent: #ffffff; --accent2: #dddddd; --on-accent: #111; }
[data-accent="custom"] { --accent: var(--brand, #5b5cf0); --accent2: color-mix(in srgb, var(--brand, #5b5cf0) 70%, #fff); --on-accent: #fff; }

[data-font="display"] { --font: 'Unbounded', 'Manrope', sans-serif; --font-display: 'Unbounded', 'Manrope', sans-serif; }
[data-font="serif"] { --font: 'Literata', Georgia, serif; --font-display: 'Literata', Georgia, serif; }
[data-font="mono"] { --font: 'JetBrains Mono', ui-monospace, Menlo, monospace; --font-display: 'JetBrains Mono', ui-monospace, monospace; }
[data-font="system"] { --font: -apple-system, 'Segoe UI', Roboto, sans-serif; --font-display: -apple-system, 'Segoe UI', Roboto, sans-serif; }
[data-corners="round"] { --r-s: 18px; --r-m: 28px; --r-l: 40px; }
[data-corners="sharp"] { --r-s: 3px; --r-m: 4px; --r-l: 6px; --r-pill: 6px; }
[data-scale="s"] { --scale: .85; } [data-scale="l"] { --scale: 1.2; } [data-scale="xl"] { --scale: 1.45; }
[data-intensity="off"] { --dur: 0; } [data-intensity="calm"] { --dur: 1.6; } [data-intensity="party"] { --dur: .7; }
@media (prefers-reduced-motion: reduce) { :root { --dur: 0; } }

/* ---------- база ---------- */
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); min-height: 100dvh; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; background: radial-gradient(900px 600px at 10% -10%, var(--bg2), transparent 60%), radial-gradient(800px 600px at 110% 110%, var(--bg3), transparent 55%), var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.015em; }
h1 { font-size: 30px; font-weight: 800; font-family: var(--font-display); }
h2 { font-size: 21px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
p { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 60px; }
.narrow { max-width: 460px; }

/* шапка приложения */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; margin-bottom: 22px; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--font-display); font-weight: 900; font-size: 21px; color: var(--fg); letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 9px; }
.brand:hover { text-decoration: none; }
.brand i { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: inline-block; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.topbar nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.topbar nav .muted { padding: 0 6px; }

/* заголовок страницы */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 20px; }
.pagehead p { margin-top: 4px; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: 14px; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 9px 14px; cursor: pointer; transition: transform .08s, background .2s, opacity .2s, box-shadow .2s, border-color .2s; text-decoration: none !important; white-space: nowrap; box-shadow: var(--shadow-s); }
.btn:hover { border-color: color-mix(in srgb, var(--fg) 20%, var(--line)); background: var(--card2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.gold { background: var(--gold); color: #1a1400; border-color: transparent; }
.btn.danger { background: transparent; border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); box-shadow: none; }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--card2); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.big { padding: 14px 22px; font-size: 16px; border-radius: var(--r-m); }
.btn.block { width: 100%; }
.btn.icon-only { padding: 8px; }

/* поля */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=color], textarea, select { font: inherit; font-size: 15px; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; width: 100%; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
textarea { resize: vertical; min-height: 70px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type=color] { padding: 4px; height: 40px; width: 60px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; cursor: pointer; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 21px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* карточки и списки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px; box-shadow: var(--shadow-s); }
.card + .card { margin-top: 12px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-s); background: var(--card); border: 1px solid var(--line); transition: box-shadow .2s, border-color .2s; }
.item:hover { box-shadow: var(--shadow-s); border-color: color-mix(in srgb, var(--fg) 15%, var(--line)); }
.item .title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: transform .15s, box-shadow .2s; box-shadow: var(--shadow-s); }
.qcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.qcard .cover { height: 80px; border-radius: var(--r-s); background: linear-gradient(135deg, var(--c-a, var(--accent)), var(--c-b, var(--accent2))); display: flex; align-items: flex-end; padding: 10px; color: #fff; font-weight: 800; gap: 6px; }
.qcard .cover .ic { width: 20px; height: 20px; }
.qcard .title { font-weight: 800; font-size: 16px; }
.qcard .meta { font-size: 13px; color: var(--muted); }
.qcard .actions { margin-top: auto; justify-content: flex-start; }
.tabs { display: flex; gap: 4px; background: var(--card2); padding: 4px; border-radius: var(--r-s); width: max-content; max-width: 100%; overflow: auto; }
.tabs button, .tabs a { font: inherit; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; text-decoration: none !important; display: inline-flex; align-items: center; gap: 6px; }
.tabs .on { background: var(--card); color: var(--fg); box-shadow: var(--shadow-s); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px 14px; }
.stats b { display: block; font-size: 22px; font-family: var(--font-display); }
.stats span { font-size: 12px; color: var(--muted); }
.searchbox { position: relative; }
.searchbox .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbox input { padding-left: 38px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.hidden { display: none !important; }
.err { color: var(--bad); font-size: 14px; min-height: 18px; margin-top: 6px; }
.ok { color: var(--ok); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: var(--r-pill); background: var(--card2); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tag.live { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.tag.lobby { background: color-mix(in srgb, var(--gold) 20%, transparent); color: #8a5a00; }
.tag.type { text-transform: none; letter-spacing: 0; font-size: 12px; background: color-mix(in srgb, var(--tc, var(--accent)) 14%, transparent); color: var(--tc, var(--accent)); }
.code { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-weight: 800; letter-spacing: .12em; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-m); background: var(--card); }
.empty .ic.xl { color: var(--accent); margin-bottom: 8px; }
.kbd, kbd { background: var(--card2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; font-family: inherit; font-size: 12px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--fg); color: var(--bg); font-weight: 700; padding: 12px 18px; border-radius: var(--r-s); box-shadow: var(--shadow); opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; }
.toast.bad { background: var(--bad); color: #fff; }
.status { position: fixed; bottom: 10px; left: 14px; font-size: 12px; color: var(--bad); z-index: 40; }

/* ---------- столбики ---------- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar { display: grid; gap: 4px; }
.bar .label { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }
.bar .label .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .label .num { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar .track { height: 14px; background: color-mix(in srgb, var(--fg) 8%, transparent); border-radius: var(--r-pill); overflow: hidden; }
.bar .fill { height: 100%; width: 0; border-radius: var(--r-pill); background: var(--bar-color, var(--accent)); transition: width calc(.7s * var(--dur)) cubic-bezier(.2,.9,.3,1.1); }
[data-bar-anim="bounce"] .bar .fill { transition-timing-function: cubic-bezier(.2,1.4,.4,1); }
[data-bar-anim="race"] .bar:nth-child(2) .fill { transition-delay: calc(.15s * var(--dur)); } [data-bar-anim="race"] .bar:nth-child(3) .fill { transition-delay: calc(.3s * var(--dur)); } [data-bar-anim="race"] .bar:nth-child(4) .fill { transition-delay: calc(.45s * var(--dur)); } [data-bar-anim="race"] .bar:nth-child(n+5) .fill { transition-delay: calc(.6s * var(--dur)); }
[data-bar-anim="none"] .bar .fill { transition: none; }
[data-bar-style="flat"] .bar .track, [data-bar-style="flat"] .bar .fill { border-radius: 2px; }
[data-bar-style="gradient"] .bar .fill { background: linear-gradient(90deg, color-mix(in srgb, var(--bar-color, var(--accent)) 60%, #fff 0%), var(--bar-color, var(--accent))); }
[data-bar-style="striped"] .bar .fill { background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.25) 0 8px, transparent 8px 16px); background-color: var(--bar-color, var(--accent)); }
[data-bar-style="glow"] .bar .fill { box-shadow: 0 0 24px var(--bar-color, var(--accent)); }
.bar.correct .name::before { content: "✓ "; color: var(--ok); }
.bar.wrong { opacity: .5; }
[data-reveal="fade"] .bar.wrong { opacity: .18; }
[data-reveal="shake"] .bar.wrong { animation: shake calc(.6s * var(--dur)) both; }
[data-reveal="spotlight"] .bar.correct { transform: scale(1.03); transform-origin: left; filter: drop-shadow(0 0 20px var(--ok)); }
[data-reveal="none"] .bar.wrong { opacity: 1; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }

.dialog-backdrop { position: fixed; inset: 0; background: rgba(23,26,46,.45); display: grid; place-items: center; z-index: 60; padding: 16px; backdrop-filter: blur(3px); }
.dialog { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; width: 100%; max-width: 440px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.dialog.wide { max-width: 760px; }

/* ---------- иконки ---------- */
.ic { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex-shrink: 0; }
.ic.lg { width: 1.6em; height: 1.6em; }
.ic.xl { width: 2.4em; height: 2.4em; }
.btn .ic { width: 1.1em; height: 1.1em; }
.iconbox { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-s); background: color-mix(in srgb, var(--tc, var(--accent)) 14%, transparent); color: var(--tc, var(--accent)); flex-shrink: 0; }
.iconbox .ic { width: 22px; height: 22px; }
.team-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--tc) 16%, transparent); color: var(--tc); font-weight: 700; font-size: .85em; border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); }

/* ---------- общие анимации ---------- */
@keyframes pop { from { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.06); } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drop { from { transform: translateY(-60px); opacity: 0; } 60% { transform: translateY(8px); } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideRight { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes zoomIn { from { transform: scale(1.15); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flipIn { from { transform: perspective(1200px) rotateY(-70deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes blurIn { from { filter: blur(20px); opacity: 0; } to { filter: none; opacity: 1; } }
@keyframes glowIn { 0% { opacity: 0; filter: brightness(3) blur(6px); } 40% { opacity: 1; filter: brightness(2) blur(0); } 100% { opacity: 1; filter: none; } }
@keyframes pulse { 50% { transform: scale(1.08); } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-12px) rotate(1deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes marquee { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
@keyframes glowLoop { to { filter: brightness(1.4); } }

/* Карточки выбора (формат игры, режим запуска) */
.fmtgrid { display: grid; gap: 8px; }
.fmtcard { font: inherit; text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 12px; border-radius: var(--r-m); border: 2px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }
.fmtcard:hover { border-color: var(--accent); }
.fmtcard .iconbox { grid-row: span 2; }
.fmtcard b { font-size: 15px; }
.fmtcard span:not(.iconbox) { font-size: 13px; color: var(--muted); }
