/*
 * menu.css — pre-game champion select.
 * Clean, centered "champ select": the champion stands in the middle, a compact
 * name/title sits below, four ability icons reveal their effect on hover, and a
 * pick bar of champions runs along the bottom. Dark glassmorphism + gold accent,
 * each champion's accentColor injected as --accent.
 */

#main-menu {
  position: absolute;
  inset: 0;
  z-index: 50;                 /* above #ui-layer (z-index: 10) and the canvas */
  pointer-events: auto;
  display: flex;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #e6e6ee;
  /* Translucent veil so the live game / map spectate-floats behind the menu. */
  background:
    radial-gradient(78% 86% at 50% 16%, rgba(40, 46, 78, 0.32), rgba(4, 5, 12, 0.80) 72%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  -webkit-user-select: none;
  user-select: none;
}

/* Over a live match — dead and waiting to come back, or paused with Escape.
   Lighter veil in both: the fight behind is still running and still yours to
   watch, and nothing about this screen should read like the safe pre-game
   lobby (a MOBA has no real pause). */
#main-menu.is-respawn,
#main-menu.is-paused {
  background:
    radial-gradient(78% 86% at 50% 16%, rgba(40, 46, 78, 0.22), rgba(4, 5, 12, 0.62) 74%);
}

#main-menu.is-hidden { display: none; }

.menu-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 32px 26px;
  min-height: 0;
}

/* ---------- Top bar / nav ---------- */
.menu-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.menu-brand { font-size: 20px; font-weight: 800; letter-spacing: 2px; color: #f0c040; }
.menu-brand span { color: #e6e6ee; font-weight: 300; margin: 0 2px; }

.menu-nav { display: flex; gap: 6px; }
.menu-tab {
  background: transparent;
  border: 0;
  color: rgba(230, 230, 238, 0.6);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 7px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.menu-tab:hover:not(.is-disabled) { background: rgba(255, 255, 255, 0.06); color: #fff; }
.menu-tab.is-active { background: rgba(240, 192, 64, 0.14); color: #f0c040; }
.menu-tab.is-disabled { opacity: 0.32; cursor: default; }

/* Resume. Sits in the tab row but is deliberately not a tab: it leaves the
   menu rather than switching what is inside it. */
.menu-resume {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  background: rgba(240, 192, 64, 0.16);
  border: 1px solid rgba(240, 192, 64, 0.45);
  color: #f0c040;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.menu-resume:hover { background: rgba(240, 192, 64, 0.26); border-color: rgba(240, 192, 64, 0.7); }
.menu-resume[hidden] { display: none; }

/* Invite friend. Like Resume, an action in the tab row rather than a tab. */
.menu-invite {
  margin-left: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e6e6ee;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.menu-invite:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.35); }
.menu-invite[hidden] { display: none; }
.menu-resume-key {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(230, 230, 238, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---------- Screen container ---------- */
.menu-screens { flex: 1; min-height: 0; }
.menu-screen { display: none; height: 100%; position: relative; }
.menu-screen.is-active { display: flex; flex-direction: column; }

.menu-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(230, 230, 238, 0.4);
}

/* ---------- Settings ---------- */
/* The Settings screen scrolls. It did not, and it outgrew the window: the
   keybind list pushed the last row — Audio, the volume sliders — below the
   bottom edge on anything shorter than ~900px, with no way to reach it. The
   sliders looked deleted. Audio now sits above Controls as well, but the list
   will keep growing, so the screen itself has to be able to scroll. */
.menu-screen[data-screen="settings"].is-active {
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 192, 64, 0.35) transparent;
}
.settings-list {
  width: min(560px, 100%);
  margin: 34px auto 0;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.settings-row {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 8, 18, 0.6);
}
.settings-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #f0c040;
}
.settings-hint {
  font-size: 12px;
  color: rgba(230, 230, 238, 0.5);
  margin-top: 4px;
  line-height: 1.45;
}
.settings-field { display: flex; gap: 8px; margin-top: 12px; }
.settings-field input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  color: #e6e6ee;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.settings-field input:focus { border-color: #f0c040; }
.settings-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #04050c;
  background: #f0c040;
  border: 0;
  border-radius: 9px;
  padding: 10px 18px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.settings-btn:hover { filter: brightness(1.1); }
.settings-btn:active { transform: translateY(1px); }
.settings-btn.is-ghost {
  color: #e6e6ee;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.settings-status {
  min-height: 16px;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(140, 220, 150, 0.9);
}
.settings-status.is-error { color: #ff8a8a; }

/* ---------- Checkbox row ---------- */
.settings-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  cursor: pointer;
}
.settings-check input[type="checkbox"] {
  /* The native control at its default size sits noticeably larger than the rest
     of this panel's type; accent-color keeps the platform widget (and its
     keyboard focus ring) rather than rebuilding one out of divs. */
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #f0c040;
  cursor: pointer;
}
.settings-check-name {
  font-size: 12px;
  color: rgba(230, 230, 238, 0.75);
}

/* ---------- Keybinds ---------- */
.settings-keybinds {
  display: grid;
  /* Two columns where there is room, one where there is not. Ten actions in a
     single column make this the tallest row by far — which is why it sits last
     and the screen scrolls (see .menu-screen[data-screen="settings"]). */
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 18px;
  margin-top: 14px;
}
.settings-keybind {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-keybind-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: rgba(230, 230, 238, 0.75);
}
.settings-keybind-key {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  /* Fixed size so the row does not twitch as the label swaps between a key and
     the listening ellipsis. */
  width: 44px;
  padding: 7px 0;
  text-align: center;
  color: #e6e6ee;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.settings-keybind-key:hover { border-color: rgba(240, 192, 64, 0.6); }
.settings-keybind-key.is-listening {
  color: #04050c;
  background: #f0c040;
  border-color: #f0c040;
}

/* ---------- Volume sliders ---------- */
.settings-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.settings-slider {
  display: grid;
  /* Fixed name and value columns so the three track starts and the three
     readouts line up as two straight edges rather than shuffling as the
     percentages change width. */
  grid-template-columns: 62px 1fr 42px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.settings-slider-name {
  font-size: 12px;
  color: rgba(230, 230, 238, 0.75);
}
.settings-slider-value {
  font-size: 12px;
  text-align: right;
  color: rgba(230, 230, 238, 0.5);
  font-variant-numeric: tabular-nums;
}
.settings-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
  cursor: pointer;
}
.settings-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f0c040;
  border: 0;
  cursor: pointer;
}
.settings-slider input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f0c040;
  border: 0;
  cursor: pointer;
}

/* ---------- Center stage ---------- */
.cs-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
  --accent: #f0c040;
}
.cs-status { color: rgba(230, 230, 238, 0.5); font-size: 15px; }

/* Champion portrait */
.cs-hero {
  position: relative;
  height: 46vh;
  max-height: 420px;
  /* The portrait is the elastic part of this column: everything below it (name,
     abilities, side picker, Enter Battle) is a fixed cost, so the floor here is
     what decides whether they get clipped on a short window. A 720p laptop
     leaves ~628px of viewport and the old 220px floor clipped the buttons — at
     140 the portrait gives way instead, which is the right thing to lose. Only
     binds below ~300px of viewport; tall screens still get the full 46vh. */
  min-height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.6));
}
/* soft glowing platform under the champion */
.cs-hero::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 230px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent), transparent 72%);
  opacity: 0.5;
  filter: blur(3px);
  z-index: -1;
}
.cs-hero img {
  height: 100%;
  width: auto;
  image-rendering: pixelated;     /* crisp upscale of the pixel-art idle frame */
  object-fit: contain;
}
.cs-hero-fallback {
  height: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 92px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(160deg, var(--accent), rgba(8, 8, 18, 0.9));
}

