/*
 * Boomvale's landing page. Its colours come from the logo: deep navy, gold and sky blue,
 * with cream for the two light sections. Its pieces are the game's own: plates with a dark
 * keyline and keys with two cut corners that go down when pressed.
 */
:root {
  --navy: #071531;
  --deep: #0b1b3a;
  --mid: #0e2448;
  --plate: #17264a;
  --line: #2f4170;
  --keyline: #050a16;
  --cream: #f4eedf;
  --paper: #fbf7ec;
  --ink: #16233f;
  --dim: #9ba8c4;
  --gold: #ffc531;
  --gold-deep: #d9870f;
  --sky: #51bff2;
  --leaf: #5fcf4d;

  --text: 'Barlow', system-ui, sans-serif;
  --ui: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  --display: 'Lilita One', 'Barlow', system-ui, sans-serif;
  --cut: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--text);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.05;
}

h1 {
  font-size: clamp(38px, 4.6vw, 62px);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(32px, 3.6vw, 50px);
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

::selection {
  background: var(--gold);
  color: #3a2a00;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.lead {
  max-width: 62ch;
  color: var(--dim);
}

.skip {
  position: fixed;
  top: -80px;
  left: 12px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--cream);
  color: var(--ink);
}

.skip:focus {
  top: 12px;
}

/* ── Keys ──────────────────────────────────────────────── */

/* A key, as in the game: cut corners, a lit top edge, and it goes down when pressed. */
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px 13px;
  border: 0;
  background: linear-gradient(#33508f, #25407a);
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / 16%),
    inset 0 -3px 0 rgb(0 0 0 / 32%);
  clip-path: var(--cut);
  color: var(--cream);
  font-family: var(--ui);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  filter: drop-shadow(0 3px 0 var(--keyline));
}

