/* PlayVault — one stylesheet.

   Colours come from the logo: brass on steel. Every colour of the hub's own
   interface is a token defined once on :root and overridden once under
   [data-theme="light"] — a colour whose only definition sits inside the light
   block will be missing in dark, and vice versa, which is the usual way a theme
   toggle half-works. The four big games' own panels (Strike Squad, Blend In,
   Stick Clash and Street Chef, further down) paint with fixed colours that
   look the same in either theme, as do a few pieces of game art: health
   bars, coins, stones.

   Mobile first. Nothing may scroll horizontally at 360px. */

:root,
[data-theme="dark"] {
  --page: #0B0F14;
  --panel: #111721;
  --panel-2: #161D28;
  --line: #1E2836;
  --line-2: #2A3648;
  --ink: #EAF0F7;
  --muted: #8494A8;
  --dim: #5E6D80;
  --accent: #F6B32B;
  --accent-soft: rgba(246, 179, 43, .14);
  --accent-ink: #0B0F14;
  --board: #20262F;
  --board-line: #4A566B;
  --felt: #1E5B43;
  --face: #0D1218;
  --sq-light: #EDE3CB;
  --sq-dark: #7E8AA0;
  --good: #34D399;
  --bad: #F87171;
  --bad-soft: rgba(248, 113, 113, .14);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

[data-theme="light"] {
  --page: #F1F4F9;
  --panel: #FFFFFF;
  --panel-2: #F6F8FC;
  --line: #DFE5EE;
  --line-2: #C9D3E0;
  --ink: #101720;
  --muted: #5E6D80;
  --dim: #8494A8;
  --accent: #B67512;
  --accent-soft: rgba(182, 117, 18, .12);
  --accent-ink: #FFFFFF;
  --board: #E3D5B4;
  --board-line: #A38F63;
  --felt: #2A7C5C;
  --face: #10161E;
  --sq-light: #F2E9D4;
  --sq-dark: #A98B63;
  --good: #0E9F6E;
  --bad: #D64545;
  --bad-soft: rgba(214, 69, 69, .10);
  --shadow: 0 8px 24px rgba(16, 23, 32, .10);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--page);
  color: var(--ink);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
p { margin: 0 0 .8em; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dim { color: var(--dim); }
.hidden-file { display: none; }

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(12px, env(safe-area-inset-left)) 10px max(12px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { display: block; border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.3px; }
.brand-name b { color: var(--accent); font-weight: 700; }
.brand-slogan { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--dim); }

.nav { display: flex; gap: 2px; }
.nav a {
  padding: 8px 12px; border-radius: 9px; text-decoration: none;
  color: var(--muted); font-size: 14px; font-weight: 500;
}
.nav a:hover { color: var(--ink); background: var(--panel); }
.nav a.on { color: var(--accent); background: var(--accent-soft); }

main {
  max-width: 1360px; margin: 0 auto;
  padding: 20px max(14px, env(safe-area-inset-left)) 56px max(14px, env(safe-area-inset-right));
}

/* ------------------------------------------------------------------ atoms */

.btn {
  appearance: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 15px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink);
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.ghost.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line-2)); }
.btn.back { padding: 6px 11px; }

/* A pill with a line icon (js/core/icons.js) — the Settings data row, drawn
   the way MoneyFlow, FinSim and PlanSphere draw theirs. The icon is filled
   with the text colour, so hover and "on" recolour both at once. */
.btn.pill {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; padding: 8px 15px 8px 13px;
}
.btn.pill:hover:not(:disabled) { color: var(--accent); }
/* A switch rather than an action: on, it is filled. */
.btn.pill.on,
.btn.pill.on:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ico { width: 15px; height: 15px; flex: none; fill: currentColor; }
/* Pills that belong together wrap as one, and only split when even the
   group alone is wider than the screen. */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
/* On a phone the three Drive pills have to share one line at 360px. */
@media (max-width: 480px) {
  .btn.pill { padding: 7px 11px 7px 10px; gap: 6px; font-size: 13px; }
  .pill-group { gap: 6px; }
}

/* Still wraps as a last resort on a very narrow phone, but an option with
   more than three choices is given the card grid below instead — a segmented
   bar that wraps leaves a ragged hole at the end of every row. */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg-btn {
  appearance: none; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 8px 13px; border: 0; background: transparent; color: var(--muted);
  border-right: 1px solid var(--line-2);
}
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--accent); color: var(--accent-ink); }
.tabs { margin-bottom: 18px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px; font-size: 12.5px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.badge {
  padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--panel-2); border: 1px dashed var(--line-2); color: var(--dim);
}

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ lobby */

.profile-strip {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 16px;
}
.avatar {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
  color: var(--accent-ink); background: var(--accent);
}
.who { min-width: 0; flex: 1; }
.name-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 17px; color: var(--ink); padding: 0;
}
.name-btn:hover { color: var(--accent); }
.xpbar { height: 6px; border-radius: 3px; background: var(--panel-2); margin: 7px 0 5px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.game-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}
/* Four to a row once there is room: auto-fill would rather make five thin ones,
   and a card that thin loses its blurb and its icon. */
@media (min-width: 1040px) { .game-grid { grid-template-columns: repeat(4, 1fr); } }
.game-card {
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 15px;
}
.game-card .icon { width: 46px; height: 46px; color: var(--muted); margin-bottom: 10px; }
.game-card .icon svg { width: 100%; height: 100%; display: block; }
.game-card h3 { margin-bottom: 4px; }
.game-card .blurb { color: var(--muted); font-size: 13px; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.card-foot .btn { margin-left: auto; }
.game-card.soon { opacity: .6; }
.game-card.soon .icon { filter: grayscale(1); }

/* ------------------------------------------------------------------- play */

.screen.play { position: relative; max-width: 1180px; margin: 0 auto; }
.play-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.play-head h2 { margin: 0; font-size: 19px; }
.game-host { display: block; }
/* A game on the whole screen (PV.fullscreen, the ⛶ that ends its bar): the
   bar on top, and the stage takes the rest, centred either way — the game
   reads its stage's size to fit itself in it. A race's table keeps its place
   above the game, and the end card lies over the lot. The page's gutter,
   and like the page (viewport-fit=cover) it keeps clear of a phone's notch. */
.game-host:fullscreen {
  display: flex; flex-direction: column; overflow: auto;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: var(--page);
}
.game-host:fullscreen > :not(.room-bar, .over-layer) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.game-host:fullscreen :is(.loop-stage, .board-box, .tetris-stage, .cards-box, .tiles-box) {
  flex: 1; min-height: 0; align-items: center; align-content: center;
}
/* Auto margins centre too, and unlike align-items they give way to the
   top edge in the one case a table outgrows its box: a spider column
   twenty cards deep. */
.game-host:fullscreen :is(.cards-box, .tiles-box) > canvas { margin: auto; }
/* A toast floats over the foot of the screen, rather than taking a row
   the stage was measured without. */
.game-host:fullscreen .game-toast {
  position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 4; transform: translateX(-50%);
  max-width: calc(100% - 32px); margin: 0; box-shadow: var(--shadow);
}
/* The game has the room: a line of help under it waits for the page. */
.game-host:fullscreen .loop-below > p { display: none; }
.game-host:fullscreen .loop-below:not(:has(> :not(p))) { display: none; }

.game-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.game-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Wraps, right-aligned, rather than push a 360px page sideways: five
   buttons and a ⛶ are more than a phone's width. */
.bar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
.turn-label { font-weight: 600; }
.stone-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.stone-dot.black { background: #10151C; border: 1px solid var(--line-2); }
.stone-dot.white { background: #EEF2F8; border: 1px solid var(--line-2); }

.board-box { display: flex; justify-content: center; }
.board-canvas { border-radius: 12px; box-shadow: var(--shadow); touch-action: manipulation; }

.game-toast {
  margin-top: 12px; padding: 9px 12px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px;
}

.over-layer {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--page) 72%, transparent);
  backdrop-filter: blur(3px);
}
.over-card {
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 16px; padding: 22px; text-align: center;
  box-shadow: var(--shadow); max-width: 340px; width: 100%;
}
.over-card h3 { font-size: 22px; }
.over-card.tone-good h3 { color: var(--accent); }
.over-card.tone-bad h3 { color: var(--bad); }
.over-lines { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.over-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ sudoku */

.sudoku-grid {
  display: grid; grid-template-columns: repeat(9, 1fr);
  width: min(100%, 620px); aspect-ratio: 1;
  border: 2px solid var(--line-2); border-radius: 10px; overflow: hidden;
  background: var(--panel);
  user-select: none;
}
.sq {
  display: grid; place-items: center; position: relative; cursor: pointer;
  font-size: clamp(15px, 4.4vw, 32px); font-weight: 600; color: var(--accent);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.sq:nth-child(9n) { border-right: 0; }
.sq:nth-child(n+73) { border-bottom: 0; }
.sq:nth-child(3n):not(:nth-child(9n)) { border-right: 2px solid var(--line-2); }
.sq:nth-child(n+19):nth-child(-n+27),
.sq:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--line-2); }
.sq.given { color: var(--ink); }
.sq.peer { background: var(--panel-2); }
.sq.same { background: var(--accent-soft); }
.sq.sel { background: color-mix(in srgb, var(--accent) 30%, var(--panel)); }
.sq.wrong { color: var(--bad); }
.sq .marks {
  display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; height: 100%;
  font-size: 9px; line-height: 1; color: var(--dim); font-style: normal; font-weight: 500;
}
.sq .marks i { display: grid; place-items: center; font-style: normal; }

.sudoku-pad {
  display: grid; grid-template-columns: repeat(9, 1fr);
  gap: 6px; width: min(100%, 620px); margin: 14px auto 10px;
}
.num {
  appearance: none; cursor: pointer; font: inherit; font-weight: 700;
  font-size: clamp(15px, 4vw, 22px); padding: 12px 0;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--panel); color: var(--accent);
}
.num:hover:not(:disabled) { border-color: var(--accent); }
.num:disabled { opacity: .3; cursor: default; }
.sudoku-tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
/* On the whole screen the view sets --grid, the biggest square the room
   under the bar holds: the grid takes it, the pad under it matches it, and
   the digits grow with it. */
