:root {
  color-scheme: dark;
  color: #f3f0e2;
  background: #16241e;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --accent: #e9c793;
  --gutter: clamp(24px, 5vw, 82px);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
main { position: relative; min-height: 340px; height: 100dvh; overflow: hidden; isolation: isolate; }
[hidden] { display: none !important; }
#view, #view canvas, .vignette { position: absolute; inset: 0; width: 100%; height: 100%; }
#view canvas { display: block; }
#perch-marker {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #182318b3;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
#prey-spotting-glow {
  position: absolute;
  width: 62px;
  height: 48px;
  transform: translate(-50%, -50%) scale(var(--glow-scale, 1));
  background: radial-gradient(ellipse, #ea4f489e, #ea4f4887 17%, #ea4f484d 37%, #ea4f4814 60%, transparent 79%);
  mix-blend-mode: screen;
  pointer-events: none;
}
.vignette {
  pointer-events: none;
  background:
    linear-gradient(90deg, #102018e8, #14221bb0 20%, #14221b31 54%, transparent 76%),
    linear-gradient(0deg, #101c16ba, transparent 26%, transparent 84%, #10201860);
}
.playing .vignette,
body:has(.pause[open]) .vignette {
  background: linear-gradient(0deg, #141f19b0, transparent 21%, transparent 88%, #16231b50);
}
#takeoff-indicator {
  position: absolute;
  top: 56%;
  left: 74%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #f6f1dc;
  font-size: 12px;
  text-shadow: 0 1px 4px #111b15, 0 0 7px #111b15;
  pointer-events: none;
}
.takeoff-silhouette {
  width: 111px;
  height: 52px;
  background: linear-gradient(to top, #f6d689 var(--takeoff-progress, 0%), #35483c var(--takeoff-progress, 0%));
  clip-path: path("M 56 18 Q 58 19 61 22 Q 73 14 81 9 Q 97 0 111 1 Q 107 5 93 10 L 110 7 Q 107 10 91 15 L 107 12 Q 104 16 88 20 L 101 18 Q 97 23 81 24 Q 74 31 64 31 Q 61 37 67 47 Q 61 51 56 49 Q 50 51 44 47 Q 50 37 47 31 Q 37 31 30 24 Q 14 23 10 18 L 23 20 Q 7 16 4 12 L 20 15 Q 4 10 1 7 L 18 10 Q 4 5 0 1 Q 14 0 30 9 Q 38 14 50 22 Q 53 19 56 18 Z");
}
@media (max-width: 560px), (max-height: 460px) {
  #takeoff-indicator { top: 35%; }
}
.playing :is(.masthead, .flight-hud, .fps) { pointer-events: none; }
.title-screen :is(.masthead, .flight-hud),
body:has(.pause[open]) .flight-hud { display: none; }
.masthead {
  position: absolute;
  top: clamp(20px, 5vh, 60px);
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f3f0e5;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.pause {
  --corner-length: 19px;
  width: min(380px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: clamp(16px, 4vh, 26px) 28px;
  border: 0;
  background:
    linear-gradient(var(--accent), var(--accent)) left top / var(--corner-length) 1px,
    linear-gradient(var(--accent), var(--accent)) left top / 1px var(--corner-length),
    linear-gradient(var(--accent), var(--accent)) right top / var(--corner-length) 1px,
    linear-gradient(var(--accent), var(--accent)) right top / 1px var(--corner-length),
    linear-gradient(var(--accent), var(--accent)) left bottom / var(--corner-length) 1px,
    linear-gradient(var(--accent), var(--accent)) left bottom / 1px var(--corner-length),
    linear-gradient(var(--accent), var(--accent)) right bottom / var(--corner-length) 1px,
    linear-gradient(var(--accent), var(--accent)) right bottom / 1px var(--corner-length),
    radial-gradient(ellipse, #13251eed, #13251e66 75%, transparent);
  background-repeat: no-repeat;
  color: #f4eddd;
  text-align: center;
}
.pause::backdrop {
  background: radial-gradient(ellipse at 50% 48%, #12231e5e, #11231fbd 94%);
}
.pause h2 {
  margin: 0 0 16px;
  font: normal clamp(48px, min(7vw, 15vh), 92px)/.95 Georgia, 'Times New Roman', serif;
  letter-spacing: -.055em;
}
button {
  background: #e9c793;
  color: #20271e;
  border: 0;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 180px;
  gap: 20px;
  padding: 14px 16px 14px 19px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
}
button:hover { background: #f6dbad; }
button:focus-visible { outline: 2px solid #fff3d4; outline-offset: 4px; }
button:disabled { opacity: .7; cursor: default; }
.pause button {
  justify-content: center;
  width: min(100%, 180px);
  min-width: 0;
  min-height: 44px;
  margin-inline: auto;
  padding: 8px 12px;
}
.pause button + button { margin-top: 6px; }
.pause button:not(#resume) {
  background: transparent;
  color: inherit;
}
.pause button:not(#resume):hover { background: #faeddd1a; }
.pause #options-title { font-size: clamp(36px, 6vw, 52px); }
.pause .spotting-option {
  margin-inline: auto;
  font-size: 15px;
}
.credits {
  position: absolute;
  z-index: 3;
  bottom: 12px;
  left: var(--gutter);
  font-size: 12px;
  line-height: 1.5;
}
.playing .credits { display: none; }
.credits summary { width: fit-content; cursor: pointer; }
.credits p {
  position: absolute;
  bottom: 100%;
  width: min(32ch, 84vw);
  margin: 0 0 6px;
  padding: 10px 12px;
  background: #111730;
}
.credits a { color: var(--accent); }
.title-screen .credits p { background: var(--title-background); }
.menu {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: var(--title-background);
}
.menu-layout {
  display: grid;
  grid-template-columns: 52% 48%;
  align-items: center;
  width: min(92vw, 164dvh);
  container-type: inline-size;
}
.menu-content { position: relative; }
.menu h1 {
  margin: 0;
  font: 700 15.4cqw/.84 Georgia, 'Times New Roman', serif;
  letter-spacing: -.016em;
}
#start {
  justify-content: center;
  width: 79%;
  min-width: 0;
  min-height: 44px;
  margin-top: 4.2cqw;
  padding: 1.4cqw 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--title-background);
  font: 700 clamp(18px, 5.5cqw, 7rem)/1 Georgia, 'Times New Roman', serif;
  letter-spacing: 0;
}
#start:hover:enabled { background: #f6dbad; }
.menu-secondary {
  justify-content: center;
  width: 79%;
  min-width: 0;
  min-height: 44px;
  margin-top: 10px;
  padding: 8px 16px;
  border: 1px solid color-mix(in srgb, currentColor 50%, transparent);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: clamp(14px, 2cqw, 22px);
}
.menu-secondary:hover:enabled { background: color-mix(in srgb, currentColor 10%, transparent); }
.menu #options { margin-top: 4.2cqw; }
.menu #options-title {
  margin: 0;
  font: 700 clamp(22px, 4cqw, 44px)/1.1 Georgia, 'Times New Roman', serif;
}
.spotting-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 44px;
  font-size: clamp(14px, 2cqw, 22px);
  cursor: pointer;
}
.spotting-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}
.menu-status {
  position: absolute;
  margin: 8px 0 0;
  font-size: clamp(12px, 1.2cqw, 18px);
}
.menu-falcon {
  display: block;
  width: 100%;
  height: auto;
  transform: translateY(-2cqw);
}
.title-screen {
  --title-background: #172820;
  background: var(--title-background);
  color: #f4eddd;
}
@media (max-aspect-ratio: 5/4) {
  .menu-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2cqw;
    justify-items: center;
    width: min(84vw, 69dvh);
    margin-bottom: 30px;
  }
  .menu-content { width: 100%; text-align: center; }
  .menu h1 { font-size: 24cqw; }
  #start { margin-inline: auto; font-size: clamp(18px, 9cqw, 50px); }
  .menu-secondary, .spotting-option { margin-inline: auto; }
  .menu-falcon { grid-row: 1; width: 65%; transform: none; }
}
@media (max-aspect-ratio: 5/4) and (max-height: 500px) {
  .menu-falcon { width: 42%; }
}
.flight-hud {
  position: absolute;
  bottom: clamp(20px, 4.5vh, 56px);
  left: var(--gutter);
  right: var(--gutter);
}
.flight-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 23px;
  padding-top: 16px;
  border-top: 1px solid #f4eed436;
}
.control { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #e4e6d9; }
.grounded .airborne-control, body:not(.can-walk) .walking-control,
body:not(.can-turn) .turning-control,
body:not(.can-hop) .hop-control { display: none; }
.control > span { margin-left: 5px; }
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid #e6eed55c;
  border-radius: 3px;
  background: #17241d72;
  font: 11px/1 system-ui, sans-serif;
  color: #f6f1dc;
}
.telemetry { display: flex; gap: 22px; margin-bottom: 16px; }
.fps { position: absolute; top: clamp(20px, 5vh, 60px); right: var(--gutter); display: none; }
.playing .fps { display: block; }
.instrument { min-width: 63px; border-left: 1px solid #eee8cf65; padding-left: 12px; }
.instrument span { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .16em; margin-bottom: 3px; }
.instrument strong { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.instrument small { margin-left: 4px; font-size: 10px; }
@media (max-width: 560px) {
  .masthead { letter-spacing: .13em; }
  .telemetry { gap: 7px; }
  .instrument { min-width: auto; padding-left: 6px; }
  .instrument strong { font-size: 16px; }
  .control { font-size: 11px; }
  .flight-controls { column-gap: 13px; }
}
