/*
 * style.css — everything the player reads, in the game's own materials.
 *
 * LOBBOTS uses graphite panels, cool accent lighting and crisp typography. Nothing here is generic, because a menu that would look the
 * same over a white page tells the player they are configuring software
 * rather than playing something (hub CLAUDE.md §2). Three consequences run
 * through the file:
 *
 *   THE FIELD SHOWS THROUGH. Every panel is translucent over a blur. The
 *   canvas is the whole window and sits under all of this, so the hillside
 *   you are about to shell is visible behind the shop you are shopping in.
 *
 *   PLAYER COLOUR IS DATA. js/ui.js writes the custom property --c onto a
 *   row, a card or the HUD; every rule below reads var(--c) and no rule
 *   names a team colour. Ten palettes, one stylesheet.
 *
 *   NO WEB FONTS, NO EMOJI. The headings are a condensed system stack with
 *   a real fallback, the weapon icons are painted onto a canvas by ui.js,
 *   and the currency mark is an inline SVG nut. An emoji is a font somebody
 *   else chose, and it is a different picture on every platform.
 *
 * Two layout rules are load-bearing rather than decorative, both from hub §2:
 * every label shares one gutter width so controls line up down the panel, and
 * a group of equal choices is sized `flex: 1 1 0` so the equal options look
 * equal. The landscape-phone block at the bottom is the third — see its own
 * comment.
 */

/* ===================== palette and metrics ===================== */

:root {
  /* ARCHITECTURE §12: the renderer, the icons and the manifest share these. */
  --plate: #15181e;
  --panel: #1e232b;
  --edge: #3a414d;
  --text: #eef0f4;
  --muted: #9aa3b2;
  --accent: #a7d9e8;
  --danger: #ff4b3e;
  --ok: #4fd66b;
  --coolant: #3fe0e0;

  /* The player colour of whatever this element belongs to. ui.js overrides
     it per row, per seat, per HUD; ice blue is the house colour when nobody
     owns the element. */
  --c: var(--accent);

  --head: "Arial Narrow", "Helvetica Neue Condensed", "Roboto Condensed",
    "Liberation Sans Narrow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    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);

  /* Comfortable for a finger; a tablet is the common case. */
  --tap: 44px;
  /* The corner's footprint: three plates, two 6px gaps, 8px off the edge.
     Everything that must stay clear of it reads these, so they follow --tap
     down on a sideways phone without a second number to keep in step. */
  --corner-w: calc(3 * var(--tap) + 12px + 8px);
  --corner-h: calc(var(--tap) + 8px);

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--plate);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

/*
 * This is a game, not a document. On a tablet a resting thumb is a long
 * press and a drag across the HUD is a text selection, so iPad Safari keeps
 * highlighting labels and offering Copy / Look Up mid-aim. Nothing selects
 * and nothing opens a callout, except a real text field (the seat names).
 * `manipulation` drops double-tap-to-zoom without taking pinch away.
 * js/touch-guard.js is the second half: CSS alone is not honoured
 * everywhere (hub CLAUDE.md §2, "a game is not a document").
 */
html,
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* The battlefield. touch-action:none because js/input.js reads a drag here as
   angle and power, and a browser that decides the same gesture is a scroll
   takes the aim with it. */
#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  background: #0f1626;
  outline: none;
}

/*
 * The overlay layer. Padded by the safe-area insets, which also pulls every
 * absolutely positioned screen inside them: an absolute child is laid out
 * against its container's PADDING box, so nothing below needs to know a notch
 * exists.
 */
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
}
#ui > * {
  pointer-events: auto;
}

/* ===================== type ===================== */

h1,
h2 {
  margin: 0;
  font-family: var(--head);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  line-height: 1;
}
h1 {
  font-size: clamp(34px, 9vw, 54px);
  color: var(--text);
  /* A restrained highlight separates the title from the dark panel. */
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.6),
    0 0 26px rgba(167, 217, 232, 0.25);
}
h2 {
  font-size: clamp(20px, 5vw, 27px);
}