.key:hover {
  background: linear-gradient(#3d5ea6, #2c4a8c);
}

.key:active,
.key.is-down {
  filter: drop-shadow(0 1px 0 var(--keyline));
  transform: translateY(2px);
}

/* The one thing to press next. */
.key-main,
.key-main:hover {
  background: linear-gradient(#ffdf6b, var(--gold) 55%, #f0a91a);
  box-shadow:
    inset 0 3px 0 rgb(255 255 255 / 55%),
    inset 0 -5px 0 var(--gold-deep);
  color: #3a2a00;
}

.key-step {
  width: 48px;
  padding: 9px 0 11px;
}

/* ── Top bar ───────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding: 0 20px;
  border-bottom: 2px solid var(--keyline);
  background: rgb(7 21 49 / 96%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-family: var(--display);
  font-size: 21px;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.top-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-family: var(--ui);
  font-size: 18px;
  font-weight: 600;
}

.top-links a {
  color: var(--dim);
  text-decoration: none;
}

.top-links a:hover {
  color: var(--cream);
}

/* Sound is off until asked for: the speaker's waves show when it is on. */
.sound {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 2px solid var(--keyline);
  border-radius: 6px;
  background: #060b18;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.sound svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.sound-waves {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0;
}

.sound[aria-pressed='true'] {
  color: var(--gold);
}

.sound[aria-pressed='true'] .sound-waves {
  opacity: 1;
}

.languages {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 2px solid var(--keyline);
  border-radius: 6px;
  background: #060b18;
}

.languages button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* A small flag beside each language: quiet until its language is the one chosen. */
.languages img {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  opacity: 0.55;
}

.languages button:hover img,
.languages button[aria-pressed='true'] img {
  opacity: 1;
}

.languages button[aria-pressed='true'] {
  background: linear-gradient(#33508f, #25407a);
  color: var(--cream);
}

/* ── Hero ──────────────────────────────────────────────── */

.hero {
  position: relative;
  /* The Low Orbit map, dimmed on the left where the words are and left to show on the right. */
  background:
    linear-gradient(90deg, rgb(7 21 49 / 96%) 0%, rgb(7 21 49 / 82%) 46%, rgb(7 21 49 / 38%) 100%),
    url('assets/map-orbit.webp') center / cover;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 48px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 124px;
}

.hero-words {
  display: grid;
  justify-items: start;
  gap: 16px;
}

.hero-logo {
  width: min(100%, 440px);
  height: auto;
  margin-left: -10px;
  filter: drop-shadow(0 8px 0 rgb(5 10 22 / 55%));
}

.hero-words p {
  max-width: 40ch;
  color: #e8eef9;
  font-size: 20px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 17px;
  font-weight: 600;
}

.status-line i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgb(74 222 128 / 22%);
}

/* The top bar's own way in. */
.key-small {
  padding: 7px 14px 9px;
  font-size: 16px;
}

/* ── Online ────────────────────────────────────────────── */

.modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.mode {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  justify-items: start;
  gap: 10px;
  padding: 22px 22px 24px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink);
}

.mode img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.mode h3 {
  margin: 0;
  font-family: var(--ui);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.mode p {
  color: #5c5540;
}

/* Friends is the one to act on: it carries the invite and stands out in gold. */
.mode-friends {
  border-color: var(--gold-deep);
  background: linear-gradient(#fff4cf, var(--paper));
  box-shadow: 0 4px 0 var(--gold-deep);
}

/* ── Invite note ───────────────────────────────────────── */

.invite-note {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 50;
  margin: 0;
  padding: 12px 20px;
  border: 2px solid var(--keyline);
  border-radius: 6px;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--ui);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 4px 0 var(--keyline);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.invite-note.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Pictures from the game ────────────────────────────── */

/* A frame of the game itself, held in the same dark keyline as the game's own plates. */
.shot {
  margin: 0;
  border: 3px solid var(--keyline);
  border-radius: 6px;
  background: var(--keyline);
  box-shadow: 0 6px 0 rgb(5 10 22 / 55%);
  overflow: hidden;
}

.shot img,
.shot video {
  display: block;
  width: 100%;
  height: auto;
}

/*
 * The hero's clip in a frame like the game's own plates: a gold bezel with a dark keyline
 * either side, so it reads as a screen of the game, not a video.
 */
.hero .shot {
  position: relative;
  padding: 6px;
  border: 2px solid var(--keyline);
  border-radius: 12px;
  background: linear-gradient(160deg, #ffe48a, var(--gold) 45%, #d98d14);
  box-shadow:
    0 6px 0 var(--keyline),
    0 18px 40px rgb(0 0 0 / 35%);
  overflow: visible;
  transition: box-shadow 0.25s ease-out;
}

/* Pointed at, the frame glows gold, as a selected card does in the game. */
.hero .shot:hover {
  box-shadow:
    0 6px 0 var(--keyline),
    0 0 0 4px rgb(255 205 60 / 35%),
    0 0 44px rgb(255 190 50 / 45%);
}

.hero .shot video,
.hero .shot img {
  border: 2px solid var(--keyline);
  border-radius: 7px;
  background: var(--keyline);
}

/* ── Edges ─────────────────────────────────────────────── */

/*
 * Sections meet along a line of hills, not a ruled edge: the game is about ground, and
 * about changing its shape. An edge sits at the foot of a section, or stands on top of one,
 * and is filled with the colour of the section below it.
 */
.edge {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  display: block;
  width: 100%;
  height: 70px;
  pointer-events: none;
}

.edge-top {
  top: -69px;
  bottom: auto;
}

.edge path {
  fill: var(--deep);
}

.edge-light path,
.edge-mid path {
  fill: var(--cream);
}

#vehicles .edge path {
  fill: var(--deep);
}

.foot .edge path {
  fill: var(--navy);
}

/* ── Bands ─────────────────────────────────────────────── */

.band {
  position: relative;
  padding: 96px 0 112px;
  background: var(--deep);
}

.band-deep {
  background: var(--mid);
}

.band-light {
  background: var(--cream);
  color: var(--ink);
}

.band-light .lead {
  color: #5c5540;
}

.band .shell {
  display: grid;
  gap: 24px;
}

.band-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.steppers {
  display: flex;
  gap: 8px;
}

/* ── A turn ────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink);
  list-style: none;
  counter-reset: step;
}

/* The four steps are one strip, read left to right, each handing on to the next. */
.steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  gap: 2px 14px;
  padding: 20px 22px 22px;
  counter-increment: step;
}

.steps li + li {
  border-left: 2px solid var(--ink);
}

.steps li::before {
  grid-row: span 2;
  color: var(--gold-deep);
  font-family: var(--display);
  font-size: 46px;
  line-height: 0.9;
  content: counter(step);
}

.steps strong {
  font-family: var(--ui);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.steps span {
  color: #5c5540;
  font-size: 16px;
  line-height: 1.4;
}

/* The little range the gauge fires across: a painted sky, ground like the game's, real rides. */
.range {
  position: relative;
  display: grid;
  border: 3px solid var(--keyline);
  border-radius: 10px;
  background: var(--keyline);
  box-shadow: 0 5px 0 var(--keyline);
  color: var(--cream);
  overflow: hidden;
}

.range-sky {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 300;
  background: url('assets/map-dunes.webp') center 35% / cover;
}

.range-ground {
  fill: url(#range-dirt);
}

/* The grass along the top of the ground, with the game's dark keyline under it. */
.range-grass {
  fill: none;
  stroke: #79d23f;
  stroke-width: 9;
  paint-order: stroke;
  filter: drop-shadow(0 3px 0 #2c5a17);
}

.range-ride {
  filter: drop-shadow(0 4px 0 rgb(5 10 22 / 45%));
}

/* The shot before this one, faint, to aim the next against. */
.range-last {
  fill: none;
  stroke: rgb(186 226 255 / 45%);
  stroke-width: 3;
  stroke-dasharray: 1 11;
  stroke-linecap: round;
}

/* Says plainly that this is a small taste, not the game. */
.range-demo {
  position: absolute;
  top: 12px;
  right: 12px;
  max-width: 300px;
  margin: 0;
  padding: 6px 12px 7px;
  border: 2px solid var(--keyline);
  border-radius: 8px;
  background: rgb(7 21 49 / 78%);
  color: #cfdaed;
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.range-arc {
  fill: none;
  stroke: rgb(255 255 255 / 85%);
  stroke-width: 4;
  stroke-dasharray: 1 13;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 50%));
}

.range-shell {
  fill: #2a2f3a;
  stroke: var(--keyline);
  stroke-width: 3;
}

/* The burst where the shot lands: a flash that swells and fades. */
.range-hit {
  fill: #ffcf3e;
  stroke: #ff7a2a;
  stroke-width: 8;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.range-hit.is-boom {
  animation: boom 0.6s ease-out;
}

@keyframes boom {
  from {
    opacity: 1;
    transform: scale(0.3);
  }

  60% {
    opacity: 0.9;
  }

  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

/* The wind for this shot, on the game's own dial: the needle shows the way, the number how hard. */
.range-wind {
  position: absolute;
  top: 10px;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--cream);
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 2px 0 var(--keyline);
  transform: translateX(-50%);
}

.range-dial {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  background: url('assets/hud/windDial.webp') center / contain no-repeat;
  filter: drop-shadow(0 3px 0 rgb(5 10 22 / 55%));
}

.range-needle {
  position: absolute;
  inset: 0;
  background: url('assets/hud/windNeedle.webp') center / contain no-repeat;
  opacity: 0.45;
  transition: transform 0.4s ease-out;
}

.range-dial b {
  position: relative;
  color: #fff;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  -webkit-text-stroke: 5px var(--keyline);
  paint-order: stroke fill;
}

.deck {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 16px 8px;
  border-top: 3px solid var(--keyline);
  background: linear-gradient(#22397a, #142554);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 12%);
}

/* The barrel's angle, as the game shows it: a little dial, the degrees, and keys to turn it. */
.angle {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 10px;
}

.angle-label {
  grid-column: 1 / -1;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 16px;
  font-weight: 600;
}

.angle-face {
  display: flex;
  align-items: center;
  gap: 6px;
}

.angle-face svg {
  width: 52px;
  height: 30px;
}

.angle-arc {
  fill: none;
  stroke: #cfdaed;
  stroke-width: 4;
  stroke-linecap: round;
}

.angle-needle {
  stroke: var(--gold);
  stroke-width: 4;
  stroke-linecap: round;
}

.angle-hub {
  fill: var(--gold);
  stroke: var(--keyline);
  stroke-width: 2;
}

.angle-face b {
  min-width: 2.4em;
  color: var(--cream);
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.angle-steps {
  display: grid;
  gap: 4px;
}

.angle-steps .key-step {
  width: 40px;
  padding: 3px 0 5px;
  font-size: 13px;
  touch-action: none;
  user-select: none;
}

/* The way the barrel points, from the Bulwark's gun. */
.range-aim {
  stroke: rgb(255 255 255 / 90%);
  stroke-width: 4;
  stroke-dasharray: 2 9;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 60%));
}

.gauge {
  display: grid;
  flex: 1;
  gap: 3px;
}

.gauge-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 16px;
  font-weight: 600;
}

.gauge-head b {
  color: var(--gold);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
}

.gauge-track {
  position: relative;
  height: 30px;
  border: 3px solid var(--keyline);
  border-radius: 999px;
  background: #0d1834;
  box-shadow: inset 0 3px 0 rgb(0 0 0 / 35%);
  overflow: hidden;
}

.gauge-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.gauge-fill {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgb(255 255 255 / 38%), transparent 46%, rgb(0 0 0 / 22%)),
    linear-gradient(90deg, #4fd163 0%, #c9e04a 38%, #ffd23e 58%, #ff9a3a 80%, #ff4b3a 100%);
  clip-path: inset(0 100% 0 0);
}

/* The gaps between the cells: twenty of them. */
.gauge-cells {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 calc(5% - 3px),
    #060b18 calc(5% - 3px) 5%
  );
}

.gauge.is-hot .gauge-track {
  animation: rattle 90ms linear infinite;
}

.gauge.is-hot .gauge-head b {
  color: #ff5a48;
}

@keyframes rattle {
  0%,
  100% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(-1px, 1px);
  }

  75% {
    transform: translate(1px, -1px);
  }
}

.key-fire {
  min-width: 190px;
  padding: 16px 22px 18px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  touch-action: none;
  user-select: none;
}

/* After a shot: a tip for the next one, then what this one was fired with. */
.range-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-height: 46px;
  padding: 4px 16px 14px;
  background: #142554;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 16px;
  font-weight: 600;
}

.range-note strong {
  margin-right: 4px;
  color: var(--cream);
  font-size: 18px;
}

.range-chip {
  padding: 3px 10px 4px;
  border: 2px solid var(--keyline);
  border-radius: 999px;
  background: #0d1834;
  color: #cfdaed;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* The word over where a shot landed, rising and fading as the game's own popups do. */
.range-pop {
  position: absolute;
  top: 24%;
  display: grid;
  justify-items: center;
  font-family: var(--display);
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0);
  -webkit-text-stroke: 6px var(--keyline);
  paint-order: stroke fill;
}

.range-pop strong {
  color: #fff;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 400;
}

.range-pop b {
  color: #ff5a48;
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 400;
}

.range-pop.is-hit strong {
  color: var(--gold);
}

.range-pop.is-shown {
  animation: pop 1.8s ease-out forwards;
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.6);
  }

  12% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.08);
  }

  22% {
    transform: translate(-50%, 0) scale(1);
  }

  75% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -26px) scale(1);
  }
}