/* Name + title */
.cs-nameblock { text-align: center; margin-top: 2px; }
.cs-name {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.05;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.cs-title { font-size: 14px; color: var(--accent); font-weight: 600; margin-top: 3px; letter-spacing: 0.5px; }
.cs-meta { font-size: 12px; color: rgba(230, 230, 238, 0.5); margin-top: 6px; letter-spacing: 0.4px; }
.cs-meta b { color: rgba(230, 230, 238, 0.8); font-weight: 600; }

/* Ability row */
.cs-abilities { display: flex; gap: 12px; margin-top: 4px; }
.cs-ability {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 8, 18, 0.82);
  overflow: visible;
  cursor: help;
  transition: border-color 0.15s, transform 0.12s;
}
.cs-ability:hover { border-color: var(--accent); transform: translateY(-2px); }
.cs-ability img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}
.cs-ability-key {
  position: absolute;
  bottom: -6px; right: -6px;
  width: 18px; height: 18px;
  border-radius: 5px;
  background: var(--accent);
  color: #04050c;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cs-ability-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 22px; font-weight: 800;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
}

/* Ability hover is the in-game tooltip (#ability-tooltip, in abilities.css) rather
   than a menu-only lookalike — one renderer, so champion select and the HUD
   cannot describe the same ability differently. The .cs-tip rules that used to
   live here went with it. */

/* Enter battle */
.cs-enter {
  margin-top: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #04050c;
  background: var(--accent);
  border: 0;
  border-radius: 11px;
  padding: 13px 46px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  box-shadow: 0 6px 22px -8px var(--accent);
}
.cs-enter:hover { filter: brightness(1.1); }
.cs-enter:active { transform: translateY(1px); }
.cs-enter:disabled { filter: grayscale(0.6) brightness(0.7); cursor: default; }