.kicker {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.tagline {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.blurb {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  min-height: 1.35em;
}

/* ===================== panels ===================== */

/*
 * One plate, riveted at the corners, with the field visible through it. The
 * four radial gradients are the rivets; the linear one is the brushed metal.
 */
.panel {
  position: relative;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background:
    radial-gradient(circle at 11px 11px, rgba(255, 255, 255, 0.17) 0 1.4px, transparent 2.3px),
    radial-gradient(circle at calc(100% - 11px) 11px, rgba(255, 255, 255, 0.17) 0 1.4px, transparent 2.3px),
    radial-gradient(circle at 11px calc(100% - 11px), rgba(255, 255, 255, 0.13) 0 1.4px, transparent 2.3px),
    radial-gradient(circle at calc(100% - 11px) calc(100% - 11px), rgba(255, 255, 255, 0.13) 0 1.4px, transparent 2.3px),
    linear-gradient(168deg, rgba(46, 53, 65, 0.88), rgba(24, 28, 35, 0.93) 55%, rgba(17, 19, 24, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 22px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(9px) saturate(1.1);
  -webkit-backdrop-filter: blur(9px) saturate(1.1);
}

/* Fine illuminated seam along each panel. Decorative and aria-hidden. */
.plate-strip {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  border-radius: 13px 13px 0 0;
  background: linear-gradient(90deg, transparent, #bad9e8a0 35%, #e4f4fa 50%, #bad9e8a0 65%, transparent);
  opacity: 0.85;
}

/*
 * Screens are centred plates. They are a flex column whose ONE scrolling
 * child is the list inside them (the roster, the shop rows, the standings):
 * the panel itself never grows past the viewport, so the way out is never
 * the thing that falls off the bottom.
 */
.screen {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, calc(100% - 20px));
  max-height: calc(100% - 20px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px 16px;
  overflow: auto;
  overscroll-behavior: contain;
}

.screen-head {
  text-align: center;
}
.screen-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* A list that scrolls inside the panel rather than stretching it. */
.rows {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 2px;
}
.rows::-webkit-scrollbar,
#seats::-webkit-scrollbar,
#weapons::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.rows::-webkit-scrollbar-thumb,
#seats::-webkit-scrollbar-thumb,
#weapons::-webkit-scrollbar-thumb {
  background: var(--edge);
  border-radius: 8px;
}

/* ===================== controls ===================== */

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button:disabled {
  cursor: not-allowed;
}

/* The big one. An illuminated control with a hard shadow under it, so it
   physically depresses when pressed. */
.primary {
  width: 100%;
  min-height: 54px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #e2eff5, #9dbfce);
  color: #15181e;
  font-family: var(--head);
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  box-shadow:
    0 5px 0 #486679,
    0 14px 28px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.06s,
    box-shadow 0.06s,
    filter 0.15s;
}
.primary:hover {
  filter: brightness(1.06);
}
.primary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #486679;
}

.ghost {
  min-height: var(--tap);
  padding: 8px 14px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: rgba(21, 24, 30, 0.6);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

/*
 * A cluster of quiet buttons — quit, exit — capped so that when the others
 * are conditionally hidden the last survivor does not stretch across the
 * whole panel (hub §2).
 */
.menu-tools {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.menu-tools > * {
  flex: 1 1 0;
  min-width: 0;
}

/*
 * THE WAY BACK TO THE ARCADE — one button in every cabinet (hub §2,
 * 2026-10-11). The same object on the setup screen, in the pause menu and on
 * the final table: last in its column and the column's full width, a little
 * more room above it than between the rows it follows, the lab's quiet ghost
 * plate rather than the lit primary — leaving is never the recommended
 * action — and the shared back arrow, stroked like the corner glyphs, before
 * sentence-case words. (`display: flex` here is safe against [hidden]: the
 * global rule at the top of this file carries !important.)
 */
.exit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.exit-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* One gutter for every row, so every control starts at the same x. */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.label {
  flex: 0 0 72px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/*
 * Segmented rows: real buttons where exactly one carries aria-pressed. Never
 * a <select> — an OS dropdown belongs to no game — and `flex: 1 1 0` rather
 * than `1 1 auto`, so "Mayhem" and "Quick" come out the same size instead of
 * telling the player the short one matters less.
 */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.seg button {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--tap);
  padding: 6px 10px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(21, 24, 30, 0.72);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  transition:
    background 0.14s,
    box-shadow 0.14s,
    color 0.14s;
}
.seg button:hover {
  background: rgba(58, 65, 77, 0.8);
}
.seg button[aria-pressed="true"] {
  background: linear-gradient(180deg, #e2eff5, #a7cbdc);
  border-color: transparent;
  color: #15181e;
  font-weight: 800;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 4px 16px rgba(167, 217, 232, 0.22);
}
.seg button:disabled {
  opacity: 0.35;
}
/* Norwegian builds long single words ("Snikskytter", "Kaosgopheren") that a
   pill cannot wrap at a space. Hyphenate where the browser knows bokmål, and
   break anywhere rather than spill out of the pill where it does not. */
.seg button {
  overflow-wrap: anywhere;
  hyphens: auto;
}

/*
 * The language row (hub §2, "Two languages"): two equal pills, Norsk first,
 * each a flag and its endonym. The flags are kitchens' drawings to the path;
 * the pill around them is this game's own. Both copies — setup and pause —
 * share these rules.
 */
.seg-lang button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.seg-lang .flag {
  flex: 0 0 auto;
  height: 14px;
  width: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

/* Seven personalities want to wrap and still look like seven equals, which a
   wrapping flex row cannot do and an auto-fit grid does exactly. */
.seg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 6px;
}
.seg-grid button {
  min-height: 38px;
  font-size: 12px;
}

/* Round pills: the HUD's − / + and the roster's fewer / more. */
.pill {
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 10px;
  border: 1px solid var(--edge);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(58, 65, 77, 0.85), rgba(24, 28, 35, 0.9));
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pill:active {
  transform: translateY(1px);
}
.pill:disabled {
  opacity: 0.3;
}

/* Text and number fields. A bare input is another OS control; this one is a
   slot milled into the plate. */
.field {
  min-height: var(--tap);
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(10, 12, 16, 0.75);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}
.field::placeholder {
  color: rgba(154, 163, 178, 0.6);
}
.field.num {
  width: 100px;
  flex: 0 0 auto;
  -moz-appearance: textfield;
  appearance: textfield;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.field.num::-webkit-outer-spin-button,
.field.num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/*
 * The volume slider. Both vendor pseudo-elements are written out because
 * there is no shared selector for them: the track is a cut channel, the thumb
 * a silver shuttle.
 */
.slider {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  min-width: 0;
}
.slider input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  touch-action: pan-y;
}
.slider input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 999px;
}
.slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, #0c0e12, #232833);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}
.slider input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, #0c0e12, #232833);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 26px;
  margin-top: -10px;
  border-radius: 5px;
  border: 1px solid #486679;
  background: linear-gradient(180deg, #e2eff5, #9dbfce);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid #486679;
  background: linear-gradient(180deg, #e2eff5, #9dbfce);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.slider output {
  flex: 0 0 44px;
  text-align: right;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* The colour chip a player wears, wherever they are named. */
.swatch {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 4px;
  background: var(--c);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(255, 255, 255, 0.12);
}

/* ===================== setup ===================== */

#logo {
  /* Slightly loosened, because condensed caps at this size read as one word
     otherwise. */
  letter-spacing: 0.12em;
}

.setup-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#roster {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
}
.roster-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.roster-head .label {
  flex: 0 0 auto;
}
#seat-count {
  font-family: var(--head);
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.seat-tools {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* The roster scrolls inside its own box: ten seat cards is more than any
   phone has, and DEPLOY must never be the thing that goes off the bottom. */
#seats {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: min(42vh, 330px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.seat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--c);
  border-radius: 10px;
  background: rgba(30, 35, 43, 0.55);
}
.seat-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.swatch-btn {
  flex: 0 0 auto;
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: rgba(10, 12, 16, 0.7);
}
.swatch-btn:hover {
  border-color: var(--c);
}
.swatch-btn .swatch {
  width: 20px;
  height: 20px;
}
.seat-name {
  flex: 1 1 70px;
}
.seg-kind {
  flex: 0 0 120px;
}
.seg-kind button {
  min-height: var(--tap);
  font-size: 12px;
  padding: 4px 6px;
}
/* The seven bot styles, fenced off from the seat's own header above them. */
.seg-pers {
  padding-top: 6px;
  border-top: 1px dashed rgba(58, 65, 77, 0.9);
}
.pers-blurb {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

/* UPDATE READY. Owned by js/update.js; it only ever toggles [hidden]. */
#update {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  background: rgba(167, 217, 232, 0.1);
  color: var(--text);
  text-align: center;
}
#update:hover {
  background: rgba(167, 217, 232, 0.18);
}
.update-title {
  display: block;
  font-family: var(--head);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.update-sub {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

#build {
  margin: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(154, 163, 178, 0.6);
}

/* ===================== HUD ===================== */

/*
 * Two strips, and they are pointer-transparent except where there is a
 * control: the field underneath is what a drag aims with, so the HUD gives
 * back every pixel it is not actually using.
 */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#hud-top,
#hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  pointer-events: none;
}
/* Only the bottom strip holds controls; nothing in the top one is tappable,
   so the whole of it stays a place you can start a drag. */
#hud-bottom > * {
  pointer-events: auto;
}

#hud-top {
  top: 0;
  /* Room on the right for #corner's three plates, which float above this
     strip — the HUD gave the corner up to them (hub §2, 2026-10-11). */
  padding: 8px calc(var(--corner-w) + 6px) 10px 10px;
  align-items: center;
  flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(15, 17, 22, 0.85), rgba(15, 17, 22, 0));
}

#turn-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 9px;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--c);
  border-radius: 9px;
  background: rgba(21, 24, 30, 0.78);
  max-width: 46vw;
}
#turn-name {
  font-family: var(--head);
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#turn-think {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  animation: think 1.6s ease-in-out infinite;
}
@keyframes think {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

#hp {
  display: flex;
  align-items: center;
  gap: 7px;
}
#hp-bar {
  position: relative;
  width: 116px;
  height: 15px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: rgba(10, 12, 16, 0.85);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
}
#hp-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  background: linear-gradient(180deg, #86e79a, var(--ok));
  transition: width 0.2s linear;
}
#hp-bar.mid #hp-fill {
  background: linear-gradient(180deg, #d7eff7, var(--accent));
}
#hp-bar.low #hp-fill {
  background: linear-gradient(180deg, #ff7a70, var(--danger));
}
#hp-shield {
  position: absolute;
  left: 0;
  top: 0;
  height: 4px;
  background: var(--coolant);
  box-shadow: 0 0 8px rgba(63, 224, 224, 0.7);
}
#hp-text {
  font-family: var(--head);
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 30px;
}

