:root {
  --ink: #fff4e6;
  --ink-dim: rgba(255, 244, 230, 0.68);
  --ink-faint: rgba(255, 244, 230, 0.4);
  --glass: rgba(23, 18, 42, 0.78);
  --glass-strong: rgba(19, 15, 35, 0.92);
  --line: rgba(255, 244, 230, 0.14);
  --p1: #ff7a59;
  --p2: #3fc8b6;
  --gold: #ffc56b;
  --gold-deep: #f29b4b;
  --well: #b78cff;
  --danger: #ff6b6b;
  --radius: 16px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", system-ui, -apple-system, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1b1733;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }

#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: block;
  touch-action: none;
}

/* ---------- shared pieces ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  background: radial-gradient(ellipse at center, rgba(16, 12, 30, 0.15), rgba(16, 12, 30, 0.55));
}
.panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 22px;
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 24px 60px rgba(8, 5, 20, 0.45);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 700;
}
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 244, 230, 0.08);
  color: var(--ink);
  font: 700 16px/1 var(--font);
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, background 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #2a1a10;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(242, 155, 75, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn.ghost { background: transparent; }
.btn.small { min-height: 44px; font-size: 14px; padding: 0 16px; }
.btn.big { min-height: 54px; font-size: 18px; }
.btn:disabled { opacity: 0.45; }
.link {
  appearance: none;
  background: none;
  border: 0;
  color: var(--ink-faint);
  font: 600 13px var(--font);
  min-height: 36px;
  cursor: pointer;
}
input {
  font: 700 17px var(--font);
  color: var(--ink);
  background: rgba(10, 8, 22, 0.55);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 48px;
  padding: 0 14px;
  width: 100%;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
input:focus { border-color: var(--gold); }
input::placeholder { color: var(--ink-faint); }

/* ---------- home ---------- */
.home-panel {
  width: min(380px, 100%);
  padding: 26px 24px 22px;
  display: grid;
  gap: 12px;
}
.wordmark {
  margin: 0;
  font-size: 52px;
  line-height: 1.05;
  padding-bottom: 0.06em;
  letter-spacing: -0.02em;
  font-weight: 800;
  background: linear-gradient(100deg, var(--p1) 0%, var(--gold) 50%, var(--p2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { margin: 0 0 6px; color: var(--ink-dim); font-size: 14.5px; line-height: 1.4; }
.field { display: grid; gap: 6px; }
.field span { font-size: 12px; color: var(--ink-dim); font-weight: 600; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#create-instead { justify-self: center; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
#code { text-transform: uppercase; letter-spacing: 0.3em; text-align: center; }
.error { margin: 0; color: var(--danger); font-size: 13px; }

.credit { margin: 4px 0 0; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--ink-faint); }
.credit a { color: var(--ink-dim); text-decoration: none; border-bottom: 1px solid var(--line); }

/* ---------- lobby ---------- */
.lobby-panel {
  width: min(560px, 100%);
  padding: 22px;
  display: grid;
  gap: 16px;
  justify-items: stretch;
}
.lobby-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 18px; flex-wrap: wrap; }
.invite { display: grid; gap: 6px; min-width: 0; flex: 1 1 260px; max-width: 360px; }
.invite-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.invite-link {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(10, 8, 22, 0.55);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-user-select: all;
  user-select: all;
}
.invite-row .btn { padding: 0 14px; flex: none; }
.code { font-size: 34px; font-weight: 800; letter-spacing: 0.22em; line-height: 1.1; }
.versus {
  align-self: center;
  color: var(--ink-faint);
  font-weight: 800;
  font-size: 14px;
  min-width: 34px;
  text-align: center;
  white-space: nowrap;
}
.seat {
  --tone: var(--p1);
  position: relative;
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  background: rgba(10, 8, 22, 0.45);
  border: 1px solid var(--line);
  display: grid;
  gap: 6px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.seat[data-seat="1"] { --tone: var(--p2); }
.seat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tone);
  opacity: 0.85;
}
.seat-title b { font-weight: inherit; }
.seat-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--tone);
}
.seat-name { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat.empty .seat-name { color: var(--ink-faint); font-weight: 600; }
.seat-status { font-size: 13px; color: var(--ink-dim); display: flex; align-items: center; gap: 6px; }
.seat-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
}
.seat.is-ready { border-color: var(--tone); box-shadow: 0 0 0 1px var(--tone), 0 0 28px -6px var(--tone); }
.seat.is-ready .seat-status { color: var(--ink); }
.seat.is-ready .seat-status::before { background: var(--tone); box-shadow: 0 0 10px var(--tone); }
.seat.is-away .seat-status::before { background: var(--danger); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.swatches:empty { display: none; }
.swatch {
  appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  padding: 0;
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease;
}
.swatch:active { transform: scale(0.9); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--glass-strong), 0 0 0 4px var(--c); }
.swatch:disabled { opacity: 0.22; cursor: not-allowed; }
.swatch:disabled::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  bottom: 3px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  transform: rotate(45deg);
}
.seat.is-me .seat-name::after { content: " (you)"; font-size: 12px; color: var(--ink-faint); font-weight: 600; }
#ready.is-on { background: rgba(255, 244, 230, 0.1); color: var(--ink); box-shadow: none; border-color: var(--line); }
.note { margin: 0; text-align: center; color: var(--ink-dim); font-size: 13px; }
#leave { justify-self: center; }