/* ---------- Side rosters (initial join only) ----------
   Two panels flanking the champion, one per side, so the lobby is legible
   before you commit to it: how many champions are already on it, who they are
   and what they picked. Bots are in that count and in that list, unlabelled —
   they are 15 of the 25 bodies on the field, and a panel that hid them showed
   an empty lobby for a game that was already 15v15.
   Absolutely positioned out of the champ-select column — the
   column is vertically tight and these must not push the portrait or the Enter
   Battle button around as players come and go.

   Each panel is also the pick control for its side, which is the part that
   makes this read like a side select rather than a leaderboard: you click the
   team you want to be on. The strip under the champion stays because Auto has
   no panel of its own to click. */
.cs-teams {
  position: absolute;
  top: 16px;                  /* clear of the nav row sitting just above */
  left: 0;
  right: 0;
  bottom: 108px;              /* clear of the champion pick bar along the bottom */
  display: flex;
  /* Pinned to the top and growing downward. Centred, the two panels slid up and
     down past each other every time somebody joined either side; a fixed height
     fixed that but left a mostly-empty box in a small lobby. Top-aligned costs
     neither. */
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;       /* only the panels themselves are clickable */
  /* .cs-stage is a later positioned sibling, so without this it paints on top —
     invisibly, being transparent, but it still eats every click aimed at a
     panel. The ability tooltip is appended to <body> and carries its own much
     higher z-index, so it clears these regardless. */
  z-index: 2;
}
/* Nothing to choose while dead — you come back on the side you left. */
#main-menu.is-respawn .cs-teams { display: none; }

.cs-teampanel {
  --side: #5aa9ff;
  pointer-events: auto;
  width: clamp(180px, 17vw, 248px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: rgba(8, 8, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.cs-teampanel.is-blue { --side: #5aa9ff; }
.cs-teampanel.is-red  { --side: #ff5d5d; }
.cs-teampanel:hover { border-color: color-mix(in srgb, var(--side) 50%, transparent); }
/* Picked: the side's own colour, matching how the strip below marks itself. */
.cs-teampanel.is-picked {
  background: color-mix(in srgb, var(--side) 12%, rgba(8, 8, 18, 0.82));
  border-color: color-mix(in srgb, var(--side) 62%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--side) 34%, transparent),
              0 10px 30px -12px var(--side);
}
/* Full: still readable, but plainly not an option. */
.cs-teampanel.is-full { cursor: default; opacity: 0.5; }
.cs-teampanel.is-full:hover { border-color: rgba(255, 255, 255, 0.09); }

.tp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--side) 14%, transparent);
  box-shadow: inset 0 2px 0 var(--side);
}
.tp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--side);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--side) 70%, transparent);
  flex: 0 0 auto;
}
.tp-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #fff;
}
.tp-count {
  font-size: 12px;
  font-weight: 700;
  color: rgba(230, 230, 238, 0.45);
  font-variant-numeric: tabular-nums;
}
.tp-count b { color: #fff; font-weight: 800; font-size: 14px; }
.tp-full-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ff8a8a;
  border: 1px solid rgba(255, 138, 138, 0.45);
  border-radius: 5px;
  padding: 2px 5px;
}

/* The player list scrolls rather than growing the panel: a packed 25-a-side
   lobby would otherwise run straight off the top and bottom of the screen. */
.tp-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.tp-list::-webkit-scrollbar { width: 6px; }
.tp-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 3px; }

.tp-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
}
/* Your own row, once you are in — the panels stay live behind the respawn
   overlay's sibling screens, and finding yourself should be instant. */
.tp-row.is-me { background: rgba(240, 192, 64, 0.14); }
.tp-row.is-me .tp-pname { color: #f0c040; }
.tp-pname {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #e6e6ee;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tp-pchamp {
  font-size: 10.5px;
  color: rgba(230, 230, 238, 0.42);
  white-space: nowrap;
}
.tp-empty {
  padding: 14px 8px;
  text-align: center;
  font-size: 11.5px;
  color: rgba(230, 230, 238, 0.32);
}
/* Too narrow to flank the champion without sitting on top of them — the strip
   under the portrait still carries the actual choice. */
@media (max-width: 900px) {
  .cs-teams { display: none; }
}

/* ---------- Side picker (initial join only) ----------
   A segmented control, not three loose buttons: one choice, three states. Each
   segment owns its side colour as --side, so the selected/hover/dot rules are
   written once instead of per team. */
/* The champ-select column is vertically tight — on a 628px viewport the portrait
   is already pinned to its minimum — so this block earns its pixels: a small
   heading, then the strip, and the error positioned OUT OF FLOW so it cannot
   shove Enter Battle down at the moment you reach for it. */
.cs-team { position: relative; margin-top: 2px; text-align: center; }
.cs-team-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(230, 230, 238, 0.4);
  margin-bottom: 6px;
}

