/* Vapour Front. Colours are the game's own (client/ui/ui_theme.gd); frames,
   buttons and fields are the game's 16px nine-slice art (margin 3) at 3x. */
@font-face {
  font-family: "Silkscreen";
  src: url("/assets/fonts/silkscreen-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("/assets/fonts/silkscreen-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --backdrop: #0b0f12;
  --panel: #11161a;
  --edge: #2b3a44;
  --text: #dfe5ea;
  --dim: #8b97a1;
  --friendly: #4a9be8;
  --hostile: #e8564a;
  --good: #5fd08a;
  --warn: #e8a24a;
  --gold: #f2c14e;
  --pixel: "Silkscreen", ui-monospace, Menlo, Consolas, monospace;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }
html { background: var(--backdrop); }
img, .px { image-rendering: pixelated; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--backdrop);
  color: var(--text);
  font: 15px/1.6 var(--mono);
}

a { color: var(--friendly); }
a:hover { color: var(--gold); }

/* ------------------------------------------------------------ top bar */
.bar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding: 12px 16px;
  border-bottom: 3px solid #000;
  background: var(--panel);
  box-shadow: inset 0 -3px 0 var(--edge);
}
.brand { display: block; line-height: 0; }
.brand img { width: 220px; max-width: 56vw; height: auto; }
.bar nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-left: auto; }
.bar nav a {
  color: var(--dim);
  font: 400 14px var(--pixel);
  text-decoration: none;
  text-transform: uppercase;
}
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--gold); }

/* --------------------------------------------------------------- type */
main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 36px 16px 56px; }
main.narrow { max-width: 480px; }
main.wide { max-width: 1040px; }
main.flush { max-width: none; padding: 0; }

