:root {
  --bg: #03040a;
  --ink: #dff3ff;
  --dim: #7f95a8;
  --cyan: #59e6ff;
  --blue: #66a6ff;
  --amber: #ffe04d;
  --green: #5cff78;
  --red: #ff4d5e;
  --panel: rgba(6, 12, 24, 0.66);
  --edge: rgba(89, 230, 255, 0.28);
  --font: "Rajdhani", "Orbitron", "Eurostile", "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }

/* Browser touch gestures are switched off per region rather than on the
   root: the canvas and the in-game buttons take none, the menus only scroll.
   (Setting touch-action on the root makes Chrome deliver the canvas's touch
   events as uncancelable.) */
html, body {
  margin: 0;
  /* Pinned in place so a stray drag cannot rubber-band the page. */
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  -webkit-touch-callout: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

canvas#c {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

body.playing canvas#c { cursor: none; }

.hidden { display: none !important; }

/* Each input style sees only the controls and instructions that apply to it. */
body:not(.touch) .touch-only { display: none !important; }
body.touch .mouse-only { display: none !important; }

/* And for a shared game against a solo one. */
body:not(.mp) .mp-only { display: none !important; }
body.mp .solo-only { display: none !important; }

/* Likewise for assist mode, which replaces the normal controls. */
body:not(.assist) .assist-only { display: none !important; }
body.assist .normal-only { display: none !important; }

/* ---------------------------------------------------------------- HUD */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.hud-tl {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  width: min(260px, 38vw);
}

.meter {
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.meter label {
  font-size: 11px;
  color: var(--dim);
}

.track {
  height: 9px;
  background: rgba(120, 160, 200, 0.14);
  border: 1px solid rgba(160, 200, 240, 0.18);
  border-radius: 2px;
  overflow: hidden;
  transform: skewX(-18deg);
}

.track i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px currentColor;
}

.meter.hull .track i { background: var(--green); color: var(--green); }
.meter.shield .track i { background: var(--blue); color: var(--blue); }
.meter.energy .track i { background: var(--amber); color: var(--amber); }

.meter.hull.low label { color: var(--red); animation: blink 0.5s steps(2) infinite; }
.meter.hull.low .track i { background: var(--red); color: var(--red); }
.meter.energy.low label { color: var(--red); }
.meter.energy.low .track { border-color: var(--red); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
}

.chips span {
  padding: 2px 7px 1px;
  border: 1px solid rgba(160, 200, 240, 0.22);
  border-radius: 2px;
  color: var(--dim);
  background: rgba(6, 12, 24, 0.5);
  white-space: nowrap;
}

#lives { color: var(--cyan); letter-spacing: 0.2em; }
#power { color: #ffb066; }
#dash.ready { color: var(--cyan); border-color: var(--edge); }
#assist-chip { color: var(--green); border-color: rgba(92, 255, 120, 0.45); }
#room-chip { color: var(--ink); letter-spacing: 0.2em; }
#mission-chip { color: var(--amber); border-color: rgba(255, 224, 77, 0.4); }

/* The team: one row per pilot, in the colour of their ship. */
#team { margin-top: 10px; font-size: 11px; }

#team .mate {
  --c: var(--cyan);
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 52px 44px;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--ink);
}

#team .mate::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
#team .mate b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c); }
#team .mate .bar { height: 5px; background: rgba(120, 160, 200, 0.16); border-radius: 2px; overflow: hidden; }
#team .mate .bar i { display: block; height: 100%; background: var(--c); transform-origin: 0 50%; }
#team .mate em { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: 0; white-space: nowrap; }
#team .mate.me b::after { content: " (you)"; color: var(--dim); font-weight: 400; }
#team .mate.down { opacity: 0.55; }
#team .mate.down em { color: var(--red); }

/* Callsigns over the other ships. */
#tags { position: absolute; inset: 0; overflow: hidden; }

#tags .tag {
  --c: var(--cyan);
  position: absolute;
  left: 0;
  top: 0;
  padding: 0 5px;
  font-size: 10px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  color: var(--c);
  text-shadow: 0 0 6px #000, 0 0 2px #000;
  will-change: transform;
}

/* What has happened to your ship, while you wait for the next one. */
#down {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  padding: 8px 16px;
  font-size: clamp(13px, 2vw, 18px);
  letter-spacing: 0.2em;
  text-align: center;
  color: var(--red);
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid rgba(255, 77, 94, 0.4);
  border-radius: 3px;
  text-shadow: 0 0 12px rgba(255, 77, 94, 0.7);
}
#overdrive { color: #ff7ae6; border-color: rgba(255, 122, 230, 0.5); animation: blink 0.4s steps(2) infinite; }

.hud-tc {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  min-width: 180px;
}

#score {
  font-family: var(--mono);
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-shadow: 0 0 14px rgba(89, 230, 255, 0.55);
}

.sub {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
  color: var(--dim);
}