/* ---------- hud ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
.topbar {
  position: absolute;
  top: calc(8px + var(--safe-t));
  left: calc(10px + var(--safe-l));
  right: calc(10px + var(--safe-r));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 10px;
  pointer-events: none !important;
}
.center { display: grid; justify-items: center; gap: 4px; }
#turn-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  white-space: nowrap;
}
#turn-label.mine { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #2a1a10; border-color: transparent; }
.clock {
  min-width: 64px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--glass);
  border: 2px solid var(--tone, var(--ink-faint));
  font-weight: 800;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.clock.urgent { color: var(--danger); }
.wind { display: flex; align-items: center; gap: 6px; }
.wind::before {
  content: "Wind";
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-faint);
}
.wind-bar {
  position: relative;
  width: 110px;
  height: 8px;
  border-radius: 6px;
  background: rgba(10, 8, 22, 0.55);
  border: 1px solid var(--line);
  overflow: hidden;
}
.wind-bar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--ink-faint); }
.wind-bar i { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, #9fd8ff, #e2f4ff); }

.controls {
  position: absolute;
  bottom: calc(12px + var(--safe-b));
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.controls.left { left: calc(12px + var(--safe-l)); }
.controls.right { right: calc(22px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); }
.pad {
  appearance: none;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  font: 800 13px var(--font);
  touch-action: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.08s ease, opacity 0.25s ease, background 0.15s ease;
}
.pad svg { width: 26px; height: 26px; }
.pad:active, .pad.down { transform: scale(0.94); background: rgba(255, 244, 230, 0.16); }
.pad.wide { width: auto; min-width: 96px; padding: 0 14px; grid-auto-flow: column; gap: 8px; font-size: 13px; }
.pad.fire {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, var(--gold), var(--gold-deep));
  color: #2a1a10;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 0;
  box-shadow: 0 8px 22px rgba(242, 155, 75, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
#hud.idle .controls { opacity: 0.32; pointer-events: none; }
#hud.counting .pad.fire, #hud.counting #jump { opacity: 0.32; pointer-events: none; }
/* reload: the Fire button refills clockwise as the weapon readies */
.pad.fire.reloading {
  background:
    conic-gradient(rgba(19, 15, 35, 0.72) calc(var(--reload, 0) * 360deg), transparent 0),
    radial-gradient(circle at 50% 35%, var(--gold), var(--gold-deep));
  color: rgba(42, 26, 16, 0.55);
  box-shadow: none;
}
/* ---------- Fire: hold to charge, release to shoot ---------- */
.pad.fire { position: relative; grid-auto-flow: row; gap: 0; align-content: center; overflow: visible; --charge: 0; --heat: var(--gold); }
.fire-icon { display: grid; place-items: center; }
.fire-icon svg { width: 24px; height: 24px; }
.fire-label { font-size: 11px; letter-spacing: 0.1em; line-height: 1; margin-top: 1px; }
.pad.fire::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: conic-gradient(var(--heat) calc(var(--charge) * 360deg), rgba(255, 244, 230, 0.14) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
}
.pad.fire.charging::before { opacity: 1; }
.pad.fire.charging {
  transform: scale(calc(1 + var(--charge) * 0.12));
  box-shadow: 0 0 calc(10px + var(--charge) * 26px) var(--heat), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: none;
}
/* each weapon winds up its own way */
.pad.fire.charging[data-weapon="rocket"] .fire-icon { animation: rumble 0.07s linear infinite; }
.pad.fire.charging[data-weapon="grenade"] .fire-icon { transform: rotate(calc(var(--charge) * -55deg)) translateX(calc(var(--charge) * -3px)); }
.pad.fire.charging[data-weapon="cluster"] .fire-icon { transform: scale(calc(1 + var(--charge) * 0.35)); animation: rumble 0.11s linear infinite; }
.pad.fire.charging[data-weapon="shotgun"] .fire-icon { transform: translateX(-4px) rotate(8deg); }
@keyframes rumble {
  0% { translate: calc(var(--charge) * -2.5px) 0; }
  50% { translate: calc(var(--charge) * 2.5px) calc(var(--charge) * -1px); }
  100% { translate: calc(var(--charge) * -2.5px) 0; }
}
.pad.fire.launch .fire-icon { animation: launch 0.38s ease-out; }
.pad.fire.launch[data-weapon="grenade"] .fire-icon, .pad.fire.launch[data-weapon="cluster"] .fire-icon { animation-name: lob; }
.pad.fire.launch[data-weapon="shotgun"] .fire-icon { animation-name: recoil; }
@keyframes launch { 0% { transform: none; opacity: 1; } 60% { transform: translate(16px, -22px) scale(0.7); opacity: 0; } 61% { transform: translateY(8px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes lob { 0% { transform: none; opacity: 1; } 30% { transform: translate(8px, -16px) rotate(90deg); } 60% { transform: translate(18px, -6px) rotate(200deg) scale(0.6); opacity: 0; } 61% { transform: none; opacity: 0; } 100% { opacity: 1; } }
@keyframes recoil { 0% { transform: translateX(-4px); } 25% { transform: translateX(-9px) rotate(-12deg); } 100% { transform: none; } }

#turn-label.warn { background: rgba(255, 107, 107, 0.18); border-color: var(--danger); color: var(--ink); }
.banner-sub { font-size: 13px; color: var(--ink-dim); margin-top: -4px; }
#hud.idle .hint, #hud.fired .hint { opacity: 0; }
#hud.fired .pad.fire, #hud.fired #weapon { opacity: 0.32; pointer-events: none; }
.hint {
  position: absolute;
  left: 50%;
  bottom: calc(16px + var(--safe-b));
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--ink-dim);
  background: var(--glass);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none !important;
  transition: opacity 0.4s ease;
}
@media (max-width: 640px) and (orientation: portrait) {
  .hint { bottom: calc(96px + var(--safe-b)); }
}

.tray {
  position: absolute;
  right: calc(12px + var(--safe-r));
  bottom: calc(100px + var(--safe-b));
  padding: 10px;
  border-radius: 18px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
  width: 236px;
  box-shadow: 0 18px 40px rgba(8, 5, 20, 0.5);
}
.tray-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tray-item {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 244, 230, 0.05);
  color: var(--ink);
  border-radius: 14px;
  min-height: 66px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  font: 700 12px var(--font);
  position: relative;
  touch-action: manipulation;
}
.tray-item svg { width: 26px; height: 26px; }
.tray-item.on { border-color: var(--gold); background: rgba(255, 197, 107, 0.14); }
.tray-item:disabled { opacity: 0.35; }
.tray-item .ammo { position: absolute; top: 5px; right: 7px; font-size: 10px; color: var(--ink-dim); }

.corner {
  position: absolute;
  top: calc(6px + var(--safe-t));
  right: calc(6px + var(--safe-r));
  display: flex;
  gap: 2px;
}
.mini {
  appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  display: grid;
  place-items: center;
  padding: 0;
  touch-action: manipulation;
}
.mini svg { width: 18px; height: 18px; }

.toast {
  position: absolute;
  left: 50%;
  top: calc(96px + var(--safe-t));
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.toast.top { position: fixed; top: calc(10px + var(--safe-t)); z-index: 20; }

.banner { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(12, 9, 24, 0.45); }
.banner-panel { padding: 24px 28px; display: grid; gap: 10px; justify-items: center; text-align: center; min-width: 260px; }
.banner-title { font-size: 30px; font-weight: 800; }

/* ---------- standings: a ranked board for any number of players ---------- */
.board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-self: start;
  min-width: 0;
  max-width: 210px;
  pointer-events: none;
}
.row {
  --tone: var(--ink-dim);
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 6px;
  border-radius: 9px;
  background: var(--glass);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}
.row .rank { color: var(--ink-faint); font-size: 10px; text-align: center; }
/* each piece has its own column: the rank and the leader's crown share the first, so showing the
   crown never pushes the name into the narrow rank column */
.row .rank, .row .crown { grid-column: 1; grid-row: 1; justify-self: center; }
.row .team-name { grid-column: 2; grid-row: 1; }
.row .team-total { grid-column: 3; grid-row: 1; }
.row .pips { grid-column: 4; grid-row: 1; }
.row .team-name { color: var(--tone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .team-total { font-variant-numeric: tabular-nums; min-width: 26px; text-align: right; }
.row.is-me { border-color: color-mix(in srgb, var(--tone) 60%, transparent); }
.row.out { opacity: 0.45; }
.row.leading { box-shadow: 0 0 0 1px var(--tone), 0 0 16px -6px var(--tone); }
.row .crown { display: none; width: 12px; height: 12px; color: var(--gold); }
.row .crown svg { width: 12px; height: 12px; display: block; }
.row.leading .crown { display: block; }
.row.leading .rank { display: none; }
.pips { display: flex; gap: 3px; }
.pip { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--tone); opacity: 0.45; }
.pip.alive { background: var(--tone); opacity: 1; }

.lead {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  white-space: nowrap;
  color: var(--tone, var(--ink-dim));
}
.lead.pulse { animation: lead-pulse 0.7s ease; }
@keyframes lead-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* one shared bar: a segment per team, sized by its share of all health left */
.tug {
  display: flex;
  width: clamp(150px, 30vw, 300px);
  height: 10px;
  border-radius: 6px;
  background: rgba(10, 8, 22, 0.55);
  border: 1px solid var(--line);
  overflow: hidden;
}
.tug .seg { height: 100%; background: var(--tone); transition: width 0.6s ease; }
.tug .seg + .seg { box-shadow: -1px 0 0 rgba(10, 8, 22, 0.85); }

/* ---------- joystick: walk sideways, push up to jump ---------- */
.stick {
  position: relative;
  width: 112px;
  height: 112px;
  touch-action: none;
  border-radius: 50%;
}
.stick-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 230, 0.04) 0 52%, rgba(255, 244, 230, 0.1) 53% 100%);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
/* a small chevron on top says "push up to jump" */
.stick-ring::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 9px;
  height: 9px;
  margin-left: -5px;
  border-left: 2px solid var(--ink-dim);
  border-top: 2px solid var(--ink-dim);
  transform: rotate(45deg);
}
.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(255, 244, 230, 0.95), rgba(255, 244, 230, 0.62));
  box-shadow: 0 6px 16px rgba(8, 5, 20, 0.45);
  transform: translate(var(--kx, 0px), var(--ky, 0px));
  transition: transform 0.14s ease;
}
.stick.active .stick-knob { transition: none; background: radial-gradient(circle at 50% 35%, var(--gold), var(--gold-deep)); }
.stick.jumped .stick-ring { box-shadow: 0 0 0 2px var(--gold); }