/* The tally of hits, in the corner of the range. */
.range-score[hidden] {
  display: none;
}

.range-score {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px 6px;
  border: 2px solid var(--keyline);
  border-radius: 8px;
  background: rgb(7 21 49 / 82%);
  color: var(--dim);
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 700;
}

.range-score b {
  color: var(--gold);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

/* ── Vehicles ──────────────────────────────────────────── */

/* A row that scrolls sideways and stops on each vehicle; the arrows step through it. */
.carousel {
  display: grid;
  grid-auto-columns: minmax(280px, 32%);
  grid-auto-flow: column;
  gap: 16px;
  /* Room inside the scroller for a card that lifts and glows when pointed at. */
  margin: -14px -8px 0;
  padding: 14px 8px 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.vehicle {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 0 0 18px;
  border: 2px solid var(--keyline);
  border-radius: 6px;
  background: linear-gradient(#24386a, var(--plate));
  box-shadow: 0 4px 0 var(--keyline);
  overflow: hidden;
  scroll-snap-align: start;
}

.vehicle,
.vehicle-art,
.vehicle-art img {
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out,
    filter 0.18s ease-out;
}

/* Pointed at: the card lifts in its own colour and the ride idles, ready to go. */
.vehicle:hover {
  border-color: var(--accent);
  box-shadow:
    0 10px 0 var(--keyline),
    0 0 0 2px var(--accent),
    0 18px 40px color-mix(in srgb, var(--accent) 35%, transparent);
  transform: translateY(-6px);
}

.vehicle:hover .vehicle-art {
  filter: brightness(1.18) saturate(1.15);
}

.vehicle:hover .vehicle-art img {
  animation: idle 0.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 10px 0 rgb(5 10 22 / 45%));
}

@keyframes idle {
  from {
    transform: translateY(0) rotate(-1deg) scale(1.04);
  }

  to {
    transform: translateY(-5px) rotate(1deg) scale(1.04);
  }
}

.vehicle > :not(.vehicle-art) {
  margin: 0 18px;
}

.vehicle-art {
  display: grid;
  place-items: end center;
  aspect-ratio: 4 / 3;
  padding: 14px 14px 10px;
  border-bottom: 2px solid var(--accent);
  background: radial-gradient(
    ellipse 70% 80% at 50% 100%,
    color-mix(in srgb, var(--accent) 45%, transparent),
    #0b1326 72%
  );
}

.vehicle-art img {
  height: 100%;
  min-height: 0;
  object-fit: contain;
  filter: drop-shadow(0 6px 0 rgb(5 10 22 / 45%));
}

.vehicle h3 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}

.vehicle p {
  color: var(--dim);
  font-size: 16px;
}

.vehicle-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 2px 18px 0;
  padding: 0;
  list-style: none;
}

