@charset "UTF-8";
/*
 * spaceship.lt teaser — a static page, no build step.
 * Colors and panel chrome mirror the game UI (resources/css/app.css). Pixel art is only ever scaled by whole
 * numbers (1×, 2×, 3×, 4×) so every art pixel stays square.
 */

/* ---------- Fonts (local, SIL OFL; latin-ext carries the Lithuanian letters) ---------- */

@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/pixelify-sans-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/pixelify-sans-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/pixelify-sans-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/pixelify-sans-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/chakra-petch-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/chakra-petch-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/chakra-petch-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/chakra-petch-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/chakra-petch-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/chakra-petch-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

:root {
  --bg: #100d15;
  --bg-deep: #09070d;
  --panel: #1a1620;
  --panel-raised: #24202a;
  --border: #3d363f;
  --border-strong: #594a4b;
  --text: #eef1ee;
  --text-soft: #c5cfd1;
  --muted: #8ba0a5;
  --accent: #69e8f3;
  --accent-deep: #3477a7;
  --gold: #f7cf7f;
  --positive: #5c9e74;
  --positive-light: #8ad195;
  --warning: #e78852;
  --danger: #ac5a48;

  /* The chosen faction tints a few highlights (switched on <html data-faction>). */
  --fx: #e78852;
  --fx-rgb: 231 136 82;

  --font-pixel: "Pixelify Sans", ui-monospace, monospace;
  --font-body: "Chakra Petch", system-ui, sans-serif;
  /* Pixelify's 5 and 9 read as S, so figures use the HUD font. */
  --font-num: "Chakra Petch", system-ui, sans-serif;

  --gutter: 16px;
  --header-h: 64px;
  --pixel-corners: polygon(0 2px, 2px 2px, 2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px));
  --pixel-corners-4: polygon(0 4px, 2px 4px, 2px 2px, 4px 2px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px));
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M0 6h2v2H0zM2 8h2v2H2zM4 6h2v2H4zM6 4h2v2H6zM8 2h2v2H8zM10 0h2v2h-2z'/%3E%3C/svg%3E");
  --plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M5 0h2v12H5zM0 5h12v2H0z'/%3E%3C/svg%3E");
}

[data-faction="swarm"] {
  --fx: #d977e6;
  --fx-rgb: 217 119 230;
}

[data-faction="construct"] {
  --fx: #74a4ff;
  --fx-rgb: 116 164 255;
}

@media (min-width: 640px) {
  :root {
    --gutter: 24px;
  }
}