#mult { color: var(--amber); font-family: var(--mono); }
#mult.hot { text-shadow: 0 0 10px var(--amber); }

.track.combo {
  height: 3px;
  margin: 5px auto 0;
  width: 120px;
  border: 0;
  transform: none;
}

.track.combo i { background: var(--amber); color: var(--amber); }

#btn-pause {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: auto;
  background: rgba(6, 12, 24, 0.5);
  border-color: rgba(160, 200, 240, 0.22);
  border-radius: 6px;
}

#btn-pause i {
  width: 5px;
  height: 16px;
  background: var(--ink);
  border-radius: 1px;
  opacity: 0.85;
}

body.touch #btn-pause { width: 56px; height: 56px; }

#fps {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(3, 8, 18, 0.8);
  top: calc(max(12px, env(safe-area-inset-top)) + 64px);
  right: max(16px, env(safe-area-inset-right));
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0;
  text-align: right;
  white-space: pre;
}

#boss {
  position: absolute;
  top: max(92px, calc(env(safe-area-inset-top) + 82px));
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, 70vw);
  text-align: center;
}

#boss label {
  font-size: 12px;
  color: var(--red);
  text-shadow: 0 0 10px rgba(255, 77, 94, 0.7);
}

#boss .track { height: 11px; margin-top: 4px; border-color: rgba(255, 77, 94, 0.45); }
#boss .track i { background: var(--red); color: var(--red); }

#toast {
  position: absolute;
  left: 50%;
  top: 27%;
  transform: translateX(-50%);
  font-size: clamp(16px, 2.6vw, 26px);
  font-weight: 700;
  letter-spacing: 0.24em;
  white-space: nowrap;
  opacity: 0;
  color: var(--cyan);
  text-shadow: 0 0 18px currentColor;
}

#toast.warn { color: var(--red); }
#toast.good { color: var(--green); }
#toast.show { animation: toast 2.3s ease-out forwards; }

@keyframes toast {
  0% { opacity: 0; letter-spacing: 0.6em; }
  12% { opacity: 1; letter-spacing: 0.24em; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-14px); }
}

@keyframes blink { 50% { opacity: 0.35; } }

#weapons {
  position: absolute;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.slot {
  --c: var(--cyan);
  position: relative;
  width: clamp(40px, 9.4vw, 82px);
  padding: 5px 4px 8px;
  border: 1px solid rgba(160, 200, 240, 0.16);
  border-radius: 3px;
  background: rgba(6, 12, 24, 0.55);
  color: var(--dim);
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: transform 0.08s, border-color 0.08s, background 0.08s;
}

.slot b {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0.7;
}

.slot span {
  display: block;
  font-size: clamp(8px, 1.25vw, 12px);
  white-space: nowrap;
  overflow: hidden;
}

.slot i {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 3px;
  height: 2px;
  background: var(--c);
  opacity: 0.45;
}

.slot.on {
  color: #fff;
  border-color: var(--c);
  background: rgba(10, 20, 38, 0.85);
  transform: translateY(-4px);
  box-shadow: 0 0 16px -2px var(--c), inset 0 0 12px -6px var(--c);
}

.slot.on i { opacity: 1; box-shadow: 0 0 8px var(--c); }
.slot.dry { border-color: var(--red); }

/* ------------------------------------------------------- touch controls */

/* Buttons sit just above where the thumbs rest. Dash is under the right
   thumb so the left can keep flying; weapons are under the left so the
   right can keep firing.

   --stick-y is how far up the screen the idle sticks sit, and must match
   stickHomeY in cmd/client/input.go; the buttons clear a stick (58px
   radius) drawn there at any screen size. */
#hud { --stick-y: 26%; --above-stick: calc(var(--stick-y) + 84px); }
#hud button { touch-action: none; }

#touch-dash, #touch-wpn button {
  border-radius: 50%;
  border: 2px solid var(--edge);
  background: rgba(6, 12, 24, 0.55);
  color: var(--ink);
  font: inherit;
  padding: 0;
  pointer-events: auto;
}

#touch-dash:active, #touch-wpn button:active { background: rgba(60, 120, 180, 0.6); transform: scale(0.94); }

#touch-dash {
  position: absolute;
  right: max(22px, env(safe-area-inset-right));
  bottom: var(--above-stick);
  width: clamp(76px, 12vmin, 104px);
  height: clamp(76px, 12vmin, 104px);
  font-size: 13px;
  letter-spacing: 0.12em;
  opacity: 0.45;
}

#touch-dash.ready {
  opacity: 1;
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 18px -4px var(--cyan);
}

#touch-wpn {
  --c: var(--cyan);
  position: absolute;
  left: max(22px, env(safe-area-inset-left));
  bottom: var(--above-stick);
  display: grid;
  grid-template-columns: auto auto;
  gap: 5px 12px;
  justify-items: center;
}

#touch-wpn button {
  width: clamp(62px, 10vmin, 86px);
  height: clamp(62px, 10vmin, 86px);
  font-size: 20px;
  color: var(--c);
  border-color: var(--c);
}