/* The strip. Same dark-glass shell as the ability icons so it belongs here. */
.cs-team-row {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(8, 8, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.cs-team-btn {
  --side: #f0c040;
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(230, 230, 238, 0.55);
  background: transparent;
  border: 0;
  border-radius: 9px;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 0.14s, background 0.14s, box-shadow 0.14s;
}
.cs-team-btn.is-blue { --side: #5aa9ff; }
.cs-team-btn.is-red  { --side: #ff5d5d; }

/* Colour dot — the row is readable as "sides" before the labels are read. */
.cs-team-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--side);
  opacity: 0.45;
  box-shadow: 0 0 0 0 var(--side);
  transition: opacity 0.14s, box-shadow 0.14s, transform 0.14s;
}

.cs-team-btn:hover { color: rgba(230, 230, 238, 0.9); background: rgba(255, 255, 255, 0.05); }
.cs-team-btn:hover .cs-team-dot { opacity: 0.85; }

/* Selected: the side's own colour carries it — a tinted seat, a matching rim and
   a lit dot. Deliberately not a solid fill, which fought the gold Enter Battle
   button directly underneath for attention. */
.cs-team-btn.is-selected {
  color: #fff;
  background: color-mix(in srgb, var(--side) 22%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--side) 55%, transparent),
    0 2px 10px color-mix(in srgb, var(--side) 22%, transparent);
}
.cs-team-btn.is-selected .cs-team-dot {
  opacity: 1;
  transform: scale(1.15);
  box-shadow: 0 0 8px 1px var(--side);
}

/* Live headcount on each side's segment. The flanking panels are hidden on a
   narrow window, so the strip has to be enough to make the choice on its own. */
.cs-team-count {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0;
  color: rgba(230, 230, 238, 0.38);
  font-variant-numeric: tabular-nums;
}
.cs-team-btn.is-selected .cs-team-count { color: rgba(255, 255, 255, 0.7); }
.cs-team-btn:disabled { opacity: 0.4; cursor: default; }
.cs-team-btn:disabled:hover { color: rgba(230, 230, 238, 0.55); background: transparent; }

.cs-team-error {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #ff8a8a;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Respawn countdown (replaces Enter Battle while dead) */
.cs-respawn { margin-top: 8px; text-align: center; }
.cs-respawn-count {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.cs-respawn-hint { font-size: 12px; color: rgba(230, 230, 238, 0.55); margin-top: 4px; }

/* ---------- Bottom pick bar ---------- */
.cs-pickbar {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
  justify-content: center;
  padding-top: 16px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.cs-pick {
  --accent: #f0c040;
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 8, 18, 0.82);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s, filter 0.15s;
  filter: grayscale(0.35) brightness(0.8);
}
.cs-pick:hover { transform: translateY(-3px); filter: none; border-color: rgba(255, 255, 255, 0.3); }
.cs-pick.is-selected {
  filter: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 6px 18px rgba(0, 0, 0, 0.5);
}
.cs-pick img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  image-rendering: pixelated;
}
.cs-pick-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(160deg, var(--accent), rgba(8, 8, 18, 0.9));
}

/* ---------- Server browser (servers.js) ----------
   Same dark-glass + gold language as champion select. The list is a table in
   spirit — ten lobbies x five columns is past where colour would help — so it
   leans on alignment and one accent, not on a palette. */
.sv-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 18px 4px 4px;
}

.sv-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.sv-title { font-size: 19px; font-weight: 700; color: #f0f0f6; }
.sv-sub { font-size: 12.5px; color: rgba(230, 230, 238, 0.55); margin-top: 3px; }
.sv-sub code {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
}
.sv-head-actions { display: flex; gap: 8px; }

.sv-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 7px;
  border: 1px solid rgba(240, 192, 64, 0.5);
  background: rgba(240, 192, 64, 0.16);
  color: #f0c040;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.sv-btn:hover:not(:disabled) { background: rgba(240, 192, 64, 0.28); border-color: #f0c040; }
.sv-btn:disabled { opacity: 0.38; cursor: default; }
.sv-btn-ghost {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(230, 230, 238, 0.8);
}
.sv-btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.3);
}

.sv-error {
  font-size: 13px;
  color: #ffd8a8;
  background: rgba(236, 131, 90, 0.16);
  border: 1px solid rgba(236, 131, 90, 0.4);
  border-radius: 7px;
  padding: 9px 13px;
}

