:root {
  --bg: #060a12;
  --bg2: #0a101c;
  --panel: rgba(14, 21, 35, .82);
  --panel-solid: #0e1523;
  --raise: #141e31;
  --line: rgba(214, 180, 106, .16);
  --line-2: rgba(255, 255, 255, .07);
  --gold: #d6b46a;
  --gold-hi: #f3d995;
  --gold-lo: #8a6d34;
  --teal: #19d3c5;
  --teal-lo: #0b6f6a;
  --text: #ece6d6;
  --muted: #8a93a8;
  --dim: #5b6479;
  --good: #3ddc97;
  --bad: #ff5a64;
  --radius: 14px;
  --display: 'Chakra Petch', 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --side-w: 320px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(25, 211, 197, .10), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(214, 180, 106, .10), transparent 60%),
    linear-gradient(180deg, #070c16, #05080f);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; opacity: .35; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64l28 16v32M28 64L0 80v32' fill='none' stroke='%23d6b46a' stroke-opacity='.07'/%3E%3C/svg%3E");
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(25, 211, 197, .35); }
.hidden { display: none !important; }

/* ---------- shell ---------- */
#app { height: 100%; display: grid; grid-template-rows: 64px 1fr auto; }
.top {
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 16, 28, .95), rgba(10, 16, 28, .7));
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 14px; color: var(--gold-hi); white-space: nowrap; }
.brand-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); }
.pill.off .dot { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--muted); transition: .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .06); }
.icon-btn svg { width: 18px; height: 18px; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); transition: .2s; }
.me-chip:hover { border-color: var(--line); }
.me-chip b { font-weight: 700; font-size: 13.5px; }

.layout { display: grid; grid-template-columns: 1fr var(--side-w); min-height: 0; }
#stage { position: relative; min-height: 0; overflow: hidden; padding: 22px; }
#side { border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(10, 16, 28, .75), rgba(8, 12, 22, .9)); display: flex; flex-direction: column; min-height: 0; }

/* ---------- buttons ---------- */
.btn {
  --c: var(--gold);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 20%, transparent), color-mix(in srgb, var(--c) 8%, transparent));
  color: color-mix(in srgb, var(--c) 30%, #fff); font-weight: 700; font-size: 14px; letter-spacing: .01em; white-space: nowrap;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent), 0 8px 30px -8px color-mix(in srgb, var(--c) 60%, transparent); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.solid { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1a1408; border-color: var(--gold-hi); }
.btn.teal { --c: var(--teal); }
.btn.good { --c: var(--good); }
.btn.bad { --c: var(--bad); }
.btn.ghost { --c: #9aa3b8; background: transparent; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn.lg { height: 54px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .4; pointer-events: none; }
kbd { font-family: var(--display); font-size: 11px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); color: var(--muted); }

/* ---------- avatars ---------- */
.av { --c: var(--gold); position: relative; flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--c) 70%, #fff 10%), color-mix(in srgb, var(--c) 35%, #050810) 75%);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 70%, #fff 0%), 0 4px 14px -6px var(--c); }
.av svg { width: 58%; height: 58%; fill: rgba(255, 255, 255, .92); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.team { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .04em; color: #fff; }
.av.off::after { content: ''; position: absolute; inset: 0; background: rgba(5, 8, 14, .55); }

/* ---------- scoreboard ---------- */
.side-head { padding: 18px 20px 12px; display: flex; align-items: baseline; justify-content: space-between; }
.side-title { font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.side-meta { font-size: 12px; color: var(--dim); }
#scores { flex: 1; overflow-y: auto; padding: 4px 12px 16px; position: relative; }
.srow { position: relative; display: grid; grid-template-columns: 22px auto 1fr auto; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; margin-bottom: 6px;
  background: rgba(255, 255, 255, .025); border: 1px solid var(--line-2); transition: background .3s, border-color .3s, box-shadow .3s; }
.srow .rank { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--dim); text-align: center; }
.srow:nth-child(1) .rank { color: var(--gold-hi); }
.srow:nth-child(2) .rank { color: #c9d1de; }
.srow:nth-child(3) .rank { color: #d3976a; }
.srow .who { min-width: 0; }
.srow .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 4px; align-items: center; min-height: 14px; flex-wrap: wrap; }
.srow .sub .mini { width: 16px; height: 16px; border-radius: 5px; }
.srow .score { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--gold-hi); font-variant-numeric: tabular-nums; text-align: right; }
.srow .score.neg { color: var(--bad); }
.srow.buzz { border-color: var(--teal); background: rgba(25, 211, 197, .1); box-shadow: 0 0 0 1px var(--teal), 0 0 30px -6px var(--teal); }
.srow.locked { opacity: .55; }
.srow .tag { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; background: rgba(61, 220, 151, .14); color: var(--good); }
.srow .tag.t2 { background: rgba(25, 211, 197, .15); color: var(--teal); }
.srow .tag.t3 { background: rgba(255, 90, 100, .14); color: var(--bad); }
.srow .adj { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: none; gap: 4px; }
.srow:hover .adj { display: flex; }
.srow .adj button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-solid); color: var(--gold-hi); font-weight: 800; }
.srow .adj button:hover { background: var(--raise); }
.delta { position: absolute; right: 14px; top: -6px; font-family: var(--display); font-weight: 700; font-size: 16px; pointer-events: none; animation: deltaUp 1.6s var(--ease-out) forwards; }
.delta.up { color: var(--good); text-shadow: 0 0 12px rgba(61, 220, 151, .6); }
.delta.down { color: var(--bad); text-shadow: 0 0 12px rgba(255, 90, 100, .6); }
@keyframes deltaUp { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 15% { opacity: 1; transform: translateY(0) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px); } }
.empty-note { color: var(--dim); font-size: 13px; text-align: center; padding: 30px 10px; line-height: 1.6; }

