/* markIt: shared styles for the host screen and the player phone view.
   Dark page with white cards: everything students read is near-black on white.
   Answers are told apart by letter and shape as well as colour. */
:root{
  --bg:#121212;--ondark:#fff;--ondark2:#c9c9c9;--soft:#f3f3f3;--line:#c8c8c8;--edge:#5c5c5c;
  --text:#000;--muted:#4a4a4a;
  --accent:#ffd23f;--link:#0b4fb3;
  --good:#0a6b3d;--good-bg:#e2f6ea;--calm-bg:#e8f0ff;--bad:#a61b1b;
  --o0:#b3360b;--o1:#0b4fb3;--o2:#7b1f6a;--o3:#00665a;
  --r:6px;--font:Roboto,Arial,sans-serif;--brandfont:Poppins,sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0;}
html{-webkit-text-size-adjust:100%;overflow-x:hidden;}
@supports (overflow:clip){html,body{overflow-x:clip;}}
body{min-height:100vh;min-height:100dvh;background:var(--bg);color:var(--text);font-family:var(--font);font-size:18px;line-height:1.5;-webkit-tap-highlight-color:transparent;}
button,input{font:inherit;color:inherit;}
img,svg{max-width:100%;}
a{color:var(--link);}
.hidden{display:none!important;}
.sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
.muted{color:var(--muted);}
.small{font-size:16px;}
.center{text-align:center;}
:focus-visible{outline:4px solid var(--link);outline-offset:3px;}