#round-text {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The wind: number, then an arrow as long and as bright as the wind is
   strong, pointing where it blows. ui.js flips the row for a westerly so the
   head is always on the outside. */
#wind {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(21, 24, 30, 0.7);
}
#wind.west {
  flex-direction: row-reverse;
}
#wind-num {
  font-family: var(--head);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
#wind.calm #wind-num {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
#wind-arrow {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--accent);
}
#wind.west #wind-arrow {
  flex-direction: row-reverse;
}
#wind.calm #wind-arrow {
  display: none;
}
#wind-bar {
  display: block;
  height: 3px;
  width: 10px;
  border-radius: 2px;
  background: currentColor;
}
#wind-head {
  font-size: 12px;
  line-height: 1;
}

#shot-timer {
  margin-left: auto;
  font-family: var(--head);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
/* The one tappable thing in the top strip, and only while no human is
   standing: there is nothing to aim then, so the drag area is not missed. */
#skip-btn {
  margin-left: auto;
  pointer-events: auto;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: rgba(21, 24, 30, 0.85);
  color: var(--accent);
  font-family: var(--head);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
#skip-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#skip-btn[hidden] {
  display: none;
}
#shot-timer.urgent {
  color: var(--danger);
  animation: urgent 0.8s steps(2) infinite;
}
@keyframes urgent {
  50% {
    opacity: 0.35;
  }
}

/* ---- the bottom strip: angle, power, loadout, FIRE ---- */

#hud-bottom {
  bottom: 0;
  padding: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  background: linear-gradient(0deg, rgba(15, 17, 22, 0.9), rgba(15, 17, 22, 0));
  transition: opacity 0.18s;
}
#hud-bottom.locked {
  opacity: 0.42;
}