/* ---------- board ---------- */
.board { height: 100%; display: grid; gap: 10px; grid-auto-rows: 1fr; }
.board .cat {
  display: grid; place-items: center; text-align: center; padding: 10px; border-radius: 12px; min-height: 0;
  font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: clamp(12px, 1.25vw, 17px); line-height: 1.2; color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(214, 180, 106, .14), rgba(214, 180, 106, .03)); border: 1px solid rgba(214, 180, 106, .35);
}
.cell {
  position: relative; border-radius: 12px; border: 1px solid rgba(214, 180, 106, .2); min-height: 0; padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0) 45%),
    linear-gradient(160deg, #13203a, #0b1222);
  display: grid; place-items: center; overflow: hidden;
  font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3vw, 44px); color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5), 0 0 24px rgba(214, 180, 106, .25);
  transition: transform .25s var(--ease-out), border-color .25s, box-shadow .25s, color .25s, opacity .4s;
  cursor: default;
}
.cell::before { content: ''; position: absolute; inset: 5px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .04); pointer-events: none; }
.cell .tico { position: absolute; left: 10px; bottom: 8px; width: 14px; height: 14px; opacity: .3; fill: var(--muted); }
.host .cell:not(.used) { cursor: pointer; }
.host .cell:not(.used):hover, .cell.active {
  transform: translateY(-2px); border-color: var(--teal); color: var(--gold-hi);
  box-shadow: 0 0 0 1px var(--teal), 0 16px 40px -14px rgba(25, 211, 197, .55);
}
.cell.used { color: transparent; text-shadow: none; background: rgba(255, 255, 255, .015); border-color: var(--line-2); }
.cell.used::after { content: ''; width: 22px; height: 2px; border-radius: 2px; background: var(--dim); opacity: .5; }
.cell.used .tico { display: none; }
.host .cell.used { cursor: pointer; }
.board.dimmed { filter: blur(3px) brightness(.45); transition: filter .6s; }
.board { transition: filter .6s; }

