:root {
  --bg: #0f1420;
  --panel: #1a2130;
  --panel-2: #222b3d;
  --border: #2e3950;
  --text: #e8ecf4;
  --muted: #aab3c7;
  --primary: #ffcb05;
  --primary-text: #1b1b1b;
  --accent: #3b6df0;
  --danger: #e04b4b;
  --go: #2fbf71;
  --elim: rgba(20, 24, 34, 0.85);
  --maybe: #f2c14e;
  --likely: #2fbf71;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, #1d2a4a 0%, var(--bg) 60%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
h1, h2, h3 { margin: 0 0 .5rem; }
h1 span { color: var(--primary); }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; margin-top: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

.screen { min-height: 100vh; display: flex; flex-direction: column; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow);
}
.home-card { max-width: 440px; width: 100%; margin: auto; }
.home-card h1 { font-size: 2rem; }
.end-card { max-width: 900px; width: 100%; margin: 2rem auto; }
.end-title { font-size: 2rem; } /* an h2, so each page keeps a single h1 */

.field { display: flex; flex-direction: column; gap: .3rem; margin: 1rem 0; }
.field span { font-size: .85rem; color: var(--muted); }
input, textarea {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: .55rem .7rem; font: inherit; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
textarea { resize: vertical; }
.join-other { margin-top: 1rem; }
.join-other summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.join-other .row { margin-top: .6rem; }
.join-other #code-input { text-transform: uppercase; letter-spacing: .1em; max-width: 150px; }
.contact-form { display: flex; flex-direction: column; gap: .5rem; margin-top: .6rem; }
.contact-form input { max-width: 260px; }

.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: .55rem .95rem; font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .05s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: transparent; }
.btn.go { background: var(--go); color: #06200f; border-color: transparent; }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .7rem 1.2rem; background: var(--panel); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 800; letter-spacing: .02em; display: flex; align-items: center; gap: .5rem; }
.btn-home { flex: none; }
.game-top .btn-home { order: -1; }
.share { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.switch-game { display: inline-flex; align-items: center; gap: .4rem; margin-right: .6rem; }
.switch-game select { padding: .3rem .5rem; font-size: .85rem; width: auto; }
.share strong { letter-spacing: .15em; font-size: 1.1rem; color: var(--primary); }
.copyable { cursor: pointer; border-bottom: 1px dashed currentColor; transition: filter .15s; }
.copyable:hover { filter: brightness(1.3); }
.copyable::after { content: " ⧉"; font-size: .75em; opacity: .7; }

.lobby-layout, .game-layout {
  display: grid; gap: 1rem; padding: 1rem; flex: 1;
}
.lobby-layout { grid-template-columns: 380px 1fr; }
.lobby-layout .player-list li { font-size: 1.15rem; padding: .55rem .6rem; }
.lobby-layout .player-list .av { width: 36px; height: 36px; }
.lobby-layout .player-list .tag { font-size: .85rem; }
.lobby-layout #btn-add-bot { margin: .6rem 0; }

/* ---------- game: three columns, no page scroll ---------- */
.game-screen { height: 100vh; min-height: 0; overflow: hidden; }
.game-layout { grid-template-columns: 250px 1fr 400px; align-items: stretch; flex: 1; min-height: 0; }
.game-layout > .panel { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.game-layout .left { gap: .8rem; }
.game-layout .left .actions.vertical { flex-direction: column; align-items: stretch; gap: .5rem; }
.game-layout .left .btn.big { font-size: 1.15rem; padding: .8rem; }
.game-layout .left #board-hint { margin-top: auto; }
.board-panel { align-items: center; }
.board-panel .tabs { align-self: flex-start; }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
  min-width: 0;
}

.player-list { list-style: none; padding: 0; margin: 0; }
.player-list li {
  display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem; border-radius: 8px;
}
.player-list li.you { background: var(--panel-2); }
.player-list li.current { outline: 2px solid var(--primary); }
.player-list .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--go); flex: none; }
.player-list .dot.off { background: var(--muted); }
.player-list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-list .tag { font-size: .75rem; color: var(--muted); }
.player-list .solved { color: var(--go); font-weight: 700; font-size: .8rem; }

