@font-face { font-family: 'Tajawal'; font-weight: 400; font-display: swap; src: url(/fonts/tajawal-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Tajawal'; font-weight: 700; font-display: swap; src: url(/fonts/tajawal-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Tajawal'; font-weight: 900; font-display: swap; src: url(/fonts/tajawal-arabic-900-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Tajawal'; font-weight: 400; font-display: swap; src: url(/fonts/tajawal-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Tajawal'; font-weight: 700; font-display: swap; src: url(/fonts/tajawal-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Tajawal'; font-weight: 900; font-display: swap; src: url(/fonts/tajawal-latin-900-normal.woff2) format('woff2'); }

:root {
  --bg: #14112b;
  --bg2: #1d1940;
  --card: #262150;
  --card2: #302a63;
  --line: #3d3678;
  --text: #f6f3ff;
  --muted: #a69fd0;
  --gold: #f5b83d;
  --gold2: #ffd47a;
  --good: #3ddc84;
  --bad: #ff5d6c;
  --t0: #2ecc71;
  --t1: #ff8c42;
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 80% -10%, #3a2f7a55, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #f5b83d18, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
button { font-family: inherit; color: inherit; }
input, textarea { font-family: inherit; }
b { font-weight: 900; }

/* ---------- basics ---------- */
.muted { color: var(--muted); }
.good { color: var(--good); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.tag { display: inline-block; background: var(--gold); color: #241a00; border-radius: 999px; padding: 2px 12px; font-weight: 700; font-size: 0.85em; margin: 0 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; width: 100%; }
.center-col { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; text-align: center; }
.row-center { display: flex; align-items: center; justify-content: center; gap: 12px; }
.row-center.wrap { flex-wrap: wrap; }
.section-title { font-weight: 900; font-size: 1.1rem; margin: 18px 0 10px; color: var(--gold2); }
.sub-head { color: var(--muted); font-size: 1rem; }
.sub-head b { color: var(--text); }
.big-line { font-size: 1.35rem; font-weight: 700; }
.big-emoji { font-size: 1.6em; }

.btn { border: 0; border-radius: 14px; padding: 12px 20px; font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: transform 0.08s, filter 0.15s, opacity 0.15s; }
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #241a00; box-shadow: 0 4px 0 #b9831b; }
.btn.secondary { background: linear-gradient(180deg, #8e7bff, #6b57f0); color: #fff; box-shadow: 0 4px 0 #4a39b8; }
.btn.success { background: linear-gradient(180deg, #5df0a0, var(--good)); color: #00301a; box-shadow: 0 4px 0 #1f9a56; }
.btn.danger { background: linear-gradient(180deg, #ff7f8b, var(--bad)); color: #fff; box-shadow: 0 4px 0 #b8323f; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--text); }
.btn.ghost.on { border-color: var(--gold); }
.btn.big { padding: 16px 28px; font-size: 1.25rem; min-width: 220px; }
.btn.small { padding: 7px 12px; font-size: 0.9rem; border-radius: 10px; }

.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 -3px 0 #0003, 0 2px 8px #0004; line-height: 1; }
.avatar-in { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.character { width: 100%; height: 100%; display: block; }
.avatar.dim { filter: grayscale(0.9) brightness(0.55); }
.avatar .badge { position: absolute; bottom: -4px; left: -4px; font-size: 14px; background: var(--bg); border-radius: 999px; padding: 1px 3px; filter: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; }
.chip.dim { opacity: 0.5; }
.chip-name { font-weight: 700; }
.chip-sub { color: var(--muted); font-size: 0.9em; }

.timer { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--gold); font-weight: 900; font-size: 1.2rem; }
.timer.urgent { border-color: var(--bad); color: var(--bad); animation: pulse 0.5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }

.prompt { font-size: 1.5rem; font-weight: 900; line-height: 1.5; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; width: 100%; }
.prompt.small { font-size: 1.15rem; padding: 14px 16px; }
.blank { color: var(--gold); letter-spacing: 2px; }

.waiting { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); padding: 18px; }
.dots { display: flex; gap: 6px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: bounce 1s infinite; }
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-8px); opacity: 1; } }

.offline { position: fixed; top: 0; inset-inline: 0; background: var(--bad); color: #fff; text-align: center; padding: 6px; z-index: 50; font-weight: 700; }

/* ---------- home ---------- */
.home { max-width: 480px; margin: 0 auto; padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 18px; min-height: 100dvh; justify-content: center; }
.logo { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.logo-mark { font-size: 4.2rem; font-weight: 900; background: linear-gradient(180deg, var(--gold2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 6px 30px #f5b83d33; line-height: 1.2; }
.logo.small .logo-mark { font-size: 2.6rem; }
.logo-sub { color: var(--muted); }
.menu-btns { display: flex; flex-direction: column; gap: 14px; width: 100%; align-items: stretch; }
.name-input, .code-input, .inline-form input, .answer-box input, .answer-box textarea, .cat-field input {
  width: 100%; background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; color: var(--text); padding: 12px 14px; font-size: 1.15rem; outline: none;
}
.name-input:focus, .code-input:focus, .inline-form input:focus, .answer-box input:focus, .answer-box textarea:focus, .cat-field input:focus { border-color: var(--gold); }
.code-input { text-align: center; font-size: 2rem; letter-spacing: 12px; font-weight: 900; direction: ltr; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 300px; overflow-y: auto; padding: 4px; }
.av-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--bg2); border: 2px solid transparent; border-radius: 12px; padding: 8px 2px; cursor: pointer; }
.av-name { font-size: 0.75rem; color: var(--muted); }
.av-pick.on { border-color: var(--gold); background: var(--card2); }
.url-box { direction: ltr; background: var(--bg2); border-radius: 10px; padding: 10px; font-weight: 900; font-size: 1.2rem; text-align: center; color: var(--gold2); }

/* ---------- phone shell ---------- */
.phone { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #14112be6; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tb-me { display: flex; align-items: center; gap: 8px; background: none; border: 0; font-weight: 700; cursor: pointer; padding: 0; }
.tb-mid { flex: 1; text-align: center; font-weight: 900; }
.dropdown { position: absolute; top: 58px; right: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 200px; box-shadow: 0 10px 30px #0008; }
.phone-main { padding: 16px; padding-bottom: 40px; flex: 1; }

.lobby { display: flex; flex-direction: column; }
.join-card { flex-direction: row; align-items: center; gap: 16px; }
.join-card .qr { width: 140px; height: 140px; }
.qr { background: #fff; border-radius: 14px; padding: 6px; }
.room-code { font-size: 2.4rem; font-weight: 900; letter-spacing: 6px; color: var(--gold2); direction: ltr; }
.room-code.huge { font-size: 5rem; }
.lobby-players { display: flex; flex-wrap: wrap; gap: 10px; }
.lp { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; width: 82px; cursor: pointer; }
.lp.off { opacity: 0.4; }
.lp-name { font-size: 0.85rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-stars { font-size: 0.8rem; color: var(--gold2); }
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: right; background: linear-gradient(160deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: transform 0.1s; }
.game-card:active:not(:disabled) { transform: scale(0.97); }
.game-card:disabled { cursor: default; opacity: 0.85; }
.gc-emoji { font-size: 2rem; }
.gc-name { font-weight: 900; font-size: 1.1rem; }
.gc-desc { color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.gc-players { font-size: 0.8rem; color: var(--gold2); margin-top: auto; }
.gc-players.bad { color: var(--bad); }

.modal { position: fixed; inset: 0; background: #0009; z-index: 40; display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.modal-box { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 14px; max-height: 90dvh; overflow: auto; }
.howto-title { font-size: 1.5rem; font-weight: 900; }
.opt-label { font-weight: 700; margin-bottom: 6px; }
.opt-choices { display: flex; flex-wrap: wrap; gap: 6px; }

.howto { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: right; width: 100%; }
.howto ol { margin: 10px 0 0; padding-inline-start: 22px; line-height: 1.9; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.team-col { border: 2px solid var(--tc); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: color-mix(in srgb, var(--tc) 10%, transparent); }
.team-title { font-weight: 900; color: var(--tc); font-size: 1.1rem; }
.team-scores { display: flex; gap: 10px; width: 100%; }
.team-score { flex: 1; display: flex; justify-content: space-between; align-items: center; border: 2px solid var(--tc); border-radius: 12px; padding: 8px 14px; background: color-mix(in srgb, var(--tc) 14%, transparent); }
.team-score b { font-size: 1.4rem; color: var(--tc); }

/* ---------- shared game bits ---------- */
.done-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.choices { display: grid; gap: 10px; width: 100%; }
.choices.cols-2 { grid-template-columns: 1fr 1fr; }
.choice { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 14px; font-size: 1.1rem; font-weight: 700; cursor: pointer; min-height: 56px; }
.choice.static { cursor: default; }
.choice.selected { border-color: var(--gold); background: var(--card2); box-shadow: 0 0 0 3px #f5b83d44; }
.choice.wrong { border-color: var(--bad); color: var(--bad); text-decoration: line-through; }
.choice.right { border-color: var(--good); background: #3ddc8422; color: var(--good); }
.choice.removed { opacity: 0.25; }
.choice:disabled:not(.right):not(.wrong) { cursor: default; }
.player-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; width: 100%; }
.pp { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px 6px; cursor: pointer; font-weight: 700; }
.pp.selected { border-color: var(--gold); background: var(--card2); box-shadow: 0 0 0 3px #f5b83d44; }
.secret { background: linear-gradient(160deg, var(--card2), var(--card)); border: 2px dashed var(--gold); border-radius: 20px; padding: 26px 18px; width: 100%; cursor: pointer; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.secret.small { padding: 12px; }
.secret.out { border-color: var(--bad); }
.secret-big { font-size: 2rem; font-weight: 900; }
.secret.small .secret-big { font-size: 1.4rem; }
.role-mafia { border-color: var(--bad); }
.reveal-word { font-size: 1.4rem; }
.reveal-word b { color: var(--gold2); }
.result-banner { background: var(--card2); border-radius: 14px; padding: 12px 20px; font-size: 1.3rem; font-weight: 900; }
.result-banner.good { background: #3ddc8433; color: var(--good); }
.result-banner.bad { background: #ff5d6c33; color: var(--bad); }
.vote-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.vote-item { background: var(--card); border-radius: 999px; padding: 4px 12px; border: 1px solid var(--line); }
.vote-item.good { border-color: var(--good); }
.vs-row { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.vs-label { color: var(--gold); font-weight: 900; }
.pairs-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 1.4rem; }
.pair { opacity: 0.5; }
.pair.cur { opacity: 1; background: var(--card2); border-radius: 10px; padding: 0 8px; }
.pair.past { opacity: 0.2; }
.winner-line { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.winner-line > .avatar { animation: pop 0.5s; }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pop { animation: pop 0.4s; }
.bars { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 30px; align-items: center; gap: 8px; text-align: right; }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 18px; border-radius: 999px; min-width: 6px; transition: width 0.6s; }
.scoreboard { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.score-row { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 6px 12px; }
.score-row .rank { width: 22px; color: var(--muted); font-weight: 900; }
.score-row .pts { margin-inline-start: auto; font-weight: 900; color: var(--gold2); font-size: 1.15rem; }
.score-row .delta { color: var(--good); font-weight: 700; }
.stars-earned { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.star-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card2); border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 900; color: var(--gold2); }
.inline-form { display: flex; gap: 8px; width: 100%; }
.inline-form input { flex: 1; }
.answer-box { display: flex; flex-direction: column; gap: 12px; width: 100%; align-items: center; }
.answer-box textarea { resize: none; }
.add-box { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ghost-box { background: #ffffff0d; border-radius: 14px; padding: 12px; width: 100%; }
.night { background: radial-gradient(circle at 50% 0, #0b0a1f, transparent 70%); border-radius: 20px; padding: 10px 0; }

/* quip */
.versus { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.quip-card { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 18px 14px; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; cursor: pointer; }
.quip-card:disabled { cursor: default; }
.quip-card.selected { border-color: var(--gold); box-shadow: 0 0 0 3px #f5b83d55; }
.quip-card.sweep { border-color: var(--good); }
.quip-text { font-size: 1.3rem; font-weight: 900; line-height: 1.5; }
.quip-meta { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pct { font-weight: 900; color: var(--gold2); font-size: 1.3rem; }
.hide-x { position: absolute; top: 6px; left: 8px; font-size: 0.9rem; opacity: 0.6; cursor: pointer; }
.final-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; width: 100%; }
.final-item { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-weight: 700; font-size: 1.1rem; display: flex; flex-direction: column; gap: 8px; }

/* letters hex board */
.hex-wrap { direction: ltr; display: flex; justify-content: center; width: 100%; }
.hex-board {
  --h: calc(var(--w) * 1.1547);
  padding: calc(var(--w) * 0.35) calc(var(--w) * 0.45);
  border-left: 8px solid var(--t0); border-right: 8px solid var(--t0);
  border-top: 8px solid var(--t1); border-bottom: 8px solid var(--t1);
  border-radius: 18px; background: #0004;
}
.hex-row { display: flex; gap: calc(var(--w) * 0.06); height: calc(var(--h) * 0.78); }
.hex-row.odd { margin-left: calc(var(--w) * 0.53); }
.hex-row:not(.odd) { margin-right: calc(var(--w) * 0.53); }
.hex {
  width: var(--w); height: var(--h); border: 0; padding: 0;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: #e9e4ff; color: #241a50; font-weight: 900; font-size: calc(var(--w) * 0.45);
  display: flex; align-items: center; justify-content: center; transition: background 0.3s, transform 0.15s;
}
.hex.pickable { cursor: pointer; }
.hex.pickable:hover, .hex.pickable:active { background: var(--gold2); transform: scale(1.06); }
.hex.own0 { background: var(--t0); color: #fff; }
.hex.own1 { background: var(--t1); color: #fff; }
.hex.cur { background: var(--gold); animation: pulse 0.6s infinite alternate; }
.hex:disabled { cursor: default; }
.legend { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; font-weight: 700; }
.letter-q { display: flex; align-items: center; gap: 14px; width: 100%; }
.big-letter { display: inline-flex; align-items: center; justify-content: center; width: 70px; height: 70px; flex-shrink: 0; border-radius: 18px; background: var(--gold); color: #241a00; font-size: 2.6rem; font-weight: 900; }
.buzzer { width: 190px; height: 190px; border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #ff8b96, var(--bad) 60%, #a5202d); font-size: 4.5rem; box-shadow: 0 10px 0 #7a1520, 0 16px 30px #0008; cursor: pointer; }
.buzzer:active { transform: translateY(8px); box-shadow: 0 2px 0 #7a1520; }

/* seen jeem */
.sj-board { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 8px; width: 100%; }
.sj-col { display: flex; flex-direction: column; gap: 6px; }
.sj-cat { background: var(--card2); border-radius: 10px; padding: 8px 4px; font-weight: 900; font-size: 0.8rem; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.sj-cat span { font-size: 1.3rem; }
.sj-cell { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #241a00; border: 0; border-radius: 10px; padding: 10px 0; font-weight: 900; font-size: 1rem; cursor: pointer; }
.sj-cell:disabled { cursor: default; }
.sj-cell.used { background: var(--bg2); }

/* reveal list (liar, draw) */
.reveal-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.reveal-item { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px; text-align: right; }
.reveal-item.truth { border-color: var(--good); background: #3ddc841a; }
.reveal-text { font-weight: 900; font-size: 1.15rem; }
.reveal-meta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; color: var(--muted); font-size: 0.9rem; margin-top: 6px; align-items: center; }
.picked { display: inline-flex; align-items: center; gap: 4px; }

/* draw */
.draw-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.draw-canvas { width: 100%; max-width: 420px; aspect-ratio: 1; border-radius: 14px; background: #fff; touch-action: none; }
.palette { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); cursor: pointer; }
.swatch.on { border-color: var(--gold); transform: scale(1.15); }
.dot { display: inline-block; border-radius: 50%; background: var(--text); }
.drawing-frame { background: var(--card); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.drawing-frame img { width: 100%; max-width: 340px; border-radius: 12px; display: block; }
.drawing-by { display: flex; align-items: center; gap: 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; align-items: start; }

/* categories */
.cat-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.cat-field { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; font-weight: 700; text-align: right; }
.review-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; width: 100%; }
.review-cat { background: var(--card); border-radius: 14px; padding: 10px; text-align: right; }
.review-head { font-weight: 900; color: var(--gold2); margin-bottom: 6px; }
.review-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); }
.review-row.invalid .review-ans { text-decoration: line-through; color: var(--bad); }
.review-ans { flex: 1; font-weight: 700; }

/* ---------- TV ---------- */
.is-tv { font-size: clamp(16px, 1.25vw, 30px); }
.tv { min-height: 100vh; display: flex; flex-direction: column; padding: 2vh 3vw; overflow: hidden; }
.tv-start { align-items: center; justify-content: center; gap: 5vh; cursor: pointer; }
.tv-start .logo-mark { font-size: 9rem; }
.tv .logo-mark { font-size: 5rem; }
.tv-lobby { display: grid; grid-template-columns: 1fr 1.3fr; gap: 4vw; align-items: center; flex: 1; }
.tv-join { display: flex; flex-direction: column; align-items: center; gap: 2vh; background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 3vh 2vw; text-align: center; }
.tv-join .qr { width: min(34vh, 22vw); height: auto; }
.tv-join-text { font-size: 1.3rem; line-height: 1.6; }
.tv-join-text b { direction: ltr; display: inline-block; color: var(--gold2); }
.tv-side .section-title { font-size: 2rem; }
.tv-players { display: flex; flex-wrap: wrap; gap: 1.6vw; }
.tv-player { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 1.2rem; width: 7.5vw; }
.tv-player.off { opacity: 0.35; }
.tv-hint { margin-top: 4vh; font-size: 1.4rem; color: var(--muted); }
.tv-top { display: flex; align-items: center; gap: 2vw; margin-bottom: 2vh; }
.tv-title { font-size: 2.2rem; font-weight: 900; flex: 1; }
.tv-top .timer { min-width: 4.5rem; height: 4.5rem; font-size: 2rem; border-width: 5px; }
.tv-corner { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 8px 14px; }
.tv-corner .qr { width: 84px; height: 84px; padding: 3px; }
.tv-corner .room-code { font-size: 1.8rem; letter-spacing: 3px; }
.tv-main { flex: 1; display: flex; justify-content: center; align-items: flex-start; max-width: 1500px; width: 100%; margin: 0 auto; }
.tv .prompt { font-size: 2.6rem; padding: 3vh 3vw; }
.tv .prompt.small { font-size: 2rem; }
.tv .big-line { font-size: 2.2rem; }
.tv .sub-head { font-size: 1.4rem; }
.tv .choice { font-size: 1.6rem; padding: 2vh 1vw; }
.tv .quip-card { min-height: 26vh; }
.tv .quip-text { font-size: 2.2rem; }
.tv .reveal-word { font-size: 2.2rem; }
.tv .result-banner { font-size: 2rem; }
.tv .big-letter { width: 9vh; height: 9vh; font-size: 6vh; }
.tv .team-score { font-size: 1.5rem; padding: 1.2vh 2vw; }
.tv .team-score b { font-size: 2.4rem; }
.tv .sj-cat { font-size: 1.2rem; min-height: 9vh; }
.tv .sj-cell { font-size: 1.8rem; padding: 1.6vh 0; }
.tv .howto { font-size: 1.5rem; padding: 3vh 3vw; }
.tv .howto-title { font-size: 2.8rem; }
.tv .reveal-text { font-size: 1.6rem; }
.tv .scoreboard { max-width: 900px; font-size: 1.4rem; }
.tv .bar-row { grid-template-columns: 16vw 1fr 3vw; font-size: 1.4rem; }
.tv .bar { height: 3vh; }
.tv .drawing-frame img { max-width: 60vh; }
.tv .review-table { font-size: 1.1rem; }
.tv .vote-item { font-size: 1.3rem; }

@media (max-width: 380px) {
  .avatar-grid { grid-template-columns: repeat(3, 1fr); }
  .game-grid { grid-template-columns: 1fr; }
  .versus { grid-template-columns: 1fr; }
}

/* /chars gallery */
.gallery { display: flex; flex-wrap: wrap; gap: 24px; padding: 24px; justify-content: center; }
.gallery-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.credit { font-size: 0.75rem; color: var(--muted); text-align: center; width: 100%; }
.credit a { color: var(--muted); }
img.character { object-fit: cover; }