/* ── buttons & inputs ── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;border:1.5px solid #000;background:#fff;color:#000;border-radius:999px;padding:10px 20px;font-weight:700;cursor:pointer;text-decoration:none;}
:is(.hbar,.conn) :focus-visible{outline-color:#8ab8ff;}
.btn:hover{background:var(--soft);}
.btn:disabled{background:var(--soft);border-color:var(--line);color:var(--muted);cursor:not-allowed;}
.btn.primary:not(:disabled){background:var(--text);border-color:var(--text);color:#fff;}
.btn.primary:not(:disabled):hover{background:#333;}
.btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;}
.btn.big{padding:14px 28px;font-size:22px;}
.btn.small{padding:6px 14px;min-height:44px;font-size:17px;}
input[type=text],input[type=password],input:not([type]){width:100%;background:#fff;border:0;border-bottom:2px solid #000;border-radius:0;padding:8px 4px;font-size:20px;color:#000;}
input::placeholder{color:#59657d;opacity:1;}
.card{background:#fff;color:var(--text);border:2px solid #fff;border-radius:var(--r);padding:26px;}
.f{display:flex;flex-direction:column;gap:6px;font-weight:700;}
.error{color:var(--bad);font-weight:700;}
.error:not(:empty)::before{content:'⚠ ';}
.tag{display:inline-block;font-size:16px;font-weight:700;background:var(--accent);color:var(--text);padding:2px 10px;border-radius:8px;margin-left:10px;}
.tag.warn{background:var(--text);color:#fff;}

.conn{position:fixed;top:0;left:0;right:0;z-index:50;background:var(--bad);color:#fff;text-align:center;font-weight:700;padding:8px;}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:50;background:var(--text);color:#fff;font-weight:700;padding:14px 20px;border-radius:12px;max-width:calc(100% - 32px);}

/* ── answer identity: letter + shape + colour ── */
.opt-0{--c:var(--o0);} .opt-1{--c:var(--o1);} .opt-2{--c:var(--o2);} .opt-3{--c:var(--o3);}
.badge{display:inline-flex;align-items:center;gap:8px;flex-shrink:0;background:var(--c);color:#fff;border-radius:10px;padding:4px 10px;font-weight:800;font-size:1.1em;line-height:1.3;}
.shape{display:inline-flex;width:.85em;height:.85em;}
.shape svg{width:100%;height:100%;fill:currentColor;}
.tagline{font-family:var(--brandfont);font-size:18px;line-height:1.3;color:var(--ondark);}
.brand{color:var(--ondark);font-family:var(--brandfont);display:inline-flex;align-items:center;gap:10px;font-weight:700;}

/* ════════ PLAYER ════════ */
.player-top{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px;width:100%;max-width:520px;margin:0 auto;}
.player-top:has(.me:empty){flex-direction:column;justify-content:center;gap:4px;padding-top:24px;}
.player-top:has(.me:empty) .brand{font-size:26px;}
.player-top .me:empty,.player-top:not(:has(.me:empty)) .tagline{display:none;}
.me{font-weight:700;color:var(--ondark);text-align:right;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.player-main{width:calc(100% - 32px);max-width:488px;margin:0 auto 32px;background:#fff;color:#000;border-radius:var(--r);padding:26px 22px;display:flex;flex-direction:column;gap:16px;}
.join{display:flex;flex-direction:column;gap:20px;border:0;padding:0;}
.join h1{font-size:26px;font-weight:700;line-height:1.15;}
#pin{font-size:28px;font-weight:800;letter-spacing:.12em;}
.status{text-align:center;padding:24px 12px;}
.status .big{font-size:56px;line-height:1.1;margin-bottom:10px;}
.status h1,.locked h1{font-size:30px;font-weight:800;line-height:1.2;margin-bottom:8px;overflow-wrap:anywhere;}
.status p{font-size:20px;overflow-wrap:anywhere;}
.status .pts{font-size:36px;font-weight:800;color:var(--good);}
.status.right{border-color:var(--good);background:var(--good-bg);}
.status.wrong{border-color:var(--link);background:var(--calm-bg);}
.qcount{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:var(--muted);}
.ptimer{width:68px;height:68px;border-radius:50%;margin:0 auto;display:flex;align-items:center;justify-content:center;font-size:28px;font-weight:800;background:conic-gradient(var(--text) var(--p,100%),var(--line) 0);position:relative;}
.ptimer::before{content:'';position:absolute;inset:7px;border-radius:50%;background:#fff;}
.ptimer span{position:relative;font-variant-numeric:tabular-nums;}
.ptext{font-size:22px;font-weight:700;line-height:1.35;overflow-wrap:anywhere;}
.answers{display:grid;gap:12px;}
.answer{background:var(--c);border:0;border-radius:12px;min-height:76px;padding:12px 16px;color:#fff;font-weight:700;font-size:20px;line-height:1.3;display:flex;align-items:center;gap:14px;text-align:left;cursor:pointer;overflow-wrap:anywhere;}
.answer>span:last-child,.option>span:last-child{min-width:0;}
.answer .badge,.option .badge{background:#fff;color:var(--c);}
.locked{text-align:center;padding:24px 12px;border-color:var(--c);}
.locked .chosen{font-size:40px;margin-bottom:14px;}
.rankline{text-align:center;font-size:20px;font-weight:700;}

/* ════════ HOST ════════ */
.host-main{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;}
.hbar{display:flex;align-items:center;gap:10px 16px;padding:8px 28px;border-bottom:1px solid #3a3a3a;background:var(--bg);position:sticky;top:0;z-index:10;flex-wrap:wrap;}
.hbar .htitle{color:var(--ondark2);font-weight:700;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;}
.hbar .hpin{font-size:22px;font-weight:700;background:#fff;color:#000;padding:4px 16px;border-radius:999px;white-space:nowrap;}
.hbar .btn:not(.primary){background:transparent;color:#fff;border-color:#fff;}
.hbar .btn:not(.primary):hover{background:#333;}
.hbar .btn.primary:not(:disabled){background:#fff;color:#000;}
.sheet{padding:22px 28px;min-height:calc((100vh - 70px) / var(--z,1) - 50px);}
.hactions{display:flex;gap:8px;flex-wrap:wrap;}
.stage{flex:1;width:100%;max-width:1560px;margin:0 auto;padding:20px 28px;min-width:0;}

/* setup: the first screen */
.welcome{display:flex;flex-direction:column;align-items:center;gap:14px;}
.intro{display:flex;flex-direction:column;align-items:center;gap:6px;}
.setup{width:100%;max-width:520px;display:flex;flex-direction:column;gap:12px;padding:24px 32px;}
.setup h1{font-size:22px;font-weight:700;line-height:1.2;}
.setup .small,.check{font-size:15px!important;line-height:1.35;}
.setup .f{font-size:15px;font-weight:500;color:var(--muted);gap:2px;}
.setup .btn.big{padding:10px 28px;font-size:19px;}
.drop{display:block;position:relative;font-weight:500;border:2px dashed var(--edge);border-radius:6px;padding:8px;text-align:center;cursor:pointer;overflow-wrap:anywhere;}
.drop:hover,.drop.over{background:#fff6d6;}
.drop:focus-within{outline:4px solid var(--link);outline-offset:3px;}
.check{display:flex;gap:12px;align-items:flex-start;font-size:16px;color:var(--muted);}
.check input{margin-top:2px;width:24px;height:24px;accent-color:var(--link);flex-shrink:0;}
.errors ul{margin:6px 0 0 22px;}

/* lobby */
.lobby{min-height:calc((100vh - 70px) / var(--z,1) - 50px);display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:24px;align-items:stretch;}
.join-panel{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px 28px;align-items:center;}
.join-panel .lead{font-size:clamp(20px,1.8vw,28px);font-weight:700;line-height:1.3;}
.join-url{font-size:clamp(24px,2.8vw,44px);font-weight:800;line-height:1.2;overflow-wrap:anywhere;margin-bottom:20px;}
.pinbox{grid-column:1/-1;border-top:3px solid var(--text);padding-top:14px;}
.big-pin{font-size:clamp(64px,10vw,180px);font-weight:800;line-height:1.05;white-space:nowrap;}
.qr{width:clamp(180px,19vw,320px);border-radius:14px;background:#fff;padding:8px;display:block;}
.players-panel{display:flex;flex-direction:column;gap:16px;}
.players-panel h1{font-size:30px;font-weight:800;line-height:1.2;}
.chips{display:flex;flex-wrap:wrap;gap:10px;align-content:flex-start;flex:1;}
.chip{background:var(--soft);border:2px solid var(--line);border-radius:12px;min-height:44px;padding:4px 14px;font-size:20px;font-weight:700;cursor:pointer;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.chip:hover,.chip:focus-visible{border-color:var(--bad);color:var(--bad);}
.chip.offline{border-style:dashed;color:var(--muted);background:#fff;}
.waiting{color:var(--muted);font-size:20px;}

/* question */
.qmeta{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:20px;font-weight:700;color:var(--muted);}
.timer-num{font-size:56px;font-weight:800;line-height:1;color:var(--text);min-width:90px;text-align:center;font-variant-numeric:tabular-nums;}
.timer{height:14px;background:var(--line);border-radius:8px;overflow:hidden;}
.timer-bar{height:100%;background:var(--text);transform-origin:left;}
.qtext{font-size:clamp(30px,3.6vw,56px);font-weight:800;line-height:1.2;overflow-wrap:anywhere;text-wrap:balance;}
.options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
.option{background:var(--c);color:#fff;border-radius:16px;padding:20px;min-height:clamp(100px,18vh,200px);display:flex;align-items:center;gap:16px;font-size:clamp(22px,2.1vw,34px);font-weight:700;line-height:1.25;overflow-wrap:anywhere;min-width:0;}
.qsplit{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start;}
.live h2{font-size:20px;margin-bottom:8px;}

/* bars */
.bars{display:flex;flex-direction:column;gap:10px;}
.barrow{display:grid;grid-template-columns:auto minmax(0,1.5fr) minmax(0,1fr) auto;gap:16px;align-items:center;border:2px solid var(--line);border-radius:14px;padding:10px 16px;font-size:clamp(20px,1.8vw,28px);}
.bartext{font-weight:700;line-height:1.25;overflow-wrap:anywhere;}
.bartrack{height:22px;background:var(--soft);border-radius:8px;overflow:hidden;}
.barfill{height:100%;width:0;background:var(--c);transition:width .5s ease-out;}
.barcount{font-weight:800;font-variant-numeric:tabular-nums;min-width:105px;text-align:right;}
.barrow.dim{background:var(--soft);}
.barrow.dim .bartrack{background:#fff;}
.barrow.dim .bartext{font-weight:500;}
.barrow.correct{border:4px solid var(--good);background:var(--good-bg);}
.barrow .tick{color:var(--good);font-weight:800;white-space:nowrap;}
.explain{font-size:clamp(20px,1.7vw,27px);line-height:1.4;background:#fff6d6;border-color:var(--accent);padding:16px 22px;}
.controls{display:flex;justify-content:flex-end;align-items:center;gap:12px;flex-wrap:wrap;}
.autonext{color:var(--muted);font-weight:700;margin-right:auto;}

/* leaderboard */
.board{list-style:none;display:flex;flex-direction:column;gap:8px;}
.board .row{display:grid;grid-template-columns:40px minmax(0,1fr) auto auto auto;gap:12px;align-items:center;background:#fff;border:2px solid var(--line);border-radius:12px;padding:5px 16px;font-weight:700;}
.board .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.board .delta{color:var(--good);}
.board .score{font-variant-numeric:tabular-nums;min-width:56px;text-align:right;}
.board .row.top1{background:var(--accent);border-color:var(--text);}
.board .row.top1 .delta{color:var(--text);}
.board.large .row{font-size:clamp(20px,1.9vw,28px);}
.board.compact .row{grid-template-columns:24px minmax(0,1fr) auto;padding:6px 12px;gap:10px;}
.board.compact .streak,.board.compact .delta{display:none;}
.lbtitle{font-size:clamp(32px,3.6vw,54px);font-weight:800;line-height:1.15;text-align:center;}
.board-wrap{width:100%;max-width:1000px;margin:0 auto;}

/* final */
.podium{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:end;max-width:900px;margin:0 auto;width:100%;}
.step{display:flex;flex-direction:column;align-items:center;text-align:center;min-width:0;}
.step .pname{font-weight:800;font-size:clamp(20px,2.4vw,36px);line-height:1.25;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.step .pscore{font-size:20px;font-weight:700;margin-bottom:8px;}
.step .block{width:100%;border-radius:14px 14px 0 0;padding-top:12px;font-size:44px;line-height:1.2;}
.step.p1 .block{height:170px;background:var(--accent);}
.step.p2 .block{height:125px;background:#cbd5e6;}
.step.p3 .block{height:95px;background:#f0bd93;}
.step.empty .block{background:var(--soft);}

@media(max-width:900px){
  .lobby,.qsplit,.welcome{grid-template-columns:minmax(0,1fr);}
  .welcome{gap:28px;}
  .hbar,.stage{padding-left:16px;padding-right:16px;}
  .options{grid-template-columns:minmax(0,1fr);}
  .barrow{grid-template-columns:auto minmax(0,1fr) auto;}
  .barrow .bartrack{grid-column:1/-1;}
}
@media(max-width:520px){
  .join-panel{grid-template-columns:minmax(0,1fr);padding:20px;}
  .board .row{grid-template-columns:30px minmax(0,1fr) auto;}
  .board .streak,.board .delta{display:none;}
}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;}}
@media(forced-colors:active){.answer,.option,.badge{border:2px solid CanvasText;}.barfill,.timer-bar{forced-color-adjust:none;}}

/* ════════ SLEEK: quiet proportions, hairline rules, slim pills ════════ */
.card,.sheet{border-width:0;border-radius:5px;}
.btn{border-width:1px;font-weight:700;transition:background .15s,color .15s;}
.btn.small{font-size:15px;padding:4px 16px;}
.btn.big{font-size:18px;padding:10px 32px;}
input[type=text],input[type=password],input:not([type]){border-bottom-width:1px;padding:4px 0;font-size:17px;transition:background .15s,box-shadow .15s;}
/* Focus stays obvious without a heavy box: tint plus a thick underline. */
input:is([type=text],[type=password],:not([type])):focus-visible{outline:2px solid transparent;outline-offset:0;background:#e8f0fe;box-shadow:0 1px 0 1px #e8f0fe,0 2px 0 0 #000;}
.timer{height:6px;background:#e4e4e4;}
.board .row,.barrow,.chip{border-width:1px;border-radius:5px;}
.barrow.correct{border-width:2px;}
.bartrack{height:12px;}
.option,.answer{border-radius:5px;}
.badge{border-radius:4px;}
.step .block{border-radius:5px 5px 0 0;}
.qtext,.lbtitle,.join-url{font-weight:700;letter-spacing:-.01em;}
.option,.bartext{font-weight:500;}
.pinbox{border-top:1px solid var(--line);}
.join-panel .lead{font-weight:400;color:var(--muted);}
.big-pin{letter-spacing:-.02em;}
.players-panel h1,.status h1,.locked h1{font-weight:700;}
.hbar{border-bottom:0;}
.hbar .hpin{font-size:18px;}
.explain{border:0;}

/* sign-in style cards: host setup and player join */
.intro .brand,.player-top:has(.me:empty) .brand{flex-direction:column;gap:6px;font-size:22px;line-height:1.2;}
.intro .tagline,.player-top:has(.me:empty) .tagline{font-size:14px;}
.intro{gap:4px;}
.welcome{gap:20px;}
.setup{max-width:400px;padding:30px 31px 32px;gap:18px;}
.setup h1,.join h1{font-size:20px;font-weight:700;line-height:1.3;margin-bottom:4px;}
.setup .f,.join .f{font-size:14px;font-weight:400;color:#5c5c5c;gap:0;line-height:1.4;}
.setup .f input,.join .f input{color:#000;}
.setup .check{font-size:14px!important;align-items:center;line-height:1.4;}
.setup .check input{width:18px;height:18px;margin:3px;accent-color:#000;}
.setup .btn.big,.join .btn.big{font-size:16px;min-height:44px;padding:8px 20px;width:100%;}
.setup .errors:empty,.join .error:empty{display:none;}
.setup .error,.join .error{font-size:15px;}
.setup .errors{font-size:15px;}
.rule{display:flex;align-items:center;gap:10px;font-size:14px;color:#5c5c5c;}
.rule::before,.rule::after{content:'';flex:1;height:1px;background:var(--line);}
.player-main:has(.join){max-width:400px;padding:30px 31px 36px;}
.join{gap:26px;}
#pin{font-size:24px;font-weight:500;letter-spacing:.06em;}
#name{font-size:18px;}
.legal{font-size:14px;line-height:1.5;color:#5c5c5c;}
.legal a{color:inherit;font-weight:700;}
.forgot{font-size:14px;text-align:center;}
.forgot a{color:#000;font-weight:700;padding:6px 2px;}
.setup{gap:12px;padding:24px 31px 26px;}
.welcome{gap:14px;}
.join{gap:22px;}
/* terms, privacy and help pages */
.doc{padding:28px 16px 48px;display:flex;flex-direction:column;align-items:center;gap:20px;}
.doc .card{width:100%;max-width:680px;padding:31px;}
.doc h1{font-size:26px;font-weight:700;line-height:1.3;}
.doc h2{font-size:18px;margin-top:22px;}
.doc p,.doc li{font-size:17px;margin-top:8px;overflow-wrap:anywhere;}
.doc ul,.doc ol{padding-left:24px;}
.doc code{background:var(--soft);padding:1px 6px;border-radius:4px;}
.doc .intro p{margin:0;}
.doc .muted{font-size:15px;}
/* ════════ LOGO: wordmark in a speech bubble ════════ */
.brand,.intro .brand,.player-top:has(.me:empty) .brand{display:inline-flex;min-width:0;max-width:100%;font-size:17px;}
.bubble{position:relative;display:inline-flex;align-items:center;gap:.55em;background:#fff;color:#000;border-radius:.5em;padding:.2em .65em;margin-bottom:.3em;min-width:0;max-width:100%;}
.bubble::after{content:'';position:absolute;left:.85em;top:calc(100% - 1px);width:.5em;height:.32em;background:#fff;clip-path:polygon(0 0,100% 0,0 100%);}
.word{font-family:var(--brandfont);font-weight:700;letter-spacing:-.045em;line-height:1.3;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.intro .bubble,.player-top:has(.me:empty) .bubble{padding:.24em .62em .28em;font-size:30px;border-radius:.4em;margin-bottom:.5em;}
.intro .word,.player-top:has(.me:empty) .word{max-width:100%;line-height:1.15;}
.player-top:has(.me:empty) #brand{display:flex;justify-content:center;max-width:100%;}
.player-top>#brand{min-width:0;}
.hbar .brand{max-width:280px;}
.tagline{font-weight:400;}
.intro .tagline,.player-top:has(.me:empty) .tagline{font-size:15px;}
/* drag-and-drop file box */
.setup .f:has(.drop){gap:6px;}
.setup .drop{border:1px dashed #8a8a8a;border-radius:5px;padding:12px 14px;font-size:15px;font-weight:400;color:#5c5c5c;text-align:center;transition:background .15s,border-color .15s;}
.droptext{display:flex;align-items:center;justify-content:center;gap:10px;min-width:0;}
.droptext svg{width:20px;height:20px;flex-shrink:0;fill:none;stroke:#000;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;}
.setup .drop b{color:#000;}
.setup .drop:hover{border-color:#000;}
.setup .drop.over{border:1px solid #000;background:#e8f0fe;}
.setup .drop:focus-within{outline:2px solid #000;outline-offset:1px;}
.setup .drop.has-file{border:1px solid #000;}
.setup .drop.has-file .droptext{justify-content:space-between;}
.fname{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;color:#000;}
.change{flex-shrink:0;text-decoration:underline;}
/* ════════ full-page drop animation ════════ */
.dz{position:fixed;inset:0;z-index:60;pointer-events:none;display:flex;align-items:center;justify-content:center;background:rgba(18,18,18,.98);color:#fff;opacity:0;visibility:hidden;transition:opacity .22s ease,visibility 0s .22s;}
.dz.on{opacity:1;visibility:visible;transition:opacity .18s ease;}
.dz-frame{position:absolute;inset:24px;opacity:.75;transform:scale(1.03);transition:transform .35s cubic-bezier(.2,.9,.3,1.2);
  background:linear-gradient(90deg,#fff 55%,transparent 0) 0 0/18px 2px repeat-x,linear-gradient(90deg,#fff 55%,transparent 0) 0 100%/18px 2px repeat-x,linear-gradient(#fff 55%,transparent 0) 0 0/2px 18px repeat-y,linear-gradient(#fff 55%,transparent 0) 100% 0/2px 18px repeat-y;}
.dz.on .dz-frame{transform:none;animation:dz-march .7s linear infinite;}
.dz-mid{display:flex;flex-direction:column;align-items:center;text-align:center;padding:0 48px;max-width:100%;}
.dz-bubble{position:relative;width:112px;height:92px;border-radius:24px;background:#fff;margin-bottom:38px;transform:scale(.6);transition:transform .35s cubic-bezier(.2,1.4,.4,1);}
.dz-bubble::after{content:'';position:absolute;left:26px;top:calc(100% - 1px);width:26px;height:18px;background:#fff;clip-path:polygon(0 0,100% 0,0 100%);}
.dz.on .dz-bubble{transform:none;}
.dz-bubble svg{position:absolute;inset:0;margin:auto;width:48px;height:48px;fill:none;stroke:#000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.dz.on .dz-arrow{animation:dz-bob 1s ease-in-out infinite;}
.dz-tick{opacity:0;stroke-dasharray:24;stroke-dashoffset:24;}
.dz.done .dz-arrow{opacity:0;}
.dz.done .dz-tick{opacity:1;stroke-dashoffset:0;transition:stroke-dashoffset .35s ease-out .05s;}
.dz.done .dz-bubble{animation:dz-pop .4s ease-out;}
.dz.done .dz-frame{animation:none;}
.dz-title{font-family:var(--brandfont);font-weight:700;font-size:clamp(30px,3.4vw,48px);line-height:1.2;letter-spacing:-.03em;}
.dz-hint{font-size:18px;color:#d0d0d0;margin-top:6px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@keyframes dz-march{to{background-position:18px 0,-18px 100%,0 -18px,100% 18px;}}
@keyframes dz-bob{0%,100%{translate:0 -6px;}50%{translate:0 6px;}}
@keyframes dz-pop{0%{transform:scale(1);}45%{transform:scale(1.14);}100%{transform:scale(1);}}
@media(prefers-reduced-motion:reduce){.dz,.dz *{animation:none!important;transition:none!important;}}
/* ════════ HOME: one small card centred on the page ════════ */
.stage:has(.welcome){display:flex;flex-direction:column;justify-content:center;}
.stage .welcome,.welcome{gap:18px;width:100%;}
.setup,.player-main .join{gap:20px;}
.setup{padding:34px 31px 36px;}
.setup h1,.player-main .join h1{margin-bottom:10px;}
.setup .error,.join .error{font-size:13px;font-weight:400;text-align:left;margin-top:5px;color:#c00000;}
.setup .error::before,.join .error::before{content:none!important;}
.setup .error:empty{display:none;}
.setup .errors ul{font-size:13px;max-height:120px;overflow:auto;}
.setup .errors .small{font-size:13px!important;}
.join .error{margin:-14px 0 0;}
.setup .forgot,.join .forgot{text-align:left;font-size:15px;}
.setup .forgot+.forgot{margin-top:-8px;}
.more summary{cursor:pointer;font-size:14px;color:#5c5c5c;width:max-content;padding:2px 0;}
.more summary:hover{color:#000;}
.more .f{margin:10px 0 12px;}
.legal{font-size:13px;color:#b9b9b9;text-align:center;max-width:400px;margin:0 auto;}
.foot{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 0;border-top:1px solid #2b2b2b;padding:12px 16px;font-size:13px;}
.foot a{color:#b9b9b9;font-weight:700;text-decoration:none;padding:4px 12px;}
.foot a:hover{color:#fff;text-decoration:underline;}
.foot a+a{border-left:1px solid #555;}
.legal a:focus-visible,.foot a:focus-visible{outline-color:#8ab8ff;}
/* student home: only while joining (the name badge is empty) */
body.player:has(.me:empty){display:flex;flex-direction:column;}
body.player:has(.me:empty) .player-top{margin-top:auto;padding-bottom:18px;}
body.player:has(.join) .player-main{background:none;padding:0;margin-bottom:auto;gap:18px;max-width:400px;flex-shrink:0;}
body.player .player-main .join{background:#fff;border-radius:5px;padding:32px 31px 34px;}
body.player:not(:has(.join)) .foot{display:none;}
body.player .foot{margin-top:24px;}
.legal{text-wrap:balance;}
.legal a{white-space:nowrap;}
.linkbtn{background:none;border:0;padding:6px 2px;font-weight:700;text-decoration:underline;cursor:pointer;color:#000;}
.setup .back{margin:-14px 0 -6px;}
/* ════════ BLACK: game screens on black, small lobby, radio answers ════════ */
.sheet,.players-panel,.player-main:not(:has(.join)){
  --text:#fff;--muted:#b9b9b9;--soft:#1c1c1c;--line:#3a3a3a;--edge:#777;--good:#5fdc9a;--good-bg:#0f2419;--link:#8ab8ff;
  --o0:#ff9b73;--o1:#8ab8ff;--o2:#eba6dd;--o3:#5fd3bc;
  color:#fff;background:none;
}
.sheet .card,.player-main:not(:has(.join)) .card{background:none;color:#fff;}
:is(.sheet,.players-panel,.player-main:not(:has(.join))) .btn{background:transparent;color:#fff;border-color:#777;}
:is(.sheet,.players-panel,.player-main:not(:has(.join))) .btn:hover:not(:disabled){background:#262626;}
:is(.sheet,.players-panel,.player-main:not(:has(.join))) .btn:disabled{color:#999;border-color:#3a3a3a;}
:is(.sheet,.players-panel) .btn.primary:not(:disabled){background:#fff;color:#000;border-color:#fff;}
:is(.sheet,.players-panel) .btn.primary:not(:disabled):hover{background:#dcdcdc;}
.btn.big{font-size:16px;min-height:44px;padding:8px 26px;}
.hbar .btn{min-height:36px;padding:2px 14px;font-size:14px;}
.hbar .hpin{font-size:16px;padding:3px 14px;}
.hbar .btn svg{width:16px;height:16px;}

/* lobby */
.stage:has(.lobby){display:flex;flex-direction:column;justify-content:center;}
.lobby{min-height:0;width:100%;max-width:740px;margin:0 auto;grid-template-columns:340px minmax(0,1fr);gap:40px;align-items:center;}
.join-panel{display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:28px 31px;border-radius:5px;}
.join-panel>div:first-child{order:0;}
.join-panel .lead{font-size:14px;line-height:1.4;}
.join-url{font-size:22px;margin:0 0 2px;}
.qr{width:170px;padding:0;border-radius:0;}
.pinbox{width:100%;padding-top:12px;}
.big-pin{font-size:60px;line-height:1.1;letter-spacing:-.01em;}
.players-panel{padding:0;gap:14px;}
.players-panel h1{font-size:24px;}
.players-panel .waiting{font-size:17px;}
.players-panel .chips{max-height:46vh;overflow:auto;gap:8px;padding:4px;margin:-4px;}
.players-panel .chip{background:transparent;color:#fff;border-color:#4a4a4a;border-radius:999px;font-size:17px;min-height:36px;padding:2px 14px;}
.players-panel .chip:is(:hover,:focus-visible){color:#ff9a9a;border-color:#ff9a9a;}
.players-panel .chip.offline{color:#aaa;background:none;}
.players-panel .controls{justify-content:flex-start;gap:14px 18px;}
.players-panel .controls .small{order:2;margin:0!important;font-size:14px;}

/* questions */
.sheet{padding:8px 0;width:100%;max-width:1080px;margin:0 auto;min-height:0;}
.stage:has(.sheet){display:flex;flex-direction:column;justify-content:center;}
.qmeta{font-size:17px;font-weight:400;}
.timer-num{font-size:44px;font-weight:700;}
.timer{height:3px;background:#333;}
.timer-bar{background:#fff;}
.qtext{font-size:clamp(28px,3vw,46px);}
.qsplit{grid-template-columns:minmax(0,1fr) 250px;gap:40px;}
.options,.answers{grid-template-columns:minmax(0,1fr);gap:10px;}
.option,.answer{width:100%;font-family:inherit;text-align:left;cursor:pointer;background:transparent;color:#fff;border:1px solid #444;border-radius:5px;padding:10px 18px;min-height:64px;gap:14px;font-weight:500;transition:background .15s,color .15s,border-color .15s;}
.option{font-size:clamp(20px,1.8vw,28px);}
.answer.option{font-size:19px;}
.option:hover,button.barrow:hover{border-color:#fff;}
.radio{flex-shrink:0;display:inline-block;width:20px;height:20px;border:1.5px solid #9a9a9a;border-radius:50%;background:none;}
.badge,.option .badge,.answer .badge{background:none;color:var(--c);padding:0;gap:7px;font-size:1em;}
[aria-pressed=true].option,.answer:active,[aria-pressed=true].barrow{background:#fff;color:#000;border-color:#fff;}
[aria-pressed=true] .badge,.answer:active .badge{color:#000!important;}
[aria-pressed=true] .radio,.answer:active .radio{border:6px solid #000;}
.live h2{font-size:14px;font-weight:400;color:var(--muted);}
.barrow{border-radius:5px;background:none;color:#fff;padding:12px 18px;min-height:60px;width:100%;font-family:inherit;text-align:left;border-color:#444;font-size:clamp(19px,1.7vw,26px);}
button.barrow{cursor:pointer;grid-template-columns:auto auto minmax(0,1.5fr) minmax(0,1fr) auto;}
.bartrack,.barrow.dim .bartrack{height:4px;background:#333;}
.barrow.dim{background:none;border-color:#2e2e2e;}
.barrow.dim .bartext{color:#c4c4c4;}
.barrow.correct{border:1px solid var(--good);background:var(--good-bg);}
[aria-pressed=true] .bartrack{background:#ccc;}
[aria-pressed=true] .barfill{background:#000;}
.explain.card{background:none!important;padding:4px 0;font-size:clamp(18px,1.5vw,24px);color:#dcdcdc!important;}
.board .row{background:none;border:0;border-bottom:1px solid #2e2e2e;border-radius:0;padding:8px 4px;}
.board.compact .row{padding:5px 0;font-weight:400;}
.board .row.top1,.board .row.top1 .delta{background:none;border-color:#2e2e2e;color:var(--accent);}
.board-wrap{max-width:760px;}
.lbtitle{font-size:clamp(26px,2.6vw,40px);}
.step.empty .block{background:#1c1c1c;}
.podium{max-width:700px;}
.step.p1 .block{height:130px;} .step.p2 .block{height:96px;} .step.p3 .block{height:72px;}
.step.p2 .block,.step.p3 .block,.step.p1 .block{font-size:34px;}

/* phone */
.player-main:not(:has(.join)){padding:12px 4px;}
.ptimer{width:56px;height:56px;font-size:22px;background:conic-gradient(#fff var(--p,100%),#333 0);}
.ptimer::before{inset:3px;background:#121212;}
.ptext{font-size:21px;}
.status p{font-size:18px;}
.player-main .card.status.right{background:var(--good-bg);}
.player-main .card.status.wrong{background:#131d33;}
.player-main .card.status.right,.player-main .card.status.wrong{border-radius:5px;}
:is(.sheet,.players-panel,.player-main:not(:has(.join))) :focus-visible{outline-color:#8ab8ff;}
@media(max-width:900px){
  .lobby{grid-template-columns:minmax(0,1fr);max-width:340px;gap:26px;}
  button.barrow{grid-template-columns:auto auto minmax(0,1fr) auto;}
}
.tag{color:#000;}
.tag.warn{background:#fff;color:#000;}
/* ════════ hands-free: loading, then next ════════ */
.loadtrack{height:3px;background:#333;border-radius:3px;overflow:hidden;}
.loadbar{height:100%;background:#fff;transform:scaleX(0);transform-origin:left;}
.loading{display:flex;align-items:center;gap:12px;font-size:17px;color:#b9b9b9;margin-right:auto;font-weight:400;}
.player-main .loading{margin:6px auto 0;}
.load-num{display:inline-block;min-width:1.4em;color:#fff;font-weight:700;font-variant-numeric:tabular-nums;}
.spin{flex-shrink:0;width:18px;height:18px;border:2px solid #444;border-top-color:#fff;border-radius:50%;animation:spin .8s linear infinite;}
.skip{background:none;border:0;color:#b9b9b9;font-size:15px;text-decoration:underline;cursor:pointer;padding:8px 4px;}
.skip:hover{color:#fff;}
.skip:disabled{color:#8a8a8a;text-decoration:none;cursor:default;}
@keyframes spin{to{transform:rotate(360deg);}}
/* ════════ LEADERBOARD: podium over an outlined panel ════════ */
.board-wrap{max-width:560px;--pu:#8f7ff5;}
.lbtitle{font-size:24px;font-weight:700;}
.pod{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:end;padding:0 34px;}
.pod-col{display:flex;flex-direction:column;align-items:center;min-width:0;}
.crown{width:38px;height:25px;margin-bottom:2px;}
.pod-face{padding:3px;border-radius:50%;background:linear-gradient(180deg,#c4baff,#5a48c8);}
.avatar{display:block;flex-shrink:0;border-radius:50%;overflow:hidden;line-height:0;}
.avatar svg{width:100%;height:100%;display:block;}
.pod-face .avatar{width:56px;height:56px;}
.r1 .pod-face .avatar{width:70px;height:70px;}
.pod-name{max-width:100%;font-size:17px;font-weight:500;line-height:1.3;margin:4px 0 8px;padding:0 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pod-block{position:relative;width:100%;display:flex;justify-content:center;background:linear-gradient(180deg,#6757cf 0,#3a2f83 60%,#1b1638 100%);font-family:var(--brandfont);font-weight:700;color:#fff;line-height:1;padding-top:16px;animation:pod-rise .55s cubic-bezier(.2,.9,.3,1) both;transform-origin:bottom;}
.pod-block::before{content:'';position:absolute;left:0;right:0;bottom:100%;height:12px;background:#a598ff;clip-path:polygon(14% 0,86% 0,100% 100%,0 100%);}
.pod-name{margin-bottom:18px;}
.r1 .pod-block{height:clamp(90px,17vh,150px);font-size:58px;animation-delay:.3s;}
.r2 .pod-block{height:clamp(68px,12.5vh,112px);font-size:46px;animation-delay:.15s;}
.r3 .pod-block{height:clamp(50px,9.5vh,84px);font-size:36px;padding-top:10px;}
.lbpanel{position:relative;z-index:1;margin-top:-10px;background:#0d0d0f;border:2px solid var(--pu);border-radius:20px;padding:16px 12px 12px;}
.lbpanel:first-child{margin-top:0;}
.lbpanel::before{content:'';position:absolute;left:50%;top:-11px;width:44px;height:11px;margin-left:-22px;background:var(--pu);clip-path:polygon(0 100%,24% 18%,34% 0,66% 0,76% 18%,100% 100%);}
.board.rich{gap:6px;}
.board.rich .row{grid-template-columns:30px auto minmax(0,1fr) auto auto auto;gap:12px;background:#1a1a1d;border:0;border-radius:10px;padding:5px 14px 5px 10px;font-size:18px;font-weight:500;min-height:clamp(38px,6.1vh,52px);color:#fff!important;}
.board.rich .avatar{width:30px;height:30px;}
.board.rich .rank{color:#fff;text-align:center;font-weight:700;}
.board.rich [class*=medal] .rank{justify-self:center;width:24px;height:24px;line-height:24px;border-radius:50%;font-size:14px;color:#000;}
.board.rich .medal1 .rank{background:#ffcf4a;} .board.rich .medal2 .rank{background:#cfd6e4;} .board.rich .medal3 .rank{background:#f0a56b;}
.board.rich .delta{color:#5fdc9a!important;min-width:0;}
.board.rich .streak{color:#ffcf4a;}
.board.rich .score{font-weight:700;min-width:76px;}
@keyframes pod-rise{from{transform:scaleY(0);}to{transform:none;}}
@media(max-width:520px){.pod{padding:0 8px;}.board.rich .row{grid-template-columns:28px auto minmax(0,1fr) auto;gap:8px;}}
.final .board.rich :is(.delta,.streak){display:none;}
.stage:has(.lb){padding-top:8px;padding-bottom:8px;}
.sheet:has(.lb){padding:0;}
.sheet:has(.lb) .board-wrap{gap:10px!important;}
@media(max-height:780px){.r1 .pod-face .avatar{width:60px;height:60px;}.pod-face .avatar{width:48px;height:48px;}.crown{width:32px;height:21px;}.r1 .pod-block{font-size:48px;}.lbpanel{padding:12px 10px 10px;}.board.rich{gap:5px;}}
.final .controls .btn.btn.btn{background:#fff;color:#000;border-color:#fff;}
.final .controls .btn.btn.btn:hover{background:#dcdcdc;}