.dials {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  pointer-events: auto;
}
.dial {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: rgba(21, 24, 30, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.dial-read {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  min-width: 58px;
  line-height: 1;
}
.dial-read b {
  font-family: var(--head);
  font-size: 23px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.dial-unit {
  font-size: 13px;
  color: var(--muted);
}
/* Power has nothing to say while Move is selected (ui.js applyLock). */
.dial.off {
  opacity: 0.35;
}
.dial-label {
  flex: 0 0 100%;
  margin-top: 4px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

#weapons {
  flex: 1 1 240px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
  pointer-events: auto;
}
.weapon {
  flex: 0 0 66px;
  width: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 3px 4px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: rgba(21, 24, 30, 0.8);
}
.weapon .wicon {
  width: 30px;
  height: 30px;
  pointer-events: none;
}
.w-name {
  max-width: 100%;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.w-ammo {
  font-family: var(--head);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.weapon[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(167, 217, 232, 0.16);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.weapon[aria-pressed="true"] .w-name {
  color: var(--text);
}

#fire-btn {
  flex: 0 0 auto;
  min-width: 118px;
  min-height: 62px;
  margin-left: auto;
  padding: 10px 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #e2eff5, #9dbfce);
  color: #15181e;
  font-family: var(--head);
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  box-shadow:
    0 5px 0 #486679,
    0 12px 26px rgba(0, 0, 0, 0.5);
  transition:
    transform 0.06s,
    box-shadow 0.06s;
}
#fire-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #486679;
}
#fire-btn:disabled {
  filter: grayscale(0.7);
}

/* ===================== scoreboard ===================== */

.sb-row {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) minmax(0, 1.3fr) minmax(0, 1.1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--c);
  border-radius: 9px;
  background: rgba(30, 35, 43, 0.6);
}
.sb-who {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sb-who b {
  font-size: 14px;
}
.sb-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.sb-money {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.earned {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--head);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}
.earned .plus {
  color: var(--ok);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.chip {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(154, 163, 178, 0.14);
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

.cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 42px;
}
.cell b {
  font-family: var(--head);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.cell i {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tag.standing {
  color: var(--ok);
  background: rgba(79, 214, 107, 0.14);
}
.tag.wrecked {
  color: var(--danger);
  background: rgba(255, 75, 62, 0.16);
}
.tag.won {
  color: var(--accent);
  background: rgba(167, 217, 232, 0.16);
}

/* The currency mark and its number. */
.bolts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bolt {
  width: 12px;
  height: 12px;
  fill: var(--accent);
  flex: 0 0 auto;
}
.bolts b {
  font-variant-numeric: tabular-nums;
}
.bolts i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ===================== the parts counter ===================== */

.shop-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
#shop-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
#shop-title .swatch {
  width: 18px;
  height: 18px;
}
#shop-money {
  font-family: var(--head);
  font-size: 22px;
  font-weight: 800;
}
#shop-money .bolt {
  width: 16px;
  height: 16px;
}
.bot-line {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--accent);
  min-height: 1.3em;
}

.shop-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(30, 35, 43, 0.6);
}
.shop-row .wicon {
  width: 38px;
  height: 38px;
}
.shop-row.held {
  border-color: rgba(167, 217, 232, 0.45);
}
.shop-row.poor {
  opacity: 0.55;
}
.sr-main {
  min-width: 0;
}
.sr-name {
  display: block;
  font-size: 14px;
}
.sr-desc {
  display: block;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--muted);
}
.sr-buy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 104px;
}
.sr-buy .bolts b {
  font-family: var(--head);
  font-size: 16px;
  font-weight: 800;
}
.sr-pack,
.sr-owned {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.sr-owned {
  color: var(--accent);
}
.buy {
  margin-top: 3px;
  min-height: 38px;
  padding: 4px 16px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #e2eff5, #9dbfce);
  color: #15181e;
  font-family: var(--head);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.buy:disabled {
  background: none;
  border: 1px solid var(--edge);
  color: var(--muted);
}

/* ===================== match over ===================== */

.mo-row {
  display: grid;
  grid-template-columns: 28px 16px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--c);
  border-radius: 9px;
  background: rgba(30, 35, 43, 0.6);
}
.mo-row.first {
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(167, 217, 232, 0.18);
}
.place {
  font-family: var(--head);
  font-size: 22px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}
.mo-row.first .place {
  color: var(--accent);
}
.mo-name {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mo-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ===================== pause ===================== */

.pause-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===================== the corner ===================== */

#corner {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 6;
}
.icon-button {
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  border: 1px solid var(--edge);
  border-radius: 11px;
  background: rgba(21, 24, 30, 0.75);
  color: var(--text);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.icon-button[hidden] {
  /* The trap the hub names: display:grid above outranks the [hidden] hint. */
  display: none;
}
.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* aria-pressed picks the picture, so the icon and the label can never
   disagree about which way the toggle is pointing. */
.icon-button .icon-on {
  display: none;
}
.icon-button[aria-pressed="true"] .icon-off {
  display: none;
}
.icon-button[aria-pressed="true"] .icon-on {
  display: inline;
}
.icon-button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===================== the callout ===================== */

#callout {
  position: absolute;
  left: 50%;
  top: 21%;
  transform: translate(-50%, -8px);
  min-width: min(300px, 80vw);
  max-width: min(520px, 92vw);
  padding: 12px 24px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: rgba(17, 19, 24, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}
#callout.up {
  opacity: 1;
  transform: translate(-50%, 0);
}
#callout-title {
  margin: 0;
  font-family: var(--head);
  font-size: clamp(20px, 5.5vw, 30px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
#callout-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ===================== the opening sting ===================== */

/*
 * js/intro.js, a canvas the script creates and removes. Over everything in
 * the game, the corner plates and the panels included, because it is a
 * curtain: for its three seconds nothing under it is meant to be reachable,
 * and a tap anywhere on it is the skip. Under the crash bar alone, so a boot
 * failure is still read rather than hidden behind the hill.
 */
#intro {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 900;
  touch-action: none;
  cursor: pointer;
}

/* ===================== the crash bar ===================== */

#crash {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  padding: 10px 14px calc(10px + var(--safe-b));
  background: var(--danger);
  color: #1a0805;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

/* ===================== narrow phones ===================== */

@media (max-width: 460px) {
  .screen {
    width: calc(100% - 16px);
    max-height: calc(100% - 16px);
    padding: 16px 12px 12px;
    gap: 8px;
  }
  .label {
    flex-basis: 60px;
    font-size: 10px;
    letter-spacing: 0.12em;
  }
  .seg button {
    font-size: 12px;
    padding: 6px 6px;
  }
  .seg-kind {
    flex-basis: 104px;
  }
  .primary {
    min-height: 50px;
    font-size: 18px;
  }

  /* The loadout moves above the dials: it is the widest thing down here and
     the one that wants a full row to itself. */
  #weapons {
    order: -1;
    flex: 1 1 100%;
  }
  #hud-bottom {
    padding: 8px;
    gap: 8px;
  }
  #fire-btn {
    min-width: 96px;
    min-height: 58px;
    font-size: 20px;
  }
  .dial-read {
    min-width: 48px;
  }
  .dial-read b {
    font-size: 20px;
  }
  #hud-top {
    padding: 6px calc(var(--corner-w) + 4px) 8px 8px;
    gap: 7px;
  }
  #hp-bar {
    width: 84px;
  }
  #turn-chip {
    max-width: 40vw;
  }

  /* Three columns of statistics do not fit across a phone; one card each. */
  .sb-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .sb-money {
    align-items: flex-start;
  }
  .chips {
    justify-content: flex-start;
  }
  .mo-row {
    grid-template-columns: 24px 14px minmax(0, 1fr);
  }
  .mo-stats {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .shop-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .shop-row .wicon {
    width: 34px;
    height: 34px;
  }
  .sr-buy {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
  }
  .buy {
    margin-top: 0;
  }
}

/* ================ landscape phones: the panels turn sideways ================
   A phone on its side is 300–430px tall and a browser toolbar can take fifty
   of those, so a column that fits a portrait phone with room to spare runs
   off the bottom sideways — and what goes off the bottom is whatever is last
   in the column, which here is DEPLOY and the way back to the arcade. What a
   sideways phone has instead is width, so the two tall screens become
   two-column grids laid over the existing markup BY AREA: nothing moves in
   index.html and portrait is untouched. maxgear is the reference and this is
   its shape. A tablet is taller than 500px whichever way up and keeps the
   stacked layout.

   The last thirty pixels are bought back from control heights, and they stop
   at 38: this query fires on a phone, where a finger is still the pointer.
   .screen keeps `overflow: auto` behind all of it as a safety net on very
   short viewports — but a safety net is not a plan. */
