/* Квизбум — дизайн-система: светлая, плоская, без теней и свечения */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f8;
  --surface: #ffffff;
  --border: #e4e4e9;
  --border-strong: #cfcfd7;
  --text: #121216;
  --muted: #676774;
  --primary: #2b59ff;
  --primary-hover: #1d46e0;
  --primary-soft: #edf1ff;
  --on-primary: #ffffff;
  --ok: #1e9e57;
  --ok-soft: #e7f6ed;
  --bad: #e03e45;
  --bad-soft: #fdeced;
  --warn: #b86e00;
  --warn-soft: #fff4dc;
  --a0: #e5484d;
  --a1: #2f6fed;
  --a2: #f2a516;
  --a3: #2ea866;
  --a4: #8e4ec6;
  --a5: #0f9f9a;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

/* Темы квиза меняют только фирменный цвет; «Тёмная» — для проектора */
[data-theme='coral'] { --primary: #e8590c; --primary-hover: #c94a07; --primary-soft: #fff1e8; }
[data-theme='teal'] { --primary: #0d8f87; --primary-hover: #0a766f; --primary-soft: #e6f6f5; }
[data-theme='green'] { --primary: #2b8a3e; --primary-hover: #237233; --primary-soft: #ebf6ed; }
[data-theme='grape'] { --primary: #9c36b5; --primary-hover: #832c99; --primary-soft: #f7ebfa; }
[data-theme='dark'] {
  --bg: #111114; --bg-soft: #18181c; --surface: #1c1c21; --border: #2c2c33; --border-strong: #3a3a43;
  --text: #f2f2f5; --muted: #9d9daa; --primary: #4f7bff; --primary-hover: #6a8fff; --primary-soft: #1d2440;
  --ok-soft: #13301f; --bad-soft: #3a1a1c; --warn-soft: #3a2c10;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* --- Типографика --- */
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); letter-spacing: -0.025em; }
h3 { font-size: 1.125rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 0.8125rem; font-weight: 600; color: var(--primary); letter-spacing: 0.02em; }

/* --- Иконки --- */
.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 28px; height: 28px; }

/* --- Лого --- */
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.04em; }
.logo:hover { text-decoration: none; }
.logo .mark { width: 28px; height: 28px; flex: none; }

/* --- Шапка и футер --- */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 30; }
.site-header .inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.site-header nav { display: flex; gap: 22px; }
.site-header nav a { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--text); text-decoration: none; }
.site-header .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--muted); font-size: 0.9rem; }
.site-footer .inner { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: var(--muted); }

/* --- Кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 0.95rem; white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--bg-soft); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: var(--border-strong); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.lg { height: 52px; padding: 0 24px; font-size: 1.05rem; border-radius: 10px; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 0.875rem; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }

/* --- Поля --- */
.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border-strong); outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea.input { height: auto; padding: 10px 14px; resize: vertical; min-height: 84px; }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23676774' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder { color: #a3a3ad; }
label.field { display: grid; gap: 6px; }
label.field > span, .label { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.hint { font-size: 0.8125rem; color: var(--muted); }

/* --- Блоки --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card.soft { background: var(--bg-soft); border-color: transparent; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px; background: var(--bg-soft); color: var(--text); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.tag.primary { background: var(--primary-soft); color: var(--primary); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* --- Варианты ответа: плоский цвет + фигура --- */
.answers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.answers.n3, .answers.n5, .answers.n6 { grid-template-columns: repeat(3, 1fr); }
.ans {
  --c: var(--a0);
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 18px;
  border-radius: var(--radius); border: 0; background: var(--c); color: #fff; text-align: left;
  font-weight: 600; font-size: clamp(1rem, 1.8vw, 1.25rem); line-height: 1.3; cursor: pointer; overflow: hidden;
  transition: filter 0.12s, opacity 0.2s, transform 0.08s;
}
button.ans:hover { filter: brightness(0.94); }
button.ans:active { transform: scale(0.985); }
.ans .shape { width: 26px; height: 26px; flex: none; fill: currentColor; }
.ans img.opt-img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.ans .count { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; }
.ans .check { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--c); display: grid; place-items: center; flex: none; position: relative; }
.ans .check .i { stroke-width: 3; width: 18px; height: 18px; }
.ans.a1 { --c: var(--a1); }
.ans.a2 { --c: var(--a2); color: #2b1d00; }
.ans.a3 { --c: var(--a3); } .ans.a4 { --c: var(--a4); } .ans.a5 { --c: var(--a5); }
.ans.dim { opacity: 0.3; }
.ans.selected { box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.95), inset 0 0 0 6px rgba(0, 0, 0, 0.25); }
.ans .bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0, 0, 0, 0.12); transition: width 0.7s ease-out; }
.ans > :not(.bar) { position: relative; }