.sv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.sv-row {
  display: grid;
  /* lobby | players | status | match | actions */
  grid-template-columns: minmax(150px, 1.4fr) minmax(130px, 1fr) 100px 72px auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.sv-row:not(.sv-row-head):hover { background: rgba(255, 255, 255, 0.045); }
.sv-row-head {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(230, 230, 238, 0.42);
  padding-bottom: 5px;
}
.sv-row-head:hover { background: none; }
/* The lobby you are actually in — the one row you must never lose in the list. */
.sv-row.is-here {
  background: rgba(240, 192, 64, 0.09);
  border-color: rgba(240, 192, 64, 0.32);
}

.sv-row-id { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sv-row-name { font-size: 14.5px; font-weight: 650; color: #f0f0f6; }
.sv-here {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f0c040;
  background: rgba(240, 192, 64, 0.16);
  border-radius: 999px;
  padding: 2px 7px;
}

/* Dot + the Status column's word: state never rides on colour alone. */
.sv-badge { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sv-badge-open { background: #4ec9a0; }
.sv-badge-live { background: #f0c040; }
.sv-badge-full { background: rgba(230, 230, 238, 0.3); }

.sv-row-players { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sv-count { font-size: 14px; font-weight: 650; color: #f0f0f6; font-variant-numeric: tabular-nums; }
.sv-max { font-weight: 400; color: rgba(230, 230, 238, 0.45); }
.sv-bar {
  flex: 1;
  min-width: 34px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.sv-bar-fill { display: block; height: 100%; border-radius: 999px; background: #f0c040; }

.sv-row-state, .sv-row-time {
  font-size: 12.5px;
  color: rgba(230, 230, 238, 0.7);
  font-variant-numeric: tabular-nums;
}
.sv-row-actions { display: flex; gap: 7px; justify-content: flex-end; }

.sv-empty, .sv-foot {
  font-size: 12.5px;
  color: rgba(230, 230, 238, 0.5);
}
.sv-empty { padding: 26px 14px; text-align: center; }
.sv-foot { padding: 2px 4px; }

/* Single dev instance — no list to show, so say what it is instead. */
.sv-single {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 17px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.sv-single-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #4ec9a0;
  flex: none;
}
.sv-single-name {
  font-size: 15px;
  font-weight: 650;
  color: #f0f0f6;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  /* Drop the two narrow numeric columns before the ones that carry identity. */
  .sv-row { grid-template-columns: minmax(120px, 1.3fr) minmax(110px, 1fr) auto; }
  .sv-row-state, .sv-row-time { display: none; }
}

/* ---------- Touch: phones and tablets ----------
   touch.js puts .touch-mode on <body> at script load, before any of these
   screens is shown, so every rule below is scoped to it and a desktop browser
   never matches one. Two tiers:
     - any touch device: sized for a fingertip rather than a cursor (nothing to
       hit under ~44px), and nothing on screen that only a keyboard can answer;
     - a landscape phone (max-height 520px — 360 to 430px tall in practice):
       the desktop column of portrait / name / abilities / side / Enter Battle
       is ~560px tall and cannot fit, so champion select is laid out sideways
       and everything else is tightened. A 1024x768 tablet stays on the
       desktop layout with the bigger targets. */

body.touch-mode #main-menu button,
body.touch-mode #main-menu .cs-pick,
body.touch-mode #main-menu .cs-teampanel {
  -webkit-tap-highlight-color: transparent;
}

/* Notches: in landscape the safe area is on the left and right edges. */
body.touch-mode .menu-shell {
  padding-left: calc(32px + env(safe-area-inset-left, 0px));
  padding-right: calc(32px + env(safe-area-inset-right, 0px));
}

body.touch-mode .menu-nav {
  /* A safety valve, not the plan: if Invite and Resume are both up on a narrow
     phone the row scrolls sideways instead of pushing off the edge. */
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
body.touch-mode .menu-nav::-webkit-scrollbar { display: none; }
body.touch-mode .menu-tab,
body.touch-mode .menu-resume,
body.touch-mode .menu-invite {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
}
/* The Escape chip on Resume: there is no Escape key, the button is the way out. */
body.touch-mode .menu-resume-key { display: none; }

/* Q/W/E/R chips on the champion select abilities name keys this player does
   not have — the on-screen buttons carry icons, not letters. */
body.touch-mode .cs-ability-key { display: none; }
body.touch-mode .cs-ability { cursor: pointer; }
body.touch-mode .cs-team-btn { min-height: 44px; padding: 10px 18px; }
body.touch-mode .cs-enter { min-height: 48px; }

/* Settings: Casting (smart vs indicator) and Controls (keybinds) only mean
   anything with a keyboard. The sticks always aim on press and cast on release. */
body.touch-mode .settings-row.is-keyboard { display: none; }
/* 16px is the size under which iOS Safari zooms the whole page into a focused
   field — and with zooming disabled in the viewport meta, it then never zooms
   back out. */
body.touch-mode .settings-field input { font-size: 16px; }
body.touch-mode .settings-btn { min-height: 44px; }
body.touch-mode .settings-check { min-height: 40px; margin-top: 8px; }
body.touch-mode .settings-check input[type="checkbox"] { width: 22px; height: 22px; }
body.touch-mode .settings-check-name { font-size: 13px; }

/* Sliders: the 4px desktop track is also the hit area, and a thumb cannot land
   on it. The input becomes a tall transparent strip and the visible track is
   drawn by the pseudo-elements instead, so the bar looks the same but the whole
   row height grabs. */
body.touch-mode .settings-slider { grid-template-columns: 62px 1fr 46px; min-height: 40px; }
body.touch-mode .settings-slider input[type="range"] {
  height: 36px;
  background: transparent;
}
body.touch-mode .settings-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
}
body.touch-mode .settings-slider input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
}
body.touch-mode .settings-slider input[type="range"]::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  /* Centres the thumb on a styled track: (track 6 - thumb 26) / 2. */
  margin-top: -10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
body.touch-mode .settings-slider input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Servers */
body.touch-mode .sv-btn { min-height: 40px; padding: 9px 16px; font-size: 14px; }

@media (max-height: 520px) {
  body.touch-mode .menu-shell {
    padding: calc(6px + env(safe-area-inset-top, 0px))
             calc(12px + env(safe-area-inset-right, 0px))
             calc(8px + env(safe-area-inset-bottom, 0px))
             calc(12px + env(safe-area-inset-left, 0px));
  }
  body.touch-mode .menu-topbar { gap: 10px; margin-bottom: 6px; }
  body.touch-mode .menu-brand { font-size: 15px; letter-spacing: 1.5px; flex: 0 0 auto; }
  body.touch-mode .menu-tab,
  body.touch-mode .menu-resume,
  body.touch-mode .menu-invite { min-height: 40px; padding: 8px 13px; font-size: 13px; }
  body.touch-mode .menu-resume,
  body.touch-mode .menu-invite { margin-left: 4px; }

  /* ── Champion select, sideways ──
     Pick grid down the left edge (scrolls once the roster outgrows it), the
     portrait in the left part of the stage, and name / abilities / side /
     Enter Battle stacked beside it — every control above the fold at 360px
     tall instead of three of them below it. */
  body.touch-mode .menu-screen[data-screen="champion-select"].is-active {
    flex-direction: row;
    gap: 12px;
  }
  /* The flanking rosters need ~250px a side; the side strip still carries the
     choice and its live headcounts. (They are already gone under 900px wide;
     this also covers 915-wide phones.) */
  body.touch-mode .cs-teams { display: none; }

  body.touch-mode .cs-pickbar {
    order: -1;
    display: grid;
    grid-template-columns: repeat(2, 56px);
    grid-auto-rows: 56px;
    align-content: start;
    gap: 8px;
    margin: 0;
    padding: 2px 12px 2px 2px;
    border-top: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  body.touch-mode .cs-pickbar::-webkit-scrollbar { display: none; }
  body.touch-mode .cs-pick { width: 56px; height: 56px; }
  /* Sticky hover: a tapped thumbnail keeps :hover until the next tap lands
     elsewhere, and a lifted one reads as "selected". Only .is-selected lifts. */
  body.touch-mode .cs-pick:hover:not(.is-selected) {
    transform: none;
    filter: grayscale(0.35) brightness(0.8);
    border-color: rgba(255, 255, 255, 0.1);
  }

  body.touch-mode .cs-stage {
    min-width: 0;            /* a flex ROW item now: let it shrink to the space left */
    gap: 8px;
    /* The portrait sits absolutely in this gutter, so the column beside it is
       centred in what is left rather than under the portrait. */
    padding-left: 42%;
  }
  body.touch-mode .cs-hero {
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 18px;
    width: 40%;
    height: auto;
    max-height: none;
    min-height: 0;
  }
  body.touch-mode .cs-hero img { max-width: 100%; object-fit: contain; }
  body.touch-mode .cs-hero::after { width: 170px; height: 34px; }
  body.touch-mode .cs-hero-fallback { font-size: 64px; max-width: 100%; }
  /* "Connecting…" / "Select a champion" has no portrait to sit beside, so it
     centres over the whole stage, gutter included. */
  body.touch-mode .cs-stage > .cs-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.touch-mode .cs-name { font-size: 22px; }
  body.touch-mode .cs-title { font-size: 12px; margin-top: 2px; }
  body.touch-mode .cs-meta { font-size: 11px; margin-top: 3px; }
  body.touch-mode .cs-abilities { gap: 8px; margin-top: 0; }
  body.touch-mode .cs-ability { width: 44px; height: 44px; border-radius: 10px; }
  body.touch-mode .cs-ability img,
  body.touch-mode .cs-ability-fallback { border-radius: 10px; }
  body.touch-mode .cs-ability:hover { transform: none; }
  body.touch-mode .cs-team { margin-top: 0; }
  body.touch-mode .cs-team-label { font-size: 9px; margin-bottom: 4px; }
  body.touch-mode .cs-team-btn { padding: 8px 14px; }
  body.touch-mode .cs-enter { margin-top: 10px; padding: 12px 40px; font-size: 14px; }
  body.touch-mode .cs-respawn { margin-top: 4px; }
  body.touch-mode .cs-respawn-count { font-size: 19px; }

  /* ── Settings ── */
  body.touch-mode .settings-list {
    width: min(640px, 100%);
    margin-top: 4px;
    gap: 10px;
  }
  body.touch-mode .settings-row { padding: 10px 14px; }
  body.touch-mode .settings-hint { font-size: 11.5px; line-height: 1.35; }
  body.touch-mode .settings-field { margin-top: 8px; }
  body.touch-mode .settings-field input { padding: 8px 12px; }
  body.touch-mode .settings-sliders { gap: 2px; margin-top: 6px; }
  body.touch-mode .settings-status:empty { min-height: 0; margin-top: 0; }

  /* ── Servers ── */
  body.touch-mode .sv-wrap { padding: 4px 0 0; gap: 8px; }
  body.touch-mode .sv-title { font-size: 16px; }
  body.touch-mode .sv-sub { font-size: 11.5px; }
  body.touch-mode .sv-row { padding: 6px 10px; gap: 10px; }
  body.touch-mode .sv-row-head { padding-bottom: 2px; }
  body.touch-mode .sv-row-name { font-size: 13.5px; }
  body.touch-mode .sv-list { overscroll-behavior: contain; }
  body.touch-mode .sv-foot { font-size: 11px; }

  /* ── Game over ──
     The banner is built with inline styles in menu.js (desktop sizing: a 96px
     title with 12px tracking, ~640px wide). Inline styles only yield to
     !important, so these are the one place that uses it. */
  body.touch-mode #game-over-banner .gob-title { font-size: 56px !important; letter-spacing: 6px !important; }
  body.touch-mode #game-over-banner .gob-sub { font-size: 15px !important; margin-top: 6px !important; text-align: center; padding: 0 16px; }
  body.touch-mode #game-over-banner .gob-restart { font-size: 14px !important; margin-top: 16px !important; }
}


/* ---------- First-join cast mode prompt (settings.js askCastMode) ----------
   Rides on the account dialog's .acct-modal/.acct-dialog shell; only the width
   and the two demo cards are its own. Each card loops a 3.2 s demo: quick cast
   fires on the key press, the indicator mode shows the shape while the key is
   held and the cursor sweeps, and fires on release. */
.acct-dialog.cm-dialog { width: min(640px, 100%); }   /* beats account.css, which loads later */
.cm-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}
.cm-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 12px 14px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.cm-card:hover, .cm-card:focus-visible {
  border-color: #f0c040;
  background: rgba(240, 192, 64, 0.07);
  outline: none;
}
.cm-card:active { transform: translateY(1px); }
.cm-card-name { font-size: 15px; font-weight: 700; color: #f0f0f6; margin-top: 4px; }
.cm-card-text { font-size: 12.5px; line-height: 1.45; color: rgba(230, 230, 238, 0.7); }
.cm-card-tag {
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #f0c040;
  background: rgba(240, 192, 64, 0.12);
  border-radius: 999px;
  padding: 3px 9px;
}

.cm-demo { width: 100%; height: auto; display: block; }
.cm-ground { fill: #142019; stroke: rgba(255, 255, 255, 0.08); }
.cm-champ { fill: #4ec9a0; stroke: #0b2a20; stroke-width: 2; }
.cm-cursor { fill: #fff; stroke: #000; stroke-width: 1; stroke-linejoin: round; }
.cm-shot { fill: #ffb347; stroke: #fff3d6; stroke-width: 1.5; opacity: 0; }
.cm-indicator { fill: rgba(90, 169, 255, 0.22); stroke: #5aa9ff; stroke-width: 1.5; opacity: 0; }
.cm-keycap { fill: #2a2a3c; stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.5; }
.cm-keytext { fill: #f0f0f6; font: 700 15px 'Segoe UI', system-ui, sans-serif; text-anchor: middle; }
.cm-label {
  fill: #f0c040;
  font: 700 11px 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
}
/* SVG transforms: origins are in viewBox units. */
.cm-aim { transform-origin: 40px 80px; }
.cm-cursor-wrap { transform-origin: 160px 80px; }
.cm-key { transform-origin: 25px 25px; }

.cm-demo * { animation-duration: 3.2s; animation-iteration-count: infinite; animation-timing-function: ease-in-out; }

/* Quick cast: aim fixed, the press IS the cast. */
.cm-demo-smart .cm-aim { transform: rotate(-22deg); }
.cm-demo-smart .cm-cursor-wrap { transform: rotate(22deg); }
.cm-demo-smart .cm-key { animation-name: cm-key-tap; }
.cm-demo-smart .cm-keycap { animation-name: cm-keycap-tap; }
.cm-demo-smart .cm-shot { animation-name: cm-shot-quick; animation-timing-function: linear; }
.cm-demo-smart .cm-label-press { animation-name: cm-label-press; }
@keyframes cm-key-tap { 0%, 30%, 40%, 100% { transform: translateY(0); } 32%, 38% { transform: translateY(2px); } }
@keyframes cm-keycap-tap { 0%, 30%, 40%, 100% { fill: #2a2a3c; } 32%, 38% { fill: #f0c040; } }
@keyframes cm-shot-quick {
  0%, 31% { transform: translateX(0); opacity: 0; }
  32% { transform: translateX(0); opacity: 1; }
  52% { transform: translateX(120px); opacity: 1; }
  56%, 100% { transform: translateX(124px); opacity: 0; }
}
@keyframes cm-label-press { 0%, 29%, 55%, 100% { opacity: 0; } 32%, 50% { opacity: 1; } }

/* Indicator: hold shows the shape and lets the aim sweep; release fires. */
.cm-demo-indicator .cm-aim { animation-name: cm-aim-sweep; }
.cm-demo-indicator .cm-cursor-wrap { animation-name: cm-cursor-counter; }
.cm-demo-indicator .cm-key { animation-name: cm-key-hold; }
.cm-demo-indicator .cm-keycap { animation-name: cm-keycap-hold; }
.cm-demo-indicator .cm-indicator { animation-name: cm-indicator-hold; }
.cm-demo-indicator .cm-shot { animation-name: cm-shot-release; animation-timing-function: linear; }
.cm-demo-indicator .cm-label-hold { animation-name: cm-label-hold; }
.cm-demo-indicator .cm-label-release { animation-name: cm-label-release; }
@keyframes cm-aim-sweep { 0%, 18% { transform: rotate(-30deg); } 62%, 100% { transform: rotate(8deg); } }
@keyframes cm-cursor-counter { 0%, 18% { transform: rotate(30deg); } 62%, 100% { transform: rotate(-8deg); } }
@keyframes cm-key-hold { 0%, 13%, 67%, 100% { transform: translateY(0); } 15%, 65% { transform: translateY(2px); } }
@keyframes cm-keycap-hold { 0%, 13%, 67%, 100% { fill: #2a2a3c; } 15%, 65% { fill: #f0c040; } }
@keyframes cm-indicator-hold { 0%, 13%, 67%, 100% { opacity: 0; } 16%, 64% { opacity: 1; } }
@keyframes cm-shot-release {
  0%, 65% { transform: translateX(0); opacity: 0; }
  66% { transform: translateX(0); opacity: 1; }
  86% { transform: translateX(120px); opacity: 1; }
  90%, 100% { transform: translateX(124px); opacity: 0; }
}
@keyframes cm-label-hold { 0%, 13%, 65%, 100% { opacity: 0; } 16%, 62% { opacity: 1; } }
@keyframes cm-label-release { 0%, 64%, 86%, 100% { opacity: 0; } 67%, 82% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .cm-demo * { animation: none !important; }
  .cm-demo .cm-shot, .cm-demo .cm-indicator { opacity: 1; }
}
@media (max-width: 520px) {
  .cm-cards { grid-template-columns: 1fr; }
}

/* Name + sign in, under the cards. */
.cm-extra {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cm-extra [hidden] { display: none !important; }
.cm-name { display: flex; flex-direction: column; gap: 6px; }
.cm-field-label { font-size: 12.5px; font-weight: 600; color: #e6e6ee; }
.cm-field-label em { font-style: normal; font-weight: 400; color: rgba(230, 230, 238, 0.5); }
.cm-name-input {
  font: inherit;
  font-size: 14px;
  color: #f0f0f6;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.cm-name-input::placeholder { color: rgba(230, 230, 238, 0.35); }
.cm-name-input:focus { border-color: #f0c040; }
.cm-signed-in { font-size: 13px; color: rgba(140, 220, 150, 0.95); }
.cm-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: rgba(230, 230, 238, 0.6);
}
.cm-signin {
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #f0c040;
  background: rgba(240, 192, 64, 0.1);
  border: 1px solid rgba(240, 192, 64, 0.35);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}
.cm-signin:hover { background: rgba(240, 192, 64, 0.18); }

/* Selectable cards + Continue + X (popup v3). */
.cm-card { position: relative; }
.cm-card.is-selected {
  border-color: #f0c040;
  background: rgba(240, 192, 64, 0.09);
  box-shadow: 0 0 0 1px #f0c040 inset;
}
.cm-card:hover:not(.is-selected), .cm-card:focus-visible:not(.is-selected) {
  border-color: rgba(240, 192, 64, 0.5);
  background: rgba(255, 255, 255, 0.05);
}
.cm-check {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(4, 5, 12, 0.6);
}
.cm-card.is-selected .cm-check {
  border-color: #f0c040;
  background: #f0c040 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%2304050c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.cm-continue {
  display: block;
  width: 100%;
  margin-top: 18px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #04050c;
  background: #f0c040;
  border: 0;
  border-radius: 11px;
  padding: 15px 20px;
  cursor: pointer;
}
.cm-continue:hover { filter: brightness(1.1); }
.cm-continue:active { transform: translateY(1px); }
.cm-continue:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