@media (min-width: 1024px) {
  :root {
    --gutter: 32px;
    --header-h: 72px;
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

p,
li {
  text-wrap: pretty;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

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

.px {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

a {
  color: var(--accent);
}

button {
  font: inherit;
  color: inherit;
}

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

strong {
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nowrap {
  white-space: nowrap;
}

.skip {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

main,
.footer {
  position: relative;
  z-index: 1;
  overflow-x: clip;
}

/* ---------- Sky: nebula + canvas starfield (main.js) ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(70vmax 45vmax at 88% -8%, rgb(52 119 167 / 0.24), transparent 70%),
    radial-gradient(55vmax 45vmax at -5% 38%, rgb(112 56 140 / 0.2), transparent 70%),
    radial-gradient(70vmax 45vmax at 70% 108%, rgb(var(--fx-rgb) / 0.1), transparent 70%),
    var(--bg);
}

.sky__stars {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Buttons, chips, cards ---------- */

.btn {
  --b: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid var(--b);
  background: var(--panel-raised);
  color: var(--text);
  font: 700 0.9375rem/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  clip-path: var(--pixel-corners);
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / 0.08),
    inset 0 -4px 0 rgb(0 0 0 / 0.28);
  transition:
    transform 0.12s ease,
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 3px 0 rgb(0 0 0 / 0.3);
}

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -6px;
}

.btn--primary {
  --b: #b8f6fb;
  background: var(--accent);
  color: #0b1a1f;
}

.btn--primary:hover {
  background: #97f2f8;
}

.btn--primary:focus-visible {
  outline-color: var(--bg);
}

.btn--ghost {
  background: rgb(26 22 32 / 0.78);
}

.btn--ghost:hover {
  --b: var(--accent);
  color: var(--accent);
}

.btn--sm {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.8125rem;
}

.btn--block {
  width: 100%;
}

.icon {
  flex: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

@media (max-width: 479px) {
  .actions .btn {
    flex: 1 1 100%;
  }
}

.card {
  position: relative;
  padding: 24px;
  background: rgb(26 22 32 / 0.88);
  border: 2px solid var(--border);
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / 0.04),
    inset 0 -2px 0 rgb(0 0 0 / 0.25);
  clip-path: var(--pixel-corners);
}

.tag {
  padding: 5px 8px;
  border: 2px solid var(--border-strong);
  color: var(--muted);
  font: 700 0.75rem/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  font-size: 0.8125rem;
}

/* HUD corner brackets around art. */
.frame {
  position: relative;
}

.frame::before {
  content: "";
  position: absolute;
  inset: -6px;
  pointer-events: none;
  --c: rgb(var(--fx-rgb) / 0.9);
  --l: 16px;
  --t: 2px;
  background:
    linear-gradient(var(--c) 0 0) top left / var(--l) var(--t),
    linear-gradient(var(--c) 0 0) top left / var(--t) var(--l),
    linear-gradient(var(--c) 0 0) top right / var(--l) var(--t),
    linear-gradient(var(--c) 0 0) top right / var(--t) var(--l),
    linear-gradient(var(--c) 0 0) bottom left / var(--l) var(--t),
    linear-gradient(var(--c) 0 0) bottom left / var(--t) var(--l),
    linear-gradient(var(--c) 0 0) bottom right / var(--l) var(--t),
    linear-gradient(var(--c) 0 0) bottom right / var(--t) var(--l);
  background-repeat: no-repeat;
}

/* ---------- Top bar ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: var(--header-h);
  border-bottom: 2px solid transparent;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease;
}

.topbar.is-scrolled {
  background: rgb(16 13 21 / 0.86);
  border-bottom-color: var(--border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.topbar__in {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  font: 700 1.3125rem/1 var(--font-pixel);
}

.brand__icon {
  width: 32px;
}

.brand__word span {
  color: var(--accent);
}

.nav {
  display: none;
  margin-left: auto;
  gap: 2px;
}

.nav a {
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav a:hover {
  color: var(--text);
}

.topbar__share {
  margin-left: auto;
}

@media (min-width: 960px) {
  .nav {
    display: flex;
  }

  .topbar__share {
    margin-left: 12px;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-h) + 32px) 0 56px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgb(255 255 255 / 0.02) 0 1px, transparent 1px 4px);
}

.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 40px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 2px solid rgb(247 207 127 / 0.5);
  background: rgb(247 207 127 / 0.08);
  color: var(--gold);
  font: 700 0.8125rem/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  clip-path: var(--pixel-corners);
}

.badge__dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  box-shadow: 0 0 10px rgb(247 207 127 / 0.9);
  animation: dim 2s ease-in-out infinite;
}

.badge__sep {
  opacity: 0.45;
}

.hero__title {
  margin-top: 22px;
  font: 700 clamp(2.5rem, 1.6rem + 3.2vw, 4.125rem)/1.04 var(--font-pixel);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
  text-shadow: 0 0 28px rgb(105 232 243 / 0.35);
}

.hero__lead {
  margin-top: 22px;
  max-width: 35rem;
  color: var(--text-soft);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
}

.hero__lead strong {
  color: var(--text);
}

.ticker {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 32px;
  min-height: 3em;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.ticker__label {
  flex: none;
  padding: 3px 8px;
  border: 2px solid var(--border);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.ticker__text::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 4px;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 1s steps(1, end) infinite;
}

.hero__art {
  display: grid;
  justify-items: center;
  gap: 20px;
}

/* The planet is 168 px: the stage is always 2× or 3× of it. On narrow phones it overflows into transparent space. */
.hero__stage {
  position: relative;
  container-type: inline-size;
  justify-self: center;
  width: 336px;
  aspect-ratio: 1;
}

.hero__glow {
  position: absolute;
  inset: -22%;
  background:
    radial-gradient(closest-side at 40% 38%, rgb(255 236 200 / 0.12), transparent 60%),
    radial-gradient(closest-side, rgb(105 232 243 / 0.3), rgb(52 119 167 / 0.14) 55%, transparent 74%);
}

.hero__orbit {
  position: absolute;
  left: -12%;
  right: -12%;
  top: 40%;
  height: 24%;
  border: 2px dashed rgb(105 232 243 / 0.28);
  border-radius: 50%;
  transform: rotate(-14deg);
}

.hero__planet {
  position: absolute;
  inset: 0;
  width: 100%;
  animation: float 10s ease-in-out infinite;
}

.hero__cruiser {
  position: absolute;
  top: 4%;
  right: -2%;
  width: 96px;
  animation: bob 7s ease-in-out -2s infinite;
}

.hero__flagship {
  position: absolute;
  left: -4%;
  bottom: 2%;
  width: 128px;
  filter: drop-shadow(0 0 16px rgb(var(--fx-rgb) / 0.45));
  animation: bob 6s ease-in-out infinite;
}

/* Three fighters cross the stage now and then (cqw: % of the stage width). */
.hero__squad {
  position: absolute;
  left: 0;
  top: 0;
  width: 120px;
  height: 84px;
  opacity: 0;
  transform: translate(-45cqw, 50cqw);
  animation: flyby 16s linear 6s infinite;
}

.hero__squad img {
  position: absolute;
  width: 48px;
}

.hero__squad img:nth-child(1) {
  left: 64px;
  top: 30px;
}

.hero__squad img:nth-child(2) {
  left: 8px;
  top: 0;
}

.hero__squad img:nth-child(3) {
  left: 0;
  top: 60px;
}

.switch {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  background: rgb(16 13 21 / 0.72);
  border: 2px solid var(--border);
  clip-path: var(--pixel-corners);
}

.switch__label {
  padding: 0 8px 0 6px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.switch__btn {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  clip-path: var(--pixel-corners);
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.switch__btn:hover {
  color: var(--text);
}

.switch__btn[aria-pressed="true"] {
  background: rgb(var(--fx-rgb) / 0.18);
  color: var(--fx);
}

.switch__btn:focus-visible {
  outline-offset: -4px;
}

@media (max-width: 479px) {
  .switch__label {
    flex-basis: 100%;
    padding: 6px 0 2px;
    text-align: center;
  }
}

.facts {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  margin-top: 56px;
  background: var(--border);
  border: 2px solid var(--border);
  clip-path: var(--pixel-corners);
}

.facts li {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 16px;
  background: rgb(22 18 28 / 0.94);
}

.facts strong {
  color: var(--gold);
  font: 700 1.5rem/1 var(--font-num);
  white-space: nowrap;
}

.facts span {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.35;
}

@media (max-width: 959px) {
  .hero__grid {
    gap: 0;
  }

  .hero__copy {
    display: contents;
  }

  .badge {
    justify-self: start;
  }

  .hero__art {
    margin-top: 40px;
  }

  .ticker {
    order: 1;
    margin-top: 24px;
  }
}

@media (min-width: 640px) {
  .hero__stage {
    width: 504px;
  }

  .hero__flagship {
    width: 256px;
    left: -10%;
  }
}

@media (min-width: 800px) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .facts li {
    padding: 22px 24px;
  }

  .facts strong {
    font-size: 2rem;
  }
}

@media (min-width: 960px) {
  .hero {
    padding-top: calc(var(--header-h) + 56px);
  }

  .hero__grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: 32px;
  }

  .hero__stage {
    width: 336px;
  }

  .hero__flagship {
    width: 128px;
    left: -4%;
  }

  .hero__squad {
    width: 240px;
    height: 168px;
  }

  .hero__squad img {
    width: 96px;
  }

  .hero__squad img:nth-child(1) {
    left: 128px;
    top: 60px;
  }

  .hero__squad img:nth-child(2) {
    left: 16px;
    top: 0;
  }

  .hero__squad img:nth-child(3) {
    left: 0;
    top: 120px;
  }
}

@media (min-width: 1160px) {
  .hero__stage {
    width: 504px;
  }

  .hero__flagship {
    width: 256px;
    left: -10%;
  }
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding-block: clamp(56px, 10vw, 128px);
}

.section--band {
  background: linear-gradient(to bottom, transparent, rgb(26 22 32 / 0.62) 96px, rgb(26 22 32 / 0.62) calc(100% - 96px), transparent);
}

.section__head {
  max-width: 48rem;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font: 700 0.8125rem/1 var(--font-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow span {
  color: var(--gold);
  font: 700 1rem/1 var(--font-num);
  letter-spacing: 0.04em;
}

.eyebrow::after {
  content: "";
  width: 40px;
  height: 2px;
  background: currentColor;
  opacity: 0.45;
}

h2 {
  margin-top: 16px;
  font: 700 clamp(2rem, 1.35rem + 2.6vw, 3.125rem)/1.08 var(--font-pixel);
  text-wrap: balance;
}

.lead {
  margin-top: 18px;
  max-width: 44rem;
  color: var(--text-soft);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
}

.note {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- Colony ---------- */

.colony {
  display: grid;
  gap: 32px;
}

.colony__scene {
  display: grid;
  justify-items: center;
  gap: 20px;
}

/* The mat is a shadow, not padding, so the hotspot percentages map straight onto the image. */
.scene {
  margin: 10px 0;
  background: var(--bg-deep);
  box-shadow:
    0 0 0 8px var(--bg-deep),
    0 0 0 10px var(--border);
}

.scene.frame::before {
  inset: -16px;
}

.scene__img {
  width: 320px;
}

/* The scene is always the Terran colony, whatever faction is picked. */
.scene__tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 5px 8px;
  background: rgb(9 7 13 / 0.85);
  border: 2px solid var(--border-strong);
  color: var(--text-soft);
  font: 700 0.75rem/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hotspot::before {
  content: "";
  position: absolute;
  inset: 16px;
  background: var(--accent);
  box-shadow:
    0 0 0 2px var(--bg-deep),
    0 0 14px 3px rgb(105 232 243 / 0.75);
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

.hotspot::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: ping 2.4s ease-out infinite;
}

.hotspot:hover::before {
  transform: scale(1.3);
}

.hotspot[aria-pressed="true"]::before {
  background: var(--gold);
  transform: scale(1.3);
  box-shadow:
    0 0 0 2px var(--bg-deep),
    0 0 16px 4px rgb(247 207 127 / 0.8);
}

.hotspot[aria-pressed="true"]::after {
  border-color: var(--gold);
}

.hotspot:focus-visible {
  outline-offset: -2px;
}

.spot {
  width: 100%;
  max-width: 660px;
  padding: 20px 22px;
}

.spot__hint {
  color: var(--muted);
  font: 700 0.8125rem/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.spot__title {
  margin-top: 10px;
  color: var(--gold);
  font: 700 1.5rem/1.15 var(--font-pixel);
}

.spot__text {
  margin-top: 6px;
  min-height: 4.8em;
  color: var(--text-soft);
}

.tiers {
  display: grid;
  gap: 20px;
  align-content: start;
}

.tiers__head h3 {
  font: 700 1.5rem/1.15 var(--font-pixel);
}

.tiers__head p {
  margin-top: 8px;
  color: var(--muted);
}

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

.seg__btn {
  min-height: 44px;
  padding: 6px 8px;
  line-height: 1.2;
  border: 2px solid var(--border);
  background: var(--panel-raised);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  clip-path: var(--pixel-corners);
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.seg__btn:hover {
  color: var(--text);
}

.seg__btn[aria-pressed="true"] {
  border-color: var(--fx);
  background: rgb(var(--fx-rgb) / 0.14);
  color: var(--text);
}

.seg__btn:focus-visible,
.tier:focus-visible,
.ftab:focus-visible {
  outline-offset: -6px;
}

.tiers__stage {
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 12px;
  min-height: 248px;
  padding: 8px 0 16px;
  background:
    radial-gradient(closest-side at 50% 58%, rgb(var(--fx-rgb) / 0.18), transparent 75%),
    rgb(9 7 13 / 0.5);
  border: 2px solid var(--border);
}

.tiers__big {
  width: 192px;
}

.tiers__caption {
  color: var(--fx);
  font: 700 0.8125rem/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tiers__row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.tier {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  min-height: 44px;
  padding: 8px 2px;
  border: 2px solid var(--border);
  background: rgb(9 7 13 / 0.5);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  clip-path: var(--pixel-corners);
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background-color 0.15s ease;
}

.tier img {
  display: none;
  width: 64px;
}

.tier:hover {
  color: var(--text);
}

.tier[aria-pressed="true"] {
  border-color: var(--fx);
  background: rgb(var(--fx-rgb) / 0.12);
  color: var(--text);
}

/* Resources: HUD chips on phones, five cells on tablets, a list beside the scene on desktops. */
.resources {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.resources li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  background: rgb(9 7 13 / 0.55);
  border: 2px solid var(--border);
  clip-path: var(--pixel-corners);
}

.resources img {
  flex: none;
  width: 32px;
}

.resources h3 {
  font: 700 1rem/1.2 var(--font-pixel);
}

/* Phones show names only; the descriptions stay for screen readers. */
.resources p {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 520px) {
  .tier img {
    display: block;
  }
}

@media (min-width: 640px) {
  .resources {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .resources li {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 12px;
  }

  .resources img {
    width: 64px;
  }

  .resources h3 {
    font-size: 1.125rem;
  }

  .resources p {
    position: static;
    width: auto;
    height: auto;
    margin: 2px 0 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.4;
  }
}

@media (min-width: 720px) {
  .scene__img {
    width: 640px;
  }

  .spot__text {
    min-height: 3.2em;
  }
}

@media (min-width: 1200px) {
  .colony {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    row-gap: 16px;
    align-items: start;
  }

  .colony__scene {
    grid-row: 1 / span 2;
  }

  .resources {
    grid-column: 2;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .resources li {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 8px 14px 8px 8px;
  }

  .resources img {
    width: 32px;
  }

  .resources li > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 10px;
  }

  .resources h3 {
    font-size: 1rem;
  }

  .resources p {
    margin: 0;
    font-size: 0.875rem;
  }
}

/* ---------- Factions ---------- */

.factions {
  display: grid;
  gap: 16px;
}

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

.ftab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 14px;
  border: 2px solid var(--border);
  background: rgb(26 22 32 / 0.84);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  clip-path: var(--pixel-corners);
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    color 0.15s ease;
}

.ftab img {
  flex: none;
  width: 64px;
}

/* Phones: every name gets a two-line box, so the roles line up across the tabs. */
.ftab strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3em;
  color: var(--text);
  /* "Konstruktas" must fit a third of a 360px screen. */
  font: 700 clamp(0.8125rem, 3.6vw, 0.9375rem)/1.15 var(--font-pixel);
}

.ftab small {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ftab:hover {
  border-color: var(--border-strong);
}

.ftab[aria-selected="true"] {
  border-color: var(--fx);
  background: rgb(var(--fx-rgb) / 0.12);
  color: var(--fx);
}

.fpanel {
  position: relative;
  display: grid;
  gap: 28px;
  padding: 24px 20px;
  background:
    radial-gradient(90% 60% at 0% 0%, rgb(var(--fx-rgb) / 0.1), transparent 70%),
    rgb(26 22 32 / 0.9);
  border: 2px solid rgb(var(--fx-rgb) / 0.5);
  clip-path: var(--pixel-corners);
}

.fpanel[hidden] {
  display: none;
}

.fpanel:focus-visible {
  outline-offset: -6px;
}

.fpanel__intro {
  display: grid;
  gap: 24px;
  align-content: start;
}

.fpanel__portrait {
  justify-self: start;
  margin: 6px;
  padding: 8px;
  background:
    radial-gradient(closest-side, rgb(var(--fx-rgb) / 0.28), transparent),
    var(--bg-deep);
  border: 2px solid var(--border);
}

.fpanel__portrait img {
  width: 192px;
}

.fpanel__role {
  color: var(--fx);
  font: 700 0.8125rem/1.2 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fpanel h3 {
  margin-top: 10px;
  font: 700 clamp(1.875rem, 1.5rem + 1.5vw, 2.625rem)/1.05 var(--font-pixel);
}

.fpanel__copy > p:not([class]) {
  margin-top: 12px;
  max-width: 34rem;
  color: var(--text-soft);
}

.bonus {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 22px;
  padding: 12px 16px;
  background: rgb(var(--fx-rgb) / 0.1);
  border: 2px solid rgb(var(--fx-rgb) / 0.55);
  clip-path: var(--pixel-corners);
}

.bonus strong {
  color: var(--fx);
  font: 700 2.125rem/1 var(--font-num);
  white-space: nowrap;
}

.bonus span {
  font-weight: 600;
}

/* Army row: 1× sprites in narrow panels, 2× once they fit (64 + 128 + 128 + gaps = 344 px). */
.army {
  max-width: 34rem;
  margin-top: 16px;
  padding: 14px 16px;
  background:
    linear-gradient(to top, rgb(var(--fx-rgb) / 0.12), transparent 70%),
    rgb(9 7 13 / 0.5);
  border: 2px solid var(--border);
  clip-path: var(--pixel-corners);
}

.army__units {
  container-type: inline-size;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.army__units img {
  width: 64px;
}

.army__units img:first-child {
  width: 32px;
}

@container (min-width: 344px) {
  .army__units img {
    width: 128px;
  }

  .army__units img:first-child {
    width: 64px;
  }
}

.army p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.875rem;
}

.fpanel__body {
  display: grid;
  gap: 16px;
  align-content: start;
}

.fleet {
  display: grid;
  gap: 8px;
}

.fleet li {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgb(9 7 13 / 0.5);
  border: 2px solid var(--border);
  clip-path: var(--pixel-corners);
}

.fleet__art {
  display: grid;
  place-items: center;
  min-height: 68px;
}

.fleet li:nth-child(1) img,
.fleet li:nth-child(2) img {
  width: 48px;
}

.fleet li:nth-child(3) img {
  width: 96px;
}

.fleet li:nth-child(4) img {
  width: 128px;
}

.fleet li > span:last-child {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.35;
}

.fleet strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font: 700 1.0625rem/1.2 var(--font-pixel);
}

.skyline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 0 4px;
  padding: 16px 12px;
  background:
    linear-gradient(to top, rgb(var(--fx-rgb) / 0.14), transparent 65%),
    rgb(9 7 13 / 0.5);
  border: 2px solid var(--border);
  clip-path: var(--pixel-corners);
}

.skyline img {
  width: 64px;
}

.skyline p {
  flex-basis: 100%;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

@media (min-width: 720px) {
  .ftab {
    flex-direction: row;
    gap: 14px;
    padding: 12px 16px;
    text-align: left;
  }

  .ftab strong {
    display: block;
    min-height: 0;
    font-size: 1.125rem;
  }

  .ftab small {
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
  }

  .fpanel {
    padding: 32px;
  }

  .fpanel__intro {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }
}

/* Tablets: a 2x2 hangar with the ships at double size instead of four sparse rows. */
@media (min-width: 720px) and (max-width: 1039px) {
  .fleet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fleet li {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    justify-items: center;
    padding: 12px 12px 16px;
    text-align: center;
  }

  .fleet__art {
    min-height: 132px;
  }

  .fleet li:nth-child(1) .fleet__art,
  .fleet li:nth-child(2) .fleet__art {
    min-height: 72px;
  }

  .fleet li:nth-child(1) img,
  .fleet li:nth-child(2) img {
    width: 96px;
  }

  .fleet li:nth-child(3) img {
    width: 192px;
  }

  .fleet li:nth-child(4) img {
    width: 256px;
  }
}

@media (min-width: 1040px) {
  .fpanel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
    gap: 40px;
  }

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

  .fpanel__portrait img {
    width: 256px;
  }

  .fleet li {
    grid-template-columns: 272px minmax(0, 1fr);
  }

  .fleet__art {
    min-height: 132px;
  }

  .fleet li:nth-child(1) img,
  .fleet li:nth-child(2) img {
    width: 96px;
  }

  .fleet li:nth-child(3) img {
    width: 192px;
  }

  .fleet li:nth-child(4) img {
    width: 256px;
  }

  .fleet li:nth-child(1) .fleet__art,
  .fleet li:nth-child(2) .fleet__art {
    min-height: 64px;
  }

  .fleet li:nth-child(3) .fleet__art {
    min-height: 104px;
  }

  .skyline img {
    width: 128px;
  }
}

/* ---------- Galaxy ---------- */

.galaxy {
  display: grid;
  gap: 40px;
  align-items: center;
}

.map {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1;
  margin-inline: auto;
}

.map__core {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(247 207 127 / 0.3), rgb(231 136 82 / 0.12) 55%, transparent 80%);
}

.map__ring {
  position: absolute;
  border: 2px dashed rgb(139 160 165 / 0.32);
  border-radius: 50%;
  animation: spin 240s linear infinite;
}

.map__ring--outer {
  inset: 10%;
}

.map__ring--mid {
  inset: 25%;
  border-color: rgb(105 232 243 / 0.34);
  animation-duration: 160s;
  animation-direction: reverse;
}

.map__ring--inner {
  inset: 38%;
  border: 2px solid rgb(247 207 127 / 0.6);
  box-shadow:
    0 0 24px rgb(247 207 127 / 0.28),
    inset 0 0 24px rgb(247 207 127 / 0.2);
  animation: shield 3.2s ease-in-out infinite;
}

.map__obj {
  position: absolute;
  left: calc(50% + cos(var(--a)) * var(--r));
  top: calc(50% + sin(var(--a)) * var(--r));
  width: 64px;
  margin: -32px 0 0 -32px;
}

.map__obj--fortress {
  left: 50%;
  top: 50%;
}

.map__obj--far {
  opacity: 0.7;
}

.map__you {
  position: absolute;
  left: calc(50% + cos(var(--a)) * var(--r));
  top: calc(50% + sin(var(--a)) * var(--r));
  padding: 3px 7px;
  background: var(--accent);
  color: var(--bg);
  font: 700 0.75rem/1.2 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translate(-50%, 30px);
}

.legend {
  display: grid;
  gap: 12px;
}

.legend__item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
  background: rgb(26 22 32 / 0.86);
  border: 2px solid var(--border);
  clip-path: var(--pixel-corners);
}

.legend__item--fortress {
  border-color: rgb(247 207 127 / 0.55);
  background:
    linear-gradient(90deg, rgb(247 207 127 / 0.09), transparent 70%),
    rgb(26 22 32 / 0.86);
}

.legend__where {
  color: var(--accent);
  font: 700 0.8125rem/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legend__item--fortress .legend__where {
  color: var(--gold);
}

/* Pointing at a legend entry dims everything else on the map. */
@media (hover: hover) {
  .map__obj,
  .legend__item {
    transition:
      opacity 0.2s ease,
      filter 0.2s ease,
      border-color 0.2s ease;
  }

  .legend__item:hover {
    border-color: var(--border-strong);
  }

  .legend__item--fortress:hover {
    border-color: var(--gold);
  }

  .galaxy:has(.legend__item--pirate:hover) .map__obj:not(.map__obj--pirate),
  .galaxy:has(.legend__item--outpost:hover) .map__obj:not(.map__obj--outpost),
  .galaxy:has(.legend__item--fortress:hover) .map__obj:not(.map__obj--fortress) {
    opacity: 0.2;
  }

  .galaxy:has(.legend__item--pirate:hover) .map__obj--pirate,
  .galaxy:has(.legend__item--outpost:hover) .map__obj--outpost,
  .galaxy:has(.legend__item--fortress:hover) .map__obj--fortress {
    opacity: 1;
    filter: drop-shadow(0 0 10px rgb(247 207 127 / 0.55));
  }
}

.legend h3 {
  margin-top: 8px;
  font: 700 1.3125rem/1.2 var(--font-pixel);
}

.legend h3 + p {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 0.9375rem;
}

.planets {
  margin-top: 64px;
}

.planets__title {
  font: 700 1.375rem/1.2 var(--font-pixel);
}

.planets__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.planets__list li {
  display: grid;
  flex: 0 0 calc((100% - 16px) / 3);
  justify-items: center;
  align-content: start;
  gap: 4px;
  padding: 16px 4px;
  background: rgb(9 7 13 / 0.5);
  border: 2px solid var(--border);
  text-align: center;
  clip-path: var(--pixel-corners);
}

.planets__list img {
  width: 64px;
  margin-bottom: 8px;
}

.planets__list strong {
  font: 700 0.9375rem/1.2 var(--font-pixel);
}

.planets__list span {
  color: var(--gold);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Phones and tablets: two wide cards on top (the home planet's name is long), three below. */
@media (max-width: 799px) {
  .planets__list li:nth-child(-n + 2) {
    flex-basis: calc((100% - 8px) / 2);
  }
}

@media (min-width: 640px) {
  .map__obj--fortress {
    width: 128px;
    margin: -64px 0 0 -64px;
  }
}

@media (min-width: 800px) {
  .planets__list {
    flex-wrap: nowrap;
    gap: 12px;
  }

  .planets__list li {
    flex: 1 1 0;
    padding: 18px 8px;
  }

  .planets__list strong {
    font-size: 1.0625rem;
  }

  .planets__list span {
    font-size: 0.875rem;
  }
}

@media (min-width: 960px) {
  .planets__list img {
    width: 128px;
  }
}

@media (min-width: 1000px) {
  .galaxy {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 56px;
  }
}

/* ---------- Combat ---------- */

.combat {
  display: grid;
  gap: 40px;
}

.checks {
  display: grid;
  gap: 24px;
  align-content: start;
}

.checks li {
  position: relative;
  padding-left: 40px;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  -webkit-mask: var(--check) center / contain no-repeat;
  mask: var(--check) center / contain no-repeat;
}

.checks h3 {
  font: 700 1.3125rem/1.2 var(--font-pixel);
}

.checks p {
  margin-top: 6px;
  color: var(--text-soft);
}

.forecast {
  display: grid;
  gap: 16px;
  padding: 22px 20px;
}

.forecast__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.forecast__head h3 {
  font: 700 1.375rem/1.2 var(--font-pixel);
}

.forecast__target {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: rgb(9 7 13 / 0.55);
  border: 2px solid var(--border);
  clip-path: var(--pixel-corners);
}

.forecast__target img {
  flex: none;
  width: 64px;
}

.forecast__name {
  font: 700 1.1875rem/1.25 var(--font-pixel);
}

.forecast__label {
  color: var(--muted);
  font: 700 0.8125rem/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.layers {
  display: grid;
  gap: 4px;
}

.layers li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  background: rgb(9 7 13 / 0.5);
  border-left: 4px solid var(--border);
  font-size: 0.9375rem;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
}

.layers em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
}

.layers li.is-open {
  background: rgb(92 158 116 / 0.14);
  border-left-color: var(--positive-light);
}

/* An opened layer shows the value it revealed. */
.layers li.is-open em {
  color: var(--positive-light);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.meter__scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.meter__track {
  position: relative;
  height: 18px;
  margin-top: 6px;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), var(--border-strong) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    rgb(9 7 13 / 0.7);
  border: 2px solid var(--border);
}

.meter__range {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: var(--from, 5%);
  width: max(4px, calc(var(--to, 95%) - var(--from, 5%)));
  background: linear-gradient(90deg, var(--warning), var(--gold), var(--positive-light));
  box-shadow: 0 0 12px rgb(247 207 127 / 0.45);
  transition:
    left 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
    width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.forecast__value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.forecast__value span {
  color: var(--muted);
  font-size: 0.875rem;
}

.forecast__value strong {
  color: var(--gold);
  font: 700 2.125rem/1 var(--font-num);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.forecast__note {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.missions__title {
  font: 700 1.375rem/1.2 var(--font-pixel);
}

.missions__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.missions__list li {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  padding: 14px 4px 12px;
  background: rgb(26 22 32 / 0.86);
  border: 2px solid var(--border);
  text-align: center;
  clip-path: var(--pixel-corners);
}

.missions__list img {
  width: 64px;
}

.missions__list strong {
  font: 700 0.875rem/1.2 var(--font-pixel);
}

/* Phones show icon and name; the description stays for screen readers. */
.missions__list span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Rows with descriptions where the list is wide enough: tablets and wide screens. */
@media (min-width: 640px) and (max-width: 959px), (min-width: 1200px) {
  .missions__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .missions__list li {
    grid-template-columns: 64px minmax(0, 1fr);
    justify-items: start;
    align-content: center;
    align-items: center;
    column-gap: 16px;
    row-gap: 0;
    padding: 12px 16px 12px 12px;
    text-align: left;
  }

  .missions__list img {
    grid-row: span 2;
  }

  .missions__list strong {
    align-self: end;
    font-size: 1.125rem;
  }

  .missions__list span {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    align-self: start;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.4;
  }
}

/* Desktop: rules and missions on the left, the forecast card beside them. */
@media (min-width: 960px) {
  .combat {
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    grid-template-rows: auto 1fr;
    gap: 56px;
    align-items: start;
  }

  .forecast {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .missions {
    grid-column: 1;
  }
}

/* Next to the forecast card the column is narrow until 1200px: phone-style tiles. */
@media (min-width: 960px) and (max-width: 1199px) {
  .missions__list {
    gap: 12px;
  }

  .missions__list strong {
    font-size: 0.9375rem;
  }
}

/* ---------- Season timeline ---------- */

.timeline {
  display: grid;
}

.step {
  position: relative;
  padding: 0 0 36px 40px;
}

.step::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: -10px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--border-strong) 0 6px, transparent 6px 10px);
}

.step:last-child {
  padding-bottom: 0;
}

.step:last-child::before {
  display: none;
}

.step::after {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 16px;
  height: 16px;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgb(105 232 243 / 0.12);
}

.step--key::after {
  background: var(--warning);
  border-color: #ffc29a;
  box-shadow:
    0 0 0 4px rgb(231 136 82 / 0.2),
    0 0 18px rgb(231 136 82 / 0.7);
}

.step__when {
  color: var(--accent);
  font: 700 0.8125rem/1.2 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.step--key .step__when {
  color: var(--warning);
}

.step h3 {
  margin-top: 8px;
  font: 700 1.375rem/1.2 var(--font-pixel);
}

.step h3 + p {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.9375rem;
}

@media (min-width: 1000px) {
  .timeline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
  }

  .step,
  .step:last-child {
    padding: 40px 0 0;
  }

  .step::before {
    left: 16px;
    right: -24px;
    top: 7px;
    bottom: auto;
    width: auto;
    height: 2px;
    background: repeating-linear-gradient(to right, var(--border-strong) 0 6px, transparent 6px 10px);
  }
}

/* ---------- Alliances ---------- */

.duo {
  display: grid;
  gap: 16px;
}

.duo h3 {
  font: 700 1.5rem/1.2 var(--font-pixel);
}

/* Three cruisers of different factions flying in one formation. */
.alliance__art {
  position: relative;
  width: 232px;
  height: 84px;
  margin: 0 auto 20px;
}

.alliance__art img {
  position: absolute;
  top: 0;
  width: 96px;
  filter: drop-shadow(0 6px 8px rgb(0 0 0 / 0.5));
}

.alliance__art img:nth-child(1) {
  left: 0;
}

.alliance__art img:nth-child(2) {
  left: 68px;
  top: 32px;
  z-index: 1;
}

.alliance__art img:nth-child(3) {
  left: 136px;
}

.ticks {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.ticks li {
  position: relative;
  padding-left: 28px;
  color: var(--text-soft);
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  -webkit-mask: var(--check) center / contain no-repeat;
  mask: var(--check) center / contain no-repeat;
}

.ranks {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.ranks li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  padding: 10px 12px;
  background: rgb(9 7 13 / 0.5);
  border-left: 4px solid var(--gold);
}

.ranks img {
  grid-row: span 2;
  width: 32px;
}

/* Name and description stay together in the middle when the icon is taller than both. */
.ranks strong {
  align-self: end;
  color: var(--gold);
  font: 700 1.0625rem/1.2 var(--font-pixel);
}

.ranks span {
  align-self: start;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.card__foot {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.875rem;
}

@media (min-width: 640px) and (max-width: 959px) {
  .ranks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .duo .ticks {
    gap: 16px;
  }

  .ranks li {
    padding-block: 8px;
  }
}

@media (min-width: 1200px) {
  .alliance__art {
    width: 464px;
    height: 168px;
  }

  .alliance__art img {
    width: 192px;
  }

  .alliance__art img:nth-child(2) {
    left: 136px;
    top: 64px;
  }

  .alliance__art img:nth-child(3) {
    left: 272px;
  }

  .ranks li {
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 16px;
    padding: 8px 16px 8px 12px;
  }

  .ranks img {
    width: 64px;
  }
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  gap: 8px;
}

.faq details {
  background: rgb(26 22 32 / 0.9);
  border: 2px solid var(--border);
  clip-path: var(--pixel-corners);
  transition: border-color 0.15s ease;
}

.faq details[open] {
  border-color: var(--border-strong);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  -webkit-mask: var(--plus) center / contain no-repeat;
  mask: var(--plus) center / contain no-repeat;
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq summary:hover {
  color: var(--accent);
}

.faq summary:focus-visible {
  outline-offset: -4px;
}

.faq details p {
  padding: 0 20px 20px;
  color: var(--text-soft);
}

@media (min-width: 960px) {
  .faq-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 56px;
    align-items: start;
  }

  .faq-layout .section__head {
    position: sticky;
    top: calc(var(--header-h) + 32px);
    margin-bottom: 0;
  }
}

/* ---------- Final ---------- */

/* The page ends on a planet's horizon: the section clips the planet, the footer's border is the edge. */
.final {
  padding-bottom: 0;
  overflow: hidden;
}

.final__grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

.final h2 {
  font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.875rem);
}

.status {
  padding: 24px;
}

.status__title {
  color: var(--muted);
  font: 700 0.8125rem/1 var(--font-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.status__list {
  display: grid;
  margin-top: 12px;
}

.status__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 2px dashed var(--border);
  font-weight: 600;
}

.status__list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status__state {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
}

.led {
  flex: none;
  width: 10px;
  height: 10px;
}

.led--ok {
  background: var(--positive-light);
  box-shadow: 0 0 10px rgb(138 209 149 / 0.75);
}

.led--wip {
  background: var(--gold);
  box-shadow: 0 0 10px rgb(247 207 127 / 0.75);
  animation: dim 1.6s ease-in-out infinite;
}

.led--wait {
  background: var(--accent);
  box-shadow: 0 0 10px rgb(105 232 243 / 0.75);
  animation: dim 2.4s ease-in-out infinite;
}

.horizon {
  position: relative;
  height: 250px;
  margin-top: 48px;
}

.horizon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 40px;
  width: 960px;
  height: 420px;
  margin-left: -480px;
  background: radial-gradient(closest-side, rgb(105 232 243 / 0.22), rgb(52 119 167 / 0.1) 60%, transparent);
}

/* 4× on phones, 6× on desktops; only the top of the disc shows. */
.horizon__planet {
  position: absolute;
  left: 50%;
  top: 104px;
  width: 672px;
  max-width: none;
  margin-left: -336px;
}

.horizon__ship {
  position: absolute;
  left: 50%;
  top: 36px;
  z-index: 1;
  width: 256px;
  margin-left: -176px;
  filter: drop-shadow(0 0 16px rgb(var(--fx-rgb) / 0.45));
  animation: bob 7s ease-in-out infinite;
}

.horizon__escort {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 96px;
  margin-left: 72px;
  animation: bob 6s ease-in-out -2s infinite;
}

@media (min-width: 960px) {
  .final__grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 64px;
  }

  .horizon {
    height: 320px;
    margin-top: 64px;
  }

  .horizon::before {
    top: 40px;
    width: 1400px;
    height: 560px;
    margin-left: -700px;
  }

  .horizon__planet {
    top: 132px;
    width: 1008px;
    margin-left: -504px;
  }

  .horizon__ship {
    top: 40px;
    margin-left: -300px;
  }

  .horizon__escort {
    top: 16px;
    width: 192px;
    margin-left: 96px;
  }
}

/* ---------- Footer, toast ---------- */

.footer {
  padding: 40px 0 calc(40px + env(safe-area-inset-bottom));
  background: rgb(9 7 13 / 0.78);
  border-top: 2px solid var(--border);
}

.footer__in {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.brand--sm {
  font-size: 1.125rem;
}

.footer p {
  color: var(--muted);
  font-size: 0.875rem;
}

.footer__small {
  opacity: 0.8;
}

@media (min-width: 800px) {
  .footer__in {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 32px;
  }

  .footer__small {
    grid-column: 1 / -1;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 14px 18px;
  background: var(--panel-raised);
  border: 2px solid var(--accent);
  color: var(--text);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 24px);
  clip-path: var(--pixel-corners);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Cookie consent (main.js, initConsent) ---------- */

.consent {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 45;
  display: grid;
  gap: 14px;
  width: min(520px, calc(100vw - 32px));
  padding: 18px;
  background: var(--panel-raised);
  border: 2px solid var(--border-strong);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.5;
  transform: translateX(-50%);
  clip-path: var(--pixel-corners);
  box-shadow: 0 -8px 32px rgb(0 0 0 / 0.5);
}

.consent[hidden] {
  display: none;
}

.consent p {
  margin: 0;
}

.consent__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ---------- Scroll reveal (main.js adds .is-in) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Without JS: every faction panel is shown and the controls that need JS are hidden. */
.no-js .factions__tabs,
.no-js .switch,
.no-js [data-share],
.no-js [data-copy],
.no-js [data-forecast-btn],
.no-js .hotspot {
  display: none;
}

.no-js .fpanel[hidden] {
  display: grid;
}

/* ---------- Keyframes ---------- */

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

@keyframes dim {
  50% {
    opacity: 0.3;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

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

  50% {
    transform: translate(6px, -6px);
  }
}

@keyframes flyby {
  0% {
    opacity: 0;
    transform: translate(-45cqw, 50cqw);
  }

  5%,
  38% {
    opacity: 1;
  }

  45%,
  100% {
    opacity: 0;
    transform: translate(110cqw, -6cqw);
  }
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes ping {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }

  75%,
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes shield {
  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .hero__squad {
    display: none;
  }
}