.ans { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12); }
.ans .lbl { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 1rem; background: rgba(255, 255, 255, 0.22); }
.ans.a2 .lbl { background: rgba(0, 0, 0, 0.1); }

/* --- Оформление квиза: атрибуты на <html> из настроек квиза --- */
/* Палитры ответов */
[data-palette='pastel'] { --a0: #f28b8b; --a1: #7ea6f2; --a2: #f5c46b; --a3: #79c99a; --a4: #b392db; --a5: #6cc4bf; }
[data-palette='bright'] { --a0: #ff3b5c; --a1: #0a84ff; --a2: #ffb800; --a3: #00c16a; --a4: #a54dff; --a5: #00b8d9; }
[data-palette='earth'] { --a0: #b5523b; --a1: #3e6a8a; --a2: #d19a3a; --a3: #5b7f4a; --a4: #7a5c8e; --a5: #3d8a80; }
[data-palette='mono'] { --a0: var(--primary); --a1: var(--primary); --a2: var(--primary); --a3: var(--primary); --a4: var(--primary); --a5: var(--primary); }
/* Белый текст на третьей кнопке нужен только для заливки: у остальных стилей фон светлый */
[data-palette='mono']:not([data-buttons='soft'], [data-buttons='outline'], [data-buttons='card']) .ans.a2 { color: #fff; }
[data-palette='mono']:not([data-buttons='soft'], [data-buttons='outline'], [data-buttons='card']) .ans.a2 .lbl { background: rgba(255, 255, 255, 0.22); }
[data-palette='mono'] .ans.dim { opacity: 0.25; }

/* Стили кнопок */
[data-buttons='soft'] .ans { background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--text); box-shadow: none; }
[data-buttons='soft'] .ans .shape { fill: var(--c); }
[data-buttons='soft'] .ans .lbl { background: var(--c); color: #fff; }
[data-buttons='outline'] .ans { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 2px var(--c); }
[data-buttons='outline'] .ans .shape { fill: var(--c); }
[data-buttons='outline'] .ans .lbl { background: var(--c); color: #fff; }
[data-buttons='card'] .ans { background: var(--surface); color: var(--text); box-shadow: inset 6px 0 0 var(--c), inset 0 0 0 1px var(--border); padding-left: 24px; }
[data-buttons='card'] .ans .shape { fill: var(--c); }
[data-buttons='card'] .ans .lbl { background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--c); }
[data-buttons='soft'] .ans .check, [data-buttons='outline'] .ans .check, [data-buttons='card'] .ans .check { background: var(--c); color: #fff; }
[data-buttons='soft'] .ans.selected, [data-buttons='outline'] .ans.selected, [data-buttons='card'] .ans.selected { box-shadow: inset 0 0 0 3px var(--c); background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
[data-buttons='soft'] .ans .bar, [data-buttons='outline'] .ans .bar, [data-buttons='card'] .ans .bar { background: color-mix(in srgb, var(--c) 18%, transparent); }

/* Углы */
[data-radius='square'] .ans, [data-radius='square'] .ans .lbl { border-radius: 3px; }
[data-radius='pill'] .ans { border-radius: 999px; padding-left: 22px; padding-right: 22px; }
[data-radius='pill'] .ans .lbl { border-radius: 50%; }

/* Расположение */
[data-layout='list'] .answers { grid-template-columns: 1fr !important; }
[data-layout='list'] .ans { min-height: 64px; }

/* Шрифты */
[data-font='serif'] body, .design-scope[data-font='serif'] { font-family: 'PT Serif', Georgia, serif; }
[data-font='rounded'] body, .design-scope[data-font='rounded'] { font-family: 'Nunito', var(--font); }
[data-font='mono'] body, .design-scope[data-font='mono'] { font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: -0.01em; }
.design-scope { color: var(--text); background: var(--bg-soft); }

/* Сегментированный выбор */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--border); }
.seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-weight: 500; font-size: 0.875rem; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--border); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs button { height: 44px; padding: 0 14px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
[data-font='serif'] .btn, [data-font='rounded'] .btn, [data-font='mono'] .btn,
[data-font='serif'] .site-header, [data-font='rounded'] .site-header, [data-font='mono'] .site-header { font-family: var(--font); }

/* --- Таймер --- */
.timer { position: relative; width: 84px; height: 84px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 7; }
.timer .track { stroke: var(--border); }
.timer .prog { stroke: var(--primary); stroke-linecap: round; transition: stroke 0.2s; }
.timer.low .prog { stroke: var(--bad); }
.timer .num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer.low .num { color: var(--bad); }
.progressbar { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.progressbar > i { display: block; height: 100%; background: var(--primary); transition: width 0.3s; }

/* --- Медиа --- */
.media { border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); border: 1px solid var(--border); display: grid; place-items: center; max-height: 46vh; }
.media img, .media video { max-height: 46vh; width: auto; object-fit: contain; }

/* --- Игроки --- */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: var(--bg-soft); border: 1px solid var(--border); flex: none; }
.avatar.xl { width: 88px; height: 88px; font-size: 48px; }
.avatar { overflow: hidden; color: var(--muted); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .i { width: 55%; height: 55%; }
.player-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; animation: appear 0.2s ease-out both; }
.player-chip .avatar { width: 32px; height: 32px; font-size: 18px; border: 0; }
.player-chip.off { opacity: 0.45; }
.player-chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; display: grid; place-items: center; border-radius: 4px; }
.player-chip button:hover { color: var(--bad); background: var(--bad-soft); }

/* --- Рейтинг --- */
.board { display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 40px 40px 1fr auto auto; align-items: center; gap: 12px;
  height: 60px; padding: 0 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  font-weight: 600; transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.row .place { font-weight: 700; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .place.r1 { color: #b8860b; } .row .place.r2 { color: #6b7280; } .row .place.r3 { color: #a0522d; }
.row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .score { font-weight: 700; font-variant-numeric: tabular-nums; }
.row .delta { font-size: 0.8125rem; min-width: 36px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .delta.up { color: var(--ok); } .row .delta.down { color: var(--bad); }
.row.me { background: var(--primary-soft); border-color: var(--primary); }
.row.out { opacity: 0.5; }
.streak { display: inline-flex; align-items: center; gap: 2px; color: var(--warn); font-size: 0.8125rem; font-weight: 700; margin-left: 6px; }
.streak .i { width: 14px; height: 14px; }

/* --- Пьедестал --- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; min-height: 360px; }
.podium .step { display: flex; flex-direction: column; align-items: center; gap: 10px; width: clamp(110px, 20vw, 200px); }
.podium .who { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; animation: appear 0.4s ease-out both; }
.podium .who .name { font-weight: 700; font-size: 1.125rem; word-break: break-word; }
.podium .who .pts { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.podium .block { width: 100%; border-radius: 10px 10px 0 0; display: grid; place-items: start center; padding-top: 14px; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; color: rgba(0, 0, 0, 0.55); transform-origin: bottom; animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.podium .p1 .block { height: 220px; background: #f5c542; animation-delay: 1.2s; }
.podium .p2 .block { height: 160px; background: #d3d7de; animation-delay: 0.7s; }
.podium .p3 .block { height: 115px; background: #e3a26f; animation-delay: 0.2s; }
.podium .p1 .who { animation-delay: 1.8s; } .podium .p2 .who { animation-delay: 1.3s; } .podium .p3 .who { animation-delay: 0.8s; }
.podium .p1 .avatar { border: 3px solid #f5c542; }
@keyframes rise { from { transform: scaleY(0); } }

/* --- Тосты --- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(92vw, 400px); }
.toast { padding: 12px 16px; border-radius: 10px; background: #121216; color: #fff; font-weight: 500; font-size: 0.95rem; animation: appear 0.2s ease-out both; display: flex; gap: 10px; align-items: center; }
.toast.err::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #ff6b70; flex: none; }
.toast.ok::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #3ecf7c; flex: none; }

/* --- Выбор из карточек и переключатели --- */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.choice { display: grid; gap: 4px; padding: 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); cursor: pointer; text-align: left; transition: border-color 0.12s, background 0.12s; }
.choice:hover { border-color: var(--muted); }
.choice.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice .i { color: var(--primary); margin-bottom: 4px; }
.choice b { font-weight: 600; }
.choice small { color: var(--muted); line-height: 1.35; font-size: 0.8125rem; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; cursor: pointer; }
.toggle + .toggle { border-top: 1px solid var(--border); }
.toggle input { appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; transition: background 0.15s; flex: none; margin: 0; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle input:checked { background: var(--primary); }
.toggle input:checked::after { transform: translateX(16px); }

/* --- Живые кнопки: подъём при наведении, волна от клика --- */
.btn, .ans, .choice { position: relative; overflow: hidden; }
.btn { transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.15s; }
.btn:not(:disabled):not(.ghost):hover { transform: translateY(-2px); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn:not(:disabled):active { transform: translateY(0) scale(0.97); box-shadow: none; }
button.ans:not(:disabled):hover { transform: translateY(-2px); }
.choice { transition: border-color 0.12s, background 0.12s, transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1); }
.choice:hover { transform: translateY(-2px); }
.choice.on .i { animation: wiggle 0.4s; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: 0.18; transform: scale(0); animation: ripple 0.6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
@keyframes wiggle { 30% { transform: rotate(-12deg) scale(1.15); } 60% { transform: rotate(8deg); } }
.logo .mark rect { transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); transform-box: fill-box; transform-origin: center; }
.logo:hover .mark rect:nth-of-type(1) { transform: rotate(-12deg) scale(0.9); }
.logo:hover .mark rect:nth-of-type(2) { transform: translateY(-2px) scale(1.08); }
.logo:hover .mark rect:nth-of-type(3) { transform: rotate(10deg) scale(0.92); }
.logo:hover .mark rect:nth-of-type(4) { transform: translateX(2px) rotate(-6deg); }
.toggle input { transition: background 0.2s; }
.toggle input::after { transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); }
.pop { animation: pop 0.45s cubic-bezier(0.3, 1.7, 0.5, 1) both; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.bounce { animation: bounce 0.8s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes bounce { 30% { transform: translateY(-14px) scale(1.06); } 60% { transform: translateY(0) scale(0.97); } }
.stagger > * { animation: appear 0.35s ease-out both; }
.stagger > *:nth-child(2) { animation-delay: 0.04s; } .stagger > *:nth-child(3) { animation-delay: 0.08s; }
.stagger > *:nth-child(4) { animation-delay: 0.12s; } .stagger > *:nth-child(5) { animation-delay: 0.16s; }
.stagger > *:nth-child(6) { animation-delay: 0.2s; } .stagger > *:nth-child(n+7) { animation-delay: 0.24s; }

/* --- Правила перед игрой --- */
.rules-back { position: fixed; inset: 0; z-index: 90; background: rgba(18, 18, 22, 0.55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: appear 0.2s ease-out; transition: opacity 0.2s; }
.rules-back.closing { opacity: 0; }
.rules { max-width: 440px; width: 100%; display: grid; gap: 16px; }
.rules .ic { width: 56px; height: 56px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.rules .ic .i { width: 28px; height: 28px; }
.checklist { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.checklist li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; }
.checklist .i { color: var(--ok); margin-top: 2px; }
.checklist b { display: block; }
.checklist span { color: var(--muted); font-size: 0.9375rem; }

/* --- Меню аккаунта --- */
.menu { position: relative; }
.menu-btn { padding: 0 8px 0 4px; gap: 8px; }
.menu-btn .avatar { font-size: 0.85rem; font-weight: 700; background: var(--primary); color: #fff; border: 0; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.25); padding: 6px; z-index: 50; display: grid; animation: appear 0.15s ease-out; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 8px; color: var(--text); font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--bg-soft); text-decoration: none; }
.menu-head { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
@media (max-width: 560px) { .menu-name { display: none; } }

/* --- Элементы новых заданий --- */
.blank-slot { display: inline-block; min-width: 3.5em; height: 0.9em; border-bottom: 3px solid var(--primary); margin: 0 0.15em; vertical-align: baseline; }
.match-rows { display: grid; gap: 8px; }
.match-row { display: grid; grid-template-columns: 1fr auto 1.2fr; gap: 10px; align-items: center; padding: 8px 8px 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; }
.match-row .i { color: var(--muted); }
.match-row select { height: 44px; }
.match-row.ok { border-color: var(--ok); background: var(--ok-soft); }
.slider-box { display: grid; gap: 14px; text-align: center; }
.slider-box .val { font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 99px; background: var(--border); outline: none; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); cursor: grab; transition: transform 0.15s; }
input[type='range']::-webkit-slider-thumb:active { transform: scale(1.15); cursor: grabbing; }
input[type='range']::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); border: 4px solid #fff; cursor: grab; }
.slider-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.hotspot { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-soft); touch-action: manipulation; user-select: none; }
.hotspot img { width: 100%; max-height: 60vh; object-fit: contain; display: block; }
.hotspot.pick { cursor: crosshair; }
.hotspot .pin { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--primary); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); animation: pop 0.3s cubic-bezier(0.3, 1.7, 0.5, 1); pointer-events: none; }
.hotspot .dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--bad); border: 2px solid #fff; opacity: 0.85; pointer-events: none; }
.hotspot .dot.ok { background: var(--ok); }
.hotspot .target { position: absolute; border-radius: 50%; border: 3px solid var(--ok); background: color-mix(in srgb, var(--ok) 22%, transparent); transform: translate(-50%, -50%); pointer-events: none; animation: pop 0.5s cubic-bezier(0.3, 1.7, 0.5, 1); }
.stars { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.stars button { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; color: var(--muted); transition: transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1), background 0.12s, color 0.12s; }
.stars button .i { width: 30px; height: 30px; }
.stars button:hover, .stars button.hl { transform: scale(1.1); color: #f2a516; border-color: #f2a516; background: #fff7e0; }
.stars.ten button { width: 46px; height: 46px; }
.stars.ten button:hover, .stars.ten button.hl { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.875rem; }
.cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 16px; padding: 12px; }
.cloud span { font-weight: 700; line-height: 1.1; animation: pop 0.5s cubic-bezier(0.3, 1.7, 0.5, 1) both; }
.rating-bars { display: grid; gap: 6px; }
.rating-bars .rb { display: grid; grid-template-columns: 40px 1fr 40px; gap: 10px; align-items: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.rating-bars .rb i { display: block; height: 22px; border-radius: 6px; background: var(--primary); transition: width 0.7s ease-out; }

/* --- Состояния: иконка в круге + заголовок + текст --- */
.state { display: grid; gap: 10px; justify-items: center; text-align: center; }
.state .ic { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted); }
.state .ic .i { width: 28px; height: 28px; }
.state .ic.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.state .ic.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.state .ic.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

/* --- Утилиты --- */
.wrap { width: min(1160px, 100%); margin: 0 auto; padding: 0 20px; }
.stack { display: grid; gap: 16px; }
.hstack { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.center { display: grid; place-items: center; text-align: center; }
.fill { min-height: 100dvh; display: flex; flex-direction: column; }
.fade-in { animation: appear 0.25s ease-out both; }
@keyframes appear { from { opacity: 0; transform: translateY(6px); } }
.shake { animation: shake 0.35s; }
@keyframes shake { 25%, 75% { transform: translateX(-6px); } 50% { transform: translateX(6px); } }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }

@media (max-width: 720px) {
  .site-header nav { display: none; }
  .answers, .answers.n3, .answers.n5, .answers.n6 { grid-template-columns: 1fr; }
  .row { grid-template-columns: 30px 36px 1fr auto; padding: 0 12px; gap: 10px; }
  .row .delta { display: none; }
  .card { padding: 18px; }
  .podium { min-height: 280px; gap: 6px; }
  .podium .p1 .block { height: 160px; } .podium .p2 .block { height: 115px; } .podium .p3 .block { height: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