#touch-wpn span {
  grid-column: span 2;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--dim);
}

/* Labels on the idle sticks, until each has been used once. */
.stick-hint {
  position: absolute;
  bottom: var(--stick-y);
  transform: translate(-50%, 50%);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--ink);
  opacity: 0.7;
  white-space: nowrap;
  transition: opacity 0.5s;
}

#hint-move { left: 17%; }
#hint-aim { left: 83%; }
#hint-fly { left: 50%; bottom: 17%; font-size: 13px; }
.stick-hint.used { opacity: 0; }

body.touch .slot { min-height: 54px; }
body.touch .slot b { font-size: 12px; }
body.touch button { min-height: 46px; }
body.touch #btn-pause, body.touch #touch-dash, body.touch #touch-wpn button { min-height: 0; }

/* ------------------------------------------------------------ overlays */

.overlay {
  /* Menus scroll, but never pinch-zoom. */
  touch-action: pan-y;
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: radial-gradient(ellipse at center, rgba(3, 4, 10, 0.1), rgba(3, 4, 10, 0.55));
}

.panel {
  width: min(980px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: clamp(18px, 3vw, 34px);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 6px;
  box-shadow: 0 0 60px rgba(40, 140, 255, 0.16), inset 0 0 40px rgba(40, 140, 255, 0.05);
  backdrop-filter: blur(5px);
  text-align: center;
}

.panel.medium { width: min(560px, 100%); }
.panel.small { width: min(340px, 100%); }

h1 {
  margin: 0;
  font-size: clamp(30px, 9vw, 92px);
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-right: -0.14em; /* the trailing letter-space would push it off centre */
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 22px rgba(89, 230, 255, 0.8), 0 0 60px rgba(60, 120, 255, 0.6);
}

h1 span { color: var(--cyan); }

.tag {
  margin: 10px 0 20px;
  color: var(--dim);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-size: clamp(10px, 1.5vw, 14px);
}

.hint {
  margin: 16px auto 4px;
  max-width: 640px;
  color: #b9cddc;
  font-size: 14px;
  line-height: 1.5;
}

h2 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--cyan);
  font-weight: 700;
}

h2.big {
  font-size: clamp(28px, 6vw, 46px);
  letter-spacing: 0.22em;
  color: #fff;
  text-shadow: 0 0 22px rgba(89, 230, 255, 0.7);
  margin-bottom: 18px;
}

h2.big.danger { text-shadow: 0 0 22px rgba(255, 77, 94, 0.9); }
h2.big.good { text-shadow: 0 0 22px rgba(92, 255, 120, 0.9); }

button {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 13px;
  padding: 10px 18px;
  color: var(--ink);
  background: rgba(20, 40, 70, 0.55);
  border: 1px solid var(--edge);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s, transform 0.08s;
}

button:hover { background: rgba(40, 80, 130, 0.6); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

button.primary {
  font-size: 17px;
  padding: 13px 44px;
  color: #02131c;
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 26px rgba(89, 230, 255, 0.55);
}

button.primary:hover { background: #9af1ff; box-shadow: 0 0 36px rgba(89, 230, 255, 0.85); }

.panel.small button { display: block; width: 100%; margin-top: 10px; }

.launch { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

button.primary.alt {
  color: var(--cyan);
  background: rgba(20, 40, 70, 0.55);
  box-shadow: 0 0 18px rgba(89, 230, 255, 0.25);
}

button.primary.alt:hover { background: rgba(40, 80, 130, 0.7); }

button.quiet { color: var(--dim); border-color: rgba(160, 200, 240, 0.15); background: transparent; font-size: 11px; }

/* ----------------------------------------------------- the campaign map */

/* The game draws the solar system on the canvas; the map screen is what is
   written over it. It has two layers: one for the whole system in view, with
   the title above and the nine worlds listed below, and one for the visit to
   a world, with its briefing beside it (under it, on a narrow screen). */
#map { display: block; padding: 0; overflow: hidden; background: none; touch-action: manipulation; }

.map-layer {
  position: absolute;
  inset: 0;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

.map-layer > * { pointer-events: auto; }
.map-layer.off { opacity: 0; visibility: hidden; }
.map-layer:not(.off) { transition: opacity 0.6s ease 0.25s, visibility 0s; }

#map-sys {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  /* Darker behind the words at the top and bottom, clear over the worlds. */
  background: linear-gradient(to bottom, rgba(3, 4, 10, 0.6), transparent 150px), linear-gradient(to top, rgba(3, 4, 10, 0.7), transparent 210px);
}

/* The title is only read, so a world passing behind it can still be chosen. */
#map-sys > #map-head { text-align: center; pointer-events: none; }
#map-head h2.big { margin: 4px 0 0; margin-right: -0.26em; font-size: clamp(21px, 4.4vw, 52px); letter-spacing: 0.26em; line-height: 1.05; }
#map-head .hint { margin: 8px auto 0; }
#map-foot .actions { margin-top: 10px; }

#planets {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
}

.planet {
  --face: #888;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1px 9px;
  padding: 7px 8px;
  text-align: left;
  letter-spacing: 0.08em;
  background: rgba(8, 16, 32, 0.66);
  border-color: rgba(160, 200, 240, 0.16);
}

.planet .orb {
  grid-row: 1 / span 3;
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--face);
  background-size: cover;
  box-shadow: inset -4px -4px 7px rgba(0, 0, 0, 0.65), 0 0 0 2px rgba(255, 77, 94, 0.6), 0 0 10px 1px rgba(255, 77, 94, 0.45);
  animation: siege 1.6s ease-in-out infinite;
}

@keyframes siege { 50% { box-shadow: inset -4px -4px 7px rgba(0, 0, 0, 0.65), 0 0 0 2px rgba(255, 77, 94, 0.25), 0 0 4px 0 rgba(255, 77, 94, 0.2); } }

.planet.saved .orb {
  animation: none;
  box-shadow: inset -4px -4px 7px rgba(0, 0, 0, 0.65), 0 0 0 2px var(--green), 0 0 10px 1px rgba(92, 255, 120, 0.5);
}

/* A moon with an operation of its own rides beside its planet. */
.planet.moon .orb::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8d8dc, #55555c 75%);
  box-shadow: 0 0 0 1.5px rgba(255, 77, 94, 0.8);
}

