:root {
  --bg: #12122B;
  --panel: #1C1C3D;
  --panel-2: #26264F;
  --line: #34346A;
  --text: #F4F2FF;
  --muted: #B9B5D6;
  --faint: #8E8BB8;
  --lime: #D4FF3F;
  --pink: #FF4F8B;
  --cyan: #5EE8FF;
  --orange: #FFB347;
  --purple: #C79BFF;
  --tile: #F6E7C1;
  --tile-edge: #D9C48F;
  --tile-ink: #1E1A10;
  --danger: #FF6B6B;
  --display: 'Syne', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); }
body { min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }
a { color: var(--lime); }
button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--lime); display: grid; place-items: center; flex-shrink: 0; }
.brand-mark svg { width: 20px; height: 20px; }

/* ---------- phone layout ---------- */
.phone { max-width: 520px; margin: 0 auto; padding: 20px 16px 28px; display: flex; flex-direction: column; gap: 18px; min-height: 100dvh; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tag { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pink); }
.card { background: var(--panel); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=password], input[type=number] {
  height: 54px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg);
  color: var(--text); font-size: 18px; padding: 0 16px; font-family: inherit; width: 100%;
}
input:focus { outline: none; border-color: var(--lime); }
input.code-input { text-transform: uppercase; letter-spacing: 0.4em; font-family: var(--display); font-weight: 800; font-size: 26px; text-align: center; }

.btn {
  min-height: 54px; border-radius: 16px; border: 0; cursor: pointer; font-family: var(--display);
  font-weight: 800; font-size: 17px; padding: 0 20px; display: inline-flex; align-items: center;
  justify-content: center; gap: 10px; text-decoration: none; transition: transform .08s ease, opacity .15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-lime { background: var(--lime); color: var(--bg); }
.btn-pink { background: var(--pink); color: var(--bg); }
.btn-ghost { background: var(--panel); color: var(--text); }
.btn-outline { background: transparent; color: var(--text); border: 2px solid var(--line); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; font-size: 15px; border-radius: 12px; padding: 0 14px; }
.btn svg { width: 22px; height: 22px; flex-shrink: 0; }

.code-tiles { display: flex; gap: 8px; }
.code-tiles span { flex: 1; height: 64px; border-radius: 12px; background: var(--lime); color: var(--bg); font-family: var(--display); font-weight: 800; font-size: 36px; display: grid; place-items: center; }

.ok-line { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.ok-line.on { color: var(--lime); }
.ok-line.off { color: var(--faint); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }

.game-option { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--panel); border: 3px solid var(--panel); color: var(--text); width: 100%; text-align: left; cursor: pointer; font-family: inherit; }
.game-option.selected { background: var(--lime); border-color: var(--lime); color: var(--bg); }
.game-option:disabled { opacity: 0.55; cursor: default; }
.game-badge { flex-shrink: 0; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--bg); }
.game-option.selected .game-badge { background: var(--bg) !important; color: var(--lime); }
.game-option .meta { font-size: 13px; opacity: 0.8; }
.pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--bg); color: var(--text); white-space: nowrap; }
.game-option.selected .pill { color: var(--lime); }

.players { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: flex; align-items: center; gap: 8px; background: var(--bg); padding: 6px 12px 6px 6px; border-radius: 999px; font-weight: 500; font-size: 15px; }
.chip.offline { opacity: 0.45; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--bg); font-family: var(--display); font-weight: 800; font-size: 14px; flex-shrink: 0; }
.chip button { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0 0 0 4px; font-size: 18px; line-height: 1; min-width: 24px; min-height: 24px; }

