/* Ember games: boards, panels, the Arcade page, badges. Uses the theme variables from theme.css. */
:root { --seat0: #ff7a3d; --seat1: #4fb3f6; --sq-l: #edd8bb; --sq-d: #b06a43; --board-edge: #5a2f1c; }

/* ---------- shared bits ---------- */
.game-glyph { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; font: 800 18px/1 var(--font-display); color: #fff;
  background: linear-gradient(145deg, var(--g1, #ff9a52), var(--g2, #d9481c)); box-shadow: inset 0 1px 0 #ffffff40, 0 4px 14px -6px var(--g2, #d9481c); }
.game-glyph.big { width: 52px; height: 52px; border-radius: 15px; font-size: 28px; }
.g-chess { --g1: #ffb067; --g2: #c4501f; } .g-connect4 { --g1: #7cc4ff; --g2: #2a68d8; } .g-uttt { --g1: #c59bff; --g2: #7136d1; }
.g-sketch { --g1: #ff9ccc; --g2: #d63a78; } .g-trivia { --g1: #ffe17a; --g2: #d48a06; } .g-wordrush { --g1: #8be3b0; --g2: #1f9a62; }
.link-btn { color: var(--link); font-weight: 600; font-size: .86rem; padding: 2px 4px; border-radius: 6px; } .link-btn:hover { text-decoration: underline; }
.center { text-align: center; justify-content: center; } .btn-row.center { justify-content: center; } .btn-row.end { justify-content: flex-end; }
.tiny { font-size: .76rem; } .small { font-size: .86rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 12px; border-radius: 12px; background: var(--bg-3); border: 1.5px solid transparent; color: var(--text); text-align: left; transition: border-color .15s, background-color .15s, transform .15s; }
.pick small { color: var(--text-faint); font-size: .74rem; } .pick:hover { background: var(--bg-4); transform: translateY(-1px); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); } .pick.small { padding: 5px 10px; font-size: .82rem; }
.switch-row { display: flex; gap: 10px; align-items: center; } .switch-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.time-bar { height: 6px; border-radius: 99px; background: var(--bg-4); overflow: hidden; } .time-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: inherit; }
.time-bar.low i { background: var(--danger); } .time-bar.done i { width: 0; }
.rank-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--text-dim); }
.rank-svg { display: inline-flex; filter: drop-shadow(0 3px 8px #0006); }
.has-badge .badge.live { background: var(--success); color: #fff; animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 30%, transparent); } }

/* ---------- full-screen game room ---------- */
.game-room { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg-0) 92%, transparent); backdrop-filter: blur(14px);
  opacity: 0; transform: scale(.985); transition: opacity .2s, transform .2s cubic-bezier(.2,.8,.2,1); }
.game-room.open { opacity: 1; transform: none; }
.room-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.room-head h2 { font: 700 1.25rem var(--font-display); letter-spacing: -.02em; }
.room-body { flex: 1; min-height: 0; overflow: auto; padding: clamp(10px, 2.5vw, 28px); display: flex; justify-content: center; }
.room-body > .game { width: 100%; max-width: 1180px; }

/* ---------- two-player layout ---------- */
.duel { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; align-items: start; }
.duel-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; align-items: center; }
.duel-main > .pbar { width: min(100%, var(--board-size, 640px)); }
.board-stage { position: relative; width: min(100%, var(--board-size, 640px)); }
.game.compact .duel { grid-template-columns: 1fr; gap: 10px; } .game.compact { --board-size: 460px; }
.pbar { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); transition: box-shadow .2s, border-color .2s; }
.pbar.turn { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pbar-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; } .pbar-name strong { font-size: .95rem; }
.bot-avatar svg { display: block; border-radius: 50%; background: var(--bg-4); }
.clock { font: 700 1.25rem var(--font-mono); padding: 4px 12px; border-radius: 10px; background: var(--bg-4); color: var(--text-dim); min-width: 84px; text-align: center; font-variant-numeric: tabular-nums; }
.clock.on { background: var(--text); color: var(--bg-0); } .clock.on.low { background: var(--danger); color: #fff; animation: low-blink 1s steps(2) infinite; }
@keyframes low-blink { 50% { opacity: .82; } }
.thinking { display: inline-flex; gap: 3px; } .thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: think 1s ease-in-out infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 50% { transform: translateY(-4px); opacity: .5; } }
.disc-mark { width: 16px; height: 16px; border-radius: 50%; background: var(--seat0); box-shadow: inset 0 -2px 0 #0003; } .disc-mark.s1 { background: var(--seat1); }
.kind-uttt .disc-mark { border-radius: 4px; }
.duel-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.duel-status { font: 700 1.05rem var(--font-display); padding: 10px 12px; border-radius: 12px; background: var(--bg-2); }
.duel-status.over { background: var(--accent-soft); }
.duel-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* result overlay */
.result-layer { position: absolute; inset: 0; display: grid; place-items: center; background: #120c0a99; backdrop-filter: blur(3px); border-radius: 12px; animation: fade-in .3s both; z-index: 5; }
.result-card { display: grid; justify-items: center; gap: 8px; padding: 22px 26px; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow); text-align: center; animation: pop-in .45s cubic-bezier(.2,1.4,.4,1) both; max-width: 92%; }
.result-card h3 { font: 800 1.7rem var(--font-display); letter-spacing: -.03em; }
.result-card.won h3 { background: linear-gradient(90deg, var(--accent-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rating-change { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 14px; background: var(--bg-3); flex-wrap: wrap; justify-content: center; }
.rating-change strong { font: 800 1.3rem var(--font-mono); margin-right: 6px; } .rating-change.up span { color: var(--success); font-weight: 800; } .rating-change.down span { color: var(--danger); font-weight: 800; }
.rating-change em { font-style: normal; font-weight: 700; width: 100%; } .rating-change .promo { color: var(--accent-2); animation: shine 1.4s ease-in-out infinite; }
@keyframes shine { 50% { filter: brightness(1.4); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.85) translateY(10px); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- chess ---------- */
.chess-wrap { position: relative; padding: 8px; border-radius: 14px; background: linear-gradient(160deg, #6b3a22, var(--board-edge)); box-shadow: 0 18px 50px -20px #000c, inset 0 1px 0 #ffffff22; }
.chess-board { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); aspect-ratio: 1; border-radius: 6px; overflow: hidden; touch-action: none; user-select: none; }
.sq { position: relative; display: grid; place-items: center; min-height: 0; min-width: 0; aspect-ratio: 1; }
.sq.l { background: var(--sq-l); } .sq.d { background: var(--sq-d); }
.sq.last::before { content: ''; position: absolute; inset: 0; background: #ffc53d66; }
.sq.sel::before { content: ''; position: absolute; inset: 0; background: #ff8a3d80; }
.sq.dot::after { content: ''; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: #2a161055; }
.sq.cap::after { content: ''; position: absolute; inset: 4%; border-radius: 50%; border: 5px solid #2a161055; }
.sq.check { background: radial-gradient(circle, #ff3b30 0%, #ff3b3088 40%, transparent 72%), var(--sq-l); }
.sq.d.check { background: radial-gradient(circle, #ff3b30 0%, #ff3b3088 40%, transparent 72%), var(--sq-d); }
.coord { position: absolute; font: 700 .62rem var(--font); opacity: .7; pointer-events: none; }
.coord.rank { top: 3px; left: 4px; } .coord.file { bottom: 2px; right: 4px; }
.sq.l .coord { color: var(--sq-d); } .sq.d .coord { color: var(--sq-l); }
.pc { position: relative; z-index: 1; width: 92%; height: 92%; cursor: grab; transition: transform .18s; }
.pc svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 2px #0005); }
.pc.dragging { z-index: 10; cursor: grabbing; transition: none; filter: drop-shadow(0 12px 10px #0007); }
.promo-pick { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; background: #000a; border-radius: 14px; z-index: 8; text-align: center; }
.promo-pick .btn-row, .promo-pick { justify-items: center; } .promo-pick p { color: #fff; font-weight: 700; }
.promo-btn { width: 70px; height: 70px; border-radius: 14px; background: var(--sq-l); margin: 0 4px; transition: transform .15s; } .promo-btn:hover { transform: scale(1.08); }
.promo-btn svg { width: 100%; height: 100%; }
.chess-side { display: flex; flex-direction: column; gap: 8px; }
.move-list { list-style: none; max-height: 320px; overflow-y: auto; padding: 6px; border-radius: 12px; background: var(--bg-2); font: 500 .9rem var(--font-mono); counter-reset: none; }
.move-list li { display: grid; grid-template-columns: 34px 1fr 1fr; padding: 2px 6px; border-radius: 6px; } .move-list li:nth-child(odd) { background: var(--bg-3); }
.move-list .mn { color: var(--text-faint); } .move-list .cur { color: var(--accent); font-weight: 800; }
.tray { display: flex; flex-wrap: wrap; min-height: 24px; } .tray span { width: 22px; height: 22px; margin-right: -6px; } .tray svg { width: 100%; height: 100%; }
.game.compact .move-list { max-height: 120px; }

/* ---------- Connect Four ---------- */
.c4-wrap { padding: 12px 12px 14px; border-radius: 18px; background: linear-gradient(170deg, #2b3f78, #1a2550); box-shadow: 0 18px 50px -20px #000c, inset 0 2px 0 #ffffff22; }
.c4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.c4-col { display: grid; gap: 6px; padding: 4px; border-radius: 12px; cursor: default; position: relative; }
.c4-col.open { cursor: pointer; } .c4-col.hot { background: #ffffff14; }
.ghost-disc { aspect-ratio: 1; border-radius: 50%; opacity: 0; background: var(--who, var(--seat0)); transform: translateY(-4px); transition: opacity .15s; margin-bottom: 2px; }
.c4-col.hot .ghost-disc { opacity: .45; }
.hole { aspect-ratio: 1; border-radius: 50%; background: #0d1530; box-shadow: inset 0 4px 6px #0008; position: relative; }
.disc { position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8 0 10%, transparent 30%), var(--seat0); box-shadow: inset 0 -5px 0 #0003, 0 2px 6px #0006; }
.disc.s1 { background: radial-gradient(circle at 35% 30%, #fff8 0 10%, transparent 30%), var(--seat1); }
.disc.drop { animation: drop calc(.12s + var(--fall) * .06s) cubic-bezier(.5,0,1,1) both; }
@keyframes drop { from { transform: translateY(calc(var(--fall) * -110%)); } }
.disc.win { animation: win-pulse .8s ease-in-out infinite alternate; } @keyframes win-pulse { to { box-shadow: 0 0 0 4px #fff, 0 0 22px 6px #fff8; } }

/* ---------- Ultimate tic-tac-toe ---------- */
.ut-wrap { padding: 10px; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--border); }
.ut { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; aspect-ratio: 1; }
.ut-b { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 5px; border-radius: 12px; background: var(--bg-3); transition: box-shadow .2s, background-color .2s; }
.ut-b.live { background: color-mix(in srgb, var(--accent) 16%, var(--bg-3)); box-shadow: 0 0 0 2px var(--accent); }
.ut-b.won .ut-c { opacity: .25; } .ut-b.w3 { opacity: .55; }
.ut-b.line { box-shadow: 0 0 0 3px var(--accent-2), 0 0 24px var(--accent-2); }
.ut-c { aspect-ratio: 1; border-radius: 7px; background: var(--bg-1); display: grid; place-items: center; color: var(--seat0); padding: 14%; }
.ut-c.m2 { color: var(--seat1); } .ut-c.ok { cursor: pointer; } .ut-c.ok:hover { background: var(--accent-soft); }
.ut-c.last { box-shadow: inset 0 0 0 2px var(--accent-2); } .ut-c svg { width: 100%; height: 100%; animation: pop-in .25s both; }
.ut-big { position: absolute; inset: 8%; display: grid; place-items: center; color: var(--seat0); pointer-events: none; animation: pop-in .35s both; } .ut-big.m2 { color: var(--seat1); }
.ut-big svg { width: 100%; height: 100%; transform: scale(1.7); filter: drop-shadow(0 6px 10px #0007); }

/* ---------- lobby ---------- */
.lobby { display: grid; gap: 18px; justify-items: center; padding: 18px; border-radius: 20px; background: var(--bg-2); max-width: 640px; margin: 0 auto; }
.lobby-head { display: flex; gap: 14px; align-items: center; } .lobby-head h3 { font: 700 1.3rem var(--font-display); }
.lobby-players, .lobby-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; align-items: center; }
.lobby-player { display: grid; justify-items: center; gap: 4px; min-width: 96px; padding: 12px; border-radius: 16px; background: var(--bg-3); animation: pop-in .3s both; }
.lobby-player.empty { opacity: .6; } .seat-ring { width: 44px; height: 44px; border-radius: 50%; border: 2px dashed var(--border-strong); animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.vs { order: 1; font: 800 1.2rem var(--font-display); color: var(--text-faint); } .lobby-seats .lobby-player:last-of-type { order: 2; }

/* ---------- party games ---------- */
.party { max-width: 1100px; margin: 0 auto; }
.scores { list-style: none; display: grid; gap: 4px; padding: 8px; border-radius: 14px; background: var(--bg-2); }
.scores li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 9px; } .scores li.me { background: var(--accent-soft); }
.scores .place { width: 18px; color: var(--text-faint); font-weight: 800; } .scores b { font-variant-numeric: tabular-nums; } .grow { flex: 1; min-width: 0; }
.podium-wrap { display: grid; justify-items: center; gap: 12px; padding: 12px; } .podium-wrap h3 { font: 800 1.6rem var(--font-display); }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 150px)); align-items: end; gap: 10px; }
.step { display: grid; justify-items: center; gap: 4px; animation: pop-in .5s both; } .step.p1 { animation-delay: .25s; } .step.p3 { animation-delay: .1s; }
.step .block { width: 100%; display: grid; place-items: center; font: 800 1.8rem var(--font-display); color: #fff; border-radius: 12px 12px 4px 4px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #000)); }
.step.p1 .block { height: 120px; background: linear-gradient(180deg, #ffd36a, #c98a12); } .step.p2 .block { height: 86px; background: linear-gradient(180deg, #dfe5ee, #8892a1); } .step.p3 .block { height: 62px; background: linear-gradient(180deg, #e3a072, #9b5a2e); }

/* Sketch & Guess */
.sketch { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.game.compact .sketch { grid-template-columns: 1fr; }
.sketch-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sketch-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--bg-2); }
.sketch-hint { display: grid; gap: 2px; } .sketch-hint .word { font: 800 1.4rem var(--font-display); letter-spacing: .02em; color: var(--accent); }
.blanks { display: flex; gap: 5px; } .blanks i { width: 18px; height: 26px; border-bottom: 3px solid var(--text); font: 800 1.15rem var(--font-display); font-style: normal; text-align: center; text-transform: uppercase; } .blanks i.gap { border: 0; width: 10px; }
.sketch-timer { font: 800 1.4rem var(--font-mono); color: var(--accent); }
.sketch-paper { position: relative; border-radius: 16px; overflow: hidden; box-shadow: 0 14px 40px -18px #000c; }
.sketch-canvas { display: block; width: 100%; aspect-ratio: 4 / 3; background: #fff; touch-action: none; } .sketch-canvas.can-draw { cursor: crosshair; }
.sketch-pick { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; background: #1c1614d9; text-align: center; color: #fff; font-weight: 700; }
.sketch-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sketch-tools .swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-strong); transition: transform .12s; } .sketch-tools .swatch.on { transform: scale(1.18); box-shadow: 0 0 0 3px var(--accent); }
.sketch-tools .size, .sketch-tools .tool { min-width: 34px; height: 34px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--bg-3); font-weight: 700; }
.sketch-tools .size i { border-radius: 50%; background: var(--text); } .sketch-tools .on { box-shadow: 0 0 0 2px var(--accent); }
.sketch-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.sketch-feed { list-style: none; flex: 1; min-height: 160px; max-height: 340px; overflow-y: auto; display: grid; align-content: start; gap: 3px; padding: 8px; border-radius: 14px; background: var(--bg-2); font-size: .9rem; }
.sketch-feed li.correct { color: var(--success); font-weight: 700; } .sketch-feed li.system { color: var(--text-faint); font-style: italic; } .sketch-feed li.close { color: var(--warning); font-weight: 700; }

/* Trivia */
.trivia { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; }
.trivia-head { display: flex; align-items: center; gap: 10px; } .trivia-head .secs, .wr-head .secs { margin-left: auto; font: 800 1.3rem var(--font-mono); color: var(--accent); }
.trivia-head .chip { margin: 0; background: var(--accent-soft); color: var(--accent); }
.trivia-q { font: 700 clamp(1.25rem, 2.6vw, 1.8rem) / 1.25 var(--font-display); letter-spacing: -.02em; animation: pop-in .35s both; }
.trivia-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game.compact .trivia-opts { grid-template-columns: 1fr; }
.opt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--bg-2); border: 2px solid var(--border); text-align: left; font-weight: 600; transition: transform .12s, border-color .15s, background-color .15s; animation: pop-in .3s both; }
.opt.o1 { animation-delay: .05s; } .opt.o2 { animation-delay: .1s; } .opt.o3 { animation-delay: .15s; }
.opt:not(:disabled):hover { transform: translateY(-2px); border-color: var(--accent); }
.opt-key { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--k, #8b8d98); }
.o0 { --k: #e5484d; } .o1 { --k: #3e8ef7; } .o2 { --k: #f5a524; } .o3 { --k: #46a758; }
.opt.picked { border-color: var(--accent); background: var(--accent-soft); }
.opt.right { border-color: var(--success); background: color-mix(in srgb, var(--success) 20%, var(--bg-2)); animation: pop-in .3s both; }
.opt.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 18%, var(--bg-2)); } .opt.off { opacity: .45; }

/* Word Rush */
.wordrush { display: grid; gap: 12px; justify-items: center; max-width: 820px; margin: 0 auto; }
.wr-head { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px; } .reveal-word { margin-left: auto; font: 800 1.4rem var(--font-display); letter-spacing: .1em; color: var(--accent); }
.wr-body { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.wr-grid { display: grid; gap: 6px; }
.wr-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; } .wr-row.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.wr-tile { width: clamp(44px, 9vw, 58px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; border: 2px solid var(--border-strong); font: 800 1.6rem var(--font-display); text-transform: uppercase; }
.wr-tile.typed { border-color: var(--text-dim); animation: pop-in .12s both; }
.wr-tile.flip { animation: flip .45s both; border-color: transparent; color: #fff; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.f-g { background: #2f9e5b; } .f-y { background: #d9a21b; } .f-x { background: #4b4340; }
.wr-others { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; max-width: 300px; }
.wr-mini { display: grid; gap: 4px; padding: 6px; border-radius: 10px; background: var(--bg-2); } .wr-mini.solved { box-shadow: 0 0 0 2px #2f9e5b; }
.mini-grid { display: grid; gap: 2px; } .mini-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; } .mini-row i { height: 10px; border-radius: 2px; }
.wr-keys { display: grid; gap: 6px; width: 100%; max-width: 520px; } .kb-row { display: flex; gap: 5px; justify-content: center; }
.kb { flex: 1; max-width: 44px; height: 50px; border-radius: 8px; background: var(--bg-4); font-weight: 800; text-transform: uppercase; display: grid; place-items: center; padding: 0; } .kb.wide { max-width: 72px; flex: 1.6; font-size: .8rem; }
.kb.f-g, .kb.f-y { color: #fff; } .kb.f-x { opacity: .45; }

/* ---------- panels in chats and calls ---------- */
.chat-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 46%); }
.chat-split > .chat-wrap { min-width: 0; }
.games-drawer { border-left: 1px solid var(--border); min-height: 0; display: flex; background: var(--bg-1); animation: slide-in .25s cubic-bezier(.2,.8,.2,1) both; }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }
.channel-games { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; }
.cg-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.cg-head select { max-width: 160px; }
.cg-body { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.cg-launch { display: grid; gap: 12px; } .mini-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.mini-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); font-weight: 600; text-align: left; transition: transform .15s, border-color .15s; }
.mini-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.stage { flex-direction: row; } .stage-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.stage-games { width: min(52%, 720px); border-left: 1px solid var(--border); display: flex; min-height: 0; background: var(--bg-1); animation: slide-in .25s both; }
.stage.with-games .stage-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.call-controls .games { color: var(--accent); }

/* ---------- new game picker ---------- */
.new-game { display: grid; gap: 16px; }
.game-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.game-card { display: grid; gap: 6px; justify-items: start; padding: 14px; border-radius: 18px; background: var(--bg-3); border: 1.5px solid transparent; text-align: left; transition: transform .15s, border-color .15s, box-shadow .15s; }
.game-card:hover { transform: translateY(-3px); border-color: var(--g2); box-shadow: 0 12px 30px -16px var(--g2); }
.game-card strong { font: 700 1.05rem var(--font-display); } .game-card small { color: var(--text-dim); } .game-card .chip { margin: 0; font-style: normal; }
.ng-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .ng-head h3 { font: 700 1.25rem var(--font-display); } .ng-head .link-btn { width: 100%; text-align: left; }
.ng-sec h4 { font-size: .78rem; color: var(--text-faint); margin-bottom: 6px; font-weight: 700; }
.seek { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 8px; }
.seek-dots { display: flex; gap: 6px; } .seek-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: think 1.1s ease-in-out infinite; } .seek-dots i:nth-child(2) { animation-delay: .18s; } .seek-dots i:nth-child(3) { animation-delay: .36s; }

/* ---------- floating cards (your move, invites, badges) ---------- */
.game-float { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: grid; gap: 10px; width: min(380px, calc(100vw - 36px)); }
.float-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow); animation: float-in .35s cubic-bezier(.2,1.3,.4,1) both; }
.float-card.out { animation: float-out .22s both; } .float-card .grow { display: grid; } .float-card small { color: var(--text-dim); }
.float-card.badge-pop { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--bg-2)), var(--bg-2)); }
.float-card.badge-pop .badge-art { animation: badge-spin .9s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes badge-spin { from { transform: rotateY(180deg) scale(.4); } }
@keyframes float-in { from { opacity: 0; transform: translateY(18px) scale(.96); } } @keyframes float-out { to { opacity: 0; transform: translateX(30px); } }

/* ---------- badges & profile ---------- */
.badge-art { display: inline-flex; filter: drop-shadow(0 4px 8px #0006); } .badge-art.locked { filter: grayscale(1) brightness(.55); opacity: .6; }
.profile-games { display: grid; gap: 6px; } .profile-games h4 { margin-top: 8px; }
.profile-ranks { display: flex; flex-wrap: wrap; gap: 8px; } .p-rank { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 12px; background: var(--bg-3); }
.p-rank div { display: grid; } .p-rank small { color: var(--text-dim); }
.profile-badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Arcade page ---------- */
.arcade { flex: 1; overflow-y: auto; padding: clamp(14px, 3vw, 34px); display: grid; grid-auto-rows: max-content; gap: 30px; align-content: start; max-width: 1240px; margin: 0 auto; width: 100%; }
.arcade h2 { font: 700 1.25rem var(--font-display); letter-spacing: -.02em; margin-bottom: 12px; }
.arcade-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: clamp(18px, 3vw, 34px); border-radius: 26px; overflow: hidden; position: relative;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 60%), linear-gradient(160deg, var(--bg-3), var(--bg-2)); border: 1px solid var(--border); }
.arcade-hero h1 { font: 800 clamp(2.4rem, 6vw, 4.2rem) / .95 var(--font-display); letter-spacing: -.05em; }
.hero-copy { display: grid; gap: 12px; } .hero-copy p { color: var(--text-dim); max-width: 46ch; font-size: 1.05rem; }
.hero-board { position: relative; } .hero-mascot { position: absolute; left: -70px; bottom: -14px; z-index: 2; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
.mini-chess { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); width: clamp(180px, 22vw, 260px); aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 6px solid var(--board-edge); transform: rotate(4deg); box-shadow: 0 24px 50px -20px #000; }
.mini-chess i { display: grid; place-items: center; } .mini-chess i.l { background: var(--sq-l); } .mini-chess i.d { background: var(--sq-d); } .mini-chess svg { width: 92%; height: 92%; }
.rank-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rank-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: linear-gradient(140deg, color-mix(in srgb, var(--rank) 20%, var(--bg-2)), var(--bg-2) 60%); border: 1px solid color-mix(in srgb, var(--rank) 35%, var(--border)); }
.rank-card .grow { display: grid; gap: 2px; } .rank-card small:first-child { color: var(--text-faint); font-weight: 700; } .rank-card strong { font: 800 1.35rem var(--font-display); color: var(--rank-glow); }
.rank-progress { height: 6px; border-radius: 99px; background: var(--bg-4); overflow: hidden; margin: 4px 0; } .rank-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--rank), var(--rank-glow)); }
.solo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.solo-card { display: grid; gap: 6px; justify-items: start; padding: 16px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--border); text-align: left; transition: transform .15s, border-color .15s; }
.solo-card:hover { transform: translateY(-3px); border-color: var(--accent); } .solo-card strong { font: 700 1.05rem var(--font-display); } .solo-card small { color: var(--text-dim); }
.solo-card .best { font-style: normal; font-size: .8rem; font-weight: 700; color: var(--accent); }
.badge-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge-tile { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 12px 10px; border-radius: 16px; background: var(--bg-2); }
.badge-tile small { color: var(--text-faint); font-size: .74rem; } .badge-tile:not(.earned) strong { color: var(--text-faint); }
.badge-tile.earned { background: linear-gradient(170deg, var(--accent-soft), var(--bg-2)); }
.active-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.active-game { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--border); text-align: left; }
.active-game .grow { display: grid; } .active-game small { color: var(--text-dim); } .chip.hot { background: var(--accent); color: #fff; }
.lb-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; } .lb-tabs .tab.on { background: var(--active); color: var(--text); }
.lb-table { width: 100%; border-collapse: collapse; } .lb-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); } .lb-table tr.me td { background: var(--accent-soft); }
.lb-table .place { width: 44px; font-weight: 800; text-align: center; } .lb-table .who { display: flex; align-items: center; gap: 8px; } .lb-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.recent-games { list-style: none; display: grid; gap: 6px; } .recent-games li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--bg-2); }
.recent-games .grow { display: grid; } .delta { font-weight: 800; font-variant-numeric: tabular-nums; } .delta.up { color: var(--success); } .delta.down { color: var(--danger); }
.out-won { background: color-mix(in srgb, var(--success) 25%, var(--bg-4)); color: var(--text); } .out-lost { background: color-mix(in srgb, var(--danger) 22%, var(--bg-4)); color: var(--text); }

/* ---------- single-player games ---------- */
.solo { flex-direction: column; align-items: center; gap: 14px; }
.solo-result { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--border-strong); animation: pop-in .35s both; } .solo-result .grow { display: grid; }
.ms-top { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 16px; background: var(--bg-2); }
.ms-count, .ms-time { font: 800 1.2rem var(--font-mono); min-width: 70px; } .ms-face { border-radius: 50%; background: var(--bg-3); padding: 2px; }
.ms-scroll { max-width: 100%; overflow: auto; padding: 4px; }
.ms-grid { --ms: clamp(24px, min(5vw, 4.4vh), 36px); display: grid; gap: 2px; padding: 8px; border-radius: 14px; background: var(--bg-3); }
.solo-mines .ms-grid:has(> :nth-child(400)) { --ms: clamp(22px, min(3vw, 4vh), 32px); }
.ms-c { width: var(--ms); height: var(--ms); border-radius: 5px; background: linear-gradient(160deg, #6b4a3a, #4e3428); box-shadow: inset 0 2px 0 #ffffff1c; font: 800 .95rem var(--font-display); display: grid; place-items: center; color: #fff; }
.ms-c:hover:not(.open) { filter: brightness(1.2); }
.ms-c.open { background: var(--bg-1); box-shadow: none; animation: fade-in .15s both; } .ms-c.flag { color: #ffb347; } .ms-c.boom { background: var(--danger); } .ms-c.mine { color: #ff8a8a; }
.ms-c.n1 { color: #63b3ff; } .ms-c.n2 { color: #5bd38a; } .ms-c.n3 { color: #ff6b6b; } .ms-c.n4 { color: #c18bff; } .ms-c.n5 { color: #ffb347; } .ms-c.n6 { color: #3fd6c6; } .ms-c.n7 { color: #fff; } .ms-c.n8 { color: #aaa; }
.ms-foot, .mg-foot { display: grid; gap: 10px; justify-items: center; }
.mg-top { display: flex; align-items: center; gap: 10px; } .mg-score { display: grid; justify-items: center; padding: 6px 14px; border-radius: 12px; background: var(--bg-2); min-width: 86px; }
.mg-score small { color: var(--text-faint); font-weight: 700; font-size: .72rem; } .mg-score b { font: 800 1.3rem var(--font-mono); }
.mg-board { --cell: min(21vw, 15vh, 104px); --gap: 10px; position: relative; width: calc(var(--cell) * 4 + var(--gap) * 5); aspect-ratio: 1; border-radius: 18px; background: #2a1d18; display: grid; grid-template-columns: repeat(4, var(--cell)); gap: var(--gap); padding: var(--gap); }
.mg-slot { border-radius: 12px; background: #ffffff0d; }
.mg-t { position: absolute; left: var(--gap); top: var(--gap); width: var(--cell); height: var(--cell); border-radius: 12px; display: grid; place-items: center; font: 800 calc(var(--cell) * .36) var(--font-display); color: #2a1610;
  transform: translate(calc(var(--c) * (var(--cell) + var(--gap))), calc(var(--r) * (var(--cell) + var(--gap)))); transition: transform .12s ease-out; background: #f3e3cf; }
.mg-t.pop { animation: tile-pop .18s .08s both; } .mg-t.merge { animation: tile-merge .2s both; } .mg-t.gone { z-index: 0; }
@keyframes tile-pop { from { scale: 0; } } @keyframes tile-merge { 50% { scale: 1.15; } }
.mg-t.v2 { background: #f3e3cf; } .mg-t.v4 { background: #f2d4ae; } .mg-t.v8 { background: #f7b37a; color: #fff; } .mg-t.v16 { background: #f99559; color: #fff; } .mg-t.v32 { background: #f7743f; color: #fff; }
.mg-t.v64 { background: #ef5426; color: #fff; } .mg-t.v128 { background: #f4c35a; color: #fff; font-size: calc(var(--cell) * .3); } .mg-t.v256 { background: #f6c240; color: #fff; font-size: calc(var(--cell) * .3); }
.mg-t.v512 { background: #f9bf2b; color: #fff; font-size: calc(var(--cell) * .3); box-shadow: 0 0 18px #ffbf2b88; } .mg-t.v1024 { background: #fcd770; color: #7a3c00; font-size: calc(var(--cell) * .25); box-shadow: 0 0 24px #ffd77088; }
.mg-t.v2048, .mg-t.v4096 { background: radial-gradient(circle, #fff, #fff6d6); color: #c4501f; font-size: calc(var(--cell) * .25); box-shadow: 0 0 34px #fff8; }
.fuse { width: min(92vw, 64vh, 600px); aspect-ratio: 1; border-radius: 16px; box-shadow: 0 20px 50px -20px #000c; touch-action: none; }

@media (max-width: 1100px) {
  .duel { grid-template-columns: 1fr; } .duel-side { position: static; }
  .chat-split { grid-template-columns: 1fr; } .chat-split > .chat-wrap { display: none; } .games-drawer { border-left: 0; }
  .stage { flex-direction: column; } .stage-games { width: 100%; border-left: 0; border-top: 1px solid var(--border); flex: 1.4; }
  .sketch { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .arcade-hero { grid-template-columns: 1fr; } .hero-board { display: none; } .arcade-hero .btn-row { flex-wrap: wrap; } .arcade-hero .btn-row .btn { flex: 1 1 auto; }
  .trivia-opts { grid-template-columns: 1fr; } .podium { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .clock { min-width: 64px; font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) { .game *, .arcade *, .game-room, .float-card { animation: none !important; transition: none !important; } }

/* ---------- Owner HQ: updates ---------- */
.hq-updates { display: grid; gap: 12px; }
.upd-now { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .upd-now div { display: grid; } .upd-now small { color: var(--text-faint); font-weight: 700; } .upd-now strong { font: 800 1.3rem var(--font-display); }
.upd-now .chip.ok { background: color-mix(in srgb, var(--success) 22%, var(--bg-4)); color: var(--text); } .upd-now .chip.warn { margin: 0; }
.upd-staged, .upd-empty { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--bg-3); justify-items: start; }
.upd-notes { white-space: pre-wrap; font-size: .9rem; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); width: 100%; }
.upd-progress { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--accent-soft); font-weight: 600; }
.upd-progress .spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* ---------- Fast Hands ---------- */
.react { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; }
.react-head { display: flex; justify-content: center; }
.react-pad { height: min(46vh, 360px); border-radius: 28px; font: 800 2.4rem/1 var(--font-display, inherit); color: #fff; background: #b8323a; box-shadow: inset 0 -8px 0 rgb(0 0 0 / .18); touch-action: manipulation; user-select: none; transition: background .08s; }
.react-pad.ready { background: #6b5a52; } .react-pad.go { background: #2fa866; } .react-pad.reveal { background: var(--bg-4); color: var(--text); } .react-pad.early { background: #8a2b2b; } .react-pad.done { background: #237a4c; }
.react-times { list-style: none; display: grid; gap: 6px; } .react-times li { display: flex; align-items: center; gap: 8px; }
/* ---------- Codewords ---------- */
.cw { display: grid; gap: 12px; }
.cw-head { display: flex; align-items: center; gap: 12px; } .cw-head .secs { margin-left: auto; }
.cw-left { font-weight: 800; padding: 4px 10px; border-radius: 10px; } .cw-left.red { background: #e5484d22; color: #ff8589; } .cw-left.blue { background: #3e8ef722; color: #7fb2ff; }
.cw-status { font-weight: 700; } .cw-status small { color: var(--text-dim); font-weight: 500; }
.cw-clue { display: flex; gap: 8px; } .cw-clue .input:first-child { flex: 1; } .cw-clue select { width: 76px; }
.cw-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cw-card { min-height: 56px; padding: 6px 4px; border-radius: 10px; background: #efe6dc; color: #2a211c; font-weight: 800; font-size: clamp(.68rem, 2.6vw, .95rem); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; box-shadow: inset 0 -3px 0 rgb(0 0 0 / .12); }
.cw-card:not(:disabled):hover { transform: translateY(-1px); }
.cw-card.red:not(.open) { box-shadow: inset 0 0 0 3px #e5484d; } .cw-card.blue:not(.open) { box-shadow: inset 0 0 0 3px #3e8ef7; } .cw-card.assassin:not(.open) { box-shadow: inset 0 0 0 3px #111; }
.cw-card.open.red { background: #e5484d; color: #fff; } .cw-card.open.blue { background: #3e8ef7; color: #fff; } .cw-card.open.neutral { background: #b9ab9c; color: #4a3f37; } .cw-card.open.assassin { background: #1b1513; color: #fff; }
.cw-card:disabled { cursor: default; }
/* ---------- Draw & Pass ---------- */
.tp { display: grid; gap: 12px; max-width: 760px; margin: 0 auto; }
.tp-head { display: flex; justify-content: space-between; align-items: center; }
.tp-prompt { font-size: 1.1rem; } .tp-prompt b { color: var(--accent); }
.tp-form { display: flex; gap: 8px; } .tp-form .input { flex: 1; }
.tp-drawing { width: 100%; height: auto; border-radius: 14px; background: #fff; display: block; }
.tp-wait { display: grid; place-items: center; min-height: 200px; color: var(--text-dim); font-weight: 600; }
.tp-album { list-style: none; display: grid; gap: 10px; } .tp-album li { display: grid; gap: 4px; padding: 10px; border-radius: 14px; background: var(--bg-3); } .tp-text { font-size: 1.15rem; font-weight: 700; }
.tp-pad .sketch-paper { aspect-ratio: 4 / 3; }
