* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: var(--cp-bg); color: var(--cp-text); font-family: "Segoe UI", Aptos, Calibri, -apple-system, BlinkMacSystemFont, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: var(--cp-highlight); }
button:focus-visible, input:focus-visible { outline: 3px solid var(--cp-accent); outline-offset: 5px; }
[hidden] { display: none !important; }
button:disabled { cursor: default; }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; background-image: linear-gradient(var(--cp-border) 1px, transparent 1px), linear-gradient(90deg, var(--cp-border) 1px, transparent 1px); background-size: 64px 64px; opacity: .28; }
.scenery { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.scenery span { position: absolute; font-size: 100px; color: var(--cp-accent); opacity: .14; animation: drift 8s ease-in-out infinite; font-weight: 900; }
.scenery span:nth-child(1) { top: 14%; left: 5%; transform: rotate(-15deg); }
.scenery span:nth-child(2) { top: 60%; left: 7%; animation-delay: -3s; color: var(--cp-warning); }
.scenery span:nth-child(3) { top: 30%; right: 6%; animation-delay: -5s; color: var(--cp-link); }
.scenery span:nth-child(4) { bottom: 12%; right: 8%; animation-delay: -2s; color: var(--cp-success); }
.scenery span:nth-child(5) { top: 5%; left: 60%; font-size: 60px; }
.scenery span:nth-child(6) { bottom: 4%; left: 35%; font-size: 72px; animation-delay: -4s; }
header { max-width: 1400px; margin: auto; padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand, .hud { display: flex; align-items: center; gap: 12px; }
.logo { background: var(--cp-accent); color: var(--cp-accent-fg); border-radius: 10px; padding: 8px; font-size: 20px; font-weight: 950; transform: rotate(-7deg); box-shadow: 0 4px 0 var(--cp-accent-hover); }
.brand strong { font-size: 15px; font-weight: 900; letter-spacing: -.4px; }
.brand strong span { color: var(--cp-accent); }
.badge { display: inline-block; background: var(--cp-surface); border: 2px solid var(--cp-border); color: var(--cp-text); padding: 8px 16px; border-radius: 10px; font-size: 12px; font-weight: 800; letter-spacing: .8px; }
.icon-button { background: var(--cp-surface); color: var(--cp-text); border: 2px solid var(--cp-border); border-radius: 10px; font-size: 24px; width: 40px; height: 40px; }
.admin-link { color: var(--cp-accent); font-size: 12px; font-weight: 800; text-decoration: none; }
.quiz-picker { margin: 0 auto 16px; max-width: 520px; display: flex; align-items: center; gap: 12px; }
.quiz-picker label { font-size: 10px; font-weight: 900; white-space: nowrap; color: var(--cp-text-muted); }
.quiz-picker select { width: 100%; min-width: 0; font: inherit; font-size: 12px; font-weight: 700; padding: 10px 12px; border: 2px solid var(--cp-border); border-radius: 10px; background: var(--cp-surface); color: var(--cp-text); }
main { max-width: 1060px; margin: auto; padding: 8px 28px 32px; min-height: calc(100svh - 150px); display: grid; align-items: center; }
section { width: 100%; animation: enter .28s ease-out; }
h1 { font-weight: 950; font-size: clamp(28px, 4vw, 48px); letter-spacing: -1.5px; line-height: 1.12; margin: 12px 0; }
h2 { font-size: 20px; }
p { line-height: 1.5; }
.muted { color: var(--cp-text-muted); }
.center { text-align: center; }
.arena-title { text-align: center; }
.arena-title .badge { transform: rotate(-2deg); background: var(--cp-accent); color: var(--cp-accent-fg); border-color: var(--cp-accent); }
.arena-title h1 { font-size: clamp(44px, 7.5vw, 84px); font-weight: 950; letter-spacing: -3px; line-height: .97; margin: 22px 0 16px; }
.arena-title em { display: inline-block; font-style: normal; color: var(--cp-accent); transform: rotate(-3deg); text-shadow: 3px 4px 0 var(--cp-highlight); }
.arena-title p { font-weight: 700; color: var(--cp-text-muted); margin: 0 0 24px; }
.room-ticket { width: fit-content; margin: auto; display: flex; align-items: center; gap: 20px; padding: 12px 24px; border: 2px dashed var(--cp-border-strong); background: var(--cp-surface); border-radius: 10px; }
.room-ticket > span:first-child { font-size: 12px; font-weight: 900; letter-spacing: 2px; }
.pin { font-family: Consolas, "Courier New", Courier, monospace; font-size: 32px; font-weight: 900; letter-spacing: 4px; }
.room-demo { color: var(--cp-text-muted); font-size: 11px; }
.lobby-actions { display: flex; justify-content: center; gap: 16px; margin: 24px 0 32px; }
.button { border: 2px solid var(--cp-accent-hover); border-radius: 10px; background: var(--cp-accent); color: var(--cp-accent-fg); box-shadow: 0 6px 0 var(--cp-accent-hover); padding: 15px 28px; font-weight: 900; font-size: 17px; letter-spacing: .4px; transition: transform .12s, box-shadow .12s; }
.button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 var(--cp-accent-hover); }
.button:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--cp-accent-hover); }
.button:disabled { opacity: .45; box-shadow: none; }
.button.secondary { background: var(--cp-surface); color: var(--cp-text); border-color: var(--cp-border-strong); box-shadow: 0 6px 0 var(--cp-border-strong); }
.button.secondary:hover:not(:disabled) { box-shadow: 0 8px 0 var(--cp-border-strong); }
.wide { width: 100%; margin-top: 24px; }
.squad { max-width: 800px; margin: auto; text-align: center; }
.section-title { display: flex; justify-content: center; align-items: center; gap: 12px; font-size: 12px; font-weight: 900; letter-spacing: 1px; margin-bottom: 20px; }
.section-title .badge { padding: 5px 10px; }
.players { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.player { display: flex; align-items: center; flex-direction: column; gap: 10px; width: 80px; font-weight: 700; font-size: 11px; animation: enter .4s both; }
.avatar { width: 60px; height: 60px; display: grid; place-items: center; font-size: 34px; border-radius: 16px; background: var(--cp-surface); border: 3px solid var(--cp-border-strong); box-shadow: 0 5px 0 var(--cp-border); transform: rotate(-5deg); }
.player:nth-child(2n) .avatar { transform: rotate(5deg); border-color: var(--cp-accent); }
.player:nth-child(3n) .avatar { border-color: var(--cp-link); }
.player:nth-child(4n) .avatar { border-color: var(--cp-success); }
.waiting { display: block; margin-top: 24px; color: var(--cp-text-muted); font-size: 12px; }
.waiting small { font-size: 11px; }
.phone-wrap { max-width: 460px; margin: auto; text-align: center; }
.phone-wrap h1 { font-size: 34px; }
.game-panel { border: 2px solid var(--cp-border-strong); background: var(--cp-surface); border-radius: 16px; padding: 24px; box-shadow: 0 6px 0 var(--cp-border); }
form { text-align: left; }
label, legend { font-size: 12px; font-weight: 800; letter-spacing: .4px; }
label { display: block; margin: 18px 0 8px; }
input { border: 2px solid var(--cp-border); border-radius: 10px; background: var(--cp-bg); color: var(--cp-text); padding: 14px 16px; width: 100%; font-size: 18px; font-weight: 700; }
.avatar-picker { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.avatar-picker legend { margin-bottom: 12px; }
#avatar-choices { display: flex; gap: 12px; justify-content: space-between; }
.avatar-choice { border: 2px solid var(--cp-border); border-radius: 10px; padding: 8px; font-size: 30px; background: var(--cp-bg); flex: 1; min-width: 0; }
.avatar-choice[aria-pressed="true"] { border-color: var(--cp-accent); background: var(--cp-highlight); transform: translateY(-4px); box-shadow: 0 4px 0 var(--cp-accent); }
.hero-avatar { font-size: 80px; animation: drift 3s ease-in-out infinite; }
.form-error { color: var(--cp-danger); font-size: 13px; }
.question-top { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 16px; }
.score-hud { display: flex; gap: 12px; font-size: 16px; font-weight: 900; }
.score-hud > * { background: var(--cp-surface); border: 2px solid var(--cp-border); padding: 8px 16px; border-radius: 10px; }
.score-hud strong { color: var(--cp-accent); }
.progress { background: var(--cp-border); height: 10px; border-radius: 10px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--cp-accent); transition: width .1s linear; }
.question-card { position: relative; text-align: center; padding: 24px 84px 28px; min-height: 180px; display: grid; align-items: center; }
.question-card h1 { font-size: clamp(24px, 3vw, 36px); line-height: 1.25; letter-spacing: -.8px; }
.timer { position: absolute; top: 32px; left: 0; width: 68px; height: 68px; border-radius: 50%; border: 5px solid var(--cp-accent); background: var(--cp-surface); color: var(--cp-text); display: grid; place-items: center; font-size: 28px; font-weight: 950; font-variant-numeric: tabular-nums; }
.timer.urgent { border-color: var(--cp-danger); color: var(--cp-danger); animation: pulse .65s infinite; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.answer { --tile: var(--cp-accent); display: flex; align-items: center; gap: 18px; text-align: left; background: var(--tile); color: var(--cp-bg-elevated); border: 3px solid var(--cp-text); border-radius: 16px; box-shadow: 0 7px 0 var(--cp-text); min-height: 130px; padding: 20px; font-size: 19px; font-weight: 800; line-height: 1.35; transition: transform .15s, opacity .15s; }
html[data-theme="dark"] .answer { color: var(--cp-accent-fg); }
.answer:nth-child(2) { --tile: var(--cp-link); }
.answer:nth-child(3) { --tile: var(--cp-warning); color: var(--cp-surface); }
html[data-theme="light"] .answer:nth-child(3) { color: var(--cp-text); }
.answer:nth-child(4) { --tile: var(--cp-success); }
.answer:hover:not(:disabled) { transform: translateY(-4px) rotate(-.5deg); }
.answer:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 2px 0 var(--cp-text); }
.letter { flex: 0 0 42px; font-size: 32px; text-align: center; }
.answer:disabled { opacity: .38; }
.answer.selected, .answer.correct { opacity: 1; transform: translateY(4px); box-shadow: 0 3px 0 var(--cp-text); }
.answer.correct::after { content: "✓"; margin-left: auto; font-size: 32px; }
.answer.incorrect { opacity: .7; }
.answer.incorrect::after { content: "✕"; margin-left: auto; font-size: 28px; }
.answer-status { text-align: center; margin: 24px 0 12px; font-size: 13px; font-weight: 700; color: var(--cp-text-muted); min-height: 20px; }
.result { text-align: center; background: var(--cp-surface); border: 2px solid var(--cp-border); border-radius: 16px; padding: 16px 24px; animation: enter .3s; }
.result h2 { margin: 4px 0 8px; font-size: 22px; }
.result p { margin: 0; font-size: 14px; color: var(--cp-text-muted); }
.reward { color: var(--cp-accent); font-size: 32px; font-weight: 950; }
.controls { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; }
.controls .button { padding: 10px 20px; font-size: 14px; }
.trophy { font-size: 56px; animation: drift 4s ease-in-out infinite; }
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: end; gap: 16px; max-width: 650px; margin: 28px auto 16px; text-align: center; }
.podium-player .avatar { margin: auto; width: 68px; height: 68px; font-size: 42px; }
.podium-player h2 { font-size: 16px; margin: 16px 0 8px; }
.podium-player strong { font-size: 24px; color: var(--cp-accent); }
.crown { display: block; font-size: 32px; margin-bottom: 8px; }
.podium-block { margin-top: 16px; border: 3px solid var(--cp-text); border-bottom: 7px solid var(--cp-text); border-radius: 10px 10px 0 0; background: var(--cp-border); color: var(--cp-text); font-size: 44px; font-weight: 950; display: grid; place-items: center; }
.second { height: 88px; }
.winner { height: 124px; background: var(--cp-accent); color: var(--cp-accent-fg); }
.third { height: 64px; }
.ranking { max-width: 650px; margin: auto; padding: 0 20px; }
.rank-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--cp-border); font-size: 14px; }
.rank-row:last-child { border: 0; }
.rank-row .avatar { width: 32px; height: 32px; font-size: 13px; box-shadow: none; border-width: 2px; }
.rank { font-weight: 900; color: var(--cp-text-muted); }
.rank-row .name { flex: 1; overflow-wrap: anywhere; }
.rank-row .score { font-weight: 900; }
.replay { margin-top: 24px; }
footer { display: flex; justify-content: center; align-items: center; gap: 20px; flex-wrap: wrap; padding: 12px 20px 20px; }
nav { display: flex; gap: 6px; padding: 4px; background: var(--cp-surface); border: 2px solid var(--cp-border); border-radius: 10px; }
nav button { border: 0; border-radius: 6px; background: var(--cp-surface); color: var(--cp-text-muted); font-size: 12px; padding: 8px 14px; font-weight: 800; }
nav button[aria-current="page"] { background: var(--cp-accent-soft); color: var(--cp-accent); }
.preview-note { font-size: 11px; color: var(--cp-text-muted); }
.countdown { position: fixed; inset: 0; z-index: 10; background: var(--cp-bg-elevated); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; font-weight: 900; }
.countdown strong { font-size: clamp(100px, 25vw, 240px); color: var(--cp-accent); animation: pop .7s infinite; line-height: 1; }
.countdown span { font-size: 20px; }
.confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 12; }
.confetti i { position: absolute; top: -30px; width: 10px; height: 16px; background: var(--cp-accent); animation: fall 1.6s ease-in forwards; }
.confetti i:nth-child(3n) { background: var(--cp-warning); }
.confetti i:nth-child(3n+1) { background: var(--cp-link); }
.toast { position: fixed; bottom: 20px; left: 20px; right: 20px; z-index: 15; padding: 16px; background: var(--cp-surface); border: 2px solid var(--cp-danger); border-radius: 10px; color: var(--cp-text); }
@keyframes enter { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes drift { 50% { translate: 0 -12px; rotate: 6deg; } }
@keyframes pulse { 50% { transform: scale(1.1); } }
@keyframes pop { from { transform: scale(.6); opacity: .5; } to { transform: scale(1); opacity: 1; } }
@keyframes fall { to { translate: 40px 110vh; rotate: 540deg; } }
@media (max-width: 600px) {
  header { padding: 16px; } .brand strong { font-size: 12px; } .hud { gap: 6px; } .hud .badge { padding: 6px; font-size: 10px; }
  main { padding: 12px 16px 24px; min-height: calc(100svh - 170px); }
  .arena-title h1 { font-size: 52px; } .arena-title .badge { font-size: 10px; padding: 8px 10px; } .arena-title p { font-size: 13px; }
  .room-ticket { padding: 10px 14px; gap: 10px; } .pin { font-size: 28px; letter-spacing: 2px; } .room-demo { display: none; }
  .lobby-actions { gap: 12px; } .button { font-size: 14px; padding: 14px 18px; } .players { gap: 14px 8px; } .player { width: 68px; font-size: 10px; } .avatar { width: 52px; height: 52px; font-size: 30px; }
  .squad { max-width: 340px; } .question-top .badge { font-size: 10px; padding: 8px; } .score-hud { font-size: 12px; gap: 6px; } .score-hud > * { padding: 8px; }
  .question-card { padding: 72px 0 16px; min-height: 0; } .timer { width: 56px; height: 56px; font-size: 24px; left: calc(50% - 28px); top: 12px; }
  .question-card h1 { font-size: 23px; } .answers { gap: 12px; } .answer { flex-direction: column; gap: 8px; padding: 12px; min-height: 150px; font-size: 14px; text-align: center; border-width: 2px; }
  .letter { flex-basis: auto; font-size: 24px; } .answer.correct::after, .answer.incorrect::after { margin: 0; font-size: 20px; }
  .controls .button { padding: 10px 12px; font-size: 12px; } .result { padding: 16px; } .result p { font-size: 13px; }
  .phone-wrap h1 { font-size: 28px; } .game-panel { padding: 20px; } #avatar-choices { gap: 8px; } .avatar-choice { font-size: 25px; padding: 6px; }
  .podium { gap: 8px; } .podium-player .avatar { width: 52px; height: 52px; font-size: 30px; } .podium-player h2 { font-size: 12px; } .podium-player strong { font-size: 20px; }
  .ranking { padding: 0 12px; } .rank-row { gap: 8px; font-size: 12px; } footer { gap: 10px; } nav button { padding: 8px 12px; }
  .scenery span { font-size: 64px; } .countdown span { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