.toast { pointer-events: none; position: fixed; left: 50%; top: 16px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 15px; z-index: 50; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast.bad { background: var(--danger); }

/* ---------- board ---------- */
.board { display: grid; gap: 2px; background: var(--line); padding: 2px; border-radius: 10px; aspect-ratio: 1; user-select: none; }
.cell { position: relative; background: var(--panel); border-radius: 3px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: var(--faint); overflow: hidden; }
.cell .prem { font-size: 0.42em; letter-spacing: 0.02em; color: var(--bg); opacity: .85; }
.cell.TW { background: var(--pink); }
.cell.DW { background: #E7A6FF; }
.cell.TL { background: var(--cyan); }
.cell.DL { background: #2F8FA3; }
.cell.DL .prem { color: var(--text); }
.cell.star { background: #E7A6FF; }
.cell.star .prem { font-size: 0.7em; }
.cell.target { cursor: pointer; }
.cell.target:hover { outline: 2px solid var(--lime); outline-offset: -2px; }

.tile { position: absolute; inset: 0; background: var(--tile); color: var(--tile-ink); border-radius: 3px; display: grid; place-items: center; box-shadow: inset 0 -2px 0 var(--tile-edge); }
.tile .v { position: absolute; right: 8%; bottom: 4%; font-size: 0.32em; font-family: var(--body); font-weight: 700; }
.tile.blank { color: #8A5A00; }
.tile.pending { background: var(--lime); box-shadow: inset 0 -2px 0 #9DBF1F; cursor: pointer; }
.tile.ghost { background: transparent; border: 2px dashed var(--lime); color: var(--lime); box-shadow: none; }
.tile.fresh { animation: pop .5s ease; background: #FFF4C9; box-shadow: inset 0 -2px 0 var(--tile-edge), 0 0 0 2px var(--orange); }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---------- rack ---------- */
.rack { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rack-tile { aspect-ratio: 1; border-radius: 10px; background: var(--tile); color: var(--tile-ink); border: 0; box-shadow: inset 0 -4px 0 var(--tile-edge); font-family: var(--display); font-weight: 800; font-size: clamp(20px, 6vw, 30px); position: relative; cursor: pointer; display: grid; place-items: center; padding: 0; }
.rack-tile .v { position: absolute; right: 6px; bottom: 4px; font-size: 11px; font-family: var(--body); font-weight: 700; }
.rack-tile.selected { background: var(--lime); box-shadow: inset 0 -4px 0 #9DBF1F, 0 0 0 3px var(--text); transform: translateY(-4px); }
.rack-tile.used { visibility: hidden; }
.rack-tile.swap { background: var(--pink); box-shadow: inset 0 -4px 0 #B8325F; }
.rack-slot { aspect-ratio: 1; border-radius: 10px; border: 2px dashed var(--line); }

.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.actions .btn { min-height: 48px; font-size: 14px; padding: 0 6px; border-radius: 12px; }

.preview { min-height: 26px; font-size: 15px; font-weight: 700; text-align: center; }
.preview.good { color: var(--lime); }
.preview.bad { color: var(--danger); }

.turn-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--panel); }
.turn-banner.mine { background: var(--lime); color: var(--bg); }
.timer { font-family: var(--display); font-weight: 800; font-size: 20px; min-width: 44px; text-align: right; }

.board-wrap { overflow: auto; border-radius: 12px; -webkit-overflow-scrolling: touch; }
.board-wrap.zoom .board { width: 640px; }
.board-wrap .board { width: 100%; font-size: clamp(12px, 4vw, 22px); }
.board-wrap.zoom .board { font-size: 26px; }

.overlay { position: fixed; inset: 0; background: rgba(10,10,30,.8); display: grid; place-items: center; z-index: 40; padding: 16px; }
.picker { background: var(--panel); border-radius: 20px; padding: 18px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.letters { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.letters button { aspect-ratio: 1; border-radius: 10px; border: 0; background: var(--tile); color: var(--tile-ink); font-family: var(--display); font-weight: 800; font-size: 20px; cursor: pointer; }

.scores-mini { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.scores-mini .s { flex-shrink: 0; display: flex; align-items: center; gap: 6px; background: var(--panel); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 14px; }
.scores-mini .s.now { outline: 2px solid var(--lime); }
.scores-mini b { font-family: var(--display); }

.results { display: flex; flex-direction: column; gap: 10px; }
.result-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: 16px; padding: 12px 14px; }
.result-row.win { background: var(--lime); color: var(--bg); }
.result-row .pos { font-family: var(--display); font-weight: 800; font-size: 20px; width: 28px; }
.result-row .nm { flex: 1; font-weight: 700; }
.result-row .pts { font-family: var(--display); font-weight: 800; font-size: 22px; }

.center-msg { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.big-icon { width: 84px; height: 84px; border-radius: 24px; background: var(--panel); display: grid; place-items: center; }
.big-icon svg { width: 44px; height: 44px; }

/* numbers: the display face's zero reads like a letter O, so scores use the body face */
.num, .scores-mini b, .result-row .pts, .timer { font-family: var(--body) !important; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- drag and drop ---------- */
.rack-tile, .tile.pending { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rack-tile { cursor: grab; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
.drag-ghost {
  position: fixed; z-index: 60; pointer-events: none; width: 58px; height: 58px; left: -100px; top: -100px;
  transform: translate(-50%, -50%) rotate(-4deg) scale(1.08);
  border-radius: 12px; background: var(--lime); color: var(--bg); box-shadow: inset 0 -4px 0 #9DBF1F, 0 14px 30px rgba(0,0,0,.45);
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 30px;
}
.drag-ghost .v { position: absolute; right: 6px; bottom: 4px; font-size: 11px; font-family: var(--body); font-weight: 700; }
.drag-ghost.blank { color: #5A4A00; }
.rack-tile.dragging { opacity: .25; transform: none; }
.cell.dragging .tile { opacity: .25; }
.cell.drop-ok { outline: 3px solid var(--lime); outline-offset: -3px; z-index: 1; }
.cell.drop-ok::after { content: ''; position: absolute; inset: 0; background: rgba(212,255,63,.25); }
.rack-tile.drop-before { box-shadow: inset 0 -4px 0 var(--tile-edge), -5px 0 0 var(--lime); }
.rack.drop-ok { outline: 3px dashed var(--lime); outline-offset: 4px; border-radius: 12px; }
.drag-ghost { transition: width .08s ease, height .08s ease, font-size .08s ease; }
.drag-ghost.over-board { opacity: .88; transform: translate(-50%, -50%); border-radius: 6px; }
.drag-ghost.over-board .v { font-size: 8px; right: 3px; bottom: 1px; }

/* ---------- quiz ---------- */
.subject-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.subject-grid button { min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--text); font-family: inherit; font-weight: 700; font-size: 15px; cursor: pointer; padding: 6px 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px; text-align: left; }
.subject-grid button.on { background: var(--lime); border-color: var(--lime); color: var(--bg); }
.subject-grid button .n { font-family: var(--display); font-weight: 800; font-size: 13px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--lime); flex-shrink: 0; }
.quiz-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.quiz-subject { font-family: var(--display); font-weight: 800; font-size: 22px; margin-top: 2px; }
.quiz-me { display: flex; flex-direction: column; align-items: flex-end; }
.quiz-me b { font-size: 24px; font-variant-numeric: tabular-nums; }
.quiz-q { font-size: 19px; font-weight: 500; line-height: 1.35; margin: 0; }
.answers { display: grid; grid-template-columns: 1fr; gap: 10px; }
.answer { min-height: 66px; border-radius: 18px; border: 0; padding: 12px 16px; display: flex; align-items: center; gap: 14px; font-family: inherit; font-weight: 700; font-size: 18px; color: var(--bg); cursor: pointer; text-align: left; transition: transform .08s, opacity .2s; }
.answer:active { transform: scale(.97); }
.answer .letter { width: 38px; height: 38px; border-radius: 10px; background: rgba(18,18,43,.9); color: var(--text); display: grid; place-items: center; font-family: var(--display); font-weight: 800; flex-shrink: 0; }
.answer.a0 { background: var(--pink); } .answer.a1 { background: var(--lime); } .answer.a2 { background: var(--cyan); } .answer.a3 { background: var(--orange); }
.answers.locked .answer { cursor: default; opacity: .35; }
.answers.locked .answer.chosen { opacity: 1; box-shadow: 0 0 0 4px var(--text); }
.result-badge { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; }
.result-badge svg { width: 54px; height: 54px; }
.result-badge.good { background: var(--lime); } .result-badge.bad { background: var(--pink); } .result-badge.none { background: var(--panel); }
.pill-round { background: var(--pink); color: var(--bg); font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .1em; padding: 6px 12px; border-radius: 999px; }
.result-row .gain { font-size: 13px; opacity: .8; font-weight: 700; }

/* ---------- against the clock ---------- */
.ck-board { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 5px; }
.ck-board.nums { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ck-tile { aspect-ratio: 1; border-radius: 9px; border: 0; padding: 0; background: var(--tile); color: var(--tile-ink); box-shadow: inset 0 -3px 0 var(--tile-edge); font-family: var(--display); font-weight: 800; font-size: clamp(18px, 5.6vw, 28px); display: grid; place-items: center; cursor: pointer; }
.ck-tile.empty { background: var(--panel); box-shadow: none; border: 2px dashed var(--line); cursor: default; }
.ck-tile.used { opacity: .2; cursor: default; }
.ck-tile.num { background: var(--cyan); box-shadow: inset 0 -3px 0 #2BAFC4; font-family: var(--body); font-weight: 700; font-size: clamp(15px, 4.6vw, 22px); aspect-ratio: auto; min-height: 52px; }
.ck-tile.num.made { background: var(--purple); box-shadow: inset 0 -3px 0 #9C6FE0; }
.ck-tile.num.sel { box-shadow: 0 0 0 3px var(--text); transform: translateY(-2px); }
.ck-target { text-align: center; background: var(--bg); border: 2px solid var(--lime); border-radius: 16px; padding: 8px; }
.ck-target b { font-family: var(--body); font-weight: 700; font-size: 44px; color: var(--lime); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.ck-entry { min-height: 60px; border-radius: 14px; background: var(--bg); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px; font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: .12em; }
.ck-entry .ph { color: var(--faint); font-family: var(--body); font-weight: 500; font-size: 15px; letter-spacing: 0; }
.ck-row { display: flex; gap: 8px; }
.ck-row .btn { flex: 1; min-height: 50px; padding: 0 8px; font-size: 15px; }
.ck-ops { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ck-ops button { min-height: 56px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: var(--text); font-size: 28px; font-weight: 700; cursor: pointer; font-family: var(--body); }
.ck-ops button.on { background: var(--lime); color: var(--bg); border-color: var(--lime); }
.ck-working { min-height: 24px; font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; font-variant-numeric: tabular-nums; }
.ck-pick-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ck-pick-btns.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ck-pick-btns .btn { min-height: 76px; font-size: 17px; padding: 0 8px; }
.ck-pick-btns.five .btn { font-size: 26px; padding: 0; }
.ck-sol-line { font-size: 15px; line-height: 1.5; }
.ck-sol-line b { font-family: var(--display); letter-spacing: .04em; }

/* ---------- stop the clock ---------- */
.st-display { text-align: center; font-family: var(--body); font-weight: 700; font-size: 72px; letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1; padding: 10px 0; }
.st-display.hidden-time { color: var(--faint); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.st-button { width: min(78vw, 300px); aspect-ratio: 1; align-self: center; border-radius: 50%; border: 0; background: var(--pink); color: var(--bg); font-family: var(--display); font-weight: 800; font-size: 44px; letter-spacing: .04em; box-shadow: inset 0 -10px 0 #B8325F, 0 12px 40px rgba(255,79,139,.35); cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; transition: transform .06s; }
.st-button:active { transform: scale(.96); }
.st-button:disabled { background: var(--panel); color: var(--faint); box-shadow: none; cursor: default; }
.st-button.wait { background: var(--panel); color: var(--muted); box-shadow: none; font-size: 64px; }

/* ---------- side menu + chat ---------- */
.menu-btn { position: relative; width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); color: var(--text); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; padding: 0; }
.menu-btn svg { width: 22px; height: 22px; }
.menu-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--pink); color: var(--bg); font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.scrim { position: fixed; inset: 0; background: rgba(8,8,24,.6); z-index: 70; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(88vw, 380px); background: var(--bg); border-right: 2px solid var(--line); z-index: 71; transform: translateX(-102%); transition: transform .22s ease; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px; }
.drawer.open { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.45); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-row { display: flex; gap: 8px; align-items: center; }
.drawer-people { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer-people .chip { font-size: 13px; padding: 4px 10px 4px 4px; }
.drawer-people .chip .avatar { width: 24px; height: 24px; font-size: 11px; }
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; background: var(--panel); border-radius: 16px; padding: 10px; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.msg .avatar { width: 26px; height: 26px; font-size: 12px; }
.msg .bubble { background: var(--panel-2); border-radius: 14px 14px 14px 4px; padding: 7px 11px; font-size: 15px; line-height: 1.35; word-break: break-word; }
.msg .who { display: block; font-size: 11px; font-weight: 700; margin-bottom: 1px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--lime); color: var(--bg); border-radius: 14px 14px 4px 14px; }
.chat-form { display: flex; gap: 6px; }
.chat-form input { height: 46px; font-size: 16px; border-radius: 12px; }
.chat-form .btn { min-height: 46px; width: 50px; padding: 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; flex-direction: row; }
.switch { appearance: none; -webkit-appearance: none; width: 54px; height: 32px; border-radius: 16px; background: var(--line); position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch:checked { background: var(--lime); }
.switch:checked::after { transform: translateX(22px); background: var(--bg); }
.switch:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.pill.open { background: var(--lime); color: var(--bg); }

#randomBtn { font-size: 16px; }

/* ---------- word grid ---------- */
.wg-word { min-height: 52px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: .1em; display: flex; align-items: center; justify-content: center; gap: 10px; }
.wg-word .pts { font-family: var(--body); font-size: 16px; letter-spacing: 0; color: var(--lime); background: var(--panel); border-radius: 999px; padding: 3px 10px; }
.wg-word .ph { font-family: var(--body); font-weight: 500; font-size: 15px; letter-spacing: 0; color: var(--faint); }
.wg-wrap { position: relative; width: min(100%, 360px); align-self: center; touch-action: none; -webkit-user-select: none; user-select: none; }
.wg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 10px; background: var(--panel); border-radius: 20px; }
.wg-tile { aspect-ratio: 1; border-radius: 14px; border: 0; padding: 0; background: var(--tile); color: var(--tile-ink); box-shadow: inset 0 -5px 0 var(--tile-edge); font-family: var(--display); font-weight: 800; font-size: clamp(28px, 9vw, 40px); display: grid; place-items: center; cursor: pointer; touch-action: none; transition: transform .08s, background .1s; }
.wg-tile.on { background: var(--lime); box-shadow: inset 0 -5px 0 #9DBF1F; transform: scale(.94); }
.wg-tile.last { box-shadow: inset 0 -5px 0 #9DBF1F, 0 0 0 3px var(--text); }
.wg-tile:disabled { cursor: default; opacity: .55; }
.wg-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.wg-line polyline { fill: none; stroke: rgba(255,79,139,.85); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.wg-wrap.good .wg-tile.on { background: var(--cyan); }
.wg-wrap.bad { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.wg-found { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.wg-found span { background: var(--panel); border-radius: 999px; padding: 5px 11px; font-weight: 700; font-size: 14px; letter-spacing: .04em; }
.wg-found span b { color: var(--lime); margin-left: 4px; font-weight: 700; }
.wg-found span.only { background: var(--lime); color: var(--bg); }
.wg-found span.only b { color: var(--bg); }

/* ---------- who's that ---------- */
.wt-photo { width: min(62vw, 240px); aspect-ratio: 4/5; align-self: center; border-radius: 18px; overflow: hidden; background: #05050F; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.wt-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; transform-origin: 50% 30%; }
.wt-name { text-align: center; font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--lime); line-height: 1.1; }

/* ---------- Buzz In ---------- */
.bz-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 260px; }
.bz-button { width: min(72vw, 300px); aspect-ratio: 1; border-radius: 50%; border: 0; font-family: var(--display); font-weight: 800; font-size: 44px; letter-spacing: .04em;
  color: #fff; background: radial-gradient(circle at 35% 30%, #FF8DB4, var(--pink) 55%, #B8245A); box-shadow: 0 14px 0 #8C1744, 0 24px 40px rgba(0,0,0,.45);
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; transition: transform .06s, box-shadow .06s; overflow: hidden; padding: 0 16px; }
.bz-button:active:not(:disabled), .bz-button.pressed { transform: translateY(10px); box-shadow: 0 4px 0 #8C1744, 0 10px 20px rgba(0,0,0,.4); }
.bz-button:disabled { cursor: default; }
.bz-button.wait { background: var(--panel); color: var(--muted); box-shadow: 0 10px 0 #0B0B1C; font-size: 28px; }
.bz-button.locked { background: #2A2A44; color: var(--faint); box-shadow: 0 10px 0 #0B0B1C; font-size: 30px; }
.bz-button.other { background: var(--who, var(--cyan)); color: var(--bg); box-shadow: 0 10px 0 rgba(0,0,0,.35); font-size: 30px; }
.bz-button.right { background: var(--lime); color: var(--bg); box-shadow: 0 10px 0 #7E9A1E; font-size: 80px; }
.bz-options { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.bz-opt { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; border: 3px solid var(--panel); background: var(--panel); color: var(--text); font: 700 18px/1.25 var(--body); text-align: left; cursor: pointer; }
.bz-opt b { width: 34px; height: 34px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; flex-shrink: 0; }
.bz-opt.out { opacity: .3; text-decoration: line-through; }
.bz-opt.chosen { border-color: var(--lime); }

/* ---------- Draw It ---------- */
.dw-sheet { border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.dw-sheet canvas { display: block; width: 100%; aspect-ratio: 4 / 3; background: #FFFDF7; touch-action: none; }
.dw-sheet.pen { outline: 3px solid var(--lime); }
.dw-choices { display: flex; flex-direction: column; gap: 10px; }
.dw-choices .btn { font-size: 20px; text-transform: capitalize; }
.dw-word { text-align: center; font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--lime); text-transform: capitalize; }
.dw-tools { display: flex; flex-direction: column; gap: 8px; }
.dw-swatches { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.dw-swatch { aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; }
.dw-swatch.on { outline: 3px solid var(--lime); outline-offset: 2px; }
.dw-row { display: flex; gap: 6px; align-items: center; }
.dw-widths { display: flex; gap: 5px; flex: 1; min-width: 0; }
.dw-row .btn { flex-shrink: 0; padding: 0 12px; height: 40px; font-size: 14px; }
.dw-width { width: 36px; height: 40px; flex-shrink: 0; border-radius: 12px; border: 2px solid var(--panel); background: var(--panel); display: grid; place-items: center; cursor: pointer; padding: 0; }
.dw-width.on { border-color: var(--lime); }
.dw-width i { display: block; border-radius: 50%; }