h1 {
  margin: 0 0 14px;
  font: 700 28px/1.2 var(--pixel);
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 3px 3px 0 #000;
}
h2 {
  margin: 0 0 10px;
  font: 700 18px/1.3 var(--pixel);
  text-transform: uppercase;
  color: var(--text);
}
h3 { margin: 0 0 6px; font: 700 15px/1.3 var(--pixel); text-transform: uppercase; color: var(--gold); }
p { margin: 0 0 14px; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
ul { padding-left: 20px; margin: 0 0 14px; }
li { margin-bottom: 6px; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border: 2px solid currentColor;
  color: var(--warn);
  font: 400 12px var(--pixel);
  text-transform: uppercase;
  white-space: nowrap;
}
.tag.good { color: var(--good); }
.tag.blue { color: var(--friendly); }
.tag.grey { color: var(--dim); }
.tag.bad { color: var(--hostile); }

/* ------------------------------------------------- nine-slice controls */
.panel {
  margin-top: 18px;
  padding: 12px 14px;
  border: 9px solid transparent;
  border-image: url("/assets/game/ui_panel.png") 3 fill / 9px stretch;
  image-rendering: pixelated;
}
.panel > :last-child { margin-bottom: 0; }
.panel.danger h2 { color: var(--hostile); }

.btn {
  display: inline-block;
  padding: 5px 16px;
  border: 9px solid transparent;
  border-image: url("/assets/game/ui_button.png") 3 fill / 9px stretch;
  image-rendering: pixelated;
  background: none;
  color: var(--text);
  font: 700 15px/1.3 var(--pixel);
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:hover { border-image-source: url("/assets/game/ui_button_hover.png"); color: var(--gold); }
.btn:active { border-image-source: url("/assets/game/ui_button_pressed.png"); transform: translateY(3px); }
.btn:disabled, .btn[aria-disabled="true"] {
  border-image-source: url("/assets/game/ui_button_disabled.png");
  color: var(--dim);
  cursor: not-allowed;
  transform: none;
}
.btn.primary { color: var(--gold); }
.btn.warn:hover { color: var(--hostile); }
.btn.sm { padding: 1px 10px; font-size: 13px; }
form .btn[type="submit"] { margin-top: 16px; }
form.stack .btn[type="submit"] { width: 100%; }

label {
  display: block;
  margin: 14px 0 4px;
  color: var(--dim);
  font: 400 13px var(--pixel);
  text-transform: uppercase;
}
form > label:first-child { margin-top: 0; }

input, select {
  width: 100%;
  padding: 4px 8px;
  border: 9px solid transparent;
  border-image: url("/assets/game/ui_line_edit.png") 3 fill / 9px stretch;
  image-rendering: pixelated;
  background: none;
  color: var(--text);
  font: 15px var(--mono);
}
input:focus, select:focus { outline: none; border-image-source: url("/assets/game/ui_line_edit_focused.png"); }
input:disabled, select:disabled { border-image-source: url("/assets/game/ui_line_edit_disabled.png"); color: var(--dim); }
select { width: auto; padding: 0 4px; font-size: 13px; }
select option { background: var(--panel); color: var(--text); }
form p.dim { margin: 8px 0 0; }

.tabs { display: flex; margin-top: 18px; }
.tabs button {
  flex: 1;
  padding: 4px 8px;
  border: 9px solid transparent;
  border-image: url("/assets/game/ui_tab_inactive.png") 3 fill / 9px stretch;
  image-rendering: pixelated;
  background: none;
  color: var(--dim);
  font: 700 14px var(--pixel);
  text-transform: uppercase;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { border-image-source: url("/assets/game/ui_tab_active.png"); color: var(--gold); }
.tabs + .panel { margin-top: 0; }

.linkish { padding: 0; border: 0; background: none; color: var(--friendly); font: inherit; text-decoration: underline; cursor: pointer; }
.linkish:hover { color: var(--gold); }

.msg { margin: 12px 0 0; min-height: 1.6em; overflow-wrap: anywhere; }
.msg:empty { min-height: 0; margin: 0; }
.msg.bad { color: var(--hostile); }
.msg.ok { color: var(--good); }

.rows { margin: 0; }
.rows div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; padding: 8px 0; border-bottom: 2px solid var(--edge); }
.rows div:last-child { border-bottom: 0; }
.rows dt { width: 130px; color: var(--dim); font: 400 13px var(--pixel); text-transform: uppercase; }
.rows dd { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.split { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.split h1, .split h2 { margin: 0; }

.notice {
  margin: 18px 0 0;
  padding: 10px 14px;
  border: 2px dashed var(--warn);
  color: var(--warn);
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 6px 10px 6px 0; color: var(--dim); font: 400 12px var(--pixel); text-transform: uppercase; white-space: nowrap; }
td { padding: 7px 10px 7px 0; border-top: 2px solid var(--edge); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td img { vertical-align: middle; margin-right: 8px; }

footer {
  padding: 16px;
  border-top: 3px solid var(--edge);
  color: var(--dim);
  font-size: 13px;
  text-align: center;
}
footer a { color: var(--dim); }

[hidden] { display: none !important; }

/* --------------------------------------------------------- landing hero */
.hero {
  position: relative;
  height: clamp(480px, 82vh, 780px);
  overflow: hidden;
  background: #56703a;
  border-bottom: 3px solid #000;
}
.layer {
  position: absolute;
  inset: -6%;
  background-position: center;
  background-size: cover;
  image-rendering: pixelated;
  animation: drift 26s ease-in-out infinite alternate;
}
.layer.ground { background-image: url("/assets/game/menu_ground.png"); animation: none; }
.layer.detail { background-image: url("/assets/game/menu_detail.png"); --drift: 1%; }
.layer.cloud-low { background-image: url("/assets/game/menu_cloud_low.png"); --drift: 2%; }
.layer.cloud-high { background-image: url("/assets/game/menu_cloud_high.png"); --drift: 4%; }
@keyframes drift {
  from { transform: translateX(calc(var(--drift) * -1)); }
  to { transform: translateX(var(--drift)); }
}

.flyover {
  position: absolute;
  left: 0;
  width: 64px;
  height: 60px;
  background: url("/assets/game/menu_flyover.png") 0 0 / 512px 60px;
  image-rendering: pixelated;
  transform-origin: 0 0;
  animation: cross 17s linear infinite;
}
.flyover.lead { top: 16%; scale: 3; }
.flyover.wing { top: 34%; scale: 2; animation-delay: 1.6s; translate: -40vw 0; }
.flyover.low { top: 74%; scale: 2; animation-duration: 23s; animation-delay: 9s; translate: -40vw 0; }
@keyframes cross {
  from { translate: -220px 0; }
  to { translate: calc(100vw + 40px) 0; }
}

.hero-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px 16px;
  text-align: center;
}
.wordmark {
  width: min(588px, 88vw);
  height: auto;
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.75));
  animation: arrive 0.55s steps(7) both;
}
@keyframes arrive { from { transform: translateY(-84px); opacity: 0; } }
.tagline {
  margin: 0;
  max-width: 760px;
  color: #fff;
  font: 700 clamp(15px, 2.6vw, 20px)/1.4 var(--pixel);
  text-transform: uppercase;
  text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000, 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}
.byline {
  margin: -8px 0 0;
  color: #fff;
  font: 400 20px/1 var(--pixel);
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000, -1px 0 0 #000, 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000;
}
.byline .vs { color: #f0a050; white-space: nowrap; }
.byline img { margin: 0 1px 0 6px; filter: drop-shadow(2px 2px 0 #000); }
.menu { display: flex; flex-direction: column; gap: 6px; width: min(300px, 100%); }
.hero .tag { background: var(--backdrop); }

/* ----------------------------------------------------- landing sections */
.band { padding: 48px 16px; border-bottom: 3px solid var(--edge); }
.band.alt { background: var(--panel); }
.band-inner { max-width: 1040px; margin: 0 auto; }
.band h2 { font-size: 24px; color: var(--gold); text-shadow: 3px 3px 0 #000; }
.band .lede { max-width: 640px; color: var(--dim); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 22px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }

.unit { display: flex; flex-direction: column; border: 3px solid #000; background: var(--backdrop); box-shadow: inset 0 0 0 3px var(--edge); }
.unit .pad {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 156px;
  background: url("/assets/game/menu_ground.png") 30% 40% / 1408px auto;
  image-rendering: pixelated;
  border-bottom: 3px solid #000;
}
.unit:nth-child(2n) .pad { background-position: 70% 10%; }
.unit:nth-child(3n) .pad { background-position: 10% 90%; }
.unit .pad img { filter: drop-shadow(6px 9px 0 rgba(0, 0, 0, 0.28)); transform: rotate(-90deg); }
.unit .body { padding: 14px 16px 16px; }
.unit .body p { margin: 0 0 10px; color: var(--dim); font-size: 14px; }
.unit .body p:last-child { margin: 0; }

.road {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 22px;
  padding: 26px 16px;
  border: 3px solid #000;
  background:
    linear-gradient(transparent calc(50% - 21px), #4a3f33 calc(50% - 21px), #6b5c4a calc(50% - 18px), #6b5c4a calc(50% + 18px), #4a3f33 calc(50% + 21px), transparent calc(50% + 21px)),
    url("/assets/game/menu_ground.png") 50% 20% / 1408px auto;
  image-rendering: pixelated;
}
.road img { filter: drop-shadow(3px 4px 0 rgba(0, 0, 0, 0.3)); }
.road .gap { width: 48px; }
.road .foe { transform: scaleX(-1); }
.road .boom {
  width: 64px;
  height: 64px;
  background: url("/assets/game/explosion_large.png") 0 0 / 384px 64px;
  image-rendering: pixelated;
  animation: boom 0.9s steps(6) infinite;
}
@keyframes boom { to { background-position: -384px 0; } }

.fact { display: flex; gap: 14px; align-items: flex-start; }
.fact img { flex: none; margin-top: 2px; }
.fact p { margin: 0; color: var(--dim); font-size: 14px; }
.map-shot { display: block; width: 100%; max-width: 576px; height: auto; border: 3px solid #000; box-shadow: 0 0 0 3px var(--edge); }

.cta { text-align: center; }
.cta .actions { justify-content: center; }

/* ------------------------------------------------------- stats and dev */
.pilot-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.pilot-card .name { font: 700 22px var(--pixel); color: var(--gold); overflow-wrap: anywhere; }
.pilot-card img { flex: none; }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 18px; }
.tile { padding: 12px 14px; border: 3px solid #000; background: var(--panel); box-shadow: inset 0 0 0 3px var(--edge); }
.tile .k { display: flex; align-items: center; gap: 8px; color: var(--dim); font: 400 12px var(--pixel); text-transform: uppercase; }
.tile .v { margin-top: 4px; font: 700 26px/1.2 var(--pixel); color: var(--text); overflow-wrap: anywhere; }
.tile .v.none { color: var(--edge); }
.tile .s { color: var(--dim); font-size: 12px; }

.dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; background: var(--dim); }
.dot.up { background: var(--good); }
.dot.down { background: var(--hostile); }
.dot.wait { background: var(--warn); }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
code { padding: 0 4px; background: var(--backdrop); color: var(--text); font: 13px var(--mono); overflow-wrap: anywhere; }

@media (max-width: 560px) {
  h1 { font-size: 22px; }
  .rows dt { width: 100%; }
  .flyover.lead { scale: 2; }
  .flyover.wing, .flyover.low { display: none; }
}

/* The game has a "menu animations" setting; this is the web's. */
@media (prefers-reduced-motion: reduce) {
  .layer, .wordmark, .road .boom { animation: none; }
  .flyover { animation: none; left: 12%; translate: none; }
  .flyover.wing, .flyover.low { display: none; }
}
