:root {
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;

  /* The token names every game defines, in Spitshooter's palette. The shared
     chrome (/shared/arcade-chrome.css + table-theme.css: icon buttons,
     Settings sheet, rules sheet, toasts) reads these, so it comes out in
     this game's lime-on-deep-blue look without any per-game copy of it. */
  --bg:            #0b1a26;
  --surface-1:     #12303f;
  --surface-2:     #0e2230;
  --border:        #2c6a8a;
  --border-strong: #3d86ab;
  --text:          #ffffff;
  --text-mid:      #d3e6f1;
  --text-muted:    #9fbccd;
  --accent:        #b6ff5a;
  --accent-hover:  #cbff85;
  --on-accent:     #0b2a10;
  --danger:        #ff6b6b;
  --danger-deep:   #4a1f22;
}

html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #111;
  color: white;
  font-family: var(--font-body);
  touch-action: none;
  -webkit-user-select: none; /* iOS Safari / Brave-iOS (all WebKit) only honour the prefixed form */
  user-select: none;
  -webkit-touch-callout: none;          /* no long-press callout (copy / look up / share) */
  -webkit-tap-highlight-color: transparent; /* no grey flash on tap */
  overscroll-behavior: none;            /* no pull-to-refresh / rubber-banding */
}

/* The page is a game, not a document: nothing on it can be selected, dragged
   or long-press-copied — EXCEPT the places a person actually types or copies
   from, which must stay normal or iOS won't even let you put a cursor in the
   name box. (See also the selectstart / contextmenu guards in game.js.) */
input, textarea, .dialog-input {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
canvas, img, svg { -webkit-user-drag: none; user-drag: none; touch-action: none; }

#game-canvas {
  display: none;
  /* Pinned to the top-left of the visible page and sized in exact pixels by
     resizeCanvas() in game.js, so it is never stretched or scrolled and a
     touch lands where it is drawn (100vh on phones is taller than the
     visible area while the browser toolbar shows). */
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: #181818;
}

/* Back-to-games link — same fixed, pill-shaped "return to the hub"
   pattern the other games under games.lightlol.com use, styled to match
   this game's own dark palette (#111/white) rather than their shared
   theme.css. Hidden once the game actually starts — see startLocalGame()
   in game.js — so it's only ever visible on the lobby/waiting screens. */
.back-home-link {
  position: fixed;
  top: 16px;
  left: 16px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  background: #222;
  border: 1px solid #444;
  z-index: 20;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.back-home-link:hover {
  background: #333;
  border-color: #666;
}

/* ============================================================
   LOBBY
============================================================ */

#lobby-screen, #waiting-screen, #runover-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, #1d4a66 0%, #0b1a26 70%);
  z-index: 10;
  gap: 16px;
}

.game-title {
  font-family: var(--font-display);
  font-size: 56px;
  letter-spacing: 4px;
  margin: 0 0 24px;
  color: #b6ff5a;
  text-shadow: 0 3px 0 #2f7a12, 0 0 18px rgba(130,255,70,0.45);
}

#name-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#name-section label {
  opacity: 0.7;
  font-size: 14px;
}

input[type="text"] {
  font-size: 20px;
  padding: 10px 16px;
  border: 2px solid #555;
  border-radius: 14px;
  background: #222;
  color: white;
  text-align: center;
  outline: none;
  width: 180px;
}

input[type="text"]:focus {
  border-color: #aaa;
}

#join-code {
  text-transform: uppercase;
  letter-spacing: 4px;
}

#lobby-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#join-section {
  display: flex;
  gap: 8px;
  align-items: center;
}

button {
  font-size: 20px;
  padding: 12px 28px;
  border: 0;
  border-radius: 10px;
  background: #b6ff5a;
  color: #0b2a10;
  cursor: pointer;
  font-weight: bold;
}

button:active { transform: scale(0.96); }

/* ── Custom dialog modal — replaces the browser's native alert()/
   confirm()/prompt(), which render as bare "games.lightlol.com says..."
   OS dialogs. One overlay reused for all three via showDialog() in
   game.js (see that function for how message/buttons/input get filled
   in and how it resolves) — showAlert()/showConfirm() are thin wrappers
   around it, and the invite-link fallback uses it directly with the
   readonly input shown. */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
}
.dialog-box {
  background: #1c1c1c;
  border: 1px solid #444;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  width: 88%;
  max-width: 340px;
}
.dialog-message { margin: 0 0 16px; color: #fff; line-height: 1.4; font-size: 15px; }
.dialog-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #555;
  background: #111;
  color: #fff;
  font-size: 14px;
  text-align: center;
}
.dialog-actions { display: flex; gap: 10px; justify-content: center; }
.dialog-btn {
  font-size: 15px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: bold;
}
.dialog-btn.primary { background: #5cbf5c; color: #111; }
.dialog-btn.secondary { background: #333; color: #fff; }

#btn-start {
  background: #5cbf5c;
  color: white;
}

.error-msg {
  color: #ff6b6b;
  font-size: 14px;
  min-height: 20px;
}

/* ============================================================
   CHARACTER SELECT
============================================================ */

#appearance-section {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 14px 18px;
}