.setup { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .6rem; }
.setup:disabled { opacity: .7; }
.setting { background: var(--panel-2); border-radius: 10px; padding: .6rem .75rem; display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.setting > .label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.setting textarea { margin: 0; }
.wide { grid-column: 1 / -1; }
.setup-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.setup-head h2 { margin: 0; }
.setup-head .gc-info.static { position: static; margin-left: auto; }
.setup-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .8rem; }
.setup-actions .btn { font-size: 1.05rem; padding: .7rem 1.3rem; }
.setup .setup-actions { margin-top: .2rem; }
.setting.dim { opacity: .5; }
.info-text p { margin: 0; }
.info-modes { margin: .8rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.info-modes b { color: var(--text); }
.lobby-layout .brand .gc-info { position: static; }
.setup-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-bottom: .7rem; }
.setup-row .label { min-width: 100px; color: var(--muted); font-size: .85rem; }
.setup-row.actions { margin-top: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 999px; padding: .25rem .65rem; font-size: .85rem; cursor: pointer;
  user-select: none;
}
.chip input { width: auto; margin: 0; accent-color: var(--primary); }
.chip:has(input:checked) { border-color: var(--primary); background: rgba(255, 203, 5, .12); }
.chip.type { text-transform: capitalize; }
.custom { flex: 1; min-width: 240px; }
.custom p { margin: 0 0 .3rem; }
.custom textarea { margin: 0 0 .4rem; }
.custom-row { align-items: flex-start; }
.advanced { margin: 0; background: transparent; border: 1px dashed var(--border); border-radius: 10px; padding: .4rem .8rem; }
.advanced summary { cursor: pointer; font-weight: 600; font-size: .9rem; padding: .2rem 0; color: var(--muted); }
.advanced[open] summary { margin-bottom: .6rem; }
.advanced .setting { background: var(--panel); }
.chip input.num { width: 56px; padding: .1rem .3rem; font-size: .8rem; margin-left: .2rem; }
.player-list .btn-x.kick { color: #ff8a8a; }
.custom-ok { color: var(--go); }
.custom-bad { color: var(--danger); }

/* ---------- board ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(var(--size, 5), minmax(0, 1fr));
  gap: 6px;
}
.board.preview { max-width: 720px; }
.board.size-10 { gap: 3px; }
.cell {
  position: relative; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 4px; aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden; user-select: none; -webkit-user-select: none;
}
.cell img { width: 78%; height: 78%; object-fit: contain; image-rendering: auto; pointer-events: none; }
.size-10 .cell img { image-rendering: pixelated; width: 90%; height: 80%; }
.cell .cname {
  font-size: .72rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}
.size-10 .cell .cname { font-size: .55rem; }
.size-3 .cell .cname { font-size: 1rem; }
.board.clickable .cell { cursor: pointer; transition: transform .08s; }
.board.clickable .cell:hover { transform: scale(1.04); border-color: var(--accent); z-index: 1; }
.cell.secret { outline: 2px solid var(--primary); }

.cell.m1 img, .cell.m1 .cname { opacity: .2; filter: grayscale(1); }
.cell.m1::after {
  content: "✕"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 2.4em; color: #ff6b6b; font-weight: 900; pointer-events: none;
}
.size-10 .cell.m1::after { font-size: 1.4em; }
.cell .info {
  position: absolute; left: 4px; top: 3px; font-size: .7rem; color: var(--muted); background: rgba(0,0,0,.3);
  border-radius: 50%; width: 16px; height: 16px; display: none; place-items: center;
}
@media (hover: none) { .cell .info { display: grid; } }

.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.tab {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .7rem;
  cursor: pointer; font-size: .85rem; font-weight: 600;
}
.tab { color: var(--text); }
.tab.active { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 0 0 2px rgba(59, 109, 240, .35); }
.tab .solved { color: var(--go); }
.tab.active .solved { color: #b7ffd6; }
.tab.active .out { color: #ffb3b3; }

/* ---------- game top ---------- */
.game-top { position: sticky; top: 0; z-index: 5; flex-wrap: nowrap; padding: .45rem 1rem; }
.game-top .turn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.05rem; }
.btn.icon { padding: .35rem .5rem; font-size: 1rem; line-height: 1; }
.turn { font-weight: 700; }
.turn.mine { color: var(--primary); animation: pulse 1.6s ease-in-out infinite; }
.turn.spec { color: var(--muted); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.secret {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; background: var(--panel-2); border-radius: 12px; padding: .8rem .6rem;
  border: 2px solid var(--primary); box-shadow: 0 0 18px rgba(255, 203, 5, .25); cursor: help;
}
.secret img { width: 140px; height: 140px; object-fit: contain; }
.secret .label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.secret strong { display: block; font-size: 1.5rem; line-height: 1.15; }
.secret .types { display: flex; gap: .3rem; margin-top: .25rem; justify-content: center; }
.guess-pill {
  display: flex; align-items: center; gap: .4rem; margin-top: .3rem; padding: .35rem .7rem; border-radius: 10px;
  background: rgba(47, 191, 113, .15); border: 1px solid var(--go); color: var(--go); line-height: 1.05;
}
.guess-pill b { font-size: 1.7rem; font-weight: 900; }
.guess-pill span { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; opacity: .9; }
.guess-pill.low { background: rgba(242, 193, 78, .15); border-color: var(--maybe); color: var(--maybe); animation: pulse 1.2s ease-in-out infinite; }
.guess-pill.none { background: rgba(224, 75, 75, .15); border-color: var(--danger); color: #ff6b6b; }
.guess-pill.inf { background: var(--panel); border-color: var(--border); color: var(--muted); }

/* ---------- shiny ---------- */
.cell .spark { position: absolute; right: 4px; top: 2px; font-size: .8rem; filter: drop-shadow(0 0 3px #fff); }
.size-10 .cell .spark { font-size: .55rem; right: 1px; top: 0; }
.cell.shiny { border-color: rgba(255, 215, 0, .55); background: linear-gradient(160deg, rgba(255, 215, 0, .12), var(--panel-2) 60%); }
.tooltip .badge.shiny { background: #b8860b; }
.pick-hint { color: var(--primary); font-size: .88rem; margin: 0 0 .5rem; }

/* ---------- avatars ---------- */
.avatar-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .3rem; }
.avatar-grid button {
  background: var(--panel-2); border: 2px solid var(--border); border-radius: 10px; padding: 2px; cursor: pointer; aspect-ratio: 1;
  display: grid; place-items: center; transition: transform .08s;
}
.avatar-grid button:hover { transform: scale(1.1); }
.avatar-grid button { min-width: 0; overflow: hidden; }
.avatar-grid button.av-custom { border-style: dashed; }
.avatar-grid button.av-custom span { font-size: 1.3rem; line-height: 1; width: auto; }
.avatar-custom { position: relative; margin-top: .5rem; display: flex; flex-direction: column; gap: .4rem; }
.avatar-custom input { max-width: 320px; }
.avatar-custom .nb-suggest { justify-content: flex-start; margin: 0; }
.avatar-grid button.on { border-color: var(--primary); background: rgba(255, 203, 5, .15); }
.avatar-grid img { width: 100%; height: 100%; image-rendering: pixelated; object-fit: contain; }
.av { width: 26px; height: 26px; image-rendering: pixelated; flex: none; vertical-align: middle; }
.av.bot { display: inline-grid; place-items: center; font-size: 1rem; }
.tab .av { width: 20px; height: 20px; margin-right: .2rem; }
.player-list .btn-x { margin-left: .3rem; padding: 0 .4rem; font-size: .75rem; }

/* ---------- daily ---------- */
.daily-box {
  margin-top: 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  background: linear-gradient(120deg, rgba(255, 203, 5, .12), rgba(59, 109, 240, .12)); border: 1px solid var(--border); border-radius: 10px; padding: .7rem .9rem;
}
.daily-title { font-weight: 800; }
.daily-result {
  margin: .8rem 0 1.2rem; padding: .8rem 1rem; border-radius: 10px; border: 1px solid var(--primary);
  background: rgba(255, 203, 5, .1); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.daily-result-text { white-space: pre-line; }
.hints-box { background: rgba(255, 203, 5, .08); border: 1px solid rgba(255, 203, 5, .4); border-radius: 8px; padding: .5rem .7rem; margin: .6rem 0; }
.hints-box h2 { font-size: .9rem; margin-bottom: .3rem; }
.hints-box ul { margin: 0; padding-left: 1.1rem; font-size: .88rem; }
.hints-box li { margin: .15rem 0; }
.msg.sys.hint { color: var(--primary); font-style: normal; }
.reveal .rv { cursor: pointer; transition: transform .08s; }
.reveal .rv:hover { transform: scale(1.04); }
.actions { display: flex; gap: .5rem; align-items: center; }

/* ---------- side ---------- */
.side { display: flex; flex-direction: column; }
.side .player-list { flex: none; max-height: 40%; overflow-y: auto; }
.chat-log {
  flex: 1; min-height: 240px; overflow-y: auto; background: var(--panel-2); border-radius: 8px; padding: .6rem .7rem;
  font-size: 1rem; line-height: 1.35; display: flex; flex-direction: column; gap: .3rem;
}
.msg { word-wrap: break-word; }
.msg .from { font-weight: 800; color: var(--primary); font-size: 1.05em; }
.chat-form input { font-size: 1rem; }
.msg.sys { color: var(--muted); font-style: italic; font-size: .92em; }
.msg.sys.hot { color: var(--go); font-style: normal; font-weight: 600; }
.chat-form { display: flex; gap: .4rem; margin-top: .5rem; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 20; padding: 1rem; }
.modal-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem;
  width: min(900px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow);
}
.modal-card.narrow { width: min(420px, 100%); }
.modal-card .row { margin-top: 1rem; justify-content: flex-end; }

/* ---------- tooltip ---------- */
.tooltip {
  position: fixed; z-index: 30; width: 280px; background: rgba(12, 17, 25, .78); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-radius: 12px; padding: .7rem .8rem; box-shadow: var(--shadow); font-size: .86rem; pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
.tooltip .meta, .tooltip .head .g { color: #c9d1e3; }
.tooltip .head { display: flex; align-items: center; gap: .6rem; }
.tooltip .head img { width: 56px; height: 56px; }
.tooltip .head .n { font-weight: 800; font-size: 1rem; }
.tooltip .head .g { color: var(--muted); font-size: .75rem; }
.tooltip .types { display: flex; gap: .3rem; margin: .4rem 0; }
.tooltip .meta { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; color: var(--muted); }
.tooltip .meta b { color: var(--text); font-weight: 600; }
.tooltip .stats { margin-top: .4rem; display: grid; grid-template-columns: 30px 28px 1fr; gap: .15rem .4rem; align-items: center; }
.tooltip .bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.tooltip .bar i { display: block; height: 100%; background: var(--accent); }
.tooltip .badge { display: inline-block; background: #4b2fb0; color: #fff; border-radius: 6px; padding: 0 .4rem; font-size: .7rem; margin-left: .3rem; }
.type-chip { padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; color: #fff; text-transform: capitalize; font-weight: 700; text-shadow: 0 1px 1px rgba(0,0,0,.4); }
.t-normal{--tc:#A8A77A}.t-fire{--tc:#EE8130}.t-water{--tc:#6390F0}.t-electric{--tc:#F7D02C;color:#222;text-shadow:none}
.t-grass{--tc:#7AC74C}.t-ice{--tc:#96D9D6;color:#222;text-shadow:none}.t-fighting{--tc:#C22E28}.t-poison{--tc:#A33EA1}
.t-ground{--tc:#E2BF65;color:#222;text-shadow:none}.t-flying{--tc:#A98FF3}.t-psychic{--tc:#F95587}.t-bug{--tc:#A6B91A}
.t-rock{--tc:#B6A136}.t-ghost{--tc:#735797}.t-dragon{--tc:#6F35FC}.t-dark{--tc:#705746}.t-steel{--tc:#B7B7CE;color:#222;text-shadow:none}.t-fairy{--tc:#D685AD}
.type-chip, .tstrip i { background: var(--tc); }

/* ---------- ranking / reveal ---------- */
.ranking { padding-left: 1.4rem; }
.ranking li { margin: .25rem 0; }
.ranking .unsolved { color: var(--muted); }
.reveal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin: .5rem 0 1.2rem; }
.reveal .rv { background: var(--panel-2); border-radius: 10px; padding: .6rem; text-align: center; }
.reveal .rv img { width: 80px; height: 80px; }
.reveal .rv .who { font-weight: 700; }
.reveal .rv .what { color: var(--muted); font-size: .85rem; }

.toast {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 50;
  background: var(--danger); color: #fff; padding: .6rem 1rem; border-radius: 8px; box-shadow: var(--shadow); font-weight: 600;
}
.toast.ok { background: var(--go); color: #06200f; }

@media (max-width: 900px) {
  .lobby-layout, .game-layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; height: auto; }
  .chat-log { min-height: 160px; max-height: 260px; }
  .topbar { padding: .6rem .8rem; }
  .game-top .brand { display: none; }
}

/* ---------- fit the board on one screen ---------- */
/* Cells are square, so the board is as tall as it is wide: cap the width by the viewport height. */
/* Board is square: cap its width by the height left under the top bar and tabs. */
#game-board { width: min(100%, calc(100vh - 150px)); margin: 0 auto; }
#guess-board { width: min(100%, calc(92vh - 170px)); margin: 0 auto; }
#preview-grid { width: min(100%, 720px, calc(100vh - 330px)); }
@media (max-width: 900px) {
  #game-board, #guess-board, #preview-grid { width: 100%; }
}
@media (min-width: 901px) and (max-width: 1300px) {
  .game-layout { grid-template-columns: 210px 1fr 320px; }
  .secret img { width: 100px; height: 100px; }
}

/* ---------- scoreboard ---------- */
.player-list .tag.wins { color: var(--primary); font-weight: 700; }
.table-wrap { overflow-x: auto; margin-bottom: 1.2rem; }
.scores { width: 100%; border-collapse: collapse; font-size: .9rem; }
.scores th, .scores td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--border); }
.scores th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.scores tr:first-child td:nth-child(2) { color: var(--primary); font-weight: 700; }

/* ---------- type stripes on cards ---------- */
.cell .tstrip { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 4px; display: flex; gap: 2px; border-radius: 2px; overflow: hidden; }
.cell .tstrip i { flex: 1; display: block; opacity: .95; }
.size-10 .cell .tstrip { left: 3px; right: 3px; bottom: 2px; height: 3px; }
.size-3 .cell .tstrip { height: 6px; bottom: 6px; left: 12px; right: 12px; }
.cell.m1 .tstrip { opacity: .15; }
.cell { padding-bottom: 10px; }
.size-3 .cell { padding-bottom: 15px; }
.size-10 .cell { padding-bottom: 6px; }

/* ---------- mark animations ---------- */
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); } }
.cell.m1::after { animation: pop .22s ease-out; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
body.shake { animation: shake .5s; }

/* ---------- timer ---------- */
.timer { display: flex; align-items: center; gap: .5rem; min-width: 170px; }
.timer .bar { flex: 1; height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.timer .bar i { display: block; height: 100%; background: var(--go); transition: width .25s linear; }
.timer.low .bar i { background: var(--danger); }
.timer.low #timer-text { color: var(--danger); animation: pulse .8s ease-in-out infinite; }
#timer-text { font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; font-weight: 800; }

/* ---------- question / answer ---------- */
.answer-panel { margin-top: .5rem; background: rgba(255, 203, 5, .1); border: 1px solid var(--primary); border-radius: 8px; padding: .6rem; }
.answer-panel .q { margin-bottom: .45rem; font-size: .9rem; }
.answer-panel .q em { color: var(--primary); font-style: normal; font-weight: 700; }
.answer-panel .row { margin: 0; flex-wrap: nowrap; }
.answer-panel .row .btn { flex: 1; padding: .5rem .3rem; }
.ask-hint { margin: .4rem 0 0; color: var(--primary); }
.msg.q { background: rgba(59, 109, 240, .16); border-left: 3px solid var(--accent); padding: .25rem .45rem; border-radius: 4px; }
.msg.q .arrow { color: var(--muted); font-size: .8em; }
.msg.a { padding: .15rem .45rem; border-radius: 4px; }
.msg.a.yes b { color: var(--go); }
.msg.a.no b { color: #ff6b6b; }
.msg.a.sortof b { color: var(--maybe); }
.msg.r { font-size: 1.05rem; }
.msg.sys.bad { color: #ff6b6b; font-style: normal; font-weight: 600; }
.msg.sys.chaos { color: #c084fc; font-style: normal; font-weight: 600; }

/* ---------- reactions ---------- */
.reactions { display: flex; gap: .25rem; margin-top: .45rem; flex-wrap: wrap; }
.reactions button {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; font-size: 1.15rem; padding: .1rem .4rem;
  cursor: pointer; transition: transform .08s; line-height: 1.4;
}
.reactions button:hover { transform: scale(1.2); }
#float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.float { position: absolute; bottom: 90px; font-size: 2.4rem; animation: floatUp 2.5s ease-out forwards; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
@keyframes floatUp {
  0% { transform: translate(0, 0) scale(.5); opacity: 0; }
  15% { opacity: 1; transform: translate(0, -30px) scale(1.15); }
  100% { transform: translate(var(--dx), -65vh) scale(1); opacity: 0; }
}

/* ---------- quick eliminate ---------- */
.tools { display: flex; flex-direction: column; gap: 1rem; }
.tools-card { width: min(980px, 100%); padding: 1.4rem 1.6rem; }
.tools-card h2 { font-size: 1.4rem; }
.tools-card > p { margin: .2rem 0 1rem; }
.tool-group { background: var(--panel-2); border-radius: 10px; padding: .7rem .9rem; }
.tool-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .5rem; font-weight: 700; }
.tool-group .chips { gap: .45rem; }
.tool-group.two { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.4rem; }
@media (max-width: 700px) { .tool-group.two { grid-template-columns: 1fr; } }
.segs { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.seg { display: inline-flex; align-items: center; gap: .1rem; background: var(--panel); border-radius: 999px; padding: .2rem; border: 1px solid var(--border); }
.seg > span { font-size: .85rem; color: var(--muted); padding: 0 .7rem 0 .6rem; font-weight: 600; }
.seg button { background: transparent; border: 0; color: var(--text); border-radius: 999px; padding: .35rem .8rem; font: inherit; font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--primary); color: var(--primary-text); }
.tool-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; justify-content: space-between; }
.tool-footer .row { margin: 0; }
.tool-count { font-size: 1rem; color: var(--muted); flex: 1; min-width: 200px; }
.tool-count.active { color: var(--text); }
.tool-count b { font-size: 1.4rem; color: var(--primary); }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin: .45rem 0; }
.tool-row .label { min-width: 52px; color: var(--muted); font-size: .8rem; }
.chip-btn {
  border: 1px solid var(--border); border-radius: 999px; padding: .35rem .8rem; font-size: .9rem; cursor: pointer;
  text-transform: capitalize; font-weight: 700; transition: transform .08s, filter .15s; background: var(--panel); color: var(--text);
}
.chip-btn:hover { filter: brightness(1.2); }
.chip-btn.on { border-color: transparent; transform: scale(1.06); background: var(--primary); color: var(--primary-text); }
/* type chips: tinted when off, full colour when on */
.chip-btn[data-type] { background: color-mix(in srgb, var(--tc, #888) 22%, var(--panel)); border-color: color-mix(in srgb, var(--tc, #888) 60%, transparent); color: var(--text); text-shadow: none; }
.chip-btn[data-type].on { background: var(--tc); border-color: transparent; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.4); }
.chip-btn.t-electric.on, .chip-btn.t-ice.on, .chip-btn.t-ground.on, .chip-btn.t-steel.on { color: #222; text-shadow: none; }
/* colour chips: swatch dot */
.chip-btn[data-color] { padding-left: .6rem; display: inline-flex; align-items: center; gap: .4rem; }
.chip-btn[data-color]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--tc); border: 1px solid rgba(255,255,255,.35); }
.c-black{--tc:#222}.c-blue{--tc:#3b6df0}.c-brown{--tc:#8b5a2b}.c-gray{--tc:#8b95ab}.c-green{--tc:#2fbf71}
.c-pink{--tc:#f48fb1}.c-purple{--tc:#8e44ad}.c-red{--tc:#e04b4b}.c-white{--tc:#f4f4f4}.c-yellow{--tc:#ffcb05}
.chip-btn[data-color].on { background: var(--tc); color: #fff; }
.c-white.on, .c-yellow.on, .c-gray.on, .c-pink.on { color: #111 !important; }
select {
  background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .3rem .5rem;
  font: inherit; font-size: .82rem;
}

/* ---------- players extras ---------- */
.player-list .out { color: #ff6b6b; font-weight: 700; font-size: .8rem; }
.player-list li.offline { opacity: .55; }
.player-list li.spec { color: var(--muted); font-size: .85rem; }
.player-list .tag.streak { color: #ff7a3d; font-weight: 700; }
.tab .out { color: #ff6b6b; }
.mode-desc { flex-basis: 100%; margin-left: 108px; margin-top: -.2rem; }
.row.space { justify-content: space-between; }

/* ---------- awards ---------- */
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; margin: .5rem 0 1.2rem; }
.award { display: flex; gap: .65rem; align-items: center; background: var(--panel-2); border-radius: 10px; padding: .6rem .7rem; border: 1px solid var(--border); }
.award .ic { font-size: 1.9rem; }
.award .t { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.award .n { font-weight: 800; }
.ranking .crown { color: var(--primary); font-weight: 700; font-size: .85rem; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 45; width: 100%; height: 100%; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .game-screen { height: auto; overflow: visible; }
  .game-layout { grid-template-columns: 1fr; }
  .game-layout > .panel { overflow: visible; }
  .game-top { padding: .5rem .6rem; gap: .5rem; flex-wrap: wrap; }
  .game-top .turn { font-size: .9rem; white-space: normal; }
  .timer { min-width: 120px; }
  .game-layout .left { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .game-layout .left .secret { flex-direction: row; text-align: left; flex: 1; padding: .4rem .6rem; }
  .game-layout .left .secret .types { justify-content: flex-start; }
  .game-layout .left .actions.vertical { flex-direction: row; flex-wrap: wrap; flex: 1; }
  .game-layout .left .btn.big { font-size: 1rem; padding: .5rem .8rem; }
  .game-layout .left #board-hint { display: none; }
  .secret img { width: 64px; height: 64px; }
  .secret strong { font-size: 1.1rem; }
  .left { order: 0; }
  .board-panel { order: 1; }
  .side { order: 2; }
  .side .player-list { max-height: none; }
  .chat-log { min-height: 140px; max-height: 220px; }
  .tool-row .label { min-width: 100%; }
  .mode-desc { margin-left: 0; }
  .cell .cname { font-size: .62rem; }
  .board.clickable .cell:hover { transform: none; }
}
@media (max-width: 520px) {
  .game-layout, .lobby-layout { padding: .5rem; gap: .5rem; }
  .panel { padding: .6rem; }
  .board { gap: 4px; }
  .cell { border-radius: 6px; padding: 2px; }
  .cell .cname { font-size: .55rem; }
  .size-10 .cell .cname { display: none; }
  .size-10 .cell .tstrip { display: none; }
  .btn { padding: .5rem .7rem; }
  .actions .btn { padding: .5rem .6rem; font-size: .9rem; }
  .setup-row .label { min-width: 100%; }
  .home-card { margin: 1rem auto; }
  .avatar-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .end-card { margin: .5rem auto; padding: 1rem; }
  .reveal { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .reveal .rv img { width: 60px; height: 60px; }
}

/* ---------- AI help ---------- */
.ai-help {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--accent); background: rgba(59, 109, 240, .2); color: #9db4ff;
  font-weight: 800; font-size: .8rem; cursor: pointer; flex: none; padding: 0; line-height: 1;
}
.ai-help:hover { background: var(--accent); color: #fff; }
.ai-card { width: min(1000px, 100%); padding: 1.4rem 1.6rem; }
.ai-card h2 { font-size: 1.4rem; }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .7rem; margin: 1rem 0; }
.ai-topic { background: var(--panel-2); border-radius: 10px; padding: .7rem .9rem; border: 1px solid var(--border); }
.ai-topic h3 { margin: 0 0 .35rem; font-size: .95rem; color: var(--primary); }
.ai-topic p { margin: 0; font-size: .9rem; line-height: 1.45; }
.ai-topic p + p { margin-top: .3rem; }
.ai-topic.no { border-color: rgba(224, 75, 75, .5); }
.ai-topic.no h3 { color: #ff8a8a; }
.ask-hint a { color: var(--primary); font-weight: 700; }

/* ---------- game log ---------- */
.game-log { display: flex; flex-direction: column; gap: .6rem; margin: .5rem 0 1.2rem; max-height: 60vh; overflow-y: auto; }
.log-round { background: var(--panel-2); border-radius: 10px; padding: .6rem .8rem; border: 1px solid var(--border); }
.log-round-title { font-weight: 800; color: var(--primary); margin-bottom: .4rem; }
.log-turn { padding: .4rem 0; border-top: 1px solid var(--border); font-size: .92rem; }
.log-turn:first-of-type { border-top: 0; }
.log-turn.oot { opacity: .85; }
.log-who { margin-bottom: .15rem; }
.log-q { margin-left: .6rem; }
.log-a { font-weight: 800; margin-left: .3rem; }
.log-a.yes { color: var(--go); } .log-a.no { color: #ff6b6b; } .log-a.sortof { color: var(--maybe); }
.log-x { margin-left: .6rem; color: var(--text); }
.log-g { margin-left: .6rem; font-weight: 700; }
.log-g.ok { color: var(--go); } .log-g.bad { color: #ff6b6b; }
.log-t { margin-left: .6rem; color: #ff6b6b; }

/* ---------- bigger home card ---------- */
.home-card { max-width: 1000px; padding: 2.2rem 2.6rem; }
.home-card h1 { font-size: 2.8rem; }
.home-card .muted { font-size: 1.05rem; }
.home-card .field > span, .home-card .field span:first-child { font-size: 1rem; }
.home-card input { font-size: 1.1rem; padding: .7rem .9rem; }
.home-card .btn { font-size: 1.1rem; padding: .75rem 1.4rem; }
.home-card .avatar-grid { grid-template-columns: repeat(11, minmax(0, 1fr)); gap: .45rem; }
.home-card .avatar-grid button { padding: 6px; }
.home-card .daily-box { padding: 1rem 1.2rem; margin-top: 1.5rem; }
.home-card .daily-title { font-size: 1.15rem; }
.home-card .join-other summary { font-size: 1rem; }
@media (max-width: 900px) {
  .home-card { padding: 1.4rem; }
  .home-card h1 { font-size: 2.1rem; }
  .home-card .avatar-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ---------- home: game picker ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .9rem; margin-top: .4rem; }
.game-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; padding: 2.2rem 1rem 1rem;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .7rem; position: relative; transition: transform .12s, border-color .15s;
}
.game-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.game-card h3 { margin: 0; font-size: 1.2rem; }
.game-card .gc-art { width: 130px; height: 130px; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0,0,0,.45)); }
.game-card .gc-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; }
.game-card .gc-meta span { font-size: .75rem; background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .55rem; color: var(--muted); }
.game-card .btn { margin-top: auto; }
.gc-info {
  position: absolute; top: .55rem; right: .55rem; width: 24px; height: 24px; border-radius: 50%; padding: 0;
  background: transparent; border: 1px solid var(--border); color: var(--muted); font: inherit; font-weight: 900; font-size: .85rem; line-height: 1; cursor: pointer;
}
.gc-info:hover { border-color: var(--primary); color: var(--primary); }
.info-text { color: var(--muted); line-height: 1.5; margin: .4rem 0 0; }
.home-card .daily-box { margin-top: .6rem; padding: .7rem .9rem; }
.home-card .daily-box .btn { font-size: .95rem; padding: .5rem .9rem; }
.home-card .daily-title { font-size: 1rem; }

/* ---------- number battle ---------- */
.setup-row.dim { opacity: .5; }
.nb-howto { margin-top: 1.2rem; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.nb-howto b { color: var(--text); }
.nb-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1rem; padding: 1rem; flex: 1; align-items: start; min-height: 0; overflow-y: auto; }
.nb-layout .side { position: sticky; top: 0; max-height: calc(100vh - 88px); overflow: hidden; }
.nb-layout .side .standings { flex: none; max-height: 45%; overflow-y: auto; }
.nb-layout .chat-log { min-height: 140px; }
.nb-stage { display: flex; flex-direction: column; align-items: center; gap: .9rem; min-height: calc(100vh - 120px); }
.nb-prompt { width: 100%; display: flex; justify-content: center; align-items: center; flex: 1; min-height: 300px; }
.nb-ask, .nb-count, .nb-reveal { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.nb-big { font-size: clamp(4rem, 14vw, 9rem); font-weight: 900; letter-spacing: .02em; color: var(--primary); line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 8px 40px rgba(255, 203, 5, .25); animation: nbpop .35s ease-out; }
@keyframes nbpop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.nb-ask > img, .nb-reveal > img { width: min(260px, 45vw); height: auto; filter: drop-shadow(0 10px 30px rgba(0,0,0,.5)); animation: nbpop .35s ease-out; }
.nb-name { font-size: 2rem; font-weight: 900; }
.nb-clues { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-direction: column; gap: .4rem; max-width: 520px; }
.nb-clues li { background: var(--panel-2); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 8px; padding: .5rem .8rem; font-size: 1.05rem; text-align: left; animation: nbslide .3s ease-out both; }
.nb-clues li.locked { color: var(--muted); border-left-color: var(--border); font-style: italic; animation: none; }
@keyframes nbslide { from { transform: translateX(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.nb-answer { display: flex; gap: .5rem; width: min(560px, 100%); position: relative; }
.nb-answer input { font-size: 1.35rem; padding: .75rem 1rem; text-align: center; font-weight: 700; }
.nb-answer input:disabled { opacity: .5; }
.nb-answer .btn { font-size: 1.1rem; }
.nb-suggest { width: min(560px, 100%); display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin-top: -.4rem; }
.nb-suggest button { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: .2rem .8rem .2rem .3rem; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.nb-suggest button img { width: 32px; height: 32px; image-rendering: pixelated; }
.nb-suggest button.on, .nb-suggest button:hover { border-color: var(--primary); background: rgba(255, 203, 5, .15); }
.nb-feedback { min-height: 1.6rem; font-weight: 800; font-size: 1.15rem; }
.nb-feedback.ok { color: var(--go); }
.nb-feedback.bad { color: #ff6b6b; }
.nb-reveal-name { font-size: 1.9rem; font-weight: 900; }
.nb-reveal-name .nb-num { color: var(--primary); }
.nb-reason { color: var(--muted); font-weight: 600; }
.nb-reason.bad { color: #ff6b6b; }
.nb-results { list-style: none; padding: 0; margin: .3rem 0 0; display: flex; flex-direction: column; gap: .25rem; min-width: 260px; }
.nb-results li { display: flex; align-items: center; gap: .5rem; justify-content: center; background: var(--panel-2); border-radius: 8px; padding: .35rem .7rem; }
.nb-results li.ok { color: var(--go); }
.nb-results li.bad { color: var(--muted); }
.nb-results .pts, .player-list .pts { font-weight: 900; color: var(--primary); margin-left: auto; font-variant-numeric: tabular-nums; }
.nb-results .pts { margin-left: 0; }
/* closest mode: the turn-by-turn guess board */
.nb-guesses { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-direction: column; gap: .3rem; width: min(520px, 100%); }
.nb-guesses li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .45rem; background: var(--panel-2); border-radius: 8px; padding: .4rem .7rem; text-align: left; }
.nb-guesses li.current { outline: 2px solid var(--primary); }
.nb-guesses li.won { background: rgba(255, 203, 5, .14); }
.nb-guesses .who { font-weight: 700; min-width: 5.5em; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-guesses img { width: 34px; height: 34px; image-rendering: pixelated; }
.nb-guesses .nb-num { color: var(--primary); font-variant-numeric: tabular-nums; }
.nb-guesses .nb-dist { margin-left: auto; color: var(--muted); font-weight: 700; white-space: nowrap; }
.nb-guesses .nb-dist.hit { color: var(--go); }
.nb-guesses .nb-dist.hi { color: #ff8a5b; }
.nb-guesses .nb-dist.lo { color: #6fb3ff; }
.nb-guesses .nb-dist.mid { color: var(--maybe); }
.nb-guesses .nb-combo.small .type-chip { font-size: .75rem; padding: .1rem .45rem; }
.nb-types > .row { justify-content: center; }
.nb-guesses.reveal img { width: 44px; height: 44px; }
.nb-guesses.reveal li.won { outline: 2px solid var(--primary); }
.staged, .nb-guesses.staged li { opacity: 0; animation: nbrow .45s ease-out forwards; }
.nb-continue { margin-top: .6rem; min-height: 2.6rem; display: flex; align-items: center; justify-content: center; }
@keyframes nbrow { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.nb-guesses .nb-locked { color: var(--muted); font-weight: 700; }
.nb-guesses .nb-turn { color: var(--primary); font-weight: 700; animation: nbblink 1.2s ease-in-out infinite; }
.nb-guesses .pts { margin-left: .3rem; }
@keyframes nbblink { 50% { opacity: .45; } }
.nb-answer #nb-btn-pass { white-space: nowrap; }
/* Which Shiny Is Real?: 2×2 picture picker */
.shiny-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; width: min(440px, 100%); margin: .3rem 0 .6rem; }
.shiny-grid.reveal { width: min(360px, 100%); gap: .45rem; }
.shiny-tile { position: relative; background: var(--panel-2); border: 2px solid var(--border); border-radius: 14px; padding: .4rem; aspect-ratio: 1; display: grid; place-items: center; transition: transform .1s, border-color .15s; }
.shiny-tile canvas, .shiny-tile img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); }
.shiny-grid.pickable .shiny-tile { cursor: pointer; }
.shiny-grid.pickable .shiny-tile:hover { transform: translateY(-2px); border-color: var(--primary); }
.shiny-tile.picked { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 203, 5, .25); }
.shiny-tile .badge { position: absolute; top: .4rem; left: .5rem; font-weight: 900; font-size: 1rem; background: rgba(0,0,0,.55); border-radius: 999px; padding: .1rem .55rem; }
.shiny-grid.reveal .shiny-tile.real { border-color: var(--go); box-shadow: 0 0 0 3px rgba(47, 191, 113, .3); }
.shiny-grid.reveal .shiny-tile.fake { opacity: .45; filter: grayscale(.4); }
.shiny-grid.reveal .shiny-tile.real::after { content: "✨ real"; position: absolute; bottom: .4rem; right: .5rem; background: var(--go); color: #06200f; font-weight: 800; font-size: .75rem; border-radius: 999px; padding: .1rem .5rem; }
.shiny-tile .pickers { position: absolute; bottom: .35rem; left: .45rem; display: flex; gap: .15rem; }
.shiny-tile .tname { position: absolute; top: .45rem; right: .5rem; font-size: .72rem; font-weight: 700; background: rgba(0,0,0,.55); border-radius: 999px; padding: .1rem .5rem; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shiny-tile .pickers .av { width: 22px; height: 22px; }
.nb-guesses.reveal li .nb-dist.hi { margin-left: auto; }
.player-list li.leader { background: rgba(255, 203, 5, .1); }
/* ---------- standings (in game) and rankings (end screen) ---------- */
.standings { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.st-row { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: 10px; background: var(--panel-2); border-left: 4px solid transparent; }
.st-row.leader { border-left-color: var(--primary); background: rgba(255, 203, 5, .1); }
.st-row.you .st-name { color: var(--primary); }
.st-row.current { outline: 2px solid var(--primary); }
.st-row.offline { opacity: .55; }
.st-row.spec { opacity: .7; }
.st-rank { width: 1.6em; text-align: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.st-row.leader .st-rank { color: var(--primary); }
.st-row .av { width: 30px; height: 30px; flex: none; }
.st-main { flex: 1; min-width: 0; }
.st-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-sub { font-size: .78rem; color: var(--muted); min-height: 1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-sub .ok { color: var(--go); } .st-sub .mid { color: var(--maybe); } .st-sub .bad { color: #ff6b6b; }
.st-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; flex: none; min-width: 2.6em; }
.st-score b { font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.st-score small { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.st-row.leader .st-score b { color: var(--primary); }
.ranking.list { list-style: none; padding: 0; margin: 0 0 1.2rem; display: flex; flex-direction: column; gap: .35rem; }
.rk-row { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.rk-row.winner { border-color: var(--primary); background: rgba(255, 203, 5, .1); }
.rk-row.compact { padding: .4rem .7rem; }
.rk-row.unsolved { opacity: .6; }
.st-name .ai-help { margin-left: .3rem; }
.rk-rank { width: 2em; text-align: center; font-size: 1.3rem; font-weight: 900; color: var(--muted); flex: none; }
.rk-row.compact .rk-rank { font-size: 1rem; }
.rk-row .av { width: 36px; height: 36px; flex: none; }
.rk-main { flex: 1; min-width: 0; }
.rk-name { font-weight: 800; font-size: 1.05rem; }
.rk-sub { font-size: .82rem; color: var(--muted); }
.rk-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; flex: none; }
.rk-score b { font-size: 1.7rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.rk-row.compact .rk-score b { font-size: 1.3rem; }
.rk-row.winner .rk-score b { color: var(--primary); }
.rk-score small { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.player-list li.spec { opacity: .7; }
.msg.sys.reveal { color: var(--text); font-style: normal; }
.nb-log { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.2rem; }
.nb-log-row { display: grid; grid-template-columns: 48px 1fr; gap: .2rem .6rem; align-items: center; background: var(--panel-2); border-radius: 10px; padding: .4rem .7rem; }
.nb-log-row img { width: 48px; height: 48px; image-rendering: pixelated; grid-row: span 2; }
.nb-log-res { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .88rem; }
.nb-log-res .ok { color: var(--go); }
.nb-log-res .bad { color: var(--muted); }
@media (max-width: 900px) {
  .nb-layout { grid-template-columns: 1fr; }
  .nb-layout .side { position: static; max-height: none; overflow: visible; }
  .nb-layout .side .standings { max-height: none; }
  .nb-stage { min-height: 0; }
  .nb-prompt { min-height: 200px; }
}

/* ---------- game cards: buttons aligned, type quiz ---------- */

.nb-types { width: min(640px, 100%); display: flex; flex-direction: column; gap: .7rem; align-items: center; }
.nb-types-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; width: 100%; }
.type-btn { background: var(--tc); border: 2px solid transparent; border-radius: 10px; padding: .55rem .3rem; font: inherit; font-weight: 800; text-transform: capitalize; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.45); cursor: pointer; opacity: .75; transition: transform .08s, opacity .15s; }
.type-btn:hover:not(:disabled) { opacity: 1; transform: translateY(-1px); }
.type-btn.on { opacity: 1; border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 203, 5, .6); transform: scale(1.05); }
.type-btn:disabled { opacity: .35; cursor: not-allowed; }
.nb-combo { display: flex; gap: .4rem; justify-content: center; }
.nb-combo .type-chip { font-size: 1.3rem; padding: .3rem 1rem; }
.nb-combo.inline { display: inline-flex; gap: .25rem; vertical-align: middle; }
.nb-combo.inline .type-chip { font-size: .8rem; padding: .1rem .5rem; }
.nb-progress { font-size: 1.2rem; }
.nb-progress b { color: var(--primary); font-size: 1.6rem; }
.nb-found { list-style: none; padding: 0; margin: .3rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .35rem; width: min(640px, 80vw); }
.nb-found li { display: flex; align-items: center; gap: .4rem; background: var(--panel-2); border-radius: 8px; padding: .3rem .6rem; font-weight: 600; text-align: left; animation: nbpop .25s ease-out; }
.nb-found li img { width: 32px; height: 32px; image-rendering: pixelated; }
.nb-found li.locked { color: var(--muted); justify-content: center; font-weight: 800; animation: none; }
.nb-found li.ok { border-left: 3px solid var(--go); }
.nb-found li.missed { border-left: 3px solid #ff6b6b; opacity: .8; }
.nb-feedback.mid, .nb-results li.mid, .nb-log-res .mid, .player-list .tag.mid { color: var(--maybe); }
.nb-log-wide { grid-column: 1 / -1; }
.nb-log-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; margin-bottom: .45rem; }
.nb-log-head .nb-combo { display: inline-flex; gap: .25rem; }
.nb-log-members { list-style: none; padding: 0; margin: 0 0 .3rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .35rem; }
.nb-log-members li { display: flex; align-items: center; gap: .4rem; background: var(--panel); border-radius: 8px; padding: .3rem .5rem; min-width: 0; }
.nb-log-members li img { width: 36px; height: 36px; image-rendering: pixelated; grid-row: auto; flex: none; }
.nb-log-members li span { font-weight: 700; line-height: 1.15; min-width: 0; }
.nb-log-members li small { margin-left: auto; white-space: nowrap; color: var(--muted); }
.nb-log-members li.ok small { color: var(--go); }
.nb-log-members li.missed { opacity: .6; }
.nb-log-members li.missed img { filter: grayscale(1); }
.nb-log-wide + .nb-log-res { grid-column: 1 / -1; }
.nb-log-res img.mini { width: 22px; height: 22px; image-rendering: pixelated; vertical-align: middle; grid-row: auto; margin: 0 .1rem 0 .15rem; }
@media (max-width: 600px) { .nb-types-grid { grid-template-columns: repeat(3, 1fr); } }
.nb-reveal .av, .nb-ask .av { width: 26px; height: 26px; }
/* game pages: the featured card (moved first by server/seo.js), card titles that link to each game's page, and the crawlable text below the picker */
.game-card .gc-link { color: inherit; text-decoration: underline dotted rgba(255, 255, 255, .35); text-underline-offset: 5px; }
.game-card .gc-link:hover { color: var(--primary); }
.game-card.featured { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(255, 203, 5, .35), var(--shadow); }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: .4rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.seo-about { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--border); color: var(--muted); line-height: 1.6; max-width: 760px; }
.seo-about h2 { font-size: 1.25rem; color: #fff; margin: 1.6rem 0 .5rem; }
.seo-about h2:first-child { margin-top: 0; }
.seo-about h3 { font-size: 1.02rem; margin: 1rem 0 .2rem; color: #fff; }
.seo-about p { margin: 0 0 .55rem; font-size: .97rem; }
.seo-about ul { margin: 0 0 .6rem; padding-left: 1.2rem; font-size: .97rem; }
.seo-about li { margin: .2rem 0; }
.seo-about a { color: var(--primary); }
.seo-about .seo-games { list-style: none; padding: 0; display: grid; gap: .5rem; }
.seo-about .seo-games a { display: flex; gap: .8rem; align-items: center; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); color: var(--muted); text-decoration: none; }
.seo-about .seo-games a:hover { border-color: var(--primary); }
.seo-about .seo-games img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.seo-about .seo-games strong { display: block; color: #fff; }
.seo-about .seo-legal { font-size: .8rem; margin-top: 1.4rem; }