@media (orientation: landscape) and (max-height: 500px) {
  :root {
    --tap: 38px;
  }
  .screen {
    width: min(780px, calc(100% - 16px));
    max-height: calc(100% - 12px);
    padding: 12px 14px 10px;
    gap: 8px;
  }
  h1 {
    font-size: clamp(22px, 5vh, 32px);
  }
  h2 {
    font-size: clamp(16px, 4vh, 22px);
  }
  .tagline {
    font-size: 11px;
    margin-top: 2px;
  }
  .primary {
    min-height: 44px;
    font-size: 17px;
  }

  /* ---- Setup: title, rules and PLAY down the left; the roster takes the
       right column and scrolls inside itself. (The language headed that
       column for a day; it lives in the menu panel only now.) ---- */
  #setup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-areas:
      "head roster"
      "opts roster"
      "go   roster"
      "foot online";
    align-content: center;
    align-content: safe center;
    gap: 8px 16px;
  }
  #setup .screen-head {
    grid-area: head;
  }
  #setup .setup-opts {
    grid-area: opts;
  }
  #setup #roster {
    grid-area: roster;
    min-height: 0;
  }
  #setup #deploy {
    grid-area: go;
    align-self: center;
  }
  /* The doors' column ends PLAY, then the way out — the hub's one button,
   * last in its column (2026-10-11). Play online, which used to share that
   * last row with it, takes the foot of the roster column instead: the left
   * column was already the whole height of a sideways phone, and the roster
   * is the one thing here that scrolls inside itself and can give a row up. */
  #setup .screen-foot {
    grid-area: foot;
    align-self: end;
  }
  #setup #online-row {
    grid-area: online;
    align-self: end;
    max-width: none;
  }
  #setup #exit-btn {
    margin-top: 0;
  }
  #seats {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
  }
  .seg-grid {
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  }
  .seg-grid button {
    min-height: 34px;
    font-size: 11px;
  }

  /* ---- Pause: the panel is short enough that standing the volume beside the
       buttons is the whole fix ---- */
  #pause {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "head opts"
      "go   opts"
      "tools opts"
      "exit opts";
    align-content: center;
    align-content: safe center;
    align-items: center;
    gap: 8px 18px;
  }
  #pause .screen-head {
    grid-area: head;
  }
  #pause .pause-opts {
    grid-area: opts;
  }
  #pause #resume-btn {
    grid-area: go;
  }
  #pause .menu-tools {
    grid-area: tools;
  }
  /* The way out is the last thing in the left column, under Quit match. */
  #exit-btn-pause {
    grid-area: exit;
    margin-top: 2px;
  }

  /* ---- The HUD gives the field back as much height as it can ----
   * ONE row, always. Wrapping put FIRE on a second line and doubled the strip
   * to 40% of a 375px screen, and the renderer now fits the battlefield ABOVE
   * this strip (main.js syncInsets), so every pixel of strip height is a
   * pixel of hill lost. The loadout lane shrinks and scrolls sideways inside
   * itself instead; the dials and FIRE keep their size, because those are
   * the controls a thumb is reaching for every turn. (2026-10-02, after the
   * owner: "lobbots looks horrible on mobile landscape".) */
  #hud-bottom {
    padding: 6px 8px;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
  }
  .dials {
    gap: 6px;
  }
  .dial {
    padding: 3px;
    gap: 3px;
  }
  .dial-read {
    min-width: 44px;
  }
  #weapons {
    flex: 1 1 0;
    min-width: 0;
  }

  /* ---- The parts counter: two columns of compact rows ----
   * Stacked, a row is price over pack over BUY and only two fit on screen.
   * In a line, and two abreast, a whole shelf of the arsenal does. */
  #shop-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .shop-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 5px 7px;
  }
  .shop-row .wicon {
    width: 30px;
    height: 30px;
  }
  .sr-desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sr-buy {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .buy {
    margin-top: 0;
    min-height: 38px;
  }
  .shop-head {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
}
/* Two abreast on the narrowest sideways phones leaves a description three
 * letters and an ellipsis, which says nothing and looks broken. The name gets
 * the room instead, and the pack size goes too (it is on the button's row
 * once bought, as "owned"); both are still there upright. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 760px) {
  .sr-desc,
  .sr-pack {
    display: none;
  }
  .sr-name {
    line-height: 1.15;
  }
  #fire-btn {
    min-height: 52px;
    min-width: 104px;
    font-size: 20px;
  }
  .weapon {
    flex-basis: 58px;
    width: 58px;
  }
  .weapon .wicon {
    width: 26px;
    height: 26px;
  }
  .dial-read b {
    font-size: 19px;
  }
  #hud-top {
    padding: 5px calc(var(--corner-w) + 4px) 8px 8px;
  }
  #callout {
    top: 14%;
    padding: 8px 18px;
  }
}

/* Robotics lab finish: graphite, frosted silver and restrained lighting. */
.panel {
  border-color: #63738380;
  background: radial-gradient(ellipse at 0 0, #46677838, transparent 65%),
    linear-gradient(145deg, #24323eef, #141e29f5 60%, #101923f7);
  box-shadow: inset 0 1px #cedbe52b, inset 0 -1px #0008,
    0 28px 90px #040a12b3, 0 0 70px #6babc210;
}

.screen:not([hidden]) {
  animation: panel-arrive 280ms ease-out both;
}

@keyframes panel-arrive {
  from {
    opacity: 0;
    margin-top: 12px;
  }
  to {
    opacity: 1;
    margin-top: 0;
  }
}

.plate-strip {
  height: 1px;
  opacity: 0.65;
}

#logo {
  letter-spacing: -0.04em;
  font-weight: 700;
  font-style: normal;
  font-size: clamp(42px, 8vw, 70px);
  text-shadow: 0 2px 24px #b3dceb12;
}

#logo span {
  color: var(--accent);
}

.hangar-kicker {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: #a8bec8;
  font-size: 9px;
}

.hangar-kicker i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #86edcb;
  box-shadow: 0 0 9px #86edcb;
  animation: beacon 3s ease-in-out infinite;
}