#appearance-preview {
  width: 96px;
  height: 96px;
  background: radial-gradient(circle at center, #2c6a8a 0%, #12303f 75%);
  border-radius: 8px;
  flex-shrink: 0;
}

#appearance-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

#color-pickers {
  display: flex;
  gap: 14px;
}

#color-pickers label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.8;
}

#color-pickers input[type="color"] {
  width: 34px;
  height: 28px;
  padding: 0;
  border: 1px solid #444;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

@media (max-width: 480px) {
  #appearance-section { flex-direction: column; }
}

/* ============================================================
   WAITING ROOM
============================================================ */

/* Same card layout every other game's waiting room uses
   (.auth-page > .auth-card > .room-code-heading + .auth-form), in
   Spitshooter's colours. The icon row under the heading
   (.lobby-hint-row / .tbl-icon-btn) comes from /shared/arcade-chrome.css. */
#waiting-screen.auth-page {
  justify-content: flex-start;
  padding: 5.5rem 1rem 2rem;
  gap: 1.25rem;
  overflow-y: auto;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
  background: rgba(10, 26, 38, 0.82);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem 1.75rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.room-code-heading {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
}
#room-code-display { color: #b6ff5a; letter-spacing: 6px; }
.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }
.auth-form > button { width: 100%; }

#player-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
#player-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 14px;
}
#player-list .p-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#player-list .p-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
}
#player-list .p-tag.muted { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }

.hint {
  color: var(--text-mid);
  font-size: 13px;
  text-align: center;
  margin: 0;
}
.hint.small { font-size: 12px; color: var(--text-muted); }

@media (max-width: 480px) {
  .auth-card { padding: 1.5rem 1.1rem; }
}

/* ============================================================
   DEATH PANEL (spectating) + RUN OVER
============================================================ */

/* Sits over the top edge of the canvas without blocking the view — the
   card itself is opaque enough to read but the rest of the screen stays
   interactive-free (pointer-events: none) so it never eats the settings
   gear or the canvas below. Faded in by game.js after the fall animation
   (see the "playerDied" handler) via the .show class. */
#death-screen {
  position: fixed;
  /* Below the HUD's floor label and zoom control (both live in the top
     ~100px of the canvas, centered) rather than on top of them. */
  top: 112px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  max-width: min(92vw, 520px);
}
#death-screen.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.death-card {
  pointer-events: auto;
  background: rgba(14, 14, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px 18px 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}