.game-host:fullscreen .sudoku-grid,
.game-host:fullscreen .sudoku-pad { width: var(--grid, min(100%, 620px)); }
.game-host:fullscreen .sq { font-size: calc(var(--grid, 620px) * .052); }
.game-host:fullscreen .sq .marks { font-size: calc(var(--grid, 620px) * .018); }

/* ------------------------------------------------------------------ tetris */

.tetris-stage { display: flex; gap: 14px; justify-content: center; align-items: flex-start; }
.well-box { display: flex; }
.well-canvas { border-radius: 10px; border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.tetris-side { display: flex; flex-direction: column; gap: 10px; min-width: 134px; }
.panel-mini {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px; text-align: center;
}
.panel-mini .k { display: block; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); margin-bottom: 5px; }
.mini-canvas { display: block; width: 120px; height: 90px; margin: 0 auto; }
.mini-canvas.tall { height: 270px; }
.panel-mini.stats { text-align: left; }
.panel-mini.stats b { display: block; font-size: 17px; margin-bottom: 7px; }
.panel-mini.stats b:last-child { margin-bottom: 0; }

.tetris-pad { display: none; gap: 8px; margin-top: 14px; grid-template-columns: repeat(3, 1fr); }
.tpad {
  appearance: none; cursor: pointer; font: inherit; font-size: 20px;
  padding: 14px 0; border-radius: 12px; touch-action: none;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
}
.tpad:active { background: var(--accent-soft); border-color: var(--accent); }

/* ------------------------------------------------------------------ stats */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.tile .k { display: block; font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--dim); }
.tile b { font-size: 22px; }

.table-wrap { overflow-x: auto; margin-bottom: 14px; border-radius: 12px; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 14px; }
.table th, .table td { padding: 10px 13px; text-align: left; white-space: nowrap; }
.table th { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.table tbody tr { border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ sheets */

.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.opt-row:last-child { margin-bottom: 0; }
.opt-row .k { font-weight: 600; font-size: 14px; }

/* Many choices, or choices with a picture: a grid of cards, full width under
   its own label. Every cell is the same size at every count, which a wrapped
   segmented control can never be. */
/* `nowrap` matters: .opt-row wraps, and a WRAPPING column is measured at a
   narrower width than it is drawn at. Map thumbnails grow with their width, so
   the grid came out 30px short and the next row sat on its bottom cards. */
.opt-row.stack { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 9px; margin-bottom: 16px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(106px, 1fr)); gap: 8px; }
/* Exactly three is always one row. On a phone auto-fit makes it two and one,
   which is the same hole this grid exists to avoid. */
.choice-grid:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice {
  appearance: none; cursor: pointer; font: inherit; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 7px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted);
  transition: border-color .12s, background .12s, color .12s;
}
.choice:hover { color: var(--ink); border-color: var(--line); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.choice .nm { font-size: 13px; font-weight: 600; line-height: 1.25; }
.choice .tag { font-size: 11px; line-height: 1; letter-spacing: 1.5px; color: var(--accent); }
.choice .thumb { display: block; width: 100%; line-height: 0; border-radius: 8px; overflow: hidden; }
.choice .thumb canvas, .choice .thumb svg { display: block; width: 100%; height: auto; }

.modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(4, 7, 11, .6); backdrop-filter: blur(3px);
}
/* Never taller than the window: on a laptop a sheet of map cards ran off the
   bottom and took Start with it. The title and the buttons stay put and the
   options between them scroll. */
.sheet {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 20px; width: 100%; max-width: 380px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
}
/* Room for three cards across. */
.sheet.wide { max-width: 470px; }
.sheet-body { margin: 14px 0 18px; }
.sheet > .sheet-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  /* The scrollbar sits in the sheet's padding, not against the cards. */
  margin-right: -14px; padding-right: 14px;
}
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; }

/* The no-JavaScript notice. In the stylesheet rather than a style attribute,
   so the page's Content-Security-Policy can refuse inline styles outright. */