@keyframes beacon {
  50% {
    opacity: 0.4;
  }
}

.tagline {
  color: #b7c6ce;
}

.hangar-art {
  position: relative;
  margin-top: 18px;
  border-block: 1px solid #96b9c52b;
  background: repeating-linear-gradient(0deg, transparent 0 27px, #91bcc707 27px 28px), repeating-linear-gradient(90deg, transparent 0 27px, #91bcc707 27px 28px);
}

#hero-mech {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 10px #0004);
}

.hangar-index {
  position: absolute;
  top: 14px;
  left: 10px;
  font: 10px monospace;
  letter-spacing: 2px;
  color: #a6bac7;
}

.hangar-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 12px;
  text-transform: uppercase;
  font: 8px monospace;
  letter-spacing: 1px;
  color: #8ca3b2;
}

.hangar-caption b {
  color: #8ce5be;
  font-weight: 400;
}

.hangar-art::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 25%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b9f5e52b, transparent);
  animation: hangar-scan 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hangar-scan {
  50% {
    transform: translateY(100px);
    opacity: 0.2;
  }
}

.seat {
  background: linear-gradient(110deg, color-mix(in srgb, var(--c) 8%, #1a2733), #17222ddd);
  border-color: #718b9e38;
  border-left-color: color-mix(in srgb, var(--c) 60%, #263547);
  box-shadow: inset 0 1px #ffffff08, 0 3px 7px #0002;
  transition: border-color 160ms, background 160ms;
}

.seat:hover, .seat:focus-within {
  border-top-color: #9aafc36b;
  background-color: #2c3d49;
}

.swatch-btn {
  width: 66px;
  height: 54px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--c) 18%, #152330), #101924);
  border-color: color-mix(in srgb, var(--c) 35%, #344557);
  overflow: hidden;
}

.mech-portrait {
  width: 72px;
  height: 54px;
  transition: transform 180ms;
  pointer-events: none;
}

.swatch-btn:hover .mech-portrait {
  transform: translateY(-2px) rotate(-3deg);
}

.seat-name {
  background: #080f1766;
  border-color: #8197a326;
  box-shadow: inset 0 2px 5px #0003;
}

.seg button {
  border-color: #607a8d4d;
  background: linear-gradient(#293948aa, #15202bcc);
  box-shadow: inset 0 1px #ffffff06;
}

.seg button[aria-pressed="true"] {
  background: linear-gradient(#d5e6f0, #aac9d9);
  box-shadow: inset 0 1px #fff9, 0 1px 0 #4f6c82, 0 4px 12px #9dd5ec12;
}

.seg-pers button[aria-pressed="true"], .seg-kind button[aria-pressed="true"] {
  color: #eaf3f7;
  background: linear-gradient(#496071, #304454);
  border-color: #9cb3c080;
  box-shadow: inset 0 1px #ffffff20, 0 2px #080f16;
}

button {
  transition: filter 140ms, transform 140ms, border-color 140ms, box-shadow 140ms;
}

button:active:not(:disabled) {
  transform: translateY(2px);
  filter: brightness(0.93);
}

.primary, #fire-btn {
  background: linear-gradient(165deg, #e5eff5, #c2d8e5 58%, #a2bfd1);
  color: #192c3c;
  border: 1px solid #dceaf3;
  box-shadow: inset 0 1px #fff9, 0 1px 0 #526f82, 0 8px 24px #a2daeb12;
  text-shadow: none;
  letter-spacing: 0.12em;
}

.primary:hover, #fire-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: inset 0 1px #fff9, 0 1px 0 #526f82, 0 8px 30px #a2daeb22;
}

#deploy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 22px;
}

#deploy .go-arrow {
  font-size: 26px;
}

#hud-bottom {
  background: linear-gradient(#283746f2, #111d2af7);
  border-top: 1px solid #91a6b655;
  box-shadow: 0 -8px 35px #040a1340, inset 0 1px #ffffff0c;
}

.dial {
  background: #0a15234d;
  border-radius: 12px;
  padding: 4px;
}

.dial-read b {
  color: #e0f4ff;
  text-shadow: 0 0 15px #72c9ff55;
}

.weapon {
  background: linear-gradient(#2a3d4e, #162331);
  border-color: #708b9e55;
}

.weapon .wicon, .shop-row .wicon {
  filter: drop-shadow(0 3px 2px #0008);
}

.shop-row, .sb-row, .mo-row {
  background: linear-gradient(110deg, #2e415066, #15212b99);
}

#callout {
  border-color: #95b9d04d;
  background: linear-gradient(120deg, #233747f2, #111e2af2);
  box-shadow: 0 16px 50px #0006, inset 3px 0 var(--accent);
}

@media (min-width: 960px) and (min-height: 620px) {
  #setup {
    width: min(1080px, calc(100% - 72px));
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.15fr);
    grid-template-areas: 'head roster' 'opts roster' 'deploy roster' 'online roster' 'foot roster';
    gap: 20px 36px;
    padding: 36px;
    max-height: calc(100% - 64px);
  }
  #setup .screen-head {
    grid-area: head;
  }
  #setup .setup-opts {
    grid-area: opts;
  }
  #setup #roster {
    grid-area: roster;
    border-left: 1px solid #7995a333;
    padding-left: 28px;
  }
  #setup #seats {
    max-height: min(66vh, 590px);
    flex: 1;
  }
  #setup #deploy {
    grid-area: deploy;
  }
  #setup #online-row {
    grid-area: online;
  }
  #setup .screen-foot {
    grid-area: foot;
  }
  /* Nothing showing in the foot — no update waiting, no way out to offer, no
   * worker to name the build — and it would still cost a row and its gap. */
  #setup .screen-foot:not(:has(> :not([hidden]))) {
    display: none;
  }
  #setup .seg-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #setup .seg-grid button {
    font-size: 11px;
  }
}

@media (max-width: 959px), (max-height: 619px) {
  .hangar-art {
    display: none;
  }
  .hangar-kicker {
    margin-bottom: 5px;
  }
  #logo {
    font-size: 42px;
  }
}