/* ---------- question card ---------- */
.qwrap { position: absolute; inset: 22px; z-index: 5; perspective: 1800px; }
.qwrap.leaving { transform-origin: center !important; animation: qLeave .45s var(--ease-out) forwards; }
@keyframes qLeave { to { opacity: 0; transform: scale(.96) translateY(10px); } }
.qcard { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: center; transition: transform .8s var(--ease-out); }
.qcard.flipped { transform: rotateY(180deg); }
.qface { position: absolute; inset: 0; border-radius: 20px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.qfront { display: grid; place-content: center; text-align: center; gap: 10px;
  background: radial-gradient(circle at 50% 40%, #1a2b4c, #0b1222 70%); border: 1.5px solid var(--gold); box-shadow: 0 0 80px -20px rgba(214, 180, 106, .6); }
.qf-cat { font-family: var(--display); font-weight: 700; letter-spacing: .25em; text-transform: uppercase; color: var(--gold); font-size: clamp(14px, 1.6vw, 22px); }
.qf-pts { font-family: var(--display); font-weight: 700; font-size: clamp(60px, 10vw, 150px); line-height: 1; color: var(--gold-hi); text-shadow: 0 0 50px rgba(243, 217, 149, .4); }
.qback { transform: rotateY(180deg); display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(20, 31, 53, .97), rgba(10, 16, 29, .98)); border: 1px solid rgba(214, 180, 106, .4);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .05); }
.qhead { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); position: relative; }
.qcat { font-family: var(--display); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); font-size: 13px; }
.qpts { font-family: var(--display); font-weight: 700; font-size: 15px; color: #1a1408; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); padding: 3px 10px; border-radius: 7px; }
.qtype { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--teal); padding: 4px 10px; border-radius: 99px; background: rgba(25, 211, 197, .1); border: 1px solid rgba(25, 211, 197, .25); }
.qtype svg { width: 13px; height: 13px; fill: currentColor; }
.qhostans { margin-left: auto; font-size: 12.5px; color: var(--muted); max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qhostans b { color: var(--gold-hi); }
.qclock { font-family: var(--display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; color: var(--text); min-width: 54px; text-align: right; }
.qclock.warn { color: var(--bad); animation: pulse 1s infinite; }
.qbar { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; overflow: hidden; }
.qbar i { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(90deg, var(--teal), var(--gold-hi)); box-shadow: 0 0 12px var(--teal); }
.qbody { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 26px 30px 22px; overflow-y: auto; }
.qprompt { font-family: var(--body); font-weight: 700; font-size: clamp(22px, 2.6vw, 40px); line-height: 1.25; text-align: center; max-width: 1000px; letter-spacing: -.01em; text-wrap: balance; }
.qprompt.small { font-size: clamp(18px, 1.8vw, 26px); }
.qprompt .w { display: inline-block; opacity: 0; transform: translateY(10px); animation: wordIn .5s var(--ease-out) forwards; }
@keyframes wordIn { to { opacity: 1; transform: none; } }
.qmedia img { max-width: 100%; max-height: 34vh; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 20px 50px -20px #000; display: block; }
.qzone { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; flex: 1; justify-content: center; }

/* audio */
.audio { display: flex; align-items: center; gap: 16px; padding: 12px 20px 12px 12px; border-radius: 99px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.audio .play { width: 52px; height: 52px; border-radius: 50%; border: none; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); display: grid; place-items: center; box-shadow: 0 0 30px -6px var(--gold); }
.audio .play svg { width: 20px; height: 20px; fill: #1a1408; }
.eq { display: flex; align-items: center; gap: 4px; height: 34px; }
.eq i { width: 4px; border-radius: 3px; background: var(--teal); height: 20%; opacity: .5; }
.audio.playing .eq i { animation: eq .9s ease-in-out infinite; opacity: 1; }
.eq i:nth-child(2n) { animation-delay: -.3s !important; } .eq i:nth-child(3n) { animation-delay: -.6s !important; } .eq i:nth-child(5n) { animation-delay: -.15s !important; }
@keyframes eq { 0%, 100% { height: 18%; } 50% { height: 100%; } }
.audio .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }

/* buzzer */
.ready { font-family: var(--display); font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); font-size: 15px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.buzz-btn {
  position: relative; width: 190px; height: 190px; border-radius: 50%; border: none;
  background: radial-gradient(circle at 50% 35%, #ff7b83, #d22d3a 60%, #8a1420); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 34px; letter-spacing: .12em;
  box-shadow: 0 12px 0 #5c0c14, 0 20px 50px -10px rgba(255, 60, 70, .7), inset 0 -8px 20px rgba(0, 0, 0, .25), inset 0 6px 14px rgba(255, 255, 255, .3);
  transition: transform .08s, box-shadow .08s;
}
.buzz-btn::before { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid rgba(255, 90, 100, .5); animation: ring 1.6s var(--ease-out) infinite; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.buzz-btn:active, .buzz-btn.hit { transform: translateY(10px); box-shadow: 0 2px 0 #5c0c14, 0 10px 30px -10px rgba(255, 60, 70, .7), inset 0 -4px 10px rgba(0, 0, 0, .25); }
.buzz-hint { color: var(--muted); font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.open-state { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.open-state .big { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .2em; text-transform: uppercase; color: var(--teal); text-shadow: 0 0 30px rgba(25, 211, 197, .5); animation: pulse 1.4s infinite; }
.locked-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 4px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); font-size: 12.5px; font-weight: 700; }
.chip .av { width: 22px; height: 22px; border-radius: 7px; }
.chip.x { color: var(--bad); border-color: rgba(255, 90, 100, .3); text-decoration: line-through; text-decoration-color: rgba(255, 90, 100, .6); }
.chip.ok { border-color: rgba(61, 220, 151, .35); color: var(--good); }
.chip.wait { color: var(--dim); }

.buzzed { --c: var(--teal); display: flex; align-items: center; gap: 28px; padding: 22px 34px 22px 22px; border-radius: 22px; position: relative;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 22%, transparent), rgba(255, 255, 255, .02));
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 0 60px -14px var(--c); animation: slam .55s var(--ease-out); }
@keyframes slam { 0% { transform: scale(1.4); opacity: 0; filter: blur(8px); } 60% { transform: scale(.97); opacity: 1; filter: none; } 100% { transform: scale(1); } }
.buzzed .av { width: 84px; height: 84px; border-radius: 20px; }
.buzzed .t1 { font-size: 13px; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.buzzed .t2 { font-family: var(--display); font-size: clamp(30px, 3.4vw, 48px); font-weight: 700; line-height: 1.05; margin-top: 4px; }
.buzzed .t3 { color: var(--muted); font-size: 13px; margin-top: 6px; font-weight: 600; }
.ringt { position: relative; width: 92px; height: 92px; flex: none; }
.ringt svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ringt circle { fill: none; stroke-width: 7; }
.ringt .bg { stroke: rgba(255, 255, 255, .08); }
.ringt .fg { stroke: var(--c); stroke-linecap: round; filter: drop-shadow(0 0 6px var(--c)); }
.ringt span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 30px; font-variant-numeric: tabular-nums; }
.ringt.up span { color: var(--bad); font-size: 15px; letter-spacing: .1em; }
.order { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.order .chip small { color: var(--muted); font-weight: 600; }

.result { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-radius: 16px; font-weight: 800; font-size: 18px; animation: slam .5s var(--ease-out); }
.result.good { background: rgba(61, 220, 151, .1); border: 1px solid rgba(61, 220, 151, .4); color: var(--good); }
.result .av { width: 44px; height: 44px; border-radius: 12px; }

/* who am I */
.clue-split { width: 100%; max-width: 1180px; flex: 1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 30px; align-items: center; }
.clue-split .qzone { flex: none; }
.clue-split .buzz-btn { width: 170px; height: 170px; font-size: 30px; }
.clue-split .buzzed { gap: 18px; padding: 18px 22px 18px 18px; }
.clue-split .buzzed .av { width: 64px; height: 64px; border-radius: 16px; }
.clue-split .buzzed .t1 { letter-spacing: .16em; font-size: 11.5px; white-space: nowrap; }
.clue-split .buzzed .t2 { font-size: clamp(24px, 2.4vw, 36px); }
.clue-split .ringt { width: 76px; height: 76px; }
.clue-split .ringt span { font-size: 24px; }
.clue-split .result { font-size: 16px; }
.seg[data-seg=type] { display: grid; grid-template-columns: 1fr 1fr; }
.clues { display: flex; flex-direction: column; gap: 9px; }
.clue { display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 56px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .022); transition: box-shadow .4s, border-color .4s; }
.clue .n { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 15px; background: rgba(255, 255, 255, .05); color: var(--dim); }
.clue .t { flex: 1; font-weight: 700; font-size: clamp(15px, 1.35vw, 20px); line-height: 1.35; }
.clue .lock { flex: none; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.clue .lock svg { width: 16px; height: 16px; fill: var(--dim); opacity: .7; }
.clue.on { border-color: rgba(214, 180, 106, .3); background: linear-gradient(90deg, rgba(214, 180, 106, .11), rgba(214, 180, 106, .015)); }
.clue.on .n { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1a1408; }
.clue.on.latest { border-color: rgba(243, 217, 149, .7); box-shadow: 0 0 40px -14px var(--gold); }
.clue.hid { border-style: dashed; }
.clue.hid .t { color: var(--dim); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.clue.peek { border-style: dashed; }
.clue.peek .t { color: var(--muted); font-weight: 600; font-style: italic; font-size: 14.5px; }
.clue.fresh { animation: clueIn .8s var(--ease-out) backwards; }
@keyframes clueIn { 0% { opacity: 0; transform: translateX(-28px) scale(.97); filter: blur(6px); } 60% { filter: none; } 100% { opacity: 1; transform: none; } }
.qworth { font-size: 12px; font-weight: 800; color: var(--gold-hi); padding: 4px 11px; border-radius: 99px; border: 1px solid rgba(214, 180, 106, .35); background: rgba(214, 180, 106, .08); }
.qworth:empty { display: none; }
.pairs .crow { display: grid; grid-template-columns: 24px 1fr 30px; gap: 6px; align-items: center; margin-bottom: 6px; }
.pairs .crow .cn { font-family: var(--display); font-weight: 700; color: var(--gold); text-align: center; }
.pairs .crow .input { height: 36px; font-size: 13.5px; }
.pairs .crow .icon-btn { width: 30px; height: 36px; }

/* typing */
.type-box { width: min(640px, 100%); display: flex; flex-direction: column; gap: 10px; }
.type-input { width: 100%; height: 64px; padding: 0 22px; border-radius: 16px; font-size: 22px; font-weight: 700; background: rgba(0, 0, 0, .3); border: 1.5px solid rgba(25, 211, 197, .35); outline: none; transition: .2s; }
.type-input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(25, 211, 197, .15), 0 0 40px -10px var(--teal); }
.type-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 0 6px; }
.type-meta .saved { color: var(--good); }
.status-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 900px; }

.cards { width: 100%; max-width: 1100px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.acard { position: relative; perspective: 900px; min-height: 124px; }
.host .acard, .host .acard-in { min-height: 158px !important; }
.acard-in { position: relative; height: 100%; min-height: 124px; transform-style: preserve-3d; transition: transform .7s var(--ease-out); }
.acard.revealed .acard-in { transform: rotateY(180deg); }
.aface { position: absolute; inset: 0; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line-2); }
.aface.f { background: linear-gradient(160deg, #13203a, #0b1222); }
.aface.b { transform: rotateY(180deg); background: linear-gradient(160deg, #162642, #0d1628); border-color: rgba(214, 180, 106, .3); }
.acard.j-correct .aface.b { border-color: var(--good); box-shadow: 0 0 30px -10px var(--good); background: linear-gradient(160deg, rgba(61, 220, 151, .16), #0d1628); }
.acard.j-wrong .aface.b { border-color: rgba(255, 90, 100, .7); background: linear-gradient(160deg, rgba(255, 90, 100, .12), #0d1628); }
.acard.focus .aface { box-shadow: 0 0 0 2px var(--teal); }
.ahead { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13.5px; }
.ahead .av { width: 26px; height: 26px; border-radius: 8px; }
.ahead .d { margin-left: auto; font-family: var(--display); font-size: 15px; }
.ahead .d.up { color: var(--good); } .ahead .d.down { color: var(--bad); }
.atext { flex: 1; display: grid; place-items: center; text-align: center; font-weight: 800; font-size: 19px; line-height: 1.25; word-break: break-word; }
.atext.none { color: var(--dim); font-weight: 600; font-size: 14px; font-style: italic; }
.aface.f .atext { color: var(--dim); }
.aface.f .qmark { font-family: var(--display); font-size: 36px; color: rgba(214, 180, 106, .35); }
.host-peek { font-size: 12.5px; color: var(--muted); text-align: center; font-style: italic; }
.ahost { display: flex; gap: 6px; justify-content: center; }
.ahost .btn { flex: 1; }
.auto { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--good); }
.acard .ahost-front { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; }

/* match */
.match { width: 100%; max-width: 1000px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.match.solo { grid-template-columns: 1fr; max-width: 720px; }
.mcol-h { font-family: var(--display); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-size: 12px; margin: 0 0 8px 4px; }
.mrows { display: flex; flex-direction: column; gap: 6px; }
.mrow { display: grid; grid-template-columns: minmax(80px, 34%) 1fr; gap: 8px; align-items: stretch; }
.mrow.withsol { grid-template-columns: minmax(80px, 28%) 1fr 1fr; }
.mleft { display: flex; align-items: center; padding: 0 14px; min-height: 42px; border-radius: 10px; background: rgba(214, 180, 106, .1); border: 1px solid rgba(214, 180, 106, .28); font-weight: 800; font-family: var(--display); font-size: 15px; color: var(--gold-hi); }
.slot { min-height: 42px; border-radius: 10px; border: 1.5px dashed rgba(255, 255, 255, .14); display: flex; align-items: center; padding: 3px; transition: .15s; }
.slot.over { border-color: var(--teal); background: rgba(25, 211, 197, .08); }
.slot.ok { border: 1.5px solid rgba(61, 220, 151, .6); background: rgba(61, 220, 151, .08); }
.slot.no { border: 1.5px solid rgba(255, 90, 100, .55); background: rgba(255, 90, 100, .07); }
.slot.sol { border: 1.5px solid rgba(214, 180, 106, .3); background: rgba(214, 180, 106, .05); padding: 0 12px; font-weight: 700; color: var(--gold-hi); font-size: 14px; }
.slot .ph { color: var(--dim); font-size: 12.5px; padding-left: 10px; }
.mcard { width: 100%; min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 8px; background: linear-gradient(180deg, #1c2c4b, #142039); border: 1px solid rgba(25, 211, 197, .3); font-weight: 700; font-size: 14px; cursor: grab; user-select: none; touch-action: none; transition: box-shadow .15s, transform .15s; }
.mcard::before { content: ''; width: 6px; height: 14px; flex: none; opacity: .4; background: radial-gradient(circle, #fff 1px, transparent 1.5px) 0 0 / 3px 3.5px; }
.mcard:hover { box-shadow: 0 0 0 1px var(--teal); }
.mcard.sel { box-shadow: 0 0 0 2px var(--teal), 0 0 24px -6px var(--teal); }
.mcard.ghost { position: fixed; z-index: 1000; pointer-events: none; width: auto; min-width: 160px; box-shadow: 0 20px 40px -10px #000, 0 0 0 2px var(--teal); transform: rotate(-2deg) scale(1.04); }
.mcard.dragging { opacity: .25; }
.pool { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; min-height: 120px; padding: 10px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .2); }
.pool.over { border-color: var(--teal); }
.pool .mcard { width: auto; }
.pool-empty { color: var(--good); font-size: 13px; font-weight: 700; padding: 8px; }
.match-hint { font-size: 12.5px; color: var(--muted); text-align: center; }
.mscore { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--gold-hi); text-align: center; }
.viewing { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.viewing .av { width: 30px; height: 30px; }

/* answer reveal */
.qanswer { display: none; padding: 16px 24px; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(214, 180, 106, .14), rgba(214, 180, 106, .04)); align-items: center; gap: 18px; justify-content: center; }
.qanswer.on { display: flex; animation: ansIn .7s var(--ease-out); }
@keyframes ansIn { from { opacity: 0; transform: translateY(20px); } }
.qanswer .l { font-family: var(--display); font-weight: 700; letter-spacing: .25em; font-size: 12px; text-transform: uppercase; color: var(--gold); }
.qanswer .v { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 2.6vw, 38px); color: var(--gold-hi); text-shadow: 0 0 30px rgba(243, 217, 149, .4); }
.qanswer img { height: 90px; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- lobby ---------- */
.lobby { height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 4vh 10px 30px; }
.hero { text-align: center; }
.eyebrow { font-family: var(--display); font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: var(--teal); font-size: 12px; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 5vw, 72px); line-height: 1; margin: 12px 0 10px; letter-spacing: .02em;
  background: linear-gradient(180deg, #fff6dc, var(--gold) 70%, var(--gold-lo)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 30px rgba(214, 180, 106, .25)); }
.hero p { color: var(--muted); margin: 0; font-size: 15px; }
.lobby-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ptiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 900px; }
.ptile { width: 120px; padding: 16px 8px 12px; border-radius: 16px; text-align: center; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop .5s var(--ease-out); }
.ptile .av { width: 64px; height: 64px; border-radius: 18px; }
.ptile .nm { font-weight: 800; font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptile.me { border-color: var(--gold); box-shadow: 0 0 30px -12px var(--gold); }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; width: 100%; max-width: 1100px; }
.tcol { --c: var(--gold); border-radius: 18px; padding: 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 12%, transparent), rgba(255, 255, 255, .015)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
.tcol-h { display: flex; align-items: center; gap: 10px; }
.tcol-h .nm { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .04em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tcol.none { --c: #6b7489; border-style: dashed; }
.tmem { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; background: rgba(0, 0, 0, .2); font-weight: 700; font-size: 13.5px; }
.tmem .av { width: 28px; height: 28px; border-radius: 8px; }
.tmem.me { box-shadow: inset 0 0 0 1px var(--gold); }

/* ---------- end ---------- */
.end { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; position: relative; }
.podium { display: flex; align-items: flex-end; gap: 16px; padding: 0 30px; border-bottom: 2px solid rgba(214, 180, 106, .45); box-shadow: 0 30px 60px -30px rgba(214, 180, 106, .35); }
.pod { --c: var(--gold); width: 190px; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: rise 1s var(--ease-out) backwards; }
.pod .av { width: 76px; height: 76px; border-radius: 20px; }
.pod .nm { font-weight: 800; font-size: 16px; text-align: center; }
.pod .bar { width: 100%; border-radius: 14px 14px 0 0; display: flex; flex-direction: column; align-items: center; padding-top: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 45%, transparent), color-mix(in srgb, var(--c) 14%, transparent)); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); border-bottom: none; }
.pod .place { font-family: var(--display); font-weight: 700; font-size: 44px; color: #fff; text-shadow: 0 0 30px var(--c); }
.pod .pts { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--gold-hi); }
.pod.p1 { --c: var(--gold-hi); animation-delay: .9s; } .pod.p1 .bar { height: 210px; }
.pod.p2 { --c: #c9d1de; animation-delay: .5s; } .pod.p2 .bar { height: 150px; }
.pod.p3 { --c: #d3976a; animation-delay: .2s; } .pod.p3 .bar { height: 110px; }
@keyframes rise { from { opacity: 0; transform: translateY(60px); } }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear infinite; opacity: .9; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- host bar ---------- */
#hostbar { border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(12, 19, 33, .96), rgba(8, 12, 22, .98)); padding: 12px 22px; display: flex; align-items: center; gap: 12px; min-height: 68px; }
#hostbar .hb-label { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; color: var(--muted); margin-right: auto; min-width: 0; }
#hostbar .hb-label b { color: var(--text); }
#hostbar .hb-label .lv { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); flex: none; }
.hb-group { display: flex; gap: 8px; align-items: center; }
.hb-sep { width: 1px; height: 28px; background: var(--line-2); }

/* ---------- modal / drawer ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(3, 6, 12, .7); backdrop-filter: blur(6px); display: grid; place-items: center; animation: fade .25s; padding: 20px; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 20px; padding: 28px; background: linear-gradient(180deg, #121c30, #0b1220); border: 1px solid var(--line); box-shadow: 0 40px 100px -30px #000; animation: pop .35s var(--ease-out); }
.modal h2 { font-family: var(--display); font-size: 26px; margin: 4px 0 4px; letter-spacing: .02em; }
.modal .lead { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > label, .flabel { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 44px; padding: 0 14px; border-radius: 11px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2); outline: none; transition: .2s; font-size: 14.5px; }
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(25, 211, 197, .14); }
select.input option { background: #0e1523; }
.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.icon-grid button { aspect-ratio: 1; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); display: grid; place-items: center; transition: .15s; padding: 0; }
.icon-grid button svg { width: 55%; height: 55%; fill: var(--muted); }
.icon-grid button.on { border-color: var(--gold); background: rgba(214, 180, 106, .12); }
.icon-grid button.on svg { fill: var(--gold-hi); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; padding: 0; transition: .15s; }
.swatches button.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); transform: scale(1.08); }
.preview-row { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line-2); margin-bottom: 18px; }
.preview-row .av { width: 60px; height: 60px; border-radius: 16px; }
.preview-row .nm { font-family: var(--display); font-size: 22px; font-weight: 700; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.drawer-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(3, 6, 12, .55); backdrop-filter: blur(3px); animation: fade .2s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: linear-gradient(180deg, #111a2c, #0a111e); border-left: 1px solid var(--line); display: flex; flex-direction: column; animation: slideIn .35s var(--ease-out); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-h h3 { margin: 0; font-family: var(--display); font-size: 20px; letter-spacing: .03em; flex: 1; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 22px 30px; }
.sect { margin-bottom: 26px; }
.sect-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sect-h h4 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line-2); margin-bottom: 6px; }
.row .grow { flex: 1; min-width: 0; }
.row .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row select.input, .row .input { height: 34px; font-size: 13px; border-radius: 9px; }
.row .input.num { width: 84px; text-align: right; font-family: var(--display); font-weight: 700; }
.row input[type=color] { width: 34px; height: 34px; padding: 0; border: none; background: none; border-radius: 9px; cursor: pointer; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line-2); margin-bottom: 8px; cursor: pointer; }
.toggle .tl { font-weight: 700; font-size: 14px; }
.toggle .td { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sw { position: relative; width: 42px; height: 24px; flex: none; border-radius: 99px; background: rgba(255, 255, 255, .1); transition: .2s; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #c8cede; transition: .25s var(--ease-out); }
.sw.on { background: var(--teal-lo); box-shadow: inset 0 0 0 1px var(--teal); }
.sw.on::after { left: 21px; background: #fff; }
.copy-line { display: flex; gap: 8px; }
.copy-line .input.mono { font-family: ui-monospace, monospace; font-size: 13px; }
.danger-zone { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- editor ---------- */
.editor { position: fixed; inset: 0; z-index: 45; background: var(--bg); display: grid; grid-template-rows: 64px 1fr; animation: fade .2s; }
.editor::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(900px 600px at 0% 0%, rgba(25, 211, 197, .07), transparent 60%); }
.ed-top { display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.ed-top .input { max-width: 380px; font-family: var(--display); font-weight: 700; font-size: 17px; }
.ed-save { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-right: auto; }
.ed-save.ok { color: var(--good); }
.ed-main { display: grid; grid-template-columns: 1fr 460px; min-height: 0; }
.ed-board { overflow: auto; padding: 22px; }
.ed-cols { display: flex; gap: 12px; align-items: flex-start; min-width: min-content; }
.ed-col { width: 224px; flex: none; display: flex; flex-direction: column; gap: 8px; }
.ed-cat { display: flex; gap: 4px; align-items: center; }
.ed-cat .input { height: 40px; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gold-hi); font-size: 12px; padding: 0 10px; background: rgba(214, 180, 106, .08); border-color: rgba(214, 180, 106, .25); }
.ed-cat .icon-btn { width: 30px; height: 30px; flex: none; }
.ed-q { text-align: left; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: linear-gradient(160deg, #13203a, #0b1222); display: flex; flex-direction: column; gap: 6px; transition: .15s; }
.ed-q:hover { border-color: rgba(25, 211, 197, .5); }
.ed-q.on { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.ed-q .top-l { display: flex; align-items: center; gap: 6px; }
.ed-q .p { font-family: var(--display); font-weight: 700; color: var(--gold); font-size: 17px; }
.ed-q .ty { margin-left: auto; display: flex; gap: 4px; }
.ed-q .ty svg { width: 14px; height: 14px; fill: var(--muted); }
.ed-q .pr { font-size: 12.5px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.ed-q .pr.empty { color: var(--bad); opacity: .7; }
.ed-add { height: 38px; border-radius: 11px; border: 1.5px dashed rgba(255, 255, 255, .12); background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; transition: .15s; }
.ed-add:hover { border-color: var(--teal); color: var(--teal); }
.ed-add.cat { width: 160px; height: 40px; flex: none; }
.ed-form { border-left: 1px solid var(--line); overflow-y: auto; padding: 20px 22px 40px; background: rgba(10, 16, 28, .6); }
.ed-form .empty-note { padding-top: 80px; }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2); }
.seg button { flex: 1; height: 36px; border-radius: 9px; border: none; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: .15s; }
.seg button svg { width: 14px; height: 14px; fill: currentColor; }
.seg button.on { background: var(--raise); color: var(--gold-hi); box-shadow: inset 0 0 0 1px rgba(214, 180, 106, .35); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.media-box { display: flex; flex-direction: column; gap: 8px; }
.media-prev { border-radius: 12px; border: 1px solid var(--line-2); padding: 8px; background: rgba(0, 0, 0, .25); display: flex; align-items: center; gap: 10px; }
.media-prev img { max-height: 120px; max-width: 100%; border-radius: 8px; }
.media-prev audio { width: 100%; height: 36px; }
.pairs .prow { display: grid; grid-template-columns: 1fr 1fr 30px; gap: 6px; margin-bottom: 6px; }
.pairs .prow .input { height: 36px; font-size: 13.5px; }
.pairs .prow .icon-btn { width: 30px; height: 36px; }
.hint { font-size: 12px; color: var(--dim); line-height: 1.45; }
.ed-form .toggle { margin-bottom: 16px; }

/* toast */
#toasts { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 12px; background: #1a2440; border: 1px solid var(--line); font-weight: 700; font-size: 13.5px; box-shadow: 0 10px 40px -10px #000; animation: pop .3s var(--ease-out); }
.toast.err { border-color: rgba(255, 90, 100, .5); color: #ffc1c5; }

/* join screen */
.join-screen { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; padding: 20px; }
.join-screen .modal { width: min(560px, 100%); }
.join-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.join-brand svg { width: 40px; height: 40px; }

/* responsive */
@media (max-width: 980px) {
  .clue-split { grid-template-columns: 1fr; gap: 18px; }
  :root { --side-w: 250px; }
  .ed-main { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100%; }
  .layout { grid-template-columns: 1fr; }
  #stage { height: 70vh; padding: 12px; }
  .qwrap { inset: 12px; }
  #side { border-left: none; border-top: 1px solid var(--line); }
  .brand-sub { display: none; }
  #hostbar { flex-wrap: wrap; }
  .match { grid-template-columns: 1fr; }
}
