:root{color-scheme:dark;--bg:#0d1b20;--panel:#172c30;--panel2:#203a3e;--text:#f1f8f6;--muted:#afc3c0;--lime:#81e0d3;--border:#35504f;--red:#ad3e46;--blue:#315da5;--yellow:#865409;--purple:#714a94}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:radial-gradient(circle at 12% 0%,#1b4845 0,transparent 35%),var(--bg);color:var(--text);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100vh}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.5}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #fff;outline-offset:3px}
h1,h2,p{margin-top:0}
h1,h2,.brand,.timer{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
h1{font-size:clamp(2.8rem,5vw,5.5rem);line-height:.98;letter-spacing:-.02em;margin-bottom:18px}
h2{font-size:1.75rem;margin-bottom:0}
.accent{color:var(--lime)}
.muted{color:var(--muted);line-height:1.6}
.eyebrow{color:var(--lime);font-size:.72rem;font-weight:700;letter-spacing:.18em;margin-bottom:14px}
.brand{display:flex;align-items:center;gap:12px;font-size:1.6rem;letter-spacing:.05em;line-height:1}
.brand small{display:block;color:var(--muted);font-size:.53rem;font-weight:700;letter-spacing:.14em;margin-top:6px}
.brand-mark{display:block;width:58px;height:58px;object-fit:contain;background:#f8fafc;border-radius:12px;padding:4px}
.brand-accent{color:var(--lime)}
.connection{font-size:.75rem;color:#f1aa6d;font-weight:700}
.connection.online{color:var(--lime)}
.player-shell{width:min(100% - 32px,520px);margin:0 auto;padding:24px 0 50px}
.player-shell>.connection{margin:22px 0}
.player-card{background:linear-gradient(145deg,#1c3739,#162a2e);border:1px solid var(--border);border-radius:24px;padding:clamp(26px,6vw,48px);box-shadow:0 20px 70px #0003}
.player-card h1{font-size:clamp(2.8rem,10vw,4.5rem)}
.player-card form{margin-top:32px}
label{display:block;font-size:.7rem;letter-spacing:.14em;font-weight:700;margin-bottom:10px}
input,textarea,select{width:100%;border:1px solid #4b6865;border-radius:10px;background:#102123;color:white;padding:16px;margin-bottom:14px}
input::placeholder,textarea::placeholder{color:#91a5a2}
textarea{resize:vertical}
.button{border:0;border-radius:10px;padding:16px 24px;font-weight:700;transition:transform .2s,filter .2s}
.button:hover:not(:disabled){filter:brightness(1.08);transform:translateY(-2px)}
.button.primary{background:#087c70;color:#fff}
.button.secondary{color:#e5eeec;background:#29413f;border:1px solid #49635f}
.button.danger{background:#562d34;color:#ffd9dc;border:1px solid #9a505a}
.button.compact{padding:10px 14px;font-size:.85rem}
.button.wide{width:100%;display:flex;justify-content:space-between}
.centered{text-align:center}
.big-icon{display:grid;place-items:center;background:#087c7033;color:var(--lime);border-radius:50%;width:82px;height:82px;margin:0 auto 25px;font-size:2.6rem}
.pulse-dots{display:flex;gap:7px;justify-content:center;margin-top:30px}
.pulse-dots i{width:7px;height:7px;background:var(--lime);border-radius:50%;animation:pulse 1.2s infinite alternate}
.pulse-dots i:nth-child(2){animation-delay:.2s}.pulse-dots i:nth-child(3){animation-delay:.4s}
@keyframes pulse{to{opacity:.2;transform:translateY(-4px)}}
.notice{border-radius:10px;padding:14px 16px;margin:16px 0;font-weight:700;line-height:1.4}
.notice.error{background:#562d34;color:#ffd9dc}.notice.success{background:#21453c;color:#b1f4dd;text-align:center}
.player-progress,.game-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.player-progress .eyebrow,.game-top .eyebrow{margin:0}
.timer{display:inline-grid;place-items:center;background:#1a3e3a;color:var(--lime);border:1px solid #3d7169;border-radius:12px;min-width:80px;padding:8px 14px;font-size:1.8rem;font-weight:700;white-space:nowrap}
.timer.small{font-size:1.4rem;min-width:65px}
.player-question{font-size:clamp(2.2rem,7vw,3.5rem);margin:28px 0}
.answer-grid,.stage-options{display:grid;grid-template-columns:1fr;gap:12px}
.answer,.stage-option{border:0;border-radius:12px;color:#fff;text-align:left;background:var(--option);min-width:0}
.answer{display:flex;align-items:center;gap:15px;min-height:82px;padding:16px;font-weight:700;font-size:1.05rem}
.answer:not(:disabled):hover{filter:brightness(1.12)}
.answer:disabled{opacity:.65}
.answer-0{--option:var(--red)}.answer-1{--option:var(--blue)}.answer-2{--option:var(--yellow)}.answer-3{--option:var(--purple)}
.answer-letter{display:inline-grid;place-items:center;flex:none;width:38px;height:38px;border-radius:9px;background:#0003;font-weight:700}
.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:30px 0}
.stat-grid.two{grid-template-columns:repeat(2,1fr)}
.stat-grid>div{background:#102224;border-radius:12px;padding:18px 5px}
.stat-grid strong{display:block;color:var(--lime);font-size:2rem}
.stat-grid span{font-size:.57rem;letter-spacing:.1em;color:var(--muted);font-weight:700}
.admin-shell{max-width:1900px;margin:auto;padding:28px clamp(20px,3vw,54px)}
.admin-header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding-bottom:24px;border-bottom:1px solid var(--border)}
.header-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px}
.library{padding-top:32px}
.create-quiz{display:flex;gap:14px;align-items:end;margin:24px 0}
.create-quiz>div{flex:1;min-width:0}
.create-quiz input{margin-bottom:0}
.quiz-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,290px),1fr));gap:16px}
.quiz-card{display:flex;flex-direction:column;gap:14px}
.quiz-card h2{overflow-wrap:anywhere}
.quiz-card .muted{margin:0;flex:1}
.quiz-card .button{align-self:flex-start}
.editor-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-top:26px}
.editor-heading h1{overflow-wrap:anywhere}
.editor-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px}
.question-list{display:grid;gap:10px;margin-top:20px}
.question-item{background:#102224;border:1px solid var(--border);border-radius:12px;padding:16px}
.question-item strong{display:block;overflow-wrap:anywhere}
.question-item p{font-size:.85rem;margin:8px 0 12px}
.question-actions{display:flex;flex-wrap:wrap;gap:8px}
.question-form .panel-heading{margin-bottom:20px}
.question-form label{margin-top:5px}
.editor-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px}
#delete-quiz{margin-top:24px}
.login-card{max-width:480px;margin:8vh auto}
.dashboard{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:32px;padding-top:32px}
.stage{min-width:0}
.section-heading{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}
.live-pill{border:1px solid #3d7169;border-radius:100px;padding:9px 14px;color:var(--lime);font-size:.7rem;font-weight:700;white-space:nowrap}
.live-pill i{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--lime);margin-right:5px}
.lobby-layout{display:grid;grid-template-columns:minmax(220px,360px) minmax(0,1fr);gap:22px;margin-top:28px}
.qr-card,.panel,.sidebar{border:1px solid var(--border);background:var(--panel);border-radius:18px}
.qr-card{padding:22px;text-align:center}
.qr-card img{display:block;width:100%;max-width:300px;aspect-ratio:1;margin:0 auto 18px;border-radius:8px;background:#fff}
.qr-card span{display:block;color:var(--muted);font-size:.65rem;letter-spacing:.14em;font-weight:700;margin-bottom:8px}
.qr-card strong{font-size:clamp(.8rem,1.3vw,1.1rem);overflow-wrap:anywhere}
.panel{padding:24px}
.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:15px}
.count-badge{border-radius:8px;background:#214a43;color:var(--lime);padding:6px 12px;font-weight:700}
.roster-panel .muted{font-size:.85rem;margin:10px 0 20px}
.roster{display:flex;flex-wrap:wrap;gap:8px}
.roster-chip{display:flex;align-items:center;gap:10px;background:#29403f;border:1px solid #46615d;border-radius:9px;padding:9px 12px;font-size:.9rem;font-weight:600;overflow-wrap:anywhere;max-width:100%}
.roster-chip.is-answered{background:#215047;border-color:#54b6a5;color:#b5f7df}
.roster-chip.is-offline{opacity:.55}
.remove-player{border:0;background:transparent;color:#aab3be;font-size:1.3rem;line-height:1;padding:0 0 0 4px}
.remove-player:hover{color:#ff8989}
.empty{color:#85909e;font-size:.9rem;margin:20px 0}
.sidebar{padding:24px;align-self:start;position:sticky;top:24px;max-height:calc(100vh - 48px);overflow:auto}
.sidebar .eyebrow{margin-bottom:5px}
.sidebar-icon{font-size:1.8rem;color:var(--lime)}
.sidebar-description{font-size:.8rem;margin:12px 0 20px}
.ranking-row{display:flex;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid var(--border);font-size:.9rem}
.ranking-row strong{min-width:0;overflow-wrap:anywhere;flex:1}
.ranking-position{color:#a7bfba;font-size:1.25rem}
.ranking-score{color:var(--lime);font-weight:700;white-space:nowrap}
.controls{display:flex;flex-wrap:wrap;gap:12px;margin:28px 0}
.game-metrics{display:flex;align-items:center;gap:18px;font-size:.9rem;font-weight:700}
.stage-question{margin:28px 0;font-size:clamp(2.8rem,4.2vw,5rem)}
.stage-options{grid-template-columns:repeat(2,minmax(0,1fr))}
.stage-option{padding:18px;min-height:88px}
.stage-option.correct{box-shadow:inset 0 0 0 4px #a0f4be;background:#276c4a}
.option-top{display:flex;align-items:center;gap:14px;font-size:clamp(1rem,1.5vw,1.35rem)}
.option-top strong{flex:1;overflow-wrap:anywhere}
.correct-mark{font-size:1.7rem}
.option-stats{display:flex;align-items:center;gap:12px;margin-top:16px;font-weight:700;font-size:.85rem;white-space:nowrap}
.bar{height:9px;background:#0003;border-radius:20px;overflow:hidden;flex:1}
.bar span{display:block;height:100%;background:#fff;border-radius:20px}
.status-panel{margin-top:20px}
.status-panel .panel-heading{margin-bottom:16px}
.status-panel .muted{font-size:.8rem}
.final-heading{margin-top:0}
.podium{display:flex;align-items:end;justify-content:center;gap:12px;margin:40px 0}
.podium-place{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;width:30%;min-height:165px;background:#29413f;border:1px solid #49635f;border-radius:16px 16px 4px 4px;text-align:center;padding:18px;overflow-wrap:anywhere}
.podium-place.place-1{order:2;min-height:220px;background:#1c5047;border-color:#57ad9d;color:var(--lime)}
.podium-place.place-2{order:1}.podium-place.place-3{order:3}
.podium-place strong{font-size:1.2rem}.podium-place span:last-child{font-size:.85rem}
.podium-number{font-size:2.8rem;font-weight:700}
.final-board h2{margin-bottom:10px}
@media(max-width:900px){.dashboard{grid-template-columns:1fr}.sidebar{position:static;max-height:none}.lobby-layout{grid-template-columns:minmax(180px,280px) 1fr}}
@media(max-width:600px){.admin-shell{padding:20px 16px}.admin-header{align-items:flex-start}.admin-header .connection{text-align:right;max-width:160px}.header-actions{max-width:180px}.create-quiz,.editor-heading{align-items:stretch;flex-direction:column}.editor-grid{grid-template-columns:1fr}.lobby-layout{grid-template-columns:1fr}.qr-card img{max-width:220px}.stage-options{grid-template-columns:1fr}.section-heading{display:block}.live-pill{display:inline-block}.game-top{align-items:flex-start;flex-direction:column}.game-metrics{width:100%;justify-content:space-between}.podium-place{padding:10px;min-width:0}.podium-place strong{font-size:.9rem}.podium-place.place-1{min-height:190px}.podium-place{min-height:140px}.controls .button{width:100%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