.noscript { padding: 24px; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 759px) {
  .hide-sm { display: none; }
  .brand-slogan { display: none; }
  .tetris-pad { display: grid; }
  .tetris-stage { flex-wrap: wrap; }
  .well-box { order: 1; width: 100%; justify-content: center; }
  .tetris-side { order: 2; flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .tetris-side { min-width: 96px; }
  .mini-canvas { width: 78px; height: 58px; }
  .mini-canvas.tall { height: 176px; }
  .panel-mini.stats b { font-size: 15px; }
  h2 { font-size: 19px; }
}

@media (max-width: 420px) {
  .nav a { padding: 8px 9px; font-size: 13.5px; }
  .brand-name { font-size: 16px; }
  .game-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .game-card { padding: 12px; }
  .game-card .icon { width: 36px; height: 36px; }
  .game-card .blurb { display: none; }
  .sudoku-pad { gap: 4px; }
  .num { padding: 9px 0; border-radius: 7px; }
}

/* ------------------------------------------------- shared game harnesses */

/* Board games (gomoku, reversi, chess, xiangqi) */
.board-extra { display: flex; justify-content: center; margin-top: 12px; }
.promo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.promo-row .k { font-size: 13px; color: var(--muted); }
.btn.promo { font-size: 22px; line-height: 1; padding: 6px 12px; }

/* Real-time games (snake, racing, tower defense) */
.loop-stage { display: flex; gap: 14px; justify-content: center; align-items: flex-start; }
.loop-box { display: flex; }
/* A game's DOM over its canvas, laid out at its own size and drawn bigger
   with a canvas past it (PV.scaleUI). Every such layer here sits at inset
   1px with a 9px corner, which stays 9px. */
.loop-box.ui-big > :not(canvas) {
  right: auto; bottom: auto;
  width: calc((100% - 2px) / var(--ui-k));
  height: calc((100% - 2px) / var(--ui-k));
  border-radius: calc(9px / var(--ui-k));
  transform: scale(var(--ui-k)); transform-origin: 0 0;
}
.loop-canvas { border-radius: 10px; border: 1px solid var(--line-2); box-shadow: var(--shadow); touch-action: none; }
.loop-side { display: flex; flex-direction: column; gap: 10px; }
.loop-side:empty { display: none; }
.loop-below { margin-top: 12px; }
.loop-pad { display: none; gap: 8px; margin-top: 14px; grid-template-columns: repeat(3, 1fr); }
/* A thumb pad (Snake's, Tetris's) is for thumbs, so it is on every touch
   screen: a tablet, or a phone on its side, as much as a phone upright. The
   width rule below adds narrow windows. Capped, so that a tablet's four
   buttons are not each a quarter of its width. */
@media (pointer: coarse) {
  .loop-pad, .tetris-pad { display: grid; }
}
.loop-pad, .tetris-pad { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
/* A phone on its side has the height for one row of buttons, not two: the
   well gets the rest. Moving on the left thumb, turning and dropping on the
   right. Tetris's panels shrink as on a phone upright, but stay either side
   of a well only the screen's height tall. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  .tetris-pad { grid-template-columns: repeat(6, 1fr); }
  .tetris-side { min-width: 96px; gap: 6px; }
  .tetris-side .mini-canvas { width: 78px; height: 58px; }
  .tetris-side .mini-canvas.tall { height: 176px; }
  .tetris-side .panel-mini.stats b { font-size: 14px; }
  .tetris-side .panel-mini.stats b:not(:last-child) { margin-bottom: 3px; }
}
.panel-mini .wide, .btn.wide { width: 100%; }

/* The card and tile canvases size themselves, so they only need centring */
.cards-box, .tiles-box { display: flex; justify-content: center; overflow-x: auto; }
.tiles-canvas { touch-action: manipulation; }
/* The spider tableau is dragged, so the canvas must own the gesture: with
   `manipulation` a sideways drag scrolls the box instead of moving a run. */
.cards-canvas { touch-action: none; }

/* Kart item slot */
.kart-slot {
  display: grid; place-items: center; width: 100%; height: 46px;
  border-radius: 10px; font-size: 24px; line-height: 1;
  background: var(--panel-2); border: 1px dashed var(--line-2); color: var(--dim);
  margin-bottom: 5px;
}
.kart-slot.full { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }

/* Worm arena: the wardrobe and the look, in the side panel at the start
   line. The HUD itself is painted on the canvas, as the reference's is. */
.worm-shop { display: grid; gap: 9px; text-align: left; width: 232px; }
.worm-shop .shop-head { display: flex; justify-content: space-between; align-items: center; }
.worm-shop .shop-head .k { margin-bottom: 0; }
.worm-shop .fx { font-size: 11.5px; color: var(--dim); margin: 0; }
.worm-skins {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  max-height: 318px; overflow-y: auto; overflow-x: hidden; padding-right: 2px;
}
.worm-skin {
  appearance: none; font: inherit; cursor: pointer; display: grid; justify-items: center; gap: 1px;
  padding: 5px 2px 4px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--muted); min-width: 0;
}
.worm-skin:hover { border-color: var(--accent); }
.worm-skin canvas { display: block; width: 100%; max-width: 64px; height: auto; }
.worm-skin .nm {
  font-size: 10.5px; font-weight: 600; line-height: 1.2; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.worm-skin .pr { font-size: 10.5px; line-height: 1.2; min-height: 1.2em; color: var(--accent); font-weight: 700; }
.worm-skin.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.worm-skin.locked canvas { opacity: .6; }
.worm-skin.poor { cursor: default; }
.worm-skin.poor .pr { color: var(--dim); }
.worm-look { display: grid; gap: 5px; }
.worm-look .k { margin: 2px 0 0; }
.worm-look .seg { width: 100%; }
.worm-look .seg-btn { flex: 1 1 0; }
.worm-floors { display: flex; gap: 7px; }
.worm-floor {
  appearance: none; cursor: pointer; width: 34px; height: 24px; padding: 0;
  border-radius: 7px; border: 2px solid var(--line-2);
}
.worm-floor.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

@media (max-width: 759px) {
  .worm-shop { width: 100%; }
  .worm-skins { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); max-height: 220px; }
}

/* Tower defense shop. The buy buttons carry the real turret art, drawn by the
   same code that paints the board, so the icon can never drift from the tower. */
.td-shop { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.td-buy { display: inline-flex; align-items: center; gap: 7px; }
.td-buy canvas, .td-lv canvas { display: block; }
.td-buy.poor { opacity: .55; }
.td-where { text-align: center; width: 100%; }

/* An upgrade row in a side-panel shop (Worm Arena's). Crowd Rush draws its
   own upgrade cards on the canvas now, the way its reference does. */
.up-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; }
.up-row .nm { font-weight: 600; font-size: 13px; }
.up-row .btn { grid-row: span 2; white-space: nowrap; }
.coin {
  display: inline-block; width: .8em; height: .8em; margin-right: 4px; vertical-align: -.08em;
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE58A, #F6B32B 55%, #C98A0B);
}
.td-boss {
  width: 100%; justify-content: center; font-weight: 600;
  color: var(--bad); border-color: var(--bad); background: transparent;
}
/* .chip sets display, so the hidden attribute needs saying again. */
.td-boss[hidden] { display: none; }
.swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.td-info {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin-top: 10px; text-align: center;
}

@media (max-width: 759px) {
  .loop-pad { display: grid; }
  .loop-stage { flex-direction: column; align-items: center; }
  .loop-side { flex-direction: row; width: 100%; justify-content: center; flex-wrap: wrap; }
  .panel-mini.stats { flex: 1 1 auto; min-width: 92px; }
  /* On the whole screen a side panel taller than the room under the canvas
     (Worm Arena's wardrobe) scrolls in the stage, from the top of it. */
  .game-host:fullscreen .loop-stage { justify-content: safe center; overflow-y: auto; }
}

/* ------------------------------------------------------- playing together

   One player chip, used in three places: the room lobby, the strip above an
   online board, and the race scoreboard. It has to survive six names on a
   360px phone, so it wraps rather than scrolls and the name is the part that
   gives way. */

.friends-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 13px 15px; margin-bottom: 16px;
}
.friends-cta h3 { margin: 0 0 2px; }
.friends-cta p { margin: 0; }

.notice {
  background: var(--accent-soft); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 9px 12px; font-size: 13.5px;
}

/* ------------------------------------------------------------------ drive */

/* Under the Auto / To Drive / From Drive / Export / Import row, one status
   line: quiet when all is well, red only when something needs a press. */
.drive-when { margin: 10px 0 0; color: var(--muted); }
.drive-when.ok::before { content: "\2713\00a0"; color: var(--good); font-weight: 700; }
.drive-when.warn { color: var(--bad); }

/* A browser with nothing in it, asked on the Games screen whether its Drive
   copy should come back. */
.drive-offer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 14px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 12px 15px; margin-bottom: 16px;
}
.drive-offer > p { margin: 0; flex: 1 1 240px; }
.drive-offer > .msg { flex-basis: 100%; }

/* A save that could not be written: at the top of every screen until a
   write lands again (syncSaving in js/app.js). */
.save-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 14px; flex-wrap: wrap;
  background: var(--bad-soft); border: 1px solid var(--line-2);
  border-left: 3px solid var(--bad);
  border-radius: 12px; padding: 12px 15px; margin-bottom: 16px;
}
.save-strip > p { margin: 0; flex: 1 1 240px; font-weight: 600; }

/* the game picker in the friends screen */
.pick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px; margin: 12px 0;
}
.pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 7px; cursor: pointer;
  color: var(--ink); font: inherit; text-align: center;
}
.pick:hover { border-color: var(--accent); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.pick .icon { display: block; width: 32px; height: 32px; color: var(--accent); }
.pick .icon svg { width: 100%; height: 100%; }
.pick .nm { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.pick .fam { font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--dim); }

.pick-setup { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.pick-setup .sheet-body { margin-bottom: 10px; }

/* the code, both ends of it */
.code-box {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 11px 14px; margin-bottom: 12px;
}
.code-box .k { display: block; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); }
.code-box .code { font-size: 27px; letter-spacing: .09em; color: var(--accent); }

.code-input {
  flex: 1 1 130px; min-width: 0; max-width: 190px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 12px; font-size: 19px; letter-spacing: .16em; text-align: center;
}
.code-input:focus { outline: none; border-color: var(--accent); }

/* who is in the room */
.room-strip { display: flex; flex-wrap: wrap; gap: 7px; }
.pchip {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px 4px 5px; font-size: 13px;
}
.pchip.me { border-color: var(--accent); }
.pchip.gone { opacity: .5; }
.pchip.turn { background: var(--accent-soft); border-color: var(--accent); }
.pchip .lv {
  display: inline-flex; align-items: center; justify-content: center;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; flex: none;
}
.pchip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 11ch; }
.pchip .tag { font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--dim); }
.pchip .tag.bad { color: var(--bad); }
.pchip .val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); }
.pchip .medal { font-size: 14px; }
.pchip.done .val { color: var(--good); }

.room-panel .room-strip { margin-top: 12px; margin-bottom: 12px; }