.planet.moon.moon-free .orb::after { box-shadow: 0 0 0 1.5px var(--green); }

.planet b { font-size: 11px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.planet .threat { font-size: 9px; letter-spacing: 0.1em; color: var(--amber); white-space: nowrap; }
.planet em { font-style: normal; font-size: 9px; color: var(--red); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planet.saved em { color: var(--green); }
.planet.sel { border-color: var(--cyan); background: rgba(20, 44, 78, 0.8); box-shadow: 0 0 18px -4px var(--cyan); }
/* The world suggested for the next operation. */
.planet.next:not(.sel) { border-color: rgba(89, 230, 255, 0.55); }
.planet.next b::after { content: "  \25B8"; color: var(--cyan); }

.p-mercury { --face: radial-gradient(circle at 62% 60%, #6a6058 0 12%, transparent 13%), radial-gradient(circle at 35% 30%, #c2b3a3, #5d544c 75%); }
.p-venus { --face: radial-gradient(circle at 35% 30%, #f3d88f, #8c5a22 78%); }
.p-earth { --face: radial-gradient(circle at 62% 64%, #3a8f4a 0 15%, transparent 16%), radial-gradient(circle at 30% 36%, #3f9950 0 19%, transparent 20%), radial-gradient(circle at 35% 30%, #5a9af0, #0d2a6b 78%); }
.p-mars { --face: radial-gradient(circle at 50% 6%, #fff 0 9%, transparent 10%), radial-gradient(circle at 35% 30%, #e0714a, #5a2415 78%); }
.p-jupiter { --face: radial-gradient(ellipse at 66% 62%, #c8523a 0 7%, transparent 8%), repeating-linear-gradient(6deg, rgba(120, 72, 44, 0.6) 0 2px, rgba(240, 220, 190, 0.1) 2px 5px), radial-gradient(circle at 35% 30%, #e6c8a0, #6b4a33 78%); }
.p-saturn { --face: repeating-linear-gradient(6deg, rgba(150, 120, 70, 0.45) 0 2px, transparent 2px 5px), radial-gradient(circle at 35% 30%, #efdca6, #6f5a34 78%); }
.p-saturn .orb::before { content: ""; position: absolute; left: -34%; right: -34%; top: 36%; bottom: 36%; border: 1.5px solid rgba(232, 214, 166, 0.75); border-radius: 50%; transform: rotate(-16deg); }
.p-uranus { --face: radial-gradient(circle at 35% 30%, #b6ecee, #2b6b78 78%); }
.p-neptune { --face: radial-gradient(circle at 40% 55%, #16217a 0 9%, transparent 10%), radial-gradient(circle at 35% 30%, #5b83f5, #0f1c6b 78%); }
.p-pluto { --face: radial-gradient(circle at 58% 60%, #efe2d0 0 20%, transparent 21%), radial-gradient(circle at 35% 30%, #b3907a, #4a342c 78%); }

/* Names that ride on the map: each is moved by the game, every frame, to
   stay with what it names. */
#map-labels { position: absolute; inset: 0; pointer-events: none; }

.map-tag {
  position: absolute;
  left: 0;
  top: 0;
  font-size: clamp(9px, 0.9vw, 12px);
  font-weight: 700;
  letter-spacing: 0.16em;
  white-space: nowrap;
  color: var(--ink);
  text-shadow: 0 0 4px var(--bg), 0 0 2px var(--bg), 0 0 8px var(--bg);
  opacity: 0;
  transition: opacity 0.3s, color 0.15s;
  will-change: transform;
}

.map-tag.on { opacity: 0.85; }
.map-tag.hot { color: var(--cyan); opacity: 1; }
.map-tag.danger { color: var(--red); }
.map-tag.good { color: var(--green); }

#map-tip {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 130px;
  padding: 8px 12px;
  pointer-events: none;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  background: rgba(6, 12, 24, 0.9);
  border: 1px solid var(--cyan);
  border-radius: 3px;
  box-shadow: 0 0 18px -4px var(--cyan);
  opacity: 0;
  transition: opacity 0.15s;
}

#map-tip.on { opacity: 1; }
#map-tip b { display: block; font-size: 14px; letter-spacing: 0.2em; color: #fff; }
#map-tip .threat { color: var(--amber); letter-spacing: 0.1em; }
#map-tip em { font-style: normal; color: var(--red); }
#map-tip em.saved { color: var(--green); }
#map-tip u { display: block; margin-top: 4px; text-decoration: none; color: var(--cyan); }

/* At a world. */
#map-out { position: absolute; left: max(16px, env(safe-area-inset-left)); top: max(14px, env(safe-area-inset-top)); }

#briefing {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  top: 50%;
  width: min(440px, 42%);
  max-height: calc(100% - 28px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(89, 230, 255, 0.35) transparent;
  touch-action: pan-y;
  padding: 16px 18px 0;
  text-align: left;
  background: rgba(6, 12, 24, 0.8);
  border: 1px solid var(--edge);
  border-radius: 6px;
  box-shadow: 0 0 60px rgba(40, 140, 255, 0.16), inset 0 0 40px rgba(40, 140, 255, 0.05);
  backdrop-filter: blur(5px);
  transform: translate(0, -50%);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s;
}

.map-layer.off #briefing { transform: translate(40px, -50%); transition: transform 0.4s ease; }

.hop { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.hop span { color: var(--dim); font-size: 11px; letter-spacing: 0.2em; white-space: nowrap; }
.hop button { padding: 6px 10px; font-size: 11px; letter-spacing: 0.14em; }

.brief-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

#brief-title {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 800;
  letter-spacing: 0.22em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 22px rgba(89, 230, 255, 0.7);
}

#brief-state {
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  white-space: nowrap;
  color: var(--red);
  border: 1px solid currentColor;
  border-radius: 2px;
  animation: blink 1.6s ease-in-out infinite;
}

#brief-state.saved { color: var(--green); animation: none; }

#brief-threat { margin-top: 8px; color: var(--amber); font-size: 13px; letter-spacing: 0.12em; }
#brief-text { margin: 12px 0 0; color: #fff; font-size: 16px; line-height: 1.45; }
#briefing h3 { margin: 16px 0 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.3em; color: var(--cyan); }
#brief-now, #brief-why { margin: 0; color: #b9cddc; font-size: 14px; line-height: 1.55; }
#brief-race { margin: 0 0 8px; color: #b9cddc; font-size: 14px; line-height: 1.55; }

#brief-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 16px 0 0; }
#brief-facts div { min-width: 0; padding: 7px 8px; background: rgba(120, 160, 200, 0.06); border: 1px solid rgba(160, 200, 240, 0.16); border-radius: 3px; }
#brief-facts dt { font-size: 9px; letter-spacing: 0.16em; color: var(--dim); }
#brief-facts dd { margin: 3px 0 0; font-family: var(--mono); font-size: 12px; color: var(--ink); overflow-wrap: anywhere; }

#brief-forces { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

#brief-forces li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink);
  background: rgba(255, 77, 94, 0.08);
  border: 1px solid rgba(255, 77, 94, 0.4);
  border-radius: 2px;
}

#brief-forces li::before { content: ""; border-left: 7px solid var(--red); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
#brief-forces li.boss { background: rgba(255, 224, 77, 0.07); border-color: rgba(255, 224, 77, 0.45); }
#brief-forces li.boss::before { border-left-color: var(--amber); }
#brief-forces li.ours { background: rgba(92, 255, 120, 0.07); border-color: rgba(92, 255, 120, 0.4); }
#brief-forces li.ours::before { border-left-color: var(--green); }

/* The operations stay at the foot of the briefing while the rest of it
   scrolls behind them, so the way into battle is never out of sight. */
#brief-act {
  position: sticky;
  bottom: 0;
  margin: 14px -18px 0;
  padding: 12px 18px 16px;
  background: rgba(5, 10, 21, 0.97);
  border-top: 1px solid rgba(160, 200, 240, 0.16);
}

#brief-act .status { min-height: 0; text-align: right; }
#brief-act .status:empty { display: none; }

#ops { display: grid; gap: 8px; }

/* An operation: what it is on the left, the two ways to fly it on the right. */
.op {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 10px;
  border-left: 2px solid var(--red);
  background: rgba(20, 34, 58, 0.5);
}

.op.done { border-left-color: var(--green); }
.op.locked { border-left-color: var(--dim); opacity: 0.75; }
.op b { grid-column: 1; align-self: end; letter-spacing: 0.16em; font-size: 13px; color: var(--ink); }
.op span { grid-column: 1; align-self: start; font-size: 12px; line-height: 1.35; color: var(--dim); }
.op button { grid-column: 2; font-size: 11px; padding: 7px 11px; letter-spacing: 0.16em; white-space: nowrap; }
.op button.go { grid-row: 1; color: #02131c; background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 18px rgba(89, 230, 255, 0.4); }
.op button.go:hover { background: #9af1ff; }
.op button.team { grid-row: 2; }

.callsign { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; font-size: 10px; letter-spacing: 0.14em; color: var(--dim); }
.callsign input { flex: none; width: 150px; padding: 7px 10px; font-size: 13px; }

/* The briefing fills in piece by piece as the view arrives. */
#briefing.play .rise { animation: rise 0.5s ease both; }
#briefing.play .rise:nth-child(2) { animation-delay: 0.35s; }
#briefing.play .rise:nth-child(3) { animation-delay: 0.42s; }
#briefing.play .rise:nth-child(4) { animation-delay: 0.49s; }
#briefing.play .rise:nth-child(5) { animation-delay: 0.56s; }
#briefing.play .rise:nth-child(6) { animation-delay: 0.63s; }
#briefing.play .rise:nth-child(7) { animation-delay: 0.7s; }
#briefing.play .rise:nth-child(8) { animation-delay: 0.77s; }
#briefing.play .rise:nth-child(9) { animation-delay: 0.84s; }
#briefing.play .rise:nth-child(10) { animation-delay: 0.84s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------ the hangar */

/* Where a pilot chooses a fighter. The one picked out is drawn by the game,
   flying, behind the clear upper part of the bay; the ten in the rack are
   pictures of the same hulls. */
#hangar { background: none; }

#hangar-in {
  display: grid;
  gap: 14px;
  width: min(1180px, 100%);
  max-height: 100%;
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(89, 230, 255, 0.35) transparent;
}

#hangar header { text-align: center; }
#hangar h2.big { margin: 0; margin-right: -0.22em; font-size: clamp(22px, 4.4vw, 46px); }
#hangar .hint { margin: 8px auto 0; }

#hangar-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 14px; align-items: start; }

#bay { min-width: 0; border: 1px solid var(--edge); border-radius: 6px; overflow: hidden; box-shadow: 0 0 60px rgba(40, 140, 255, 0.14); }
#bay-view { position: relative; height: clamp(220px, 48vh, 540px); box-shadow: inset 0 0 60px rgba(3, 4, 10, 0.6); }
.bay-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 56px; padding: 0; font-size: 20px; letter-spacing: 0; background: rgba(6, 12, 24, 0.6); }
.bay-nav:active { transform: translateY(calc(-50% + 1px)); }
#bay-prev { left: 10px; }
#bay-next { right: 10px; }

#bay-brief { padding: 14px 16px 16px; text-align: left; background: rgba(6, 12, 24, 0.82); border-top: 1px solid rgba(160, 200, 240, 0.16); }
#fighter-name { margin: 0; font-size: clamp(26px, 3.6vw, 42px); font-weight: 800; letter-spacing: 0.22em; line-height: 1; color: #fff; text-shadow: 0 0 22px rgba(89, 230, 255, 0.7); }
#fighter-idx { color: var(--dim); font-size: 11px; letter-spacing: 0.2em; white-space: nowrap; }
#fighter-blurb { margin: 10px 0 0; max-width: 52ch; color: #fff; font-size: 16px; line-height: 1.45; }

#fighter-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
#fighter-tags li { padding: 4px 9px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: var(--ink); background: rgba(120, 160, 200, 0.06); border: 1px solid rgba(160, 200, 240, 0.16); border-radius: 2px; }
#fighter-tags li.paint { display: flex; align-items: center; gap: 6px; }
#fighter-tags li.paint i { width: 11px; height: 11px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25); }
#bay-brief .actions { justify-content: flex-start; margin-top: 16px; }
#bay-brief .actions .primary { font-size: 15px; padding: 12px 28px; }

#rack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }

.fighter {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 2px 12px;
  padding: 2px 10px 2px 6px;
  text-align: left;
  letter-spacing: 0.1em;
  background: rgba(8, 16, 32, 0.72);
  border-color: rgba(160, 200, 240, 0.16);
}

/* The picture is baked nose to the right; in the rack it stands nose up. */
.fighter canvas { grid-row: 1 / span 2; display: block; width: 96px; height: 94px; transform: rotate(-90deg); }
.fighter b { align-self: end; font-size: 14px; letter-spacing: 0.18em; color: #fff; }
.fighter span { align-self: start; font-size: 11px; font-weight: 500; letter-spacing: 0.04em; line-height: 1.3; text-transform: none; color: var(--dim); }
.fighter.sel { border-color: var(--cyan); background: rgba(20, 44, 78, 0.8); box-shadow: 0 0 18px -4px var(--cyan); }
.fighter.mine b::after { content: "  \2714"; color: var(--green); }

#saved-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 4px; }
#saved-row .orb { width: 34px; height: 34px; border-radius: 50%; background: var(--face); box-shadow: inset -6px -6px 10px rgba(0, 0, 0, 0.65), 0 0 0 2px var(--green), 0 0 12px rgba(92, 255, 120, 0.5); }

/* Multiplayer menu. */
#mp .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0 22px; }
#mp .row button.primary { font-size: 14px; padding: 10px 26px; }
h2.sub { margin-top: 6px; text-align: left; }

#mp-rooms { display: grid; gap: 8px; text-align: left; min-height: 54px; }
#mp-rooms p { margin: 6px 0; color: var(--dim); font-size: 14px; }

#mp-rooms button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 14px;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  letter-spacing: 0.08em;
}

#mp-rooms button b { font-family: var(--mono); font-size: 16px; letter-spacing: 0.2em; color: var(--cyan); }
#mp-rooms button span { font-size: 12px; color: #b9cddc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0.02em; }
#mp-rooms button em { font-style: normal; font-size: 11px; color: var(--amber); white-space: nowrap; }
#mp-rooms button:disabled { opacity: 0.5; cursor: default; }

#mp-results td:nth-child(1) { width: 14px; }
#mp-results td:nth-child(1)::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--cyan)); }
#mp-results td:nth-child(3) { color: var(--ink); }
#mp-over table.scores { margin: 0 auto; max-width: 420px; }

.util { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.util button { font-size: 11px; padding: 8px 14px; }

button.js-assist.on {
  color: #04180a;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(92, 255, 120, 0.45);
}

#assist-note {
  margin: 14px auto 0;
  max-width: 640px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #c9f7d2;
  background: rgba(92, 255, 120, 0.08);
  border: 1px solid rgba(92, 255, 120, 0.35);
  border-radius: 4px;
}

#assist-note b { color: var(--green); }

.cols {
  display: grid;
  grid-template-columns: 1.25fr 1.25fr 1fr;
  gap: 22px;
  margin-top: 22px;
  text-align: left;
}

.cols section {
  padding-top: 14px;
  border-top: 1px solid rgba(160, 200, 240, 0.14);
}

.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 12px;
  margin: 0;
  font-size: 13px;
  align-items: center;
}

.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: #b9cddc; }

kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  margin-right: 2px;
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
  color: var(--ink);
  background: rgba(120, 160, 200, 0.12);
  border: 1px solid rgba(160, 200, 240, 0.3);
  border-bottom-width: 2px;
  border-radius: 3px;
}

#arsenal {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

#arsenal li {
  --c: var(--cyan);
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 1px 6px;
  margin-bottom: 7px;
  padding-left: 8px;
  border-left: 2px solid var(--c);
}

#arsenal b { font-family: var(--mono); font-size: 11px; color: var(--dim); grid-row: span 2; align-self: center; }
#arsenal strong { color: var(--c); letter-spacing: 0.1em; font-size: 12px; }
#arsenal em { font-style: normal; color: #9fb4c6; font-size: 12px; }

table.scores {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--mono);
}

table.scores td { padding: 3px 4px; white-space: nowrap; }
table.scores td:nth-child(1) { color: var(--dim); width: 22px; }
table.scores td:nth-child(2) { color: var(--ink); overflow: hidden; text-overflow: ellipsis; max-width: 150px; width: 100%; text-align: left; }
table.scores td:nth-child(3) { text-align: right; color: var(--amber); }
table.scores td:nth-child(4) { text-align: right; color: var(--dim); font-size: 11px; }
table.scores tr.me td { color: var(--green); text-shadow: 0 0 8px rgba(92, 255, 120, 0.6); }
table.scores td.empty { color: var(--dim); font-family: var(--font); text-align: left; }

#over table.scores { margin: 12px auto 0; max-width: 420px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.stats div {
  padding: 10px 4px;
  background: rgba(120, 160, 200, 0.07);
  border: 1px solid rgba(160, 200, 240, 0.14);
  border-radius: 3px;
}

.stats b { display: block; font-family: var(--mono); font-size: clamp(16px, 3.6vw, 24px); color: #fff; }
.stats span { font-size: 10px; letter-spacing: 0.22em; color: var(--dim); }

#o-form { display: flex; gap: 8px; justify-content: center; }

input[type="text"] {
  flex: 1;
  min-width: 0;
  max-width: 240px;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(3, 6, 14, 0.8);
  border: 1px solid var(--edge);
  border-radius: 3px;
  -webkit-user-select: text;
  user-select: text;
}

.status { min-height: 18px; margin: 8px 0 0; font-size: 13px; color: var(--dim); }
.status.good { color: var(--green); }
.status.bad { color: var(--red); }

.actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* -------------------------------------------------------------- loading */

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  color: var(--dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

body.ready #loading { display: none; }
body #loading.failed { display: flex; color: var(--red); z-index: 10; text-transform: none; letter-spacing: 0.04em; }
#loading.failed .spinner { display: none; }

.spinner {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(89, 230, 255, 0.18);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- narrow */

/* The map on smaller screens. Nine worlds across needs room for their names:
   below that each stands on its own, then they wrap to three rows, and the
   briefing moves from beside the world to under it. */
@media (max-width: 1180px) {
  .planet { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 3px; padding: 7px 2px; }
  .planet .orb { grid-row: auto; }
}

@media (max-width: 960px) {
  .planet em { font-size: 8px; letter-spacing: 0.02em; }
}

@media (max-width: 560px) {
  .op button { padding: 7px 8px; letter-spacing: 0.1em; }
  .callsign input { width: 120px; }
}

@media (max-width: 900px) {
  #hangar-body { grid-template-columns: minmax(0, 1fr); }
  #bay-view { height: clamp(200px, 36vh, 400px); }
}

@media (max-width: 520px) {
  .fighter { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 4px; }
  .fighter canvas { grid-row: auto; }
  .fighter span { display: none; }
}

@media (max-width: 820px) and (orientation: portrait) {
  #planets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .planet { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; padding: 6px; gap: 0 7px; letter-spacing: 0.04em; }
  .planet .orb { grid-row: 1 / span 3; width: 22px; height: 22px; }
  .planet em { font-size: 8.5px; letter-spacing: 0; }
  #briefing { left: max(16px, env(safe-area-inset-left)); top: auto; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; height: 56%; max-height: none; transform: none; }
  .map-layer.off #briefing { transform: translate(0, 30px); }
  #brief-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .cols { grid-template-columns: 1fr; gap: 14px; }
  .meter { grid-template-columns: 48px 1fr; }
  .meter label { font-size: 9px; }
  #hud { letter-spacing: 0.08em; }
}

/* Phones: score moves to the right corner, weapon slots shrink to numbers. */
@media (max-width: 600px) {
  .hud-tc { left: auto; right: calc(max(14px, env(safe-area-inset-right)) + 66px); transform: none; text-align: right; min-width: 0; }
  .sub { justify-content: flex-end; }
  .track.combo { margin-right: 0; }
  #weapons { gap: 4px; }
  .slot { width: clamp(36px, 11.5vw, 52px); padding: 7px 2px 9px; }
  .slot span { display: none; }
  .slot b { font-size: 15px; opacity: 1; }
  #boss { top: 124px; width: 86vw; }
  #toast { top: 22%; white-space: normal; width: 90vw; text-align: center; letter-spacing: 0.16em; }
  h1 { letter-spacing: 0.08em; margin-right: -0.08em; }
}

/* Phones on their side: little height, so shrink what sits at the bottom
   and keep the weapon bar clear of the thumbs. */
@media (max-height: 520px) {
  #planets { gap: 4px; }
  .planet { gap: 2px; padding: 4px 2px; }
  .planet .orb { width: 20px; height: 20px; }
  .planet .threat, .planet em { display: none; }
  .planet b { font-size: 10px; }
  #map-head h2.big { font-size: 20px; }
  #map-foot .actions { margin-top: 6px; }
  #map-foot .actions button { padding: 6px 14px; }
  #briefing { padding-top: 10px; }
  #brief-title { font-size: 24px; }
  #hangar h2.big { font-size: 20px; }
  #bay-view { height: 150px; }
  #fighter-name { font-size: 22px; }
  .fighter canvas { width: 64px; height: 63px; }
  .fighter { grid-template-columns: 64px minmax(0, 1fr); }
  /* Each operation is cut down to its name and its two buttons, so there
     is room left to read the briefing above them. */
  #briefing { width: min(440px, 48%); }
  #brief-act { padding-top: 8px; padding-bottom: 10px; }
  .op { grid-template-columns: 1fr 1fr; gap: 4px 8px; padding: 5px 8px; }
  .op b { grid-row: 1; grid-column: 1 / -1; }
  .op span { grid-row: 2; grid-column: 1 / -1; }
  .op:not(.locked) span { display: none; }
  .op button { padding: 5px 6px; }
  .op button.go { grid-row: 2; grid-column: 1; }
  .op button.team { grid-row: 2; grid-column: 2; }
  .hint, .tag { display: none; }
  .cols { margin-top: 12px; }
  .slot { width: clamp(44px, 7vw, 60px); }
  .slot span { font-size: 9px; letter-spacing: 0.02em; }
  body.touch .slot { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .map-layer, .map-layer:not(.off), #briefing, .map-layer.off #briefing { transition: none; }
  #briefing.play .rise, #brief-state { animation: none; }
  #toast.show { animation-duration: 2.3s; }
  .spinner { animation-duration: 3s; }
}

.auto-option { display: block; margin: 12px 0; }
.auto-option input { width: auto; margin-right: 6px; }
#mp-auto-link { color: var(--cyan); }