@media (max-width: 460px) {
  .swatch-btn {
    width: 52px;
  }
  .mech-portrait {
    width: 64px;
    height: 48px;
  }
  .seat-head {
    gap: 5px;
  }
  .seat-name {
    padding-inline: 6px;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  #setup {
    height: calc(100% - 16px);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    align-content: stretch;
  }
  #setup #roster {
    overflow: hidden;
  }
  /* The options are the left column's one stretchy row (minmax(0, 1fr)), and
   * on a short phone they are taller than it. Without their own scroll they
   * spilled out of the cell over DEPLOY and nothing could reach them — the
   * panel's height is fixed, so its overflow: auto had nothing to scroll.
   * They scroll inside themselves, like the roster beside them, and `safe`
   * keeps an overflowing column from being centred up past its own top. */
  #setup .setup-opts {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    justify-content: safe center;
    gap: 5px;
  }
  #setup #logo {
    font-size: 32px;
  }
  #setup .hangar-kicker {
    display: none;
  }
  #setup #deploy {
    min-height: 44px;
  }
}

/* A player who has asked for less movement gets less movement. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===================== online: the hangar ===================== */

/*
 * Online play (js/net/). Built from the setup screen's own parts — the same
 * plate, the same .primary and .ghost, the same seat swatch — so the hangar
 * looks like the rest of the hangar. The one new thing is the code, and the
 * code is the whole point of the screen: three words, set like stencilled
 * plates, big enough to read out across a room.
 */

.code-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.code-word {
  flex: 1 1 0;
  min-width: 0;
  max-width: 130px;
  padding: 5px 8px;
  border: 1px solid rgba(167, 217, 232, 0.45);
  border-radius: 8px;
  background: rgba(167, 217, 232, 0.1);
  color: var(--text);
  font-family: var(--head);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
}
.code-word.empty {
  color: var(--muted);
  border-style: dashed;
}
.code-words.hero {
  margin: 4px 0;
}
.code-words.hero .code-word {
  padding: 12px 8px;
  font-size: 22px;
  box-shadow: 0 0 22px rgba(167, 217, 232, 0.14);
}

/* The open hangar on the setup screen, above the seats it fills. */
#hangar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid rgba(167, 217, 232, 0.35);
  border-radius: 10px;
  background: rgba(167, 217, 232, 0.06);
}
.hangar-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hangar-line .code-words {
  flex: 1 1 auto;
  justify-content: flex-start;
}
.ghost.small {
  min-height: 34px;
  padding: 4px 10px;
  flex: 0 0 auto;
}
.blurb.live {
  color: var(--accent);
}
.blurb.warn {
  color: #f0b36a;
}

/* A friend's seat: the name is theirs and the kind is not a choice. */
.seat.online .seat-name {
  background: transparent;
  box-shadow: none;
}
.online-tag {
  flex: 0 0 auto;
  color: var(--accent);
  background: rgba(167, 217, 232, 0.16);
}

/* The lobby panel. */
#lobby {
  width: min(480px, calc(100% - 20px));
}
.lobby-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.lobby-view .field {
  flex: 1 1 auto;
}
/* Two doors of equal standing: one size, side by side (hub §2). */
.lobby-doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lobby-doors .primary {
  min-width: 0;
}
.lobby-fine {
  text-align: center;
}
#lobby-status {
  text-align: center;
}

/* The keypad: twelve words, one size, in a grid so they stay equal. */
.pad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.pad button {
  min-height: var(--tap);
  padding: 4px 2px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(21, 24, 30, 0.72);
  color: var(--text);
  font-family: var(--head);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.pad button:hover {
  background: rgba(58, 65, 77, 0.8);
  border-color: var(--accent);
}

/* A guest's crew list. */
.room-seat {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--c);
  border-radius: 8px;
  background: rgba(21, 24, 30, 0.6);
}
.room-seat .swatch {
  background: var(--c);
}
.room-seat b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-seat .tag:not(.won) {
  color: var(--muted);
  background: rgba(154, 163, 178, 0.12);
}

#sb-wait {
  text-align: center;
}

/* Sideways phone: the lobby must not scroll (hub §2). The heading goes —
   the kicker already says which step this is — the keypad turns six wide,
   and the guest's code sits beside the crew rather than above it. */
@media (orientation: landscape) and (max-height: 500px) {
  #lobby {
    width: min(680px, calc(100% - 20px));
    gap: 6px;
    padding: 12px 14px 10px;
  }
  #lobby h2 {
    display: none;
  }
  #lobby .lobby-view {
    gap: 6px;
  }
  .pad {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
  }
  .pad button,
  #lobby .primary,
  #lobby .ghost {
    min-height: 38px;
  }
  .code-words.hero .code-word {
    padding: 6px 8px;
    font-size: 18px;
  }
  #lobby-room {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'code seats' 'rules seats';
    align-items: start;
  }
  #room-code { grid-area: code; }
  #room-rules { grid-area: rules; }
  #room-seats { grid-area: seats; max-height: 52vh; }
}

/* ===================== room for the corner =====================
 * The corner's three plates sit over every screen (hub §2), and on a phone a
 * centred panel reaches right up under them. Two shapes, one per way up:
 *
 *   narrow, upright   the panel's frame starts below the plates. It gives up
 *                     one plate's height, which the roster, the shop rows and
 *                     the standings absorb — each scrolls inside itself.
 *   sideways phone    height is the scarce thing, so the plates get a column
 *                     of their own on the right instead and the panel is
 *                     centred in what is left: the same two-column layouts,
 *                     a little narrower, and no row lost. (Setup is the
 *                     exception, below.)
 *
 * `#ui > .screen` so these win over the per-screen rules above (#setup,
 * #lobby) without !important. Wider and taller screens need neither: the
 * panel stops short of the corner on its own. */
@media (max-width: 780px) {
  #ui > .screen {
    top: calc(50% + var(--corner-h) / 2);
    max-height: calc(100% - var(--corner-h) - 16px);
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  #ui > .screen {
    top: 50%;
    left: calc(50% - var(--corner-w) / 2);
    width: min(780px, calc(100% - var(--corner-w) - 16px));
    max-height: calc(100% - 12px);
  }
  /* Except the setup screen, which is two dense columns already and cannot
     spare the width: it keeps its full size, and only the row the plates
     actually sit over — the roster's head, top of the right column, with the
     seat buttons at its right end — steps in from the right by however much
     of the corner overhangs the panel. */
  #ui > #setup {
    left: 50%;
    width: min(780px, calc(100% - 16px));
    height: calc(100% - 16px);
  }
  #setup .roster-head {
    padding-right: max(0px, calc(var(--corner-w) + 6px - (100vw - min(780px, 100vw - 16px)) / 2 - 14px));
  }
}