.vehicle-stats li {
  display: grid;
  padding: 6px 8px 7px;
  border-radius: 6px;
  background: rgb(5 10 22 / 45%);
  font-family: var(--ui);
}

.vehicle-stats span {
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
}

.vehicle-stats b {
  color: var(--cream);
  font-size: 18px;
}

/* The vehicle's three shots, as keys: pressing one says what it does. */
.shots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shots button {
  padding: 4px 12px 5px;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #0b1326;
  color: var(--cream);
  font-family: var(--ui);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.shots button.is-special {
  background: var(--gold);
  color: #3a2a00;
}

.shots button[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent);
}

.shot-line {
  min-height: 3.2em;
  color: var(--dim);
  font-size: 15px;
}

.shot-line b {
  color: var(--cream);
  font-family: var(--ui);
}

.shot-line em {
  display: block;
  color: #cfdaed;
  font-style: normal;
}

/* ── Maps ──────────────────────────────────────────────── */

.maps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.map {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  background: var(--keyline);
  color: var(--cream);
  text-align: left;
  cursor: pointer;
  border: 2px solid var(--keyline);
  border-radius: 6px;
  box-shadow: 0 4px 0 var(--keyline);
  overflow: hidden;
}

.map img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.map:hover img {
  transform: scale(1.04);
}

