:root {
  --bg: #0d1020; --panel: #171b33; --panel2: #1f2443; --line: #2c3360; --text: #eef0ff; --muted: #9aa2d0;
  --accent: #ffcc33; --accent-ink: #1a1400; --good: #2ecc71; --bad: #ff4d5e; --blue: #4d8dff;
  --radius: 12px; --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: "Arial Black", "Segoe UI Black", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 14px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
button:hover { filter: brightness(1.15); }
button:disabled { opacity: .4; cursor: default; filter: none; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 800; }
button.good { background: var(--good); color: #04220f; border-color: var(--good); font-weight: 800; }
button.bad { background: var(--bad); color: #2a0006; border-color: var(--bad); font-weight: 800; }
button.ghost { background: transparent; }
input, select { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #0a0d1c; color: var(--text); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- slide stage ---------- */
.stage-wrap { position: relative; overflow: hidden; background: #000; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; background: #000; }
.stage .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; user-select: none; }
.stage .layer { position: absolute; transition: opacity .45s ease, filter .45s ease, transform .45s ease; }
.stage.instant .layer { transition: none !important; }
.stage .layer.tx { display: flex; }
.stage .txbox { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; }
.stage .txt { white-space: pre-wrap; line-height: 1.12; overflow-wrap: break-word; width: 100%; outline: none; }
.stage .albl { position: absolute; top: 50%; transform: translateY(-50%); border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; display: grid; place-items: center; border: 3px solid rgba(255, 255, 255, .75); line-height: 1; }

/* ---------- editor ---------- */
body.editor { display: grid; grid-template-rows: auto 1fr; height: 100vh; overflow: hidden; }
.ed-main { display: grid; grid-template-columns: 200px 1fr 330px; min-height: 0; }
.ed-slides { overflow-y: auto; border-right: 1px solid var(--line); padding: 8px; background: #0b0e1d; }
.ed-thumb { position: relative; margin-bottom: 8px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; background: #000; }
.ed-thumb.cur { border-color: var(--accent); }
.ed-thumb.drop-before { box-shadow: 0 -4px 0 var(--accent); }
.ed-thumb .tw { width: 100%; aspect-ratio: 16/9; border-radius: 6px; }
.ed-thumb .no { position: absolute; left: 4px; top: 4px; z-index: 5; background: rgba(0, 0, 0, .75); font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; }
.ed-thumb .ty { position: absolute; right: 4px; bottom: 4px; z-index: 5; background: rgba(0, 0, 0, .75); font-size: 10px; padding: 1px 6px; border-radius: 6px; color: var(--accent); }
.ed-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ed-tools { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); align-items: center; }
.ed-tools button { padding: 7px 10px; font-size: 13px; }
.ed-canvas { flex: 1; position: relative; min-height: 0; background: #05060d; }
.ed-canvas .stage-wrap { position: absolute; inset: 14px; background: transparent; overflow: visible; }
.ed-canvas .stage { box-shadow: 0 0 0 1px #333, 0 10px 40px rgba(0, 0, 0, .6); overflow: hidden; }
.ed-canvas .stage .layer { cursor: move; }
.ed-canvas .stage .layer[data-show="DisplayAfterAnswer"], .ed-canvas .stage .layer[data-show="AfterBuzzed"], .ed-canvas .stage .layer[data-show="HideAfterAnswer"] { opacity: 1; transform: none; }
.ed-canvas .stage .layer[data-show="DisplayAfterAnswer"]::after, .ed-canvas .stage .layer[data-show="AfterBuzzed"]::after { content: 'after answer'; position: absolute; right: 0; top: 0; background: #2ecc71; color: #000; font: 700 22px var(--font); padding: 2px 10px; border-radius: 0 0 0 10px; z-index: 60; }
.ed-canvas .stage .layer[data-show="AfterBuzzed"]::after { content: 'after buzz'; }
.ed-canvas .stage .layer.editing { cursor: text; }
.ed-canvas .stage .layer.editing .txt { outline: 3px dashed rgba(255, 204, 51, .8); cursor: text; user-select: text; }
.sel { position: absolute; border: 3px solid var(--accent); pointer-events: none; z-index: 900; box-shadow: 0 0 0 1px #000; }
.sel .h { position: absolute; width: 13px; height: 13px; background: #fff; border: 2px solid var(--accent); border-radius: 3px; pointer-events: auto; }
.sel .h[data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; } .sel .h[data-h="n"] { left: calc(50% - 6px); top: -8px; cursor: ns-resize; }
.sel .h[data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; } .sel .h[data-h="e"] { right: -8px; top: calc(50% - 6px); cursor: ew-resize; }
.sel .h[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; } .sel .h[data-h="s"] { left: calc(50% - 6px); bottom: -8px; cursor: ns-resize; }
.sel .h[data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; } .sel .h[data-h="w"] { left: -8px; top: calc(50% - 6px); cursor: ew-resize; }
.guide { position: absolute; background: #ff3df0; z-index: 899; pointer-events: none; }
.ed-panel { border-left: 1px solid var(--line); overflow-y: auto; background: #0b0e1d; }
.ed-tabs { display: flex; position: sticky; top: 0; z-index: 2; background: #0b0e1d; border-bottom: 1px solid var(--line); }
.ed-tabs button { flex: 1; border-radius: 0; border: 0; background: transparent; padding: 10px; color: var(--muted); font-weight: 700; }
.ed-tabs button.on { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.pgroup { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pgroup h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.prow { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.prow > label { font-size: 12px; color: var(--muted); min-width: 64px; }
.prow input[type=number] { width: 76px; padding: 6px 8px; }
.prow input[type=text], .prow select, .prow textarea { flex: 1; min-width: 0; padding: 6px 8px; }
.prow input[type=color] { width: 40px; height: 32px; padding: 0 2px; border-radius: 6px; border: 1px solid var(--line); background: #0a0d1c; }
.prow button { padding: 6px 9px; font-size: 13px; }
.prow button.on { background: var(--accent); color: var(--accent-ink); }
.ed-panel textarea { font: inherit; background: #0a0d1c; color: var(--text); border: 1px solid var(--line); border-radius: 8px; width: 100%; min-height: 70px; padding: 8px; resize: vertical; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.menu { position: absolute; z-index: 1000; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); min-width: 220px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; }
.menu button:hover { background: var(--panel2); }
.dirty { color: var(--accent); font-weight: 800; }
.ed-empty { padding: 20px; color: var(--muted); }
.medialist .mi { display: flex; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.medialist .mi span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage .layer img { width: 100%; height: 100%; display: block; user-select: none; }
.stage video.layer { object-fit: contain; background: #000; }
.stage .layer[data-show="DisplayAfterAnswer"], .stage .layer[data-show="AfterBuzzed"] { opacity: 0; transform: scale(.96); }
.stage.revealed .layer[data-show="DisplayAfterAnswer"], .stage.buzzed .layer[data-show="AfterBuzzed"] { opacity: 1; transform: none; }
.stage.revealed .layer[data-show="HideAfterAnswer"] { opacity: 0; }
.stage.revealed .layer[data-show="DisplayAfterAnswer"] { transition-delay: var(--rd, 0s); }
.stage.has-correct .layer[data-letter]:not(.correct) { opacity: .3; filter: grayscale(.8); }
.stage .layer.correct { z-index: 50 !important; animation: correctPulse 1.4s ease-in-out infinite; filter: drop-shadow(0 0 14px #ffe066) drop-shadow(0 0 28px #ffcc33); }
/* the right answer turns green: two layers cut to the answer's outline - a deep emerald gradient that recolours the
   picture (its light and shade stay), and a soft top-down sheen - with a green glow instead of gold */
.stage .layer .win { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s ease; mix-blend-mode: color;
  background: linear-gradient(180deg, #7dffa8 0%, #22d164 38%, #0fa346 62%, #08702f 100%); }
.stage .layer .win.shine { mix-blend-mode: soft-light; background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(120,255,170,.35) 40%, rgba(0,90,30,.45) 100%); }
.stage .layer.correct .win { opacity: 1; }
.stage .layer.correct:has(.win) { filter: drop-shadow(0 0 12px rgba(80, 255, 140, .85)) drop-shadow(0 0 30px rgba(20, 200, 90, .6)); }
/* gold instead of green: game setting winColour = 'gold' */
.stage[data-win="gold"] .layer .win { background: linear-gradient(180deg, #fff3b0 0%, #ffd23f 35%, #e9a400 62%, #9a6200 100%); }
.stage[data-win="gold"] .layer .win.shine { background: linear-gradient(180deg, rgba(255,255,255,.6) 0%, rgba(255,230,140,.35) 40%, rgba(90,50,0,.45) 100%); }
.stage[data-win="gold"] .layer.correct:has(.win) { filter: drop-shadow(0 0 12px rgba(255, 220, 90, .9)) drop-shadow(0 0 30px rgba(255, 180, 20, .65)); }
.stage[data-win="gold"] .layer.tx.correct[data-letter] { background: linear-gradient(180deg, #fff3b0 0%, #ffd23f 30%, #e9a400 62%, #9a6200 100%) !important; border-color: #fff1a8 !important; color: #2b1a00 !important; text-shadow: 0 1px 0 rgba(255,255,255,.5); filter: drop-shadow(0 0 12px rgba(255, 220, 90, .9)) drop-shadow(0 0 30px rgba(255, 180, 20, .65)); }
/* answers drawn as live text boxes get the same green */
.stage .layer.tx.correct[data-letter] { background: linear-gradient(180deg, #8dffb4 0%, #2bd36b 30%, #12a84a 62%, #0a7434 100%) !important; border-color: #b8ffd0 !important; color: #fff !important; text-shadow: 0 2px 3px rgba(0, 60, 20, .55); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), inset 0 -4px 0 rgba(0,70,25,.4); filter: drop-shadow(0 0 12px rgba(80, 255, 140, .85)) drop-shadow(0 0 30px rgba(20, 200, 90, .6)); }
@keyframes correctPulse { 50% { transform: scale(1.035); } }

/* ---------- big screen ---------- */
body.screen { overflow: hidden; background: #000; cursor: none; }
body.screen .stage-wrap { position: fixed; inset: 0; }
.ov { position: fixed; z-index: 100; pointer-events: none; }
.chip { background: rgba(8, 10, 25, .82); border: 2px solid rgba(255, 255, 255, .15); border-radius: 999px; padding: .35em .9em; font-family: var(--display); font-size: 2.2vh; color: #fff; backdrop-filter: blur(4px); }
#timer { right: 2.2vh; top: 2.2vh; width: 15vh; height: 15vh; }   /* the gold clock itself is drawn by clock.js */
@keyframes shake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
#counter { left: 2vh; bottom: 2vh; }
#kochip { right: 2vh; bottom: 2vh; border-color: var(--accent); }
#banner .b.ko { background: var(--bad); color: #fff; }
.team.ko-out .nm { text-decoration: line-through; opacity: .6; }
.ph-out { background: rgba(255, 77, 94, .15); border: 2px solid var(--bad); color: var(--text); border-radius: 12px; padding: 8px 12px; text-align: center; font-weight: 800; }
#joinchip { right: 2vh; bottom: 2vh; display: flex; align-items: center; gap: 1vh; padding: .6vh .6vh .6vh 1.4vh; border-radius: 1.4vh; }
#joinchip img { width: 9vh; height: 9vh; background: #fff; border-radius: .8vh; }
#banner { left: 0; right: 0; bottom: 12vh; display: flex; justify-content: center; }
#banner .b { font-family: var(--display); font-size: 6vh; padding: 1.5vh 5vh; border-radius: 2vh; color: #111; box-shadow: 0 1vh 4vh rgba(0, 0, 0, .6); animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); text-align: center; max-width: 90vw; }
#banner .b small { display: block; font-family: var(--font); font-size: 2.6vh; font-weight: 700; opacity: .8; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
#results { left: 2vh; right: 2vh; top: 2vh; display: flex; gap: 1vh; flex-wrap: wrap; justify-content: center; }
#results .r { font-family: var(--font); font-weight: 800; font-size: 3vh; padding: .5vh 1.4vh; border-radius: 999px; background: rgba(8, 10, 25, .85); border: 2px solid; animation: pop .3s backwards; }
.full { position: fixed; inset: 0; z-index: 200; background: radial-gradient(ellipse at top, #24306b, #070914 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.full h1 { font-family: var(--display); font-size: 7vh; margin: 0 0 3vh; letter-spacing: .02em; text-align: center; }
#lobby .row { display: flex; gap: 6vh; align-items: center; }
#lobby .qr { background: #fff; padding: 2vh; border-radius: 2vh; width: 44vh; height: 44vh; }
#lobby .qr img { width: 100%; height: 100%; }
#lobby .how { font-size: 3.4vh; line-height: 1.5; }
#lobby .code { font-family: var(--display); font-size: 12vh; letter-spacing: .12em; color: var(--accent); line-height: 1; }
#lobby .url { font-family: var(--display); font-size: 4vh; }
#lobby .teams { margin-top: 4vh; display: flex; flex-wrap: wrap; gap: 1.2vh; justify-content: center; max-width: 90vw; }
.tchip { display: inline-flex; align-items: center; gap: .6em; padding: .4em .9em; border-radius: 999px; background: rgba(255, 255, 255, .08); font-weight: 800; font-size: 2.6vh; animation: pop .3s backwards; }
.dot { width: .8em; height: .8em; border-radius: 50%; display: inline-block; flex: none; }
#board ol { list-style: none; padding: 0; margin: 0; width: min(80vw, 120vh); }
#board li { display: grid; grid-template-columns: 8vh 1fr auto; align-items: center; gap: 2vh; padding: 1.2vh 2.4vh; margin: .8vh 0; border-radius: 1.6vh; background: rgba(255, 255, 255, .07); font-size: 3.6vh; font-weight: 800; animation: slideIn .5s backwards; }
#board li .rk { font-family: var(--display); color: var(--accent); font-size: 4vh; }
#board li .sc { font-family: var(--display); }
#board li.top { background: linear-gradient(90deg, rgba(255, 204, 51, .35), rgba(255, 204, 51, .08)); }
@keyframes slideIn { from { transform: translateX(-6vw); opacity: 0; } }
#start { position: fixed; inset: 0; z-index: 500; background: #070914; display: grid; place-items: center; cursor: pointer; text-align: center; }
#start h1 { font-family: var(--display); font-size: 6vh; }

/* ---------- host ---------- */
body.host { display: grid; grid-template-rows: auto 1fr; height: 100vh; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-family: var(--display); font-size: 20px; letter-spacing: .02em; }
.brand b { color: var(--accent); }
.roomcode { font-family: var(--display); font-size: 22px; color: var(--accent); letter-spacing: .1em; }
.spacer { flex: 1; }
.host-main { display: grid; grid-template-columns: 210px 1fr 340px; min-height: 0; }
.slides { overflow-y: auto; border-right: 1px solid var(--line); padding: 8px; background: #0b0e1d; }
.thumb { position: relative; border-radius: 8px; overflow: hidden; margin-bottom: 8px; cursor: pointer; border: 2px solid transparent; }
.thumb img { width: 100%; display: block; aspect-ratio: 16/10; object-fit: cover; background: #000; }
.thumb.cur { border-color: var(--accent); }
.thumb .no { position: absolute; left: 4px; top: 4px; background: rgba(0, 0, 0, .75); font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; }
.thumb .ty { position: absolute; right: 4px; bottom: 4px; background: rgba(0, 0, 0, .75); font-size: 10px; padding: 1px 6px; border-radius: 6px; color: var(--muted); }
.thumb .ty.q { color: var(--accent); }
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px; gap: 10px; overflow-y: auto; }
#preview { width: 100%; aspect-ratio: 16/9; border-radius: var(--radius); flex: none; max-height: 52vh; }
.qinfo { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.qinfo .q { font-size: 18px; font-weight: 700; white-space: pre-wrap; }
.qinfo .ans { margin-top: 6px; font-size: 18px; } .qinfo .ans b { color: var(--good); }
.qinfo .meta { margin-top: 6px; color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.qinfo .notes { margin-top: 6px; color: #c9cdf0; font-size: 14px; white-space: pre-wrap; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#stepBtn { font-size: 20px; padding: 14px 22px; min-width: 240px; }
.judge { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 2px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; font-size: 18px; }
.judge button { font-size: 18px; padding: 12px 20px; }
.phase { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.side { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #0b0e1d; }
.side h3 { margin: 0; padding: 12px 14px 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: flex; justify-content: space-between; }
.teamlist { overflow-y: auto; flex: 1; padding: 0 8px 8px; }
.team { display: grid; grid-template-columns: 26px 1fr auto; gap: 4px 8px; align-items: center; padding: 8px; border-radius: 10px; background: var(--panel); margin-bottom: 6px; border: 1px solid var(--line); }
.team.off { opacity: .45; }
.team .rk { font-weight: 800; color: var(--accent); text-align: center; }
.team .nm { font-weight: 700; display: flex; align-items: center; gap: 6px; min-width: 0; } .team .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team .sc { font-family: var(--display); font-size: 18px; text-align: right; cursor: pointer; }
.team .ans { grid-column: 2 / 4; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.team .ans .v { color: var(--text); font-weight: 700; } .team .ans .ok { color: var(--good); font-weight: 800; } .team .ans .no { color: var(--bad); font-weight: 800; }
.team .tools { grid-column: 1 / 4; display: none; gap: 4px; flex-wrap: wrap; } .team.open .tools { display: flex; }
.team .tools button { padding: 4px 8px; font-size: 12px; }
.sidefoot { padding: 8px; display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.sidefoot button { font-size: 12px; padding: 6px 8px; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; z-index: 50; }
.modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; width: min(900px, 94vw); max-height: 88vh; overflow-y: auto; }
.modal h2 { margin: 0 0 12px; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.game { background: var(--panel2); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; }
.game img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: #000; }
.game div { padding: 8px 10px; font-weight: 700; } .game small { display: block; color: var(--muted); font-weight: 400; }
.importbox { margin-top: 16px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; }
.importbox .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.importbox input[type=text] { flex: 1; min-width: 260px; }
#importLog { margin-top: 10px; max-height: 180px; overflow-y: auto; font: 12px/1.4 Consolas, monospace; color: var(--muted); white-space: pre-wrap; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 99; }
.kbd { font: 11px Consolas, monospace; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--muted); }
@media (max-width: 1100px) { .host-main { grid-template-columns: 150px 1fr 280px; } }

/* ---------- phone ---------- */
body.phone { min-height: 100%; display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
/* iPhones refuse typing into a box whose page has selection switched off, so switch it back on for inputs */
body.phone input, body.phone textarea { user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; }
.ph-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--panel); border-bottom: 3px solid var(--tc, var(--accent)); }
.ph-top .nm { font-weight: 800; font-size: 18px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-top .sc { font-family: var(--display); font-size: 20px; } .ph-top .rk { color: var(--muted); font-size: 13px; }
.ph-body { flex: 1; display: flex; flex-direction: column; padding: 16px; gap: 14px; }
.ph-q { font-size: 20px; font-weight: 700; line-height: 1.3; }
.ph-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.ph-center h2 { font-size: 28px; margin: 0; } .ph-center p { margin: 0; color: var(--muted); font-size: 17px; }
.big { font-family: var(--display); font-size: 52px; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 16px; font-size: 19px; font-weight: 700; border-radius: 14px; background: var(--panel2); border: 2px solid var(--line); }
.opt .l { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #0a0d1c; font-family: var(--display); }
.opt.sel { border-color: var(--accent); background: #3a3215; } .opt.sel .l { background: var(--accent); color: var(--accent-ink); }
.ph-input { font-size: 22px; padding: 16px; width: 100%; border-radius: 14px; }
.ph-send { font-size: 22px; padding: 16px; width: 100%; border-radius: 14px; }
.buzzer { width: min(78vw, 46vh); aspect-ratio: 1; border-radius: 50%; border: 0; font-family: var(--display); font-size: 44px; color: #fff; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), transparent 45%), radial-gradient(circle at 50% 50%, var(--tc, #e6194b) 55%, color-mix(in srgb, var(--tc, #e6194b) 55%, #000)); box-shadow: 0 14px 0 color-mix(in srgb, var(--tc, #e6194b) 35%, #000), 0 24px 40px rgba(0, 0, 0, .5); transition: transform .05s, box-shadow .05s; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); touch-action: manipulation; }
.buzzer:active, .buzzer.down { transform: translateY(10px); box-shadow: 0 4px 0 #4a000b, 0 10px 20px rgba(0, 0, 0, .5); }
.buzzer:disabled { background: radial-gradient(circle at 35% 30%, #777, #444 60%, #222); box-shadow: 0 14px 0 #111; opacity: 1; }
.buzzer.won { animation: wonPulse .6s infinite alternate; }
@keyframes wonPulse { to { box-shadow: 0 14px 0 #4a000b, 0 0 60px 20px var(--tc, #ffcc33); } }
.result { padding: 24px; border-radius: 18px; text-align: center; }
.result.ok { background: rgba(46, 204, 113, .15); border: 2px solid var(--good); } .result.no { background: rgba(255, 77, 94, .12); border: 2px solid var(--bad); }
.result .big { font-size: 40px; }
.timerbar { height: 8px; border-radius: 99px; background: var(--panel2); overflow: hidden; } .timerbar i { display: block; height: 100%; background: var(--accent); width: 100%; }
.join { max-width: 420px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 12px; padding-top: 6vh; }
.join h1 { font-family: var(--display); text-align: center; margin: 0; } .join h1 b { color: var(--accent); }
.err { color: var(--bad); font-weight: 700; text-align: center; }
#banner.low { bottom: 3vh; }

/* ---------- QuizXpress special rounds (rounds-ui.js), drawn in slide pixels ---------- */
.round-ov { position: absolute; left: 0; top: 0; z-index: 800; pointer-events: none; font-family: var(--display); color: #fff; }
.round-ov .bc[data-i], .round-ov .fp[data-k] { pointer-events: auto; }
.feud { position: absolute; left: 6%; right: 6%; top: 6%; bottom: 6%; display: flex; flex-direction: column; gap: 3%; }
.feud .ft { background: linear-gradient(180deg, #1c3fa8, #0b1f63); border: .18em solid #ffcc33; border-radius: .6em; padding: .5em 1em; text-align: center; font-size: 1.5em; line-height: 1.15; box-shadow: 0 .3em 1em rgba(0,0,0,.6); }
.feud .fg { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 2.5%; }
.feud .fc { display: flex; flex-direction: column; gap: 4%; }
.fp { flex: 1; display: flex; align-items: center; justify-content: center; border-radius: .4em; border: .14em solid #ffcc33; background: linear-gradient(180deg, #2a55d4, #102c86); font-size: 1.7em; position: relative; box-shadow: inset 0 0 .6em rgba(0,0,0,.5); }
.fp .fn { display: inline-flex; width: 2em; height: 1.4em; border-radius: 50%; align-items: center; justify-content: center; background: #0a1a52; border: .08em solid #ffcc33; }
.fp.open { background: linear-gradient(180deg, #ffe27a, #e0a10f); color: #1a1000; justify-content: space-between; padding: 0 .7em; }
.fp.open .fl { font-size: .9em; text-transform: uppercase; text-align: left; } .fp.open .fs { font-size: 1.05em; background: #1a1000; color: #ffcc33; border-radius: .3em; padding: 0 .35em; }
.fp.peek { justify-content: space-between; padding: 0 .7em; color: #b8c6ff; } .fp.peek .fl { font-size: .8em; opacity: .75; } .fp.peek .fs { font-size: .8em; opacity: .75; }
.fp.flip { animation: fflip .5s ease-out; }
@keyframes fflip { 0% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.fp .fby { position: absolute; right: .5em; bottom: -.1em; font-size: .4em; font-style: normal; color: #5a3d00; }
.feud .fx { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .3em; pointer-events: none; }
.feud .fx b { font-size: 9em; color: #ff2e3e; text-shadow: 0 0 .15em #000, 0 0 .4em #ff2e3e; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.feud .fm { position: absolute; right: 0; top: -1.6em; background: #ffcc33; color: #1a1000; border-radius: 1em; padding: .1em .7em; font-size: .9em; }
.tb { position: absolute; left: 4%; right: 4%; top: 6%; bottom: 6%; display: grid; gap: .5em; grid-auto-rows: 1fr; }
.tb .bt { background: linear-gradient(180deg, #1c3fa8, #0b1f63); border: .1em solid #6d86ff; border-radius: .3em; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 1.1em; text-transform: uppercase; padding: .2em; line-height: 1.05; }
.tb .bc { background: linear-gradient(180deg, #1f3ec0, #0c2178); border: .1em solid #6d86ff; border-radius: .3em; display: flex; align-items: center; justify-content: center; font-size: 2.2em; color: #ffcc33; text-shadow: .06em .06em 0 #000; cursor: pointer; }
.tb .bc.used, .tb .bc.none { background: rgba(10, 20, 60, .55); border-color: rgba(109, 134, 255, .25); cursor: default; }
.tb .bc[data-i]:hover { filter: brightness(1.25); }
.ladder { position: absolute; left: 30%; right: 30%; top: 5%; bottom: 5%; display: flex; flex-direction: column; gap: .5%; }
.ladder.side { left: auto; right: 1%; width: 19%; top: 3%; bottom: 3%; font-size: .66em; }
.ladder .lr { flex: 1; display: flex; align-items: center; gap: .6em; background: rgba(8, 14, 44, .88); border: .08em solid #3a4b9a; border-radius: 1em; padding: 0 .8em; }
.ladder .lr.safe { border-color: #ffcc33; } .ladder .lr.safe .lp { color: #ffcc33; }
.ladder .lr.cur { background: rgba(255, 204, 51, .25); }
.ladder .lr.ground { opacity: .8; }
.ladder .ln { width: 1.6em; color: #8fa0e8; } .ladder .lp { width: 3.5em; text-align: right; color: #f5961e; }
.ladder .lt { flex: 1; display: flex; align-items: center; gap: .25em; overflow: hidden; white-space: nowrap; }
.ladder .lt .dot { width: .8em; height: .8em; border-radius: 50%; display: inline-block; flex: none; }
.ladder .lt em { font-style: normal; font-family: var(--font); font-size: .7em; opacity: .85; margin-left: .3em; overflow: hidden; text-overflow: ellipsis; }
/* phone: bingo card and feud list */
.bingo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.bingo .c { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 10px; line-height: 1.1; padding: 2px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; word-break: break-word; }
.bingo .c.on { background: var(--accent); color: var(--accent-ink); font-weight: 800; border-color: var(--accent); }
.bingo .c.free { background: #3a3215; color: var(--accent); font-weight: 800; }
.feudlist { display: flex; flex-direction: column; gap: 6px; } .feudlist .f { display: flex; justify-content: space-between; background: rgba(46, 204, 113, .15); border: 1px solid var(--good); border-radius: 10px; padding: 8px 12px; font-weight: 800; }
.strikes { color: var(--bad); font-weight: 900; font-size: 22px; letter-spacing: 4px; text-align: center; }

/* phone: one-time "keep your screen on" tip */
.ph-tip { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 50; background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.6); font-size: 14px; line-height: 1.35; }
.ph-tip strong { display: block; color: var(--accent); font-family: var(--display); margin-bottom: 4px; }
.ph-tip span b { color: var(--text); }
.ph-tip span { color: var(--muted); }
.ph-tip button { display: block; margin: 10px 0 0 auto; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 800; }