/* The Settings face (no match on) opens over whichever screen called it, and
 * two plates stacked one on the other read as neither. The one underneath
 * steps out of sight until Back — still there, nothing reset. */
#ui.menu-over > .screen:not(#pause) {
  visibility: hidden;
}

/* ===================== the setup screen on a phone: two tabs =====================
 * (2026-10-27, after the owner: "the menu is still crowded and the text on
 * buttons is still squashed".) Rules and crew side by side gave each half a
 * phone, so every pill broke its word in two — "Van-lig", a 500 stacked one
 * digit per line, "Kaosgop-heren". On a phone the setup now shows ONE of
 * them, full width, behind a tab row; the doors — PLAY, Play online and the
 * way out — stay where they are whichever tab is up. The panel has a fixed
 * height so switching tabs never makes it jump.
 *
 *   upright   logo · tabs · the chosen panel (scrolls inside itself) · doors
 *   sideways  logo and the doors down a narrow left column; the tabs head
 *             the right column and the chosen panel fills the rest of it.
 *
 * Wider screens never see the tab row: they have room for both panels, and
 * #setup[data-tab] means nothing to them. This block comes last so it wins
 * over the older per-orientation setup rules above without !important. */
.setup-tabs {
  display: none;
  gap: 4px;
  padding: 4px;
  border: 1px solid #607a8d33;
  border-radius: 12px;
  background: #0a131c99;
  box-shadow: inset 0 2px 6px #0004;
}
.setup-tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--head);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.setup-tabs button:hover {
  color: var(--text);
}
/* The chosen tab is a lifted plate, the same graphite as a chosen bot. */
.setup-tabs button[aria-selected="true"] {
  color: #eaf3f7;
  background: linear-gradient(#496071, #304454);
  border-color: #9cb3c080;
  box-shadow: inset 0 1px #ffffff20, 0 2px #080f16;
}
/* What is behind a closed tab: the crew's head count, the preset's name. */
.tab-badge {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #a7d9e824;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.tab-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--accent);
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

@media (max-width: 700px), (orientation: landscape) and (max-height: 500px) {
  .setup-tabs {
    display: flex;
  }
  #setup[data-tab="crew"] .setup-opts,
  #setup[data-tab="rules"] #roster {
    display: none;
  }
  #setup .hangar-kicker {
    display: none;
  }

  /* The rules, given the whole width: each caption above its row rather
     than beside it, so a row of six purses gets every pixel of the panel. */
  #setup .setup-opts {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    justify-content: flex-start;
    gap: 6px;
    padding: 2px 2px 4px;
  }
  #setup .setup-opts .row {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
  #setup .setup-opts .label {
    flex: none;
  }
  #setup .setup-opts .seg {
    flex-wrap: nowrap;
  }
  #setup .setup-opts .seg button {
    white-space: nowrap;
    padding-inline: 4px;
  }
  #setup .setup-opts .blurb {
    margin-bottom: 4px;
  }
  #setup .setup-opts .field.num {
    max-width: 120px;
  }

  /* The crew: the roster column is the panel, and #seats its scrolling body. */
  #setup #roster {
    min-height: 0;
    overflow: hidden;
  }
  #setup #seats {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }
  #setup .roster-head {
    padding-right: 0;
  }
  /* Who drives and which bot: room enough now that no word has to break. */
  #setup .seg-kind {
    flex: 0 0 136px;
  }
  #setup .seg-kind button {
    white-space: nowrap;
  }
}

/* Upright: one column, and the chosen panel takes whatever the doors leave. */
@media (max-width: 700px) and (min-height: 501px), (max-width: 700px) and (orientation: portrait) {
  #ui > #setup {
    height: calc(100% - var(--corner-h) - 16px);
    padding: 14px 14px 12px;
    gap: 9px;
  }
  #setup #logo {
    font-size: 40px;
  }
  #setup .setup-opts,
  #setup #roster {
    flex: 1 1 auto;
  }
  #setup .exit-btn {
    margin-top: 2px;
  }
}

/* Sideways: the doors' column on the left, the tabbed panel on the right. */
@media (orientation: landscape) and (max-height: 500px) {
  #setup {
    grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1.6fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
    grid-template-areas:
      "head   tabs"
      "head   panel"
      ".      panel"
      "go     panel"
      "online panel"
      "foot   panel";
    gap: 8px 16px;
  }
  #setup .screen-head {
    grid-area: head;
    align-self: start;
  }
  #setup .setup-tabs {
    grid-area: tabs;
    /* The corner's plates sit over the top of this column: the tab row steps
       in from the right by as much of them as overhangs the panel. */
    margin-right: max(0px, calc(var(--corner-w) + 6px - (100vw - min(780px, 100vw - 16px)) / 2 - 14px));
  }
  #setup .setup-tabs button {
    min-height: 38px;
    font-size: 14px;
  }
  #setup .setup-opts,
  #setup #roster {
    grid-area: panel;
  }
  #setup #deploy {
    align-self: end;
  }
  #setup #online-row {
    max-width: none;
  }
  #setup #online-row .ghost,
  #setup .exit-btn {
    min-height: 38px;
  }
  #setup .exit-btn {
    margin-top: 0;
  }
  /* Two purses rows of six still want the width: tighten the pill text. */
  #setup .setup-opts .seg button {
    min-height: 36px;
    font-size: 12px;
  }
}
/* The tab already says "Players 4"; the roster's own heading would say it twice. */
@media (max-width: 700px), (orientation: landscape) and (max-height: 500px) {
  #setup .roster-head > .label,
  #setup #seat-count {
    display: none;
  }
}

/* The seven bot names, at every size: wide enough that "Kaosgopheren" and
 * "Improvisatoren" never break — a tablet upright was still splitting them
 * at seven to a row. Fewer to a row is the honest trade. */
#setup .seg-pers {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}
#setup .seg-pers button {
  min-height: 38px;
  padding: 4px 6px;
  font-size: 12px;
  hyphens: none;
  overflow-wrap: normal;
}