/* The first map is shown large: four times the room of the others. */
.map:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.map:first-child span {
  font-size: 30px;
}

/* The last map is twice as wide, so eight maps fill the grid with no gap at the end. */
.map:last-child {
  grid-column: span 2;
}

.map:last-child img {
  aspect-ratio: 32 / 9;
}

.map[aria-pressed='true'] {
  border-color: var(--gold);
  box-shadow:
    0 4px 0 var(--keyline),
    0 0 0 3px var(--gold);
}

.map span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 18px 12px 8px;
  background: linear-gradient(transparent, rgb(5 10 22 / 88%));
  font-family: var(--ui);
  font-size: 20px;
  font-weight: 700;
}

/* What the chosen map is like: its words from the game, then gravity, wind and weather. */
.map-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 28px;
  padding: 18px 22px;
  border: 2px solid var(--keyline);
  border-radius: 8px;
  background: var(--plate);
  box-shadow: 0 4px 0 var(--keyline);
}

.map-detail h3 {
  margin: 0;
  color: var(--gold);
  font-family: var(--ui);
  font-size: 24px;
  font-weight: 700;
}

.map-detail p {
  grid-column: 1;
  color: #cfdaed;
}

.map-facts {
  display: flex;
  grid-row: 1 / span 2;
  grid-column: 2;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.map-facts li {
  display: grid;
  padding: 6px 12px 7px;
  border-radius: 6px;
  background: rgb(5 10 22 / 45%);
  font-family: var(--ui);
}

.map-facts span {
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
}

.map-facts b {
  font-size: 17px;
}

.weather {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.weather li:not(.is-here) {
  opacity: 0.45;
}

.weather li {
  transition: opacity 0.2s;
  padding: 6px 12px 7px;
  border: 2px solid var(--keyline);
  border-radius: 6px;
  background: var(--plate);
  font-size: 15px;
}

.weather b {
  margin-right: 6px;
  color: var(--sky);
  font-family: var(--ui);
  font-size: 17px;
}

/* ── Rider ─────────────────────────────────────────────── */

/* Four riders in a row, each a card like the game's own: the portrait, the set, its pieces. */
.rider-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.rider-card {
  display: grid;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink);
  overflow: hidden;
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out;
}

.rider-card:hover {
  box-shadow:
    0 8px 0 var(--ink),
    0 16px 30px rgb(22 35 63 / 22%);
  transform: translateY(-5px);
}

.rider-portrait {
  display: grid;
  place-items: end center;
  aspect-ratio: 4 / 5;
  padding: 18px 14px 8px;
  background:
    radial-gradient(ellipse 46% 6% at 50% 94%, rgb(22 34 62 / 24%), transparent 70%),
    linear-gradient(#fff8e2, #f1e4bd);
}

.rider-portrait img {
  width: auto;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  transition: transform 0.25s ease-out;
}

.rider-card:hover .rider-portrait img {
  transform: scale(1.04);
}

.rider-card figcaption {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px 10px 14px;
  border-top: 2px solid var(--ink);
}

.rider-card b {
  color: var(--ink);
  font-family: var(--ui);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.rider-pieces {
  display: flex;
  gap: 6px;
}

.rider-pieces img {
  width: 40px;
  height: 40px;
  padding: 3px;
  border: 2px solid rgb(22 35 63 / 18%);
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}

.rider-ways {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--ui);
  font-size: 20px;
  font-weight: 600;
}

.rider-ways li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rider-ways img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

/* ── Ranks ─────────────────────────────────────────────── */

.rank-bands {
  display: grid;
  gap: 18px;
}

.rank-band {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 18px 36px;
  padding: 24px 28px;
  border: 2px solid var(--keyline);
  border-radius: 6px;
  background: var(--mid);
  box-shadow: 0 4px 0 var(--keyline);
}

.rank-band h3 {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: var(--ui);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.rank-band p {
  color: var(--dim);
}

.rank-badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 14px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-badges li {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--cream);
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.rank-badges img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

/* Who is on top right now, from the game's public leaderboard. */
.top-players {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 20px 24px;
  border: 2px solid var(--keyline);
  border-radius: 6px;
  background: var(--mid);
  box-shadow: 0 4px 0 var(--keyline);
}

.top-players[hidden] {
  display: none;
}

.top-players h3 {
  margin: 0;
  color: var(--gold);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
}

.top-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-list li {
  display: grid;
  grid-template-columns: 28px 36px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  color: var(--cream);
  font-family: var(--ui);
  font-size: 17px;
}

.top-list img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.top-place {
  color: var(--gold);
}

.top-name {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-rank,
.top-points {
  color: var(--dim);
  font-size: 15px;
}

@media (max-width: 560px) {
  .top-list li {
    grid-template-columns: 24px 32px minmax(0, 1fr) auto;
  }

  .top-rank {
    display: none;
  }
}

/* The top seats: few badges, drawn large. */
.rank-band-top .rank-badges {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rank-band-top .rank-badges img {
  width: 96px;
  height: 96px;
}

.rank-band-top .rank-badges li {
  font-size: 17px;
}

/* ── Footer ────────────────────────────────────────────── */

.foot {
  position: relative;
  padding: 64px 0 0;
  background: var(--navy);
  color: #cfdaed;
}

/* The last call to play, centred above the links. */
.foot-call {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding-bottom: 56px;
  text-align: center;
}

.foot-call h2 {
  color: var(--cream);
  font-size: clamp(32px, 3.6vw, 46px);
}

.foot-call p {
  max-width: 52ch;
}

.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 32px 40px;
  padding: 44px 0;
  border-top: 2px solid rgb(155 168 196 / 18%);
}

/* Until a social network has an address the Community column is hidden: the others close up. */
.foot-col[hidden] {
  display: none;
}

@media (min-width: 861px) {
  .foot-grid:has(> #community[hidden]) {
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  }
}

.foot-brand {
  display: grid;
  gap: 14px;
}

.foot-logo {
  width: 200px;
  height: auto;
}

.foot-brand p {
  max-width: 34ch;
  color: var(--dim);
  font-size: 16px;
}

.foot-col h3 {
  margin: 0 0 14px;
  color: var(--cream);
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.foot-col ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-col a,
.foot-link {
  padding: 0;
  border: 0;
  background: none;
  color: #cfdaed;
  font: inherit;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}

.foot-col a:hover,
.foot-link:hover {
  color: var(--gold);
}

/* A social link: the network's colour as a dot, then its name. */
.social {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.social i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding: 22px 0 28px;
  border-top: 2px solid rgb(155 168 196 / 18%);
  color: var(--dim);
  font-size: 14px;
}

.foot-bottom a {
  color: var(--dim);
}

.foot-bottom a:hover {
  color: var(--gold);
}

.foot-legal {
  display: flex;
  flex: 1;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ── Small screens ─────────────────────────────────────── */

@media (max-width: 860px) {
  .top-links {
    display: none;
  }

  .sound {
    margin-left: auto;
  }

  .sound span {
    display: none;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .rider-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foot-brand {
    grid-column: 1 / -1;
  }

  .hero-inner {
    gap: 28px;
    padding: 36px 0 96px;
  }

  .steps,
  .maps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps li:nth-child(3) {
    border-left: 0;
  }

  .steps li:nth-child(n + 3) {
    border-top: 2px solid var(--ink);
  }

  .edge {
    height: 40px;
  }

  .edge-top {
    top: -39px;
  }

  .carousel {
    grid-auto-columns: 82%;
  }

  .modes {
    grid-template-columns: minmax(0, 1fr);
  }

  .range-demo {
    display: none;
  }

  .map-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .map-facts {
    grid-row: auto;
    grid-column: 1;
  }

  .rank-band {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
  }

  .rank-badges img {
    width: 48px;
    height: 48px;
  }

  .deck {
    flex-wrap: wrap;
  }

  /* The gauge gets a row to itself, so its twenty cells stay wide enough to read. */
  .gauge {
    flex-basis: 100%;
  }

  .key-fire {
    flex: 1;
  }

  .band {
    padding: 64px 0 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rider-card:hover,
  .rider-card:hover .rider-portrait img {
    transform: none;
  }

  .range-pop.is-shown {
    animation: none;
    opacity: 1;
  }

  .vehicle:hover,
  .vehicle:hover .vehicle-art img {
    animation: none;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 480px) {
  /* The icon alone names the page where the bar has no room for the word. */
  .brand span {
    display: none;
  }
}

/* The offer of the visitor's own language: a slim bar floating at the bottom, gone once answered. */
.language-bar {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 1000;
  max-width: 640px;
  margin: 0 auto;
  border: 2px solid #050a16;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 45%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  padding: 10px 48px 10px 16px;
  background: #0f2a55;
  color: #f4eedf;
  font-weight: 600;
  text-align: center;
}

.language-bar-go {
  padding: 4px 12px;
  border-radius: 8px;
  background: #ffc531;
  color: #0f2a55;
  font-weight: 800;
  text-decoration: none;
}

.language-bar-close {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  color: #f4eedf;
  font-size: 18px;
  transform: translateY(-50%);
  cursor: pointer;
}

/* ── Legal pages (privacy, terms): the site's top bar, a navy title band, then the text on
   cream paper beside a list of contents, and the site's footer. Written from docs/legal. ── */

.legal-page .top-links a[aria-current='page'] {
  color: var(--gold);
}

.legal-play {
  margin-left: auto;
}

.legal-hero {
  padding: 44px 0 64px;
  border-bottom: 2px solid var(--keyline);
  background:
    radial-gradient(ellipse at 15% 0%, rgb(81 191 242 / 18%), transparent 55%),
    linear-gradient(var(--deep), var(--navy));
}

.legal-eyebrow {
  margin: 0 0 8px;
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-eyebrow a {
  color: var(--gold);
  text-decoration: none;
}

.legal-updated {
  display: inline-block;
  margin: 16px 0 0;
  padding: 4px 12px;
  border: 2px solid var(--keyline);
  border-radius: 999px;
  background: var(--plate);
  color: var(--dim);
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 600;
}

/* A reading page: narrower than the landing, the title band and the text lined up on it. */
.legal-page .shell {
  width: min(1040px, calc(100% - 40px));
}

/* The paper stands a little into the band above it, as the landing's light sections do. */
.legal-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: -32px;
  margin-inline: auto;
  padding-bottom: 72px;
}

.legal-contents {
  position: sticky;
  top: 84px;
  padding: 16px 18px;
  border: 2px solid var(--keyline);
  border-radius: 12px;
  background: var(--plate);
  box-shadow: 0 4px 0 var(--keyline);
}

.legal-contents h2 {
  margin: 0 0 8px;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.legal-contents ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--ui);
  font-size: 17px;
  font-weight: 600;
}

.legal-contents a {
  color: var(--cream);
  text-decoration: none;
}

.legal-contents a:hover {
  color: var(--gold);
}

.legal {
  padding: 36px 44px 44px;
  border: 2px solid var(--keyline);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 6px 0 var(--keyline);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
}

.legal > :first-child {
  margin-top: 0;
}

.legal h2 {
  margin: 36px 0 10px;
  color: var(--ink);
  font-size: 28px;
  scroll-margin-top: 84px;
}

.legal p,
.legal ul {
  margin: 0 0 14px;
}

.legal li {
  margin-bottom: 6px;
}

.legal strong {
  color: #0b1530;
}

.legal a {
  color: #1d5fbf;
  font-weight: 600;
}

.legal table {
  width: 100%;
  margin: 8px 0 18px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 2px solid #d9cfb5;
  border-radius: 10px;
  font-size: 15px;
}

.legal th {
  padding: 10px 12px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--ui);
  font-size: 15px;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.legal td {
  padding: 10px 12px;
  border-top: 1px solid #e6dcc3;
  vertical-align: top;
}

.legal tbody tr:nth-child(even) td {
  background: #f4eedd;
}

/* A blank still to fill in before the page goes live. */
.legal .blank {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--gold);
  color: #3a2a00;
}

.legal-foot {
  padding: 22px 0 32px;
  border-top: 2px solid var(--keyline);
  background: var(--deep);
  font-family: var(--ui);
  font-size: 16px;
}

.legal-foot .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  color: var(--dim);
}

.legal-foot a {
  color: var(--cream);
  text-decoration: none;
}

.legal-foot a:hover {
  color: var(--gold);
}

/* A phone: the contents go above the paper, and each table row stands as a small card. */
@media (max-width: 820px) {
  .legal-page .top-links {
    display: none;
  }

  .legal-hero {
    padding: 28px 0 52px;
  }

  .legal-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .legal-contents {
    position: static;
  }

  .legal {
    padding: 24px 20px 28px;
  }

  .legal table,
  .legal tbody,
  .legal tr,
  .legal td {
    display: block;
  }

  .legal thead {
    display: none;
  }

  .legal tr {
    padding: 10px 12px;
    border-top: 1px solid #e6dcc3;
  }

  .legal tr:first-child {
    border-top: 0;
  }

  .legal td {
    padding: 2px 0;
    border: 0;
    background: none !important;
  }

  .legal td::before {
    content: attr(data-label);
    display: block;
    color: #6b6450;
    font-family: var(--ui);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}