.death-title {
  font-size: 26px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #f0d5d5;
}
.death-sub {
  font-size: 13px;
  color: #bbb;
}
.death-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 2px 0;
}
.death-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 54px;
}
.death-stat .v {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
}
.death-stat .k {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #888;
}
.death-items {
  font-size: 12px;
  color: #9fc9ff;
  max-width: 460px;
}
.death-items:empty { display: none; }
.death-spectate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.death-btn {
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #2a2a33;
  color: #fff;
  border: 1px solid #555;
}
.death-btn:hover { background: #3a3a45; }
.death-hint {
  font-size: 11px;
  color: #777;
}

/* ── Death recap: the black screen after the zoom + iris ── */
#death-recap {
  position: fixed; inset: 0;
  z-index: 15;               /* above the canvas and the small spectate card, below the settings gear (20) */
  background: #000;
  align-items: center; justify-content: center;
  padding: 16px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#death-recap.show { opacity: 1; }
.recap-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  max-width: min(92vw, 560px);
  text-align: center;
  transform: translateY(10px);
  transition: transform 0.35s ease;
}
#death-recap.show .recap-card { transform: translateY(0); }
.recap-title { font-size: 34px; font-weight: bold; letter-spacing: 2px; color: #f0d5d5; }
.recap-sub { font-size: 15px; color: #bbb; }
.recap-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 26px; margin: 10px 0 4px; }
.recap-stats .death-stat { min-width: 76px; }
.recap-stats .death-stat .v { font-size: 34px; }
.recap-stats .death-stat .k { font-size: 11px; }
.recap-items { font-size: 13px; color: #9fc9ff; }
.recap-items:empty { display: none; }
.recap-btn {
  margin-top: 8px;
  font-size: 16px; font-weight: bold;
  padding: 10px 26px; border-radius: 999px;
  background: #2a2a33; color: #fff; border: 1px solid #666;
  cursor: pointer;
}
.recap-btn:hover, .recap-btn:focus-visible { background: #3a3a45; border-color: #aaa; outline: none; }
.recap-hint { font-size: 12px; color: #777; }
@media (prefers-reduced-motion: reduce) {
  #death-recap, .recap-card { transition: none; }
}

/* Controls section in Settings: the volume slider */
.ctl-volume { width: 100%; accent-color: var(--tbl-accent, #3a8dff); margin: 2px 0 6px; }
.ctl-volume-label { margin-top: 0.9rem; }

#runover-screen h2 {
  font-size: 40px;
  margin: 0 0 4px;
  text-align: center;
  padding: 0 16px;
}
.runover-floor {
  font-size: 16px;
  color: #bbb;
  margin-bottom: 12px;
}
/* The won ending: warm title, the story in a narrow column above the stats */
#runover-screen.won h2 { color: #ffd98a; text-shadow: 0 0 18px rgba(255, 200, 100, 0.35); }
.runover-ending {
  max-width: 520px;
  margin: 4px 16px 14px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.5;
  color: #e9e4d6;
  background: rgba(255, 230, 180, 0.06);
  border: 1px solid rgba(255, 220, 160, 0.18);
  border-radius: 12px;
  text-align: left;
}
.runover-ending p { margin: 0 0 8px; }
.runover-ending p:last-child { margin-bottom: 0; font-style: italic; color: #ffd98a; }
.runover-table {
  display: grid;
  grid-template-columns: auto repeat(5, minmax(56px, auto));
  gap: 6px 22px;
  align-items: center;
  margin-bottom: 20px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  max-width: 92vw;
  overflow-x: auto;
}
.runover-table .h {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #888;
}
.runover-table .n {
  font-weight: bold;
  text-align: left;
}
.runover-table .c {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Portrait used to be flat-out blocked here (a #rotate-warning overlay
   forced via @media (orientation: portrait)). Removed — the game now
   renders correctly at any aspect ratio (see draw()'s letterboxed
   uniform scale in game.js), so there was nothing left worth blocking. */


/* ── Face picker (lobby) — one small button per blob face ───────────── */
#face-buttons {
  display: flex;
  gap: 6px;
}
.face-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.face-btn.selected { border-color: #b6ff5a; background: rgba(182,255,90,0.15); }
.face-btn canvas { width: 44px; height: 44px; }

/* ============================================================
   ROTATE HINT — brief "turn your phone sideways" nudge
============================================================ */
#rotate-hint {
  position: fixed;
  left: 50%;
  top: 140px;
  transform: translate(-50%, -8px);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;   /* left:50% would otherwise cap the width at half the screen */
  max-width: 88vw;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(10, 26, 38, 0.92);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;   /* never intercepts a game touch */
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#rotate-hint.show { opacity: 1; transform: translate(-50%, 0); }
.rotate-phone {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--accent);
  animation: rotatePhone 2.4s ease-in-out infinite;
}
/* upright -> on its side -> hold -> back */
@keyframes rotatePhone {
  0%, 15%   { transform: rotate(0deg); }
  45%, 70%  { transform: rotate(-90deg); }
  100%      { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) { .rotate-phone { animation: none; } }


/* ── Settings sheet: "Your Build" (stats + backpack) and the item pop-up ── */
/* A little wider than the card games' sheet so the stat grid and a 4-wide
   backpack fit comfortably. */
#tbl-settings-modal .tbl-modal-sheet { max-width: 440px; }

.build-wrap { display: flex; flex-direction: column; gap: 0.6rem; font-family: var(--font-display); }
.build-sub { margin-top: 0.6rem; }
.build-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.build-stat {
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: 0.5rem 0.7rem; border-radius: 14px;
  background: rgba(127, 127, 160, 0.14);
  border: 1px solid var(--tbl-panel-border);
}
.build-stat-label { font-size: 0.68rem; color: var(--tbl-text-muted); letter-spacing: 0.04em; font-weight: 600; }
.build-stat-value { font-size: 1.05rem; font-weight: 700; color: var(--tbl-text); display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.build-stat-value.muted { color: var(--tbl-text-muted); font-weight: 600; font-size: 0.9rem; }
.build-stat-bonus { font-size: 0.72rem; font-weight: 700; }
.build-stat-bonus.up   { color: #2fb463; }
.build-stat-bonus.down { color: #e0554f; }
.build-power {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.55rem 0.9rem; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 210, 74, 0.28), rgba(255, 122, 217, 0.22));
  border: 1.5px solid rgba(255, 210, 74, 0.6);
}
.build-power-value { font-size: 1.3rem; font-weight: 700; color: var(--tbl-text); }
.build-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.build-chip {
  font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.65rem; border-radius: 999px;
  background: rgba(127, 127, 160, 0.18); border: 1px solid var(--tbl-panel-border); color: var(--tbl-text);
}
.build-defense { opacity: 0.85; }

.build-bag { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.build-tile, .build-slot {
  position: relative; aspect-ratio: 1 / 1; min-height: 0;
  border-radius: 18px; border: 2px solid var(--tbl-panel-border);
  background: rgba(127, 127, 160, 0.14);
}
.build-slot { border-style: dashed; background: transparent; opacity: 0.55; }
.build-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  padding: 0.3rem; cursor: pointer; color: var(--tbl-text); font-family: var(--font-display);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.build-tile:hover, .build-tile:focus-visible { border-color: var(--tbl-accent); transform: scale(1.04); outline: none; }
.build-tile:active { transform: scale(0.96); }
.build-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  font-size: 1.05rem; font-weight: 700; color: #1a1420;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 0 0 2px rgba(255, 255, 255, 0.55);
}
.build-icon.big { width: 3.2rem; height: 3.2rem; font-size: 1.6rem; flex: none; }
.build-tile-name { font-size: 0.62rem; font-weight: 700; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.build-badge {
  position: absolute; top: -6px; right: -6px; font-size: 0.62rem; font-weight: 700;
  padding: 0.1rem 0.4rem; border-radius: 999px; background: #ffd24a; color: #5c4400; border: 1.5px solid #fff;
}

.item-popup-backdrop {
  position: fixed; inset: 0; z-index: 520;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(10, 6, 20, 0.6);
}
.item-popup-card {
  width: 100%; max-width: 340px; max-height: 85vh; overflow-y: auto;
  padding: 1.1rem 1.1rem 1rem; border-radius: 22px;
  background: var(--tbl-panel-bg); border: 2px solid var(--tbl-panel-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  color: var(--tbl-text); font-family: var(--font-display);
  display: flex; flex-direction: column; gap: 0.7rem;
}
.item-popup-head { display: flex; align-items: center; gap: 0.8rem; }
.item-popup-name { font-size: 1.25rem; font-weight: 700; line-height: 1.15; }
.item-popup-kind { font-size: 0.7rem; color: var(--tbl-text-muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.item-popup-name.red { color: #ff4d4d; text-shadow: 0 0 10px rgba(255, 60, 60, 0.35); }
.item-popup-kind.red { color: #ff7a7a; }
.item-popup-flavor { margin: 0; font-size: 0.85rem; line-height: 1.4; font-style: italic; color: #ff8a8a; font-family: var(--font-body); }
.item-popup-desc { margin: 0; font-size: 0.9rem; line-height: 1.4; color: var(--tbl-text-mid, var(--tbl-text)); font-family: var(--font-body); }
.item-popup-lines {
  list-style: none; margin: 0; padding: 0.6rem 0.8rem; border-radius: 14px;
  background: rgba(20, 12, 36, 0.78); display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.95rem; font-weight: 700;
}
.item-popup-close { margin-top: 0.2rem; }


/* ── Room code + invite pills (top of the Settings sheet) ── */
.room-pills { display: flex; gap: 0.5rem; align-items: stretch; }
.room-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.6rem; padding: 0.35rem 0.95rem; border-radius: 999px;
  border: 2px solid var(--tbl-panel-border); background: rgba(127, 127, 160, 0.16);
  color: var(--tbl-text); font-family: var(--font-display); font-weight: 700; cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease, background 0.12s ease;
}
.room-pill:hover, .room-pill:focus-visible { border-color: var(--tbl-accent); outline: none; }
.room-pill:active { transform: scale(0.97); }
.room-pill-code { flex: 1 1 auto; justify-content: space-between; }
.room-pill-share { flex: 0 0 auto; }
.room-pill-label { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tbl-text-muted); }
.room-pill-code-text { font-size: 1.25rem; letter-spacing: 0.18em; color: var(--tbl-text); margin-right: auto; margin-left: 0.2rem; }
.room-pill-icon { display: inline-flex; color: var(--tbl-accent); }
.room-pill-share .room-pill-label { color: var(--tbl-text); font-size: 0.8rem; }
.room-pill.done { border-color: #2fb463; }
.room-pill.done .room-pill-label, .room-pill.done .room-pill-icon { color: #2fb463; }

/* "How to Play" is intuitive here, so it sits near the bottom of the Settings
   sheet, just above Leave Game. The sheet body is a flex column, so `order`
   moves it without touching the shared menu code. */
#tbl-settings-body > .tbl-settings-slot-howto  { order: 10; }
#tbl-settings-body > .tbl-settings-slot-leave  { order: 11; }
#tbl-settings-body > .tbl-settings-slot-signin { order: 12; }


/* ── Wordless, ominous stat bars (Settings → Your stats) ── */
.stat-bars { display: flex; flex-direction: column; gap: 0.7rem; padding: 0.2rem 0 0.1rem; }
.bar-row { display: flex; align-items: center; gap: 0.7rem; }
.bar-icon { flex: none; width: 1.7rem; height: 1.7rem; padding: 0.17rem; color: #8a5fd0; opacity: 0.9; transition: color 0.3s ease, filter 0.3s ease; }
.bar-row.up   .bar-icon { color: #e46bff; filter: drop-shadow(0 0 5px rgba(228, 107, 255, 0.7)); }
.bar-row.down .bar-icon { color: #c4455f; }
.bar-row.big .bar-icon { padding: 0; }

.bar-track {
  position: relative; flex: 1 1 auto; height: 1.05rem; border-radius: 999px; overflow: hidden;
  background:
    repeating-linear-gradient(100deg, transparent 0 10px, rgba(140, 80, 220, 0.09) 10px 11px),
    linear-gradient(180deg, #07040d, #140b22);
  background-size: 22px 100%, 100% 100%;
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.85), inset 0 -1px 0 rgba(180, 120, 255, 0.12), 0 0 0 1.5px rgba(150, 90, 230, 0.3);
  animation: bar-drift 14s linear infinite;
}
.bar-row.big .bar-track { height: 1.45rem; }
.bar-base, .bar-extra, .bar-lack { position: absolute; top: 0; bottom: 0; width: var(--w, 0%); animation: bar-grow 0.9s cubic-bezier(.2, .8, .2, 1) both; }
.bar-base {
  left: 0; border-radius: 999px 0 0 999px;
  background: linear-gradient(180deg, #5b2f99, #2a1450);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
/* Where a boost lives: hot, glowing, breathing. */
.bar-extra {
  background: linear-gradient(90deg, #b13bff, #ff3d8b 70%, #ffb36b);
  box-shadow: 0 0 14px rgba(255, 61, 139, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  border-radius: 0 999px 999px 0;
  animation: bar-grow 0.9s cubic-bezier(.2, .8, .2, 1) both, bar-breathe 2.6s ease-in-out 0.9s infinite;
}
.bar-row.big .bar-extra { animation: bar-grow 0.9s cubic-bezier(.2, .8, .2, 1) both, bar-breathe 1.7s ease-in-out 0.9s infinite; }
/* What a nerf took away: a dark red hatched gap. */
.bar-lack {
  background: repeating-linear-gradient(135deg, rgba(190, 40, 70, 0.55) 0 4px, rgba(60, 10, 25, 0.8) 4px 8px);
  border-radius: 0 999px 999px 0;
}
/* The starting character's mark. */
.bar-notch {
  position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: #efe4c8; box-shadow: 0 0 6px rgba(239, 228, 200, 0.85); opacity: 0.9;
}
.bar-row.locked .bar-icon { color: #4b4160; filter: none; }
.bar-row.locked .bar-track {
  background: repeating-linear-gradient(135deg, rgba(120, 90, 170, 0.14) 0 6px, rgba(10, 6, 18, 0.9) 6px 12px);
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.85), 0 0 0 1.5px rgba(120, 90, 170, 0.18);
  animation: none;
}
@keyframes bar-grow    { from { width: 0; } }
@keyframes bar-breathe { 0%, 100% { filter: brightness(0.9) saturate(1); } 50% { filter: brightness(1.35) saturate(1.25); } }
@keyframes bar-drift   { to { background-position: 22px 0, 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .bar-track, .bar-base, .bar-extra, .bar-lack, .bar-row.big .bar-extra { animation: none; }
}

/* Settings → TV camera (only while the room is on a TV): a 2-column grid of
   the same buttons the shared choice row uses, so seven fit on a phone. */
.tv-cam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.tv-cam-grid .tbl-settings-btn { flex: none; margin-top: 0; }
