:root {
  color-scheme: dark;
  --mint: #82ffd5;
  --muted: #77869b;
  --line: #263143;
  --bg: #090e19;
}
.pilot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.overlay:not(.hidden) ~ #toast {
  display: none;
}
.pilot-card {
  text-align: left;
  letter-spacing: 0;
  padding: 18px;
}
.pilot-card.selected {
  border-color: var(--pilot-color);
  background: #1b2d39;
}
.pilot-card strong,
.pilot-card small {
  display: block;
  margin-top: 6px;
}
.pilot-card strong {
  font-size: 17px;
  color: var(--pilot-color);
}
.pilot-card small {
  font-size: 10px;
  color: #b8c8da;
}
.pilot-card p {
  font-size: 11px;
  line-height: 1.65;
  font-weight: 400;
  color: #8ea3bc;
  margin: 8px 0 0;
}
.pilot-face {
  color: var(--pilot-color);
  font-size: 25px;
}
.hangar-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.boss-hud {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, 75%);
  text-align: center;
  display: none;
}
.boss-hud strong {
  font-size: 10px;
  letter-spacing: 1px;
  color: #ffb99c;
}
.boss-hud .bar i {
  background: #ff668f;
}
.interaction {
  position: absolute;
  bottom: 55px;
  right: 0;
  font-size: 10px;
  letter-spacing: 1px;
  color: #ffdc88;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 24px 0;
}
.shop-item {
  padding: 22px;
  text-align: left;
  letter-spacing: 0;
}
.shop-item strong {
  font-size: 16px;
}
.shop-item p {
  color: #9fb1c7;
  font-size: 12px;
  font-weight: 400;
}
.shop-item b {
  color: #ffdc88;
  font-size: 11px;
}
.recap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
  padding: 18px;
  background: #132030;
  border-radius: 8px;
}
.recap b {
  display: block;
  font:
    22px Consolas,
    monospace;
}
.recap small {
  display: block;
  font-size: 8px;
  letter-spacing: 1px;
  color: #97aabe;
  margin-top: 8px;
}
.recap-detail {
  background: #101a29;
  text-align: left;
  padding: 16px;
  line-height: 1.8;
  font-size: 11px;
  color: #9fb1c7;
  margin: 20px 0;
}
.recap-detail b {
  color: #cfb8ff;
  font-size: 10px;
}
.recap-detail hr {
  border: 0;
  border-top: 1px solid #263143;
}
@media (max-width: 600px) {
  .pilot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pilot-card {
    padding: 12px;
  }
  .recap {
    grid-template-columns: repeat(2, 1fr);
  }
  .hangar-actions {
    flex-wrap: wrap;
  }
}
.build-status {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  font-size: 10px;
  color: #cdb8ff;
  letter-spacing: 1px;
  line-height: 1.6;
  max-width: 85%;
}
.recipe-list {
  text-align: left;
  background: #0c1725;
  border: 1px solid #2d3a51;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px auto;
  max-width: 700px;
}
.recipe-list .hint {
  margin-bottom: 10px;
  font-size: 9px;
  line-height: 1.5;
}
.recipe {
  font-size: 11px;
  color: #8596af;
  line-height: 2;
}
.recipe b {
  color: #cfb8ff;
  font-weight: 600;
}
.recipe .owned {
  color: #82ffd5;
}
.recipe.complete {
  border-left: 2px solid #82ffd5;
  padding-left: 8px;
}
.recipe.complete b {
  color: #ffdc88;
}
.overlay {
  overscroll-behavior: contain;
}
@media (max-height: 760px) {
  .overlay .panel {
    margin: auto;
  }
  .overlay {
    align-items: flex-start;
  }
  .overlay .cards {
    margin: 16px 0;
  }
  .overlay .card {
    min-height: 140px;
    padding: 16px;
  }
  .overlay .card .glyph {
    margin-bottom: 8px;
  }
  .overlay h2 {
    font-size: 30px;
  }
  .overlay .eyebrow {
    margin-bottom: 12px;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #080c14;
  color: #eaf2fb;
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  border: 1px solid var(--line);
  background: #111a29;
  padding: 11px 16px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover {
  background: #203243;
  border-color: #6b9b97;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
#app {
  max-width: 1600px;
  margin: auto;
  padding: 0 36px;
}
header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.brand {
  color: #f1f7fb;
  text-decoration: none;
  letter-spacing: 3px;
  font-size: 20px;
  font-weight: 850;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  color: var(--mint);
  font-size: 31px;
}
.brand small {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 16px;
  margin-left: 8px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.live {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-right: 16px;
}
.live i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  margin-right: 6px;
}
.arena {
  height: calc(100dvh - 150px);
  min-height: 390px;
  max-height: 1000px;
  border: 1px solid var(--line);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}
canvas:focus {
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 50%, #0b1725b8, #080d18e8);
  padding: 24px;
  overflow: auto;
}
.overlay.hidden,
.hidden {
  display: none !important;
}
.panel {
  max-width: 800px;
  width: 100%;
  text-align: center;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--mint);
  font-weight: 700;
  margin-bottom: 22px;
}
.eyebrow:before {
  content: "—";
  margin-right: 12px;
}
h1 {
  font-size: clamp(48px, 7vw, 94px);
  line-height: 0.95;
  letter-spacing: -4px;
  margin: 0 0 22px;
  font-weight: 900;
}
h1 span {
  color: var(--mint);
}
h2 {
  font-size: 38px;
  letter-spacing: -1.5px;
  margin: 10px 0 12px;
}
.subtitle {
  font-size: 13px;
  line-height: 1.8;
  color: #91a3ba;
  max-width: 450px;
  margin: 0 auto 26px;
}
.primary {
  background: var(--mint);
  border-color: var(--mint);
  color: #09251f;
  padding: 16px 30px;
  letter-spacing: 2px;
  font-size: 12px;
  box-shadow: 0 0 36px #82ffd515;
}
.primary:hover {
  background: #b0ffe6;
  color: #09251f;
  transform: translateY(-2px);
}
.best {
  margin-top: 23px;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
}
.best b {
  color: #e7c781;
  margin-left: 10px;
}
.features {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin: 35px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid #24304080;
  font-size: 10px;
  letter-spacing: 1px;
  color: #99aabd;
}
.features span {
  color: var(--mint);
  margin-right: 7px;
}
.hud {
  position: absolute;
  inset: 24px 26px;
  pointer-events: none;
}
.vitals {
  width: 220px;
}
.hud-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #aab8c9;
}
.hud-label b {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #eaf2fb;
}
.bar {
  height: 6px;
  background: #263044;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--mint);
  transition: width 0.12s;
}
.xp-label {
  margin-top: 18px;
}
.xp {
  height: 3px;
}
.xp i {
  background: #a697ff;
}
.run-stats {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  gap: 35px;
}
.run-stats div {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: right;
}
.run-stats small {
  font-size: 8px;
  letter-spacing: 2px;
  color: #92a1b5;
}
.run-stats strong {
  font:
    24px Consolas,
    monospace;
  letter-spacing: 1px;
}
.dash-state {
  position: absolute;
  bottom: 0;
  left: 0;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--mint);
}
footer {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1px;
  gap: 12px;
}
kbd {
  font:
    9px Segoe UI,
    sans-serif;
  padding: 4px 5px;
  background: #151e2c;
  border: 1px solid #2b3547;
  border-radius: 3px;
  margin-right: 3px;
  color: #afbacb;
}
footer em {
  font-style: normal;
  color: #39475d;
  margin: 0 12px;
}
footer b {
  font-weight: 400;
  font-size: 8px;
}
footer i {
  color: var(--mint);
  margin: 0 15px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 26px 0;
}
.card {
  text-align: left;
  padding: 24px 20px;
  background: #101c2b;
  font-size: 12px;
  letter-spacing: 0;
  min-height: 175px;
}
.card .glyph {
  display: block;
  color: var(--mint);
  font-size: 27px;
  margin-bottom: 18px;
}
.card strong {
  font-size: 16px;
  display: block;
  margin-bottom: 12px;
}
.card p {
  line-height: 1.65;
  color: #93a6bc;
  font-size: 12px;
  font-weight: 400;
  margin: 0;
}
.card small {
  float: right;
  color: #6c7c92;
}
.summary {
  display: flex;
  justify-content: center;
  gap: 45px;
  margin: 30px 0;
}
.summary span {
  display: block;
  font-size: 9px;
  color: #93a6bc;
  letter-spacing: 2px;
  margin-bottom: 9px;
}
.summary b {
  font:
    28px Consolas,
    monospace;
}
.secondary {
  margin-left: 10px;
}
#toast {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--mint);
  letter-spacing: 2px;
  text-align: center;
  pointer-events: none;
  width: 90%;
}
.hint {
  color: #77869b;
  font-size: 10px;
  letter-spacing: 1px;
}
@media (max-width: 720px) {
  #app {
    padding: 0 12px;
  }
  header {
    height: 66px;
  }
  .brand {
    font-size: 15px;
  }
  .brand small,
  .live,
  footer > span:last-child {
    display: none;
  }
  .header-actions {
    gap: 5px;
  }
  button {
    padding: 10px;
  }
  .arena {
    height: calc(100dvh - 120px);
  }
  footer {
    font-size: 8px;
    justify-content: center;
  }
  .hud {
    inset: 18px 15px;
  }
  .vitals {
    width: 140px;
  }
  .run-stats {
    gap: 12px;
  }
  .run-stats strong {
    font-size: 17px;
  }
  .run-stats div:last-child {
    display: none;
  }
  .cards {
    gap: 8px;
  }
  .card {
    padding: 14px 10px;
    min-height: 170px;
  }
  .card strong {
    font-size: 13px;
  }
  .card p {
    font-size: 10px;
  }
  .features {
    gap: 13px;
    font-size: 8px;
  }
  h1 {
    letter-spacing: -2px;
  }
  .summary {
    gap: 20px;
  }
}
.touch-controls,
.touch-help {
  display: none;
}
@media (pointer: coarse) {
  .touch-controls {
    display: flex;
    position: absolute;
    inset: auto 20px max(16px, env(safe-area-inset-bottom));
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
  }
  .joystick {
    width: 120px;
    height: 120px;
    border: 1px solid #82ffd566;
    background: #122d3a88;
    border-radius: 50%;
    display: grid;
    place-items: center;
  }
  .joystick span {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #82ffd5aa;
    border: 2px solid #baffeb;
    pointer-events: none;
  }
  .joystick,
  .touch-actions button {
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .touch-actions {
    display: flex;
    gap: 12px;
    align-items: flex-end;
  }
  .touch-actions button {
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    background: #132d3ee6;
  }
  #touchDash {
    width: 76px;
    height: 76px;
    color: #82ffd5;
    border-color: #82ffd580;
  }
  #game {
    touch-action: none;
  }
  .overlay {
    z-index: 3;
  }
  .build-status {
    bottom: 144px;
    max-width: 100%;
    font-size: 9px;
  }
  .interaction {
    bottom: 166px;
  }
  .dash-state {
    display: none;
  }
  #toast {
    bottom: 160px;
    letter-spacing: 1px;
  }
  footer > span {
    display: none !important;
  }
  footer > .touch-help {
    display: inline !important;
  }
  header {
    height: 58px;
  }
  .arena {
    height: calc(100dvh - 100px);
    min-height: 240px;
  }
  #app {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
}
@media (max-width: 480px) {
  .overlay {
    padding: 20px 14px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .overlay .card {
    min-height: 0;
    padding: 14px;
  }
  .card .glyph {
    display: none;
  }
  .shop-grid {
    grid-template-columns: 1fr;
  }
  .summary {
    gap: 10px;
    flex-wrap: wrap;
  }
  .brand-icon {
    display: none;
  }
  .vitals {
    width: 125px;
  }
  .hud {
    inset: 12px;
  }
}
@media (pointer: coarse) and (max-height: 500px) {
  header {
    height: 44px;
  }
  footer {
    display: none;
  }
  .arena {
    height: calc(100dvh - 52px);
  }
  .joystick {
    width: 96px;
    height: 96px;
  }
  .build-status {
    bottom: 106px;
  }
  .interaction {
    bottom: 125px;
  }
  .boss-hud {
    top: 0;
    width: 30%;
  }
  #toast {
    bottom: 110px;
  }
}
@media (pointer: coarse) {
  footer {
    height: 42px;
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  #toast {
    bottom: 190px;
  }
}
@media (pointer: coarse) and (max-height: 500px) {
  #toast {
    bottom: 155px;
  }
}
