@font-face {
  font-family: "Manrope";
  src: url("/Manrope-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ink: #102129;
  --glass: rgba(247, 252, 250, .78);
  --line: rgba(15, 45, 54, .13);
  --accent: #087c66;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  color: var(--ink);
  background: #9fd4df;
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#game { width: 100%; height: 100%; display: block; touch-action: none; }

.hud {
  position: fixed;
  z-index: 4;
  top: 0;
  left: 0;
  width: 100%;
  padding: 24px 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}
.hud-brand {
  padding: 10px 14px 10px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--glass);
  box-shadow: 0 12px 35px rgba(22,57,65,.08);
  backdrop-filter: blur(14px);
}
.wing { width: 30px; height: 30px; position: relative; border-radius: 9px; background: #16313a; }
.wing::before { content: ""; position: absolute; left: 7px; top: 13px; width: 17px; height: 4px; border-radius: 5px 0 5px 0; background: #b8efcf; transform: skewX(-24deg); }
.hud-brand strong, .hud-brand small { display: block; }
.hud-brand strong { font-size: 12px; letter-spacing: -.02em; }
.hud-brand small { margin-top: 2px; color: #6a7e83; font-size: 8px; text-transform: uppercase; letter-spacing: .12em; }

.instruments {
  overflow: hidden;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--glass);
  box-shadow: 0 12px 35px rgba(22,57,65,.08);
  backdrop-filter: blur(14px);
}
.instrument { min-width: 105px; padding: 10px 14px; border-left: 1px solid var(--line); }
.instrument:first-child { border-left: 0; }
.instrument span { display: block; margin-bottom: 3px; color: #60777c; font-size: 8px; font-weight: 650; text-transform: uppercase; letter-spacing: .11em; }
.instrument strong { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.instrument small { margin-left: 4px; color: #74878b; font-size: 8px; }

.mission {
  position: fixed;
  z-index: 4;
  top: 108px;
  left: 50%;
  padding: 8px 13px;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  color: rgba(255,255,255,.94);
  background: rgba(18,60,69,.35);
  font-size: 9px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.mission strong { margin-left: 7px; font-size: 10px; }

.nav-map {
  position: fixed;
  z-index: 4;
  right: 28px;
  bottom: 26px;
  width: 190px;
  padding: 11px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 17px;
  color: rgba(239,250,247,.95);
  background: rgba(14,42,48,.62);
  box-shadow: 0 18px 48px rgba(9,35,42,.18);
  backdrop-filter: blur(15px) saturate(1.15);
  pointer-events: none;
}
.map-heading,
.map-key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: .11em;
}
.map-heading { padding: 1px 3px 9px; font-size: 7px; color: rgba(218,236,232,.56); }
.map-heading strong { color: rgba(236,251,246,.92); font-size: 8px; font-weight: 700; }
#nav-map {
  width: 168px;
  height: 168px;
  display: block;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px;
  background: rgba(8,31,37,.42);
}
.map-key { padding: 9px 3px 1px; justify-content: flex-start; gap: 13px; color: rgba(218,236,232,.56); font-size: 6px; }
.map-key span { display: flex; align-items: center; gap: 5px; }
.map-key i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; }
.map-key .key-route { border: 1px solid #a8f4d3; background: transparent; }
.map-key .key-airport { border-radius: 2px; background: #e8e1b6; }

.reticle {
  position: fixed;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 112px;
  height: 54px;
  transform: translate(-50%, -50%);
  opacity: .62;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.12));
}
.reticle > i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 50%;
}
.reticle-wing {
  position: absolute;
  top: 50%;
  width: 36px;
  height: 8px;
  border-top: 1px solid rgba(255,255,255,.95);
}
.reticle-wing::after {
  content: "";
  position: absolute;
  top: -1px;
  width: 8px;
  height: 7px;
  border-top: 1px solid rgba(255,255,255,.95);
}
.reticle-wing.left { left: 5px; border-left: 1px solid rgba(255,255,255,.95); }
.reticle-wing.right { right: 5px; border-right: 1px solid rgba(255,255,255,.95); }
.reticle-wing.left::after { right: 0; transform: rotate(-14deg); transform-origin: right top; }
.reticle-wing.right::after { left: 0; transform: rotate(14deg); transform-origin: left top; }
.pitch-mark {
  position: absolute;
  left: 50%;
  width: 44px;
  transform: translateX(-50%);
  border-top: 1px solid rgba(255,255,255,.6);
  color: rgba(255,255,255,.72);
  font-size: 6px;
  line-height: 1;
  text-align: right;
}
.pitch-up { top: 0; }
.pitch-down { bottom: 0; }

.speed-lines {
  position: fixed;
  z-index: 2;
  inset: -22%;
  opacity: 0;
  background: repeating-conic-gradient(
    from 2deg,
    transparent 0deg 8deg,
    rgba(255,255,255,.2) 8.3deg 8.55deg,
    transparent 8.8deg 15deg
  );
  -webkit-mask-image: radial-gradient(circle, transparent 0 19%, #000 43%, transparent 72%);
  mask-image: radial-gradient(circle, transparent 0 19%, #000 43%, transparent 72%);
  transform: scale(.82);
  transition: opacity .18s, transform .22s;
  pointer-events: none;
}
.speed-lines.show { opacity: .32; transform: scale(1); animation: speed-flicker .35s linear infinite; }
@keyframes speed-flicker {
  50% { opacity: .22; transform: scale(1.035); }
}

.warning {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 16%;
  opacity: 0;
  transform: translate(-50%, 8px);
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  color: white;
  background: rgba(189,63,75,.8);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.warning.show { opacity: 1; transform: translate(-50%, 0); }

.message {
  position: fixed;
  z-index: 5;
  top: 29%;
  left: 50%;
  opacity: 0;
  transform: translate(-50%, 12px);
  color: white;
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 3px 18px rgba(0,0,0,.2);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.message.show { opacity: 1; transform: translate(-50%, 0); }

.overlay {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  background: rgba(17,44,52,.24);
  backdrop-filter: blur(8px);
  transition: opacity .25s, visibility .25s;
}
.overlay.visible { opacity: 1; visibility: visible; }
.panel {
  width: min(430px, calc(100% - 34px));
  padding: 38px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  background: rgba(250,253,250,.92);
  box-shadow: 0 30px 90px rgba(17,44,52,.2);
  text-align: center;
}
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-size: 42px; line-height: 1; letter-spacing: -.06em; }
.panel > p:not(.eyebrow) { margin: 18px auto 25px; max-width: 300px; color: #667a7e; font-size: 12px; line-height: 1.6; }
.keys { margin: 0 0 26px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.keys > div { padding: 12px 6px; border: 1px solid #e0e7e3; border-radius: 10px; background: #f5f8f5; }
.keys span { min-height: 25px; display: flex; align-items: center; justify-content: center; gap: 4px; }
kbd { min-width: 23px; padding: 5px 6px; border: 1px solid #d1dad5; border-bottom-width: 2px; border-radius: 5px; background: white; font: 600 9px "Manrope", sans-serif; }
.keys small { display: block; margin-top: 7px; color: #738287; font-size: 8px; }
#start {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: #14343d;
  font: 650 12px "Manrope", sans-serif;
  cursor: pointer;
  transition: transform .15s, background .15s;
}
#start:hover { background: #087c66; transform: translateY(-1px); }
#start:disabled {
  color: #7c8d8f;
  background: #e6ece9;
  cursor: wait;
  transform: none;
}
.hint { display: block; margin-top: 13px; color: #93a09d; font-size: 8px; }
.model-credit {
  display: block;
  margin-top: 9px;
  color: #a0aaa7;
  font-size: 7px;
}
.model-credit a { color: inherit; text-underline-offset: 2px; }
.model-credit a:hover { color: var(--accent); }

.mobile-controls { display: none; }

.mobile-optimized .hud-brand,
.mobile-optimized .instruments,
.mobile-optimized .nav-map,
.mobile-optimized .warning,
.mobile-optimized .overlay,
.mobile-optimized .panel,
.mobile-optimized .mobile-controls button,
.mobile-optimized .reticle,
.mobile-optimized .speed-lines,
.mobile-optimized .mission {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
.mobile-optimized .message { text-shadow: none; }
.mobile-optimized .speed-lines.show { animation: none; }
.mobile-optimized .reticle { filter: none; opacity: .55; }
.mobile-optimized #start:hover { transform: none; }

@media (max-width: 1024px), (hover: none), (pointer: coarse) {
  .hud { padding: 14px; }
  .hud-brand { display: none; }
  .instruments { width: 100%; justify-content: stretch; }
  .instrument { min-width: 0; flex: 1; padding: 9px 10px; }
  .instrument strong { font-size: 14px; }
  .streak-instrument { display: none; }
  .mission { top: 78px; }
  .nav-map {
    top: 118px;
    right: 14px;
    bottom: auto;
    width: 128px;
    padding: 8px;
    border-radius: 13px;
    opacity: .88;
  }
  .map-heading { padding-bottom: 6px; }
  .map-heading strong { font-size: 6px; }
  #nav-map { width: 110px; height: 110px; border-radius: 8px; }
  .map-key { display: none; }
  .mobile-controls {
    position: fixed;
    z-index: 6;
    left: 0;
    bottom: 20px;
    width: 100%;
    padding: 0 18px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
  }
  .control-pad { display: flex; gap: 8px; pointer-events: auto; }
  .control-pad button {
    width: 51px;
    height: 51px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 50%;
    color: white;
    background: rgba(17,52,61,.38);
    font: 500 20px "Manrope", sans-serif;
    backdrop-filter: blur(8px);
    touch-action: none;
  }
  .control-pad .boost { color: #173a40; background: rgba(199,244,213,.76); }
  .panel { padding: 30px 22px; }
  .keys { display: none; }
  .mobile-optimized .mission {
    top: 70px;
    padding-top: 5px;
    opacity: .8;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .hud { padding: 16px; }
  .instruments { width: 100%; gap: 0; }
  .instrument { padding: 10px 8px; }
  .instrument strong { font-size: 14px; }
  .mission { top: 88px; }
  .nav-map {
    top: 128px;
    right: 18px;
    width: 140px;
  }
  #nav-map { width: 118px; height: 118px; }
  .control-pad button {
    width: 48px;
    height: 48px;
    font-size: 17px;
  }
  .panel { width: min(420px, calc(100% - 40px)); padding: 32px 28px; }
}

@media (max-width: 768px) {
  .hud-brand { display: none; }
  .nav-map {
    top: 110px;
    right: 12px;
    width: 118px;
    padding: 7px;
  }
  .map-heading strong { font-size: 5px; }
  #nav-map { width: 102px; height: 102px; }
  .instrument span,
  .instrument small { font-size: 7px; }
  .instrument strong { font-size: 13px; }
  .mobile-controls { bottom: 14px; padding: 0 12px; }
  .control-pad button {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }
  .panel { padding: 26px 20px; }
  .panel > p:not(.eyebrow) { margin: 14px auto 20px; max-width: 270px; }
  .hint { font-size: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