/* the banner above a game being played with other people */
.room-bar {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
}
.room-bar-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.room-line { flex: 1 1 auto; }
.room-line.you { color: var(--accent); font-weight: 600; }
.small-btn { padding: 4px 10px; font-size: 12.5px; }

@media (max-width: 759px) {
  .code-box .code { font-size: 23px; }
  .pchip .nm { max-width: 8ch; }
}

/* ---------------------------------------------------- strike squad (fps) */
/* The lobby and the pause card are the game's own glass over a 3D scene,
   like its HUD: dark in both themes, so their colours are their own rather
   than the page's tokens. Frosted, not see-through: the map behind them is
   a soft backdrop, not buildings showing through every card. The cards
   are solid, and the guns sit on light tiles, because a dark gun on dark
   glass was hard to see at all. */

.fps-box { position: relative; }
.fps-box .fps-hud { position: relative; z-index: 1; cursor: crosshair; }
.fps-gl { position: absolute; left: 1px; top: 1px; border-radius: 9px; pointer-events: none; }
.fps-box:fullscreen { background: #000; align-items: center; justify-content: center; }
.fps-box:fullscreen .fps-hud { border: 0; border-radius: 0; }
.fps-box:fullscreen .fps-gl { left: 0; top: 0; border-radius: 0; }

.fps-lobby {
  position: absolute; inset: 1px; z-index: 2; overflow: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 14px 18px;
  border-radius: 9px; color: #F2F6FA;
  background: rgba(21, 28, 38, .86);
  -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
}
.fps-lobby > :not(.fps-toast) { width: 100%; max-width: 960px; margin-left: auto; margin-right: auto; }
.fps-lobby[hidden] { display: none; }
.fps-lobby .muted { color: #B9C5D3; }
.fps-lobby .btn, .fps-pause .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .26); color: #F2F6FA; }
.fps-lobby .btn.primary, .fps-pause .btn.primary { background: #F97316; border-color: #F97316; color: #14100C; font-weight: 700; }
.fps-lobby .btn:disabled { opacity: .45; cursor: default; }
.fps-lobby .btn.sm, .fps-pause .btn.sm { padding: 5px 10px; font-size: 12.5px; }
.fps-lobby kbd, .fps-pause kbd {
  display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 5px;
  background: #E9EEF4; color: #17202B; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .28);
  font: 700 11px/1.5 system-ui, sans-serif; text-align: center; white-space: nowrap;
}

.fps-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.fps-rank { display: flex; align-items: center; gap: 10px; }
.fps-rank .badge {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 10px; background: #F97316; color: #14100C;
  font-weight: 800; font-size: 18px;
}
.fps-rank .who { display: flex; flex-direction: column; gap: 3px; min-width: 150px; }
.fps-rank small { color: #B9C5D3; font-size: 11.5px; }
.fps-rank .xp, .fps-mis .xp { display: block; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, .16); }
.fps-rank .xp i, .fps-mis .xp i { display: block; height: 100%; background: #F97316; }
.fps-coins { font-weight: 800; font-size: 18px; color: #FFD35A; font-variant-numeric: tabular-nums; }

.fps-tabs {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px;
  background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .08);
}
.fps-tab {
  position: relative; background: none; border: 0; border-radius: 9px;
  color: #C3CEDA; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer;
}
.fps-tab:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.fps-tab.on { color: #fff; background: rgba(255, 255, 255, .14); box-shadow: inset 0 -2px 0 #F97316; }
.fps-tab .dot {
  display: inline-flex; align-items: center; justify-content: center; margin-left: 5px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #F0503E; color: #fff; font-size: 11px;
}
.fps-body { display: flex; flex-direction: column; gap: 12px; }
.fps-sec h5, .fps-settings h5 { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #B9C5D3; }

.fps-mission { display: flex; flex-direction: column; gap: 5px; }
.fps-mission .head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.fps-mission .mode { font-size: 22px; font-weight: 800; line-height: 1.2; margin-right: 2px; }
.fps-mission .tag { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: rgba(255, 255, 255, .1); color: #E4EAF1; }
.fps-mission .tag.diff-easy { background: rgba(88, 210, 106, .18); color: #8BEA99; }
.fps-mission .tag.diff-normal { background: rgba(242, 192, 64, .18); color: #FFD35A; }
.fps-mission .tag.diff-hard { background: rgba(240, 80, 62, .2); color: #FF8A7A; }
.fps-mission .info { margin: 0; color: #C3CEDA; font-size: 13.5px; }
.fps-kit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fps-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fps-slot, .fps-card, .fps-item {
  display: flex; flex-direction: column; gap: 5px; min-width: 0;
  background: #243040; border: 1px solid #37455A;
  border-radius: 12px; padding: 10px; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.fps-slot { align-items: stretch; }
.fps-slot small, .fps-card small, .fps-item small { color: #B9C5D3; font-size: 12px; }
.fps-slot:hover, .fps-card:hover, .fps-item:hover { border-color: #F97316; background: #2A3748; }
.fps-card.on, .fps-item.on { border-color: #F97316; background: #3B3431; }
.fps-card.locked, .fps-item.locked, .fps-chip.locked, .fps-swatch.locked { opacity: .5; }
.fps-gun-tile { display: flex; align-items: center; justify-content: center; padding: 4px; }
.fps-gun-tile, .fps-card .fps-gun, .fps-hero .fps-gun {
  border-radius: 9px; background: radial-gradient(ellipse at 50% 40%, #7D8CA2 0%, #505D71 55%, #3A4658 100%);
}
.fps-slot .icons { display: flex; gap: 12px; flex-wrap: wrap; }
.fps-slot .sk { font-weight: 700; white-space: nowrap; }
.fps-perks { margin: 0; color: #8BEA99; font-size: 13px; }
/* Deploy never scrolls out of sight: it rides the bottom of the panel
   until the page reaches its own place for it. */
.fps-deploy {
  position: sticky; bottom: 6px; z-index: 2;
  align-self: center; min-width: 240px; padding: 12px 34px; font-size: 18px; letter-spacing: .08em;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45), 0 0 0 4px rgba(21, 28, 38, .55);
}
.fps-hint { margin: 0; text-align: center; color: #B9C5D3; font-size: 12.5px; }
.fps-keys {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 7px 14px;
  padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .2); border: 1px solid rgba(255, 255, 255, .07);
  font-size: 12.5px; color: #D5DDE6;
}
.fps-keys .key { display: flex; align-items: center; gap: 8px; min-width: 0; }

.fps-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.fps-guns { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.fps-card { align-items: center; text-align: center; }
.fps-gun { display: block; max-width: 100%; }
.fps-gun.dim { filter: grayscale(1) brightness(.8); }
.fps-detail { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 12px; background: #1F2935; border: 1px solid #334155; }
.fps-hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fps-hero h4 { margin: 0; font-size: 20px; }
.fps-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.fps-stat { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; font-size: 12.5px; color: #D5DDE6; }
.fps-stat .track { position: relative; display: block; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, .12); }
.fps-stat .track i, .fps-stat .track b { position: absolute; left: 0; top: 0; bottom: 0; }
.fps-stat .track b { z-index: 0; background: #F97316; }
.fps-stat .track i { z-index: 1; background: #C9D4E0; }
.fps-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fps-up { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.fps-up .pips i { display: inline-block; width: 18px; height: 8px; margin-right: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.fps-up .pips i.on { background: #F97316; }
.fps-up .max { color: #8BEA99; font-weight: 700; font-size: 12px; }
.fps-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 3px 0; }
.fps-opts .k { width: 96px; color: #B9C5D3; font-size: 13px; }
.fps-chip {
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px;
  color: #F2F6FA; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.fps-chip:hover { border-color: #F97316; }
.fps-chip.on { background: #F97316; border-color: #F97316; color: #14100C; font-weight: 700; }
.fps-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.fps-swatch {
  display: inline-flex; align-items: flex-end; justify-content: flex-end;
  width: 36px; height: 36px; padding: 2px; border-radius: 8px; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, .22); background: #2F3237; color: #fff; font-size: 10px;
}
.fps-swatch.on { border-color: #F97316; box-shadow: 0 0 0 2px rgba(249, 115, 22, .45); }
.fps-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
.fps-item .sw { display: block; width: 22px; height: 22px; border-radius: 6px; }
.fps-item .big { font-size: 24px; line-height: 1.1; }
.fps-item .price { color: #FFD35A; font-weight: 700; font-size: 12.5px; }
.fps-item.crate { cursor: default; }
.fps-item.crate .btn { align-self: flex-start; margin-top: 4px; }
.fps-mis { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.fps-mis .txt { display: flex; flex-direction: column; gap: 4px; }
.fps-mis small { color: #B9C5D3; font-size: 11.5px; }
.fps-mis.done { opacity: .6; }
.fps-mis .ok { color: #8BEA99; font-weight: 800; font-size: 18px; }

/* Settings: in the lobby's tab and on the pause card. */
.fps-settings { display: flex; flex-direction: column; gap: 12px; }
.fps-settings .grp {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px;
  border-radius: 12px; background: #1F2935; border: 1px solid #334155;
}
.fps-settings .grp h5 { margin-bottom: 2px; }
.fps-settings .hint { margin: 0; color: #B9C5D3; font-size: 12px; }
.fps-set { display: grid; grid-template-columns: 190px 1fr 60px; align-items: center; gap: 10px; font-size: 13.5px; }
.fps-set input { width: 100%; accent-color: #F97316; }
.fps-set .v { color: #FFD35A; font-variant-numeric: tabular-nums; text-align: right; }
.fps-xh { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.fps-xprev { display: block; border-radius: 9px; border: 1px solid #334155; }
.fps-xctl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fps-xctl .fps-set { grid-template-columns: 64px 1fr 48px; }
.fps-xcols { display: flex; flex-wrap: wrap; gap: 8px; }
.fps-xcol { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .45); cursor: pointer; }
.fps-xcol.on { box-shadow: 0 0 0 2px #1F2935, 0 0 0 4px #F97316; }
.fps-reset { align-self: flex-start; }

/* The pause card: over the stopped match, lightly dimmed. */
.fps-pause {
  position: absolute; inset: 1px; z-index: 3; display: flex; align-items: center; justify-content: center;
  padding: 14px; border-radius: 9px; background: rgba(8, 12, 18, .42);
}
.fps-pause[hidden] { display: none; }
.fps-pause-card {
  width: 100%; max-width: 600px; max-height: 100%; overflow: auto;
  display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-radius: 14px;
  color: #F2F6FA; background: rgba(21, 28, 38, .92); border: 1px solid #37455A;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.fps-pause-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fps-pause-head h3 { margin: 0; font-size: 20px; }

.fps-toast {
  position: sticky; bottom: 0; align-self: center; margin-top: auto;
  padding: 8px 16px; border-radius: 999px; background: #F97316; color: #14100C; font-weight: 700;
}

@media (max-width: 759px) {
  .fps-lobby { padding: 10px; }
  .fps-kit, .fps-row, .fps-bars { grid-template-columns: 1fr; }
  .fps-up { grid-template-columns: 90px 1fr auto; }
  .fps-set { grid-template-columns: 1fr 56px; }
  .fps-set .k { grid-column: 1 / -1; }
  .fps-xh { grid-template-columns: 1fr; }
  .fps-xctl .fps-set { grid-template-columns: 1fr 48px; }
  .fps-keys { grid-template-columns: 1fr 1fr; }
  .fps-pause { padding: 8px; }
}

/* ------------------------------------------------------ blend in (hide) */

.hide-box { position: relative; }
.hide-box .hide-hud { position: relative; z-index: 1; cursor: default; }
.hide-gl { position: absolute; left: 1px; top: 1px; border-radius: 9px; pointer-events: none; }
.hide-box:fullscreen { background: #000; align-items: center; justify-content: center; }
.hide-box:fullscreen .hide-hud { border: 0; border-radius: 0; }
.hide-box:fullscreen .hide-gl { left: 0; top: 0; border-radius: 0; }

.hide-ui {
  position: absolute; inset: 1px; z-index: 2; pointer-events: none; overflow: hidden; border-radius: 9px;
  font-family: "Nunito", "Segoe UI Rounded", "Segoe UI", system-ui, sans-serif; color: #fff;
}
.hide-ui > * { pointer-events: auto; }
.hide-ui [hidden] { display: none !important; }
.hide-ui button { font: inherit; cursor: pointer; }

/* The bar of keys along the bottom. */
.hide-bar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; }
.hide-key {
  pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 58px; height: 58px; padding: 2px 0 4px; border-radius: 12px; border: 3px solid #17181D;
  color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .45); line-height: 1.05;
}
.hide-key .k { font-size: 10.5px; font-weight: 800; opacity: .95; }
.hide-key .i { font-size: 19px; }
.hide-key .l { font-size: 11.5px; font-weight: 800; text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.hide-key:hover { filter: brightness(1.12); }
.hide-key.on { outline: 3px solid #fff; outline-offset: -1px; }
.hide-key.red { background: #C9373A; }
.hide-key.purple { background: #8A42C8; }
.hide-key.orange { background: #E0861E; }
.hide-key.blue { background: #2F7DC9; }
.hide-key.grey { background: #5C6068; }

/* The paint panel. */
.hide-paint {
  position: absolute; right: 12px; top: 50%; transform: translateY(-58%); width: 250px;
  display: flex; flex-direction: column; gap: 9px; padding: 11px; border-radius: 14px;
  background: #5A5B60; border: 3px solid #2B2C31; box-shadow: 0 6px 0 rgba(0, 0, 0, .35);
}
.hp-top { display: flex; align-items: center; gap: 8px; }
.hp-wheel { width: 108px; height: 108px; border-radius: 50%; cursor: crosshair; touch-action: none; flex: none; }
.hp-val { width: 13px; height: 108px; border-radius: 7px; cursor: ns-resize; touch-action: none; flex: none; }
.hp-swatch { flex: 1; height: 92px; border-radius: 12px; border: 3px solid #2B2C31; }
.hp-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hp-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 2px 5px;
  border-radius: 10px; border: 3px solid #2B2C31; color: #fff; line-height: 1.1;
}
.hp-btn b { font-size: 13px; }
.hp-btn .n { font-weight: 900; font-size: 14px; }
.hp-btn small { font-size: 10px; opacity: .85; }
.hp-btn.pick { background: #2F7DC9; }
.hp-btn.fill { background: #1F9A73; }
.hp-btn.reset { background: #A52A2E; }
.hp-btn.on { outline: 3px solid #FFE27A; }
.hp-btn:hover { filter: brightness(1.12); }
.hp-brush { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 10px; background: #34353A; }
.hp-brush .ic { font-size: 15px; }
.hp-size { flex: 1; accent-color: #fff; }
.hp-dotbox { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: #1E1F23; flex: none; }
.hp-dot { display: block; border-radius: 50%; border: 2px solid #fff; }
.hp-recent { display: flex; gap: 5px; flex-wrap: wrap; min-height: 22px; }
.hp-rc { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #2B2C31; padding: 0; }

/* Poses. */
.hide-poses {
  position: absolute; left: 50%; bottom: 82px; transform: translateX(-50%); width: min(560px, calc(100% - 24px));
  padding: 10px; border-radius: 14px; background: rgba(38, 30, 60, .94); border: 3px solid #17181D;
}
.hide-poses h4 { margin: 0 0 8px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: #E6DCFF; }
.hide-poses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.hide-pose {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px;
  border-radius: 10px; border: 2px solid rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .07); color: #fff;
}
.hide-pose .big { font-size: 22px; }
.hide-pose .nm { font-size: 11.5px; font-weight: 700; }
.hide-pose small { color: #FFD35A; font-size: 11px; }
.hide-pose.on { border-color: #B98BFF; background: rgba(185, 139, 255, .25); }
.hide-pose.locked { opacity: .45; cursor: default; }
.hide-pose:hover:not(:disabled) { border-color: #B98BFF; }

/* Cards: the menu, the table. */
.hide-menu, .hide-results { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10, 12, 18, .45); }
.hide-card {
  width: min(360px, calc(100% - 24px)); max-height: calc(100% - 20px); overflow: auto;
  border-radius: 16px; background: #34353B; border: 4px solid #1B1C21; box-shadow: 0 8px 0 rgba(0, 0, 0, .4);
}
.hide-card-head { padding: 9px 14px; background: linear-gradient(#FFC857, #F0A93A); border-bottom: 4px solid #1B1C21; text-align: center; }
.hide-card-head h3 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: .04em; color: #fff; text-shadow: 0 2px 0 #7A4B08, 0 0 3px #7A4B08; }
.hide-rows { display: flex; flex-direction: column; gap: 7px; padding: 12px; }
.hide-row { display: grid; grid-template-columns: 118px 1fr 48px; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: #F4F1EA; color: #26272C; font-size: 13px; font-weight: 800; }
.hide-row .chips { grid-column: 2 / -1; display: flex; gap: 6px; }
.hide-row input { width: 100%; accent-color: #2F7DC9; }
.hide-row .v { color: #1F9A73; text-align: right; }
.hide-chip {
  padding: 4px 10px; border-radius: 8px; border: 2px solid #2B2C31; background: #E3E0D8; color: #26272C;
  font-weight: 800; font-size: 12px;
}
.hide-chip.on { background: #1F9A73; color: #fff; }
.hide-keys { margin: 0 12px 4px; color: #B9BCC6; font-size: 11.5px; }
.hide-actions { display: flex; gap: 8px; justify-content: center; padding: 10px 12px 14px; flex-wrap: wrap; }
.hide-big { padding: 8px 18px; border-radius: 10px; border: 3px solid #1B1C21; color: #fff; font-weight: 900; font-size: 14px; box-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.hide-big.green { background: #34B24A; }
.hide-big.purple { background: #7B3FD0; }
.hide-big:hover { filter: brightness(1.1); }

.hide-results { background: rgba(10, 12, 18, .25); align-items: flex-start; padding-top: 3%; }
.hide-card.res .rows { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; }
.hide-card.res .row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 8px; background: #F4F1EA; color: #26272C; font-weight: 800; font-size: 13px; }
.hide-card.res .row.me { outline: 3px solid #FFC857; }
.hide-card.res .row .st { font-size: 12.5px; }
.hide-card.res .row.survived .st { color: #1F9A4A; }
.hide-card.res .row.found .st { color: #D2393C; }
.hide-card.res .row.seeker .st { color: #5C6068; }
.hide-card.res .row.found .ic, .hide-card.res .row.seeker .ic { color: #D2393C; }
.hide-card.res .sum { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 12px 14px; }
.hide-card.res .gains { display: flex; gap: 18px; padding: 7px 18px; border-radius: 10px; background: #26272C; font-weight: 900; font-size: 16px; }
.hide-card.res .gains span:first-child { color: #FFD35A; }
.hide-card.res .gains span:last-child { color: #FF8FB8; }
.hide-card.res .sum small { color: #C4C7D0; font-weight: 700; }

/* The role card. */
.hide-intro { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.hide-intro-card {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px; max-width: calc(100% - 24px);
  border-radius: 16px; background: rgba(22, 22, 28, .94); border: 3px solid #0E0F12;
}
.hide-intro-card .pic canvas { display: block; border-radius: 10px; width: 150px; height: 100px; }
.hide-intro-card small { color: #B9BCC6; font-weight: 800; letter-spacing: .1em; font-size: 11.5px; }
.hide-intro-card h3 { margin: 3px 0 6px; font-size: 24px; font-weight: 900; }
.hide-intro-card h3.seek { color: #FF6A5A; }
.hide-intro-card h3.hide { color: #7FE0A0; }
.hide-intro-card .lines { font-size: 13.5px; color: #E4E6EE; display: flex; flex-direction: column; gap: 2px; }

/* The lobby. */
.hide-lobby {
  position: absolute; left: 10px; top: 10px; bottom: 10px; width: min(360px, calc(100% - 20px));
  display: flex; flex-direction: column; border-radius: 14px; background: rgba(26, 24, 40, .9); border: 3px solid #0E0F12;
}
.hide-lobby.folded { bottom: auto; width: auto; background: transparent; border-color: transparent; }
.hide-lobby.folded .hide-lobby-body { display: none; }
.hide-fold { align-self: flex-start; margin: 6px; padding: 4px 10px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, .25); background: rgba(20, 20, 28, .85); color: #fff; font-size: 12px; font-weight: 800; }
.hide-lobby-body { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; overflow: auto; min-height: 0; }
.hide-me { display: flex; align-items: center; gap: 10px; }
.hide-me .badge { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: #E4587A; font-weight: 900; font-size: 18px; flex: none; }
.hide-me .who { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hide-me .who small { color: #C4C7D0; font-size: 11.5px; font-weight: 700; }
.hide-me .xp { display: block; height: 7px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, .14); }
.hide-me .xp i { display: block; height: 100%; background: linear-gradient(90deg, #4DB6E8, #8E63D6, #E4587A); }
.hide-coins { font-weight: 900; font-size: 17px; color: #FFD35A; font-variant-numeric: tabular-nums; }
.hide-next { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 2px solid #4CC38A; }
.hide-next canvas { display: block; border-radius: 8px; }
.hide-next .txt { display: flex; flex-direction: column; }
.hide-next small { color: #B9BCC6; font-weight: 800; letter-spacing: .08em; font-size: 11px; text-transform: uppercase; }
.hide-next b { font-size: 19px; }
.hide-role { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hide-role .k { color: #C4C7D0; font-weight: 800; font-size: 12.5px; }
.hide-role .chips { display: flex; gap: 6px; }
.hide-play {
  padding: 11px; border-radius: 12px; border: 3px solid #0E0F12; background: linear-gradient(#5ED45F, #2EA83F);
  color: #fff; font-weight: 900; font-size: 20px; letter-spacing: .06em; text-shadow: 0 2px 0 #1B6A26; box-shadow: 0 4px 0 rgba(0, 0, 0, .45);
}
.hide-play:hover { filter: brightness(1.08); }
.hide-tabs { display: flex; gap: 2px; border-bottom: 1px solid rgba(255, 255, 255, .15); }
.hide-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: #B9BCC6; padding: 6px 10px; font-weight: 800; }
.hide-tab.on { color: #fff; border-bottom-color: #E4587A; }
.hide-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.hide-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px;
  border-radius: 10px; border: 2px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #fff;
}
.hide-item .big { font-size: 22px; }
.hide-item .nm { font-size: 11.5px; font-weight: 800; }
.hide-item .price { font-size: 11px; font-weight: 800; color: #FFD35A; }
.hide-item.own .price { color: #7FE0A0; }
.hide-item.on { border-color: #E4587A; background: rgba(228, 88, 122, .2); }
.hide-item.poor { opacity: .5; }
.hide-item:hover { border-color: #E4587A; }
.hide-item .gun { display: flex; height: 22px; border-radius: 6px; overflow: hidden; border: 2px solid #0E0F12; }
.hide-item .gun i { display: block; width: 14px; }
.hide-tip { margin: 0; color: #B9BCC6; font-size: 12px; }

@media (max-width: 759px) {
  .hide-key { width: 50px; height: 50px; }
  .hide-key .l { font-size: 10px; }
  .hide-bar { gap: 5px; }
  .hide-paint { right: 6px; left: 6px; width: auto; top: auto; bottom: 66px; transform: none; padding: 7px; gap: 6px; border-width: 2px; }
  .hp-top { gap: 6px; }
  .hp-wheel, .hp-val { height: 62px; }
  .hp-wheel { width: 62px; }
  .hp-val { width: 11px; }
  .hp-swatch { height: 46px; border-width: 2px; }
  .hp-btn { padding: 3px 2px; border-width: 2px; flex-direction: row; justify-content: center; gap: 4px; }
  .hp-btn small { display: none; }
  .hp-brush { padding: 2px 7px; }
  .hp-dotbox { width: 30px; height: 30px; }
  .hp-recent { min-height: 0; }
  .hp-rc { width: 18px; height: 18px; }
  .hide-intro-card { flex-direction: column; text-align: center; }
  .hide-row { grid-template-columns: 1fr 44px; }
  .hide-row .k { grid-column: 1 / -1; }
  .hide-row .chips { grid-column: 1 / -1; }
}

/* --------------------------------------------------- stick clash (stick) */

.stk-box { position: relative; }
.stk-box:fullscreen { background: #000; align-items: center; justify-content: center; }
.stk-box:fullscreen .loop-canvas { border: 0; border-radius: 0; }
.stk-ui {
  position: absolute; inset: 1px; z-index: 2; pointer-events: none; overflow: hidden; border-radius: 9px;
  color: #EAF0F7; font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.stk-ui > * { pointer-events: auto; }
.stk-ui [hidden] { display: none !important; }
.stk-ui button { font: inherit; cursor: pointer; }

.stk-select {
  position: absolute; inset: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px; background: linear-gradient(rgba(10, 12, 18, .72), rgba(10, 12, 18, .88));
}
/* A short canvas scrolls the panel; nothing in it squeezes into its neighbour. */
.stk-select > * { flex-shrink: 0; }
.stk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stk-title { font-size: 20px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: #FFE070; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); }
.stk-coins { padding: 5px 12px; border-radius: 999px; background: rgba(0, 0, 0, .45); border: 1px solid #F6B32B; font-weight: 900; color: #FFD35A; }
.stk-tabs { display: flex; gap: 6px; }
.stk-tab {
  padding: 6px 14px; border-radius: 8px; border: 2px solid #2A3648; background: rgba(13, 18, 24, .8);
  color: #8494A8; font-weight: 800; font-size: 13px;
}
.stk-tab.on { border-color: #F6B32B; color: #F6B32B; }
.stk-body { display: flex; gap: 14px; align-items: flex-start; min-height: 0; }
.stk-grid { flex: 1 1 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; align-content: start; }
.stk-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 5px 6px;
  border-radius: 10px; border: 2px solid #2A3648; background: #0D1218; color: #EAF0F7;
}
.stk-card canvas { display: block; width: 100%; height: auto; border-radius: 6px; }
.stk-card .nm { font-size: 12px; font-weight: 800; }
.stk-card .price { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .7); color: #FFD35A; font-size: 11px; font-weight: 900; }
.stk-card.locked .nm { color: #8494A8; }
.stk-card:hover { border-color: #5A6B82; }
.stk-card.focus { border-color: #9CC3FF; }
.stk-card.on { border-color: #F6B32B; box-shadow: 0 0 0 2px rgba(246, 179, 43, .35), 0 0 18px rgba(246, 179, 43, .35); }
.stk-info {
  flex: 0 0 210px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px;
  border-radius: 12px; background: rgba(13, 18, 24, .85); border: 1px solid #2A3648;
}
.stk-big { width: 120px; height: auto; border-radius: 8px; }
.stk-info h3 { margin: 0; font-size: 18px; font-weight: 900; text-align: center; }
.stk-info h3 small { display: block; font-size: 11.5px; font-weight: 700; color: #8494A8; letter-spacing: .06em; text-transform: uppercase; }
.stk-stats { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.stk-stat { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800; color: #B9C4D2; }
.stk-stat .bar { display: flex; gap: 3px; }
.stk-stat .bar i { display: block; width: 14px; height: 7px; border-radius: 2px; background: #2A3648; }
.stk-stat .bar i.on { background: #F6B32B; }
.stk-sp { list-style: none; margin: 2px 0 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.stk-sp b { display: inline-block; min-width: 28px; padding: 0 5px; border-radius: 5px; background: #2A3648; color: #FFE070; font-size: 11px; text-align: center; }
.stk-sub { margin: 0; color: #8494A8; font-size: 11.5px; text-align: center; }
.stk-buy {
  width: 100%; padding: 8px; border-radius: 10px; border: 2px solid #1B1C21; background: #F6B32B; color: #0B0F14;
  font-weight: 900; box-shadow: 0 3px 0 rgba(0, 0, 0, .4);
}
.stk-buy:disabled { opacity: .45; cursor: default; }
.stk-ladder { display: flex; gap: 6px; flex-wrap: wrap; }
.stk-rung { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px; border-radius: 8px; border: 2px solid #2A3648; background: #0D1218; font-size: 11px; font-weight: 900; color: #8494A8; }
.stk-rung canvas { display: block; width: 40px; height: auto; border-radius: 5px; }
.stk-rung.done { opacity: .45; }
.stk-rung.done::after { content: '✓'; position: absolute; top: 2px; right: 5px; color: #4CD37A; font-size: 14px; }
.stk-rung.now { border-color: #FF5A4E; color: #FF8A7E; box-shadow: 0 0 14px rgba(255, 90, 78, .45); }
.stk-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: auto; }
/* On a short canvas the grid scrolls under it; Fight! never scrolls away. */
.stk-select .stk-foot { position: sticky; bottom: -14px; margin: 0 -16px -14px; padding: 8px 16px 12px; background: rgba(10, 12, 18, .94); }
.stk-keys { color: #8494A8; font-size: 12px; }
.stk-go {
  padding: 10px 30px; border-radius: 12px; border: 3px solid #1B1C21; background: linear-gradient(#FF6B5A, #D8352A);
  color: #fff; font-weight: 900; font-size: 18px; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .45); text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.stk-go.small { padding: 6px 18px; font-size: 14px; }
.stk-go:hover:not(:disabled) { filter: brightness(1.1); }
.stk-go:disabled { opacity: .45; cursor: default; }

.stk-moves { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(10, 12, 18, .6); }
.stk-card-panel {
  width: min(640px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 14px; background: #121821; border: 1px solid #2A3648; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.stk-moves-body { display: flex; flex-wrap: wrap; gap: 12px; }
.stk-movelist { flex: 1 1 260px; }
.stk-movelist h4 { margin: 0 0 6px; font-size: 15px; font-weight: 900; }
.stk-movelist h4 small { color: #8494A8; font-weight: 700; font-size: 11.5px; }
.stk-rows { display: flex; flex-direction: column; gap: 4px; }
.stk-row { display: grid; grid-template-columns: minmax(92px, auto) 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.stk-row kbd { padding: 2px 7px; border-radius: 6px; border: 1px solid #2A3648; border-bottom-width: 3px; background: #0D1218; color: #FFE070; font: 800 12px system-ui, sans-serif; text-align: center; white-space: nowrap; }

.stk-train { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 10px; background: rgba(10, 12, 18, .7); }
.stk-train .k { font-size: 11px; font-weight: 900; color: #8494A8; text-transform: uppercase; letter-spacing: .06em; margin-right: 2px; }
.stk-chip { padding: 4px 10px; border-radius: 8px; border: 1px solid #2A3648; background: #0D1218; color: #B9C4D2; font-size: 12px; font-weight: 800; }
.stk-chip.on { border-color: #F6B32B; color: #F6B32B; }

.stk-settings { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.stk-settings label { display: inline-flex; align-items: center; gap: 6px; }
.stk-settings input[type=range] { width: 110px; accent-color: var(--accent); }

/* The thumb controls (pad.js): a stick on the left, four buttons on the
   right. Under the canvas on the page. On the whole screen, or a phone on
   its side, view.js puts them in the box: they lie over the bottom of the
   canvas, see-through, sized to the screen's height, and the dummy's chips
   move up out of their way. Above the canvas, below the move list. */
.stk-pad {
  display: flex; align-items: stretch; gap: 12px;
  width: 100%; max-width: 620px; height: 172px; margin: 12px auto 0;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.stk-pad.off { visibility: hidden; }
.stk-zone {
  position: relative; flex: 1 1 auto; overflow: hidden; touch-action: none;
  border-radius: 14px; border: 1px dashed var(--line-2); background: var(--panel);
}
.stk-base {
  position: absolute; left: 50%; top: 50%; width: 116px; height: 116px; margin: -58px 0 0 -58px;
  border-radius: 50%; border: 2px solid rgba(140, 150, 165, .55); background: rgba(140, 150, 165, .16);
  pointer-events: none;
}
.stk-knob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: rgba(140, 150, 165, .55); box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.stk-zone.on .stk-knob { background: var(--accent); }
.stk-btns { flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, 76px); grid-auto-rows: 76px; gap: 10px; align-content: center; }
.stk-b {
  appearance: none; cursor: pointer; font: inherit; font-size: 28px; line-height: 1; padding: 0;
  border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
  touch-action: none; -webkit-tap-highlight-color: transparent;
}
.stk-b.on { background: var(--accent-soft); border-color: var(--accent); }

.loop-box.stk-box > .stk-pad {
  --b: min(72px, 16vh);
  position: absolute; z-index: 1; left: 1px; right: 1px; bottom: 1px; top: auto;
  width: auto; max-width: none; height: calc(var(--b) * 2 + 24px); margin: 0; transform: none; border-radius: 0;
  padding: 0 max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.stk-box > .stk-pad .stk-zone { border: 0; background: transparent; }
.stk-box > .stk-pad .stk-btns { grid-template-columns: repeat(2, var(--b)); grid-auto-rows: var(--b); gap: 8px; }
.stk-box > .stk-pad .stk-b { font-size: calc(var(--b) * .38); border-color: rgba(255, 255, 255, .5); background: rgba(12, 16, 22, .45); color: #fff; }
.stk-box > .stk-pad .stk-b.on { background: rgba(255, 211, 90, .45); }
.stk-box > .stk-pad .stk-base { width: calc(var(--b) * 1.55); height: calc(var(--b) * 1.55); margin: calc(var(--b) * -.775) 0 0 calc(var(--b) * -.775); left: calc(var(--b) * 1.1); }
.stk-box > .stk-pad .stk-knob { width: calc(var(--b) * .68); height: calc(var(--b) * .68); margin: calc(var(--b) * -.34) 0 0 calc(var(--b) * -.34); }
.stk-box:has(> .stk-pad) .stk-train { top: 26%; bottom: auto; }

@media (max-width: 759px) {
  .stk-pad { height: 156px; gap: 10px; }
  .stk-btns { grid-template-columns: repeat(2, 68px); grid-auto-rows: 68px; gap: 9px; }
  .stk-b { font-size: 25px; }
  .stk-base { width: 104px; height: 104px; margin: -52px 0 0 -52px; }
  .stk-knob { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  .stk-select { padding: 10px; gap: 8px; }
  .stk-select .stk-foot { bottom: -10px; margin: 0 -10px -10px; padding: 6px 10px 10px; }
  .stk-title { font-size: 16px; }
  .stk-body { flex-direction: column; align-items: stretch; }
  .stk-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .stk-card { padding: 3px; }
  .stk-card .nm { font-size: 10.5px; }
  .stk-info { flex: none; flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .stk-big { width: 70px; }
  .stk-go { padding: 8px 20px; font-size: 15px; }
  .loop-pad .tpad { font-size: 22px; padding: 16px 0; }
}

/* ------------------------------------------------------ street chef (chef) */
/* The lobby is the game's own card over the street — cream paper and dark
   ink in both themes, like a menu board — so its colours are its own and
   not the page's tokens, as Strike Squad's glass is. */
.chef-box { position: relative; }
.chef-menu {
  position: absolute; inset: 1px; z-index: 2; overflow: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px;
  border-radius: 9px; color: #2A1E14;
  background: rgba(255, 248, 234, .92);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.chef-menu[hidden] { display: none; }
.chef-menu > .chef-top, .chef-menu > .chef-tabs, .chef-menu > .chef-body { width: 100%; max-width: 980px; margin-left: auto; margin-right: auto; }
.chef-menu .muted { color: #7A6552; }
.chef-menu .btn { background: #FFFFFF; border-color: #E2CFAF; color: #2A1E14; }
.chef-menu .btn.primary { background: #F07A26; border-color: #D8631A; color: #FFFFFF; font-weight: 800; }
.chef-menu .btn.sm { padding: 5px 10px; font-size: 12.5px; }
.chef-menu .btn:disabled { opacity: .5; cursor: default; }

.chef-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.chef-rank { display: flex; align-items: center; gap: 10px; }
.chef-rank .badge {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; background: #F07A26; color: #FFFFFF;
  font-weight: 900; font-size: 18px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.chef-rank .who { display: flex; flex-direction: column; gap: 3px; min-width: 140px; }
.chef-rank .xp { display: block; height: 7px; border-radius: 4px; overflow: hidden; background: #EADBC2; }
.chef-rank .xp i { display: block; height: 100%; background: #3DBE74; }
.chef-rank small { color: #7A6552; font-size: 11.5px; }
.chef-purse { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chef-purse .coins, .chef-purse .gems {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  background: #FFFFFF; border: 1px solid #E2CFAF; font-weight: 800; font-variant-numeric: tabular-nums;
}

.chef-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #F3E4C9; }
.chef-tab { flex: 1; background: none; border: 0; border-radius: 9px; padding: 7px 14px; font: inherit; font-weight: 700; color: #7A6552; cursor: pointer; }
.chef-tab.on { background: #FFFFFF; color: #2A1E14; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.chef-body { display: flex; flex-direction: column; gap: 12px; }

/* Seventeen streets: one row that scrolls sideways, the chosen one kept in view. */
.chef-trucks {
  position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.chef-truck {
  flex: 0 0 124px; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
  padding: 6px 4px 8px; border-radius: 12px; background: #FFFFFF; border: 2px solid #EADBC2;
  font: inherit; color: inherit; cursor: pointer;
}
.chef-truck canvas { max-width: 100%; height: auto !important; }
.chef-truck b { font-size: 13px; line-height: 1.2; text-align: center; }
.chef-truck small { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; color: #7A6552; text-align: center; }
.chef-truck small.poor { color: #C0392B; }
.chef-truck small.ok { color: #1E8A4C; font-weight: 700; }
.chef-truck.on { border-color: #F07A26; box-shadow: 0 0 0 2px rgba(240, 122, 38, .25); }
.chef-truck.locked { background: #F6EEDF; }

.chef-levels { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.chef-level {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 52px; padding: 4px 2px; border-radius: 10px; border: 2px solid #EADBC2; background: #FFFFFF;
  font: inherit; color: inherit; cursor: pointer;
}
.chef-level .n { font-weight: 900; font-size: 16px; }
.chef-level .st { font-size: 11px; color: #F2A900; letter-spacing: -1px; }
.chef-level .mk { position: absolute; top: -7px; right: -4px; font-size: 11px; }
.chef-level.next { border-color: #F07A26; background: #FFF1E3; }
.chef-level.locked { background: #F1E7D6; color: #B7A58A; cursor: default; }

.chef-kit { display: flex; flex-direction: column; gap: 6px; }
.chef-kit p { margin: 0; }
.chef-up {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center;
  padding: 6px 10px; border-radius: 12px; background: #FFFFFF; border: 1px solid #EADBC2;
}
.chef-up .what { display: flex; flex-direction: column; min-width: 0; }
.chef-up small { color: #7A6552; font-size: 12px; }
.chef-up .pips { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.chef-up .pips i { width: 9px; height: 9px; border-radius: 50%; background: #EADBC2; }
.chef-up .pips i.on { background: #3DBE74; }
.chef-up .buy { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-weight: 800; }
.chef-max { font-size: 12px; font-weight: 800; color: #1E8A4C; }

/* The level card and the help, over the lobby. */
.chef-layer {
  position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center;
  padding: 12px; background: rgba(42, 30, 20, .45); border-radius: 9px;
}
.chef-layer[hidden] { display: none; }
.chef-card {
  display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; max-height: 100%; overflow: auto;
  padding: 14px 16px; border-radius: 16px; background: #FFFCF5; box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}
.chef-card .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chef-card h3 { margin: 0; font-size: 18px; }
.chef-card p { margin: 0; }
.chef-card .goals { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.chef-card .goals .warn { list-style: none; margin-left: -18px; color: #C0392B; font-weight: 700; }
.chef-card .stars { display: flex; gap: 6px; flex-wrap: wrap; }
.chef-card .stars .line {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px 8px; border-radius: 999px;
  background: #F3E4C9; color: #9A6B00; font-weight: 800; font-size: 13px;
}
.chef-card .stars .line.got { background: #FFE7A3; }
.chef-card .fresh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: #EAF7EE; }
.chef-card .fresh b { width: 100%; font-size: 13px; color: #1E8A4C; }
.chef-card .fresh .dish { display: inline-flex; align-items: center; gap: 6px; }
.chef-card .fresh small { font-size: 12px; }
.chef-card .boosts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.chef-card .boosts b { grid-column: 1 / -1; font-size: 13px; }
.chef-boost {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px;
  border-radius: 12px; border: 2px solid #EADBC2; background: #FFFFFF; font: inherit; color: inherit; cursor: pointer;
}
.chef-boost .ic { font-size: 20px; line-height: 1; }
.chef-boost .nm { font-size: 12px; font-weight: 700; text-align: center; }
.chef-boost small { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; color: #1E8A4C; font-weight: 800; }
.chef-boost.on { border-color: #3DBE74; background: #EAF7EE; }
.chef-boost:disabled { opacity: .45; cursor: default; }
.chef-card.help ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

.chef-toast {
  position: absolute; left: 50%; bottom: 14px; z-index: 4; transform: translateX(-50%); max-width: 90%;
  padding: 8px 14px; border-radius: 999px; background: #2A1E14; color: #FFF8EA;
  font-weight: 700; font-size: 13px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.chef-toast[hidden] { display: none; }
.chef-hint { text-align: center; }
/* On the whole screen the kitchen has the room; the line of help waits for the page. */
.game-host:fullscreen .loop-below:has(> .chef-hint) { display: none; }

/* On a phone the trucks scroll sideways rather than shrink past reading. */
@media (max-width: 759px) {
  .chef-menu { padding: 10px; }
  .chef-truck { flex-basis: 104px; }
  .chef-levels { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .chef-up { grid-template-columns: 40px 1fr auto; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