/* ---------- lobby for up to six ---------- */
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.seat { --tone: var(--c, var(--p1)); }
.seat.open { border-style: dashed; background: transparent; }
.seat.open::before { display: none; }
.seat.open .seat-title { color: var(--ink-faint); }
.seat-wins { font-size: 11px; color: var(--ink-faint); font-weight: 700; }
.seat.is-waiting .seat-status::before { background: var(--gold); }
.my-colors { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.my-colors .swatches { margin: 0; }

/* ---------- short landscape phones ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .screen { padding-top: calc(10px + var(--safe-t)); padding-bottom: calc(10px + var(--safe-b)); }
  .home-panel {
    width: min(700px, 100%);
    grid-template-columns: 1fr 1fr;
    column-gap: 28px;
    row-gap: 10px;
    padding: 22px 24px;
    align-items: center;
  }
  .home-panel .eyebrow, .home-panel .wordmark, .home-panel .sub { grid-column: 1; }
  .home-panel .eyebrow { grid-row: 1; align-self: end; }
  .home-panel .wordmark { grid-row: 2; }
  .home-panel .sub { grid-row: 3 / span 2; align-self: start; }
  .home-panel .field { grid-column: 2; grid-row: 1 / span 2; }
  .home-panel #create, .home-panel #join-cta { grid-column: 2; grid-row: 3; }
  .home-panel #create-instead { grid-column: 2; grid-row: 4; }
  .home-panel .or { grid-column: 2; grid-row: 4; }
  .home-panel .join-row { grid-column: 2; grid-row: 5; }
  .home-panel .error { grid-column: 1 / -1; }
  .home-panel .credit { grid-column: 1; grid-row: 5; align-self: center; }
  .wordmark { font-size: 56px; }
  .lobby-panel { padding: 16px 20px; gap: 12px; width: min(620px, 100%); }
  .code { font-size: 28px; }
  .note { display: none; }
  .seat { padding: 8px 10px 8px; gap: 3px; }
  .seats { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 6px; }
  .seat-title b { display: block; }
  .lobby-panel { max-height: 100%; overflow-y: auto; }
  .btn.big { min-height: 46px; }
  .seat-name { font-size: 16px; }
  .stick { width: 100px; height: 100px; }
  .pad { width: 52px; height: 52px; border-radius: 16px; }
  .pad.fire { width: 68px; height: 68px; }
  .tray { bottom: calc(86px + var(--safe-b)); }
}
