#hangar {
  --hangar-active: var(--amber, #ffc978);
  position: relative;
  width: min(100%, 410px);
  margin: 0 0 17px;
  pointer-events: auto;
}
.hangar-group {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}
.hangar-heading {
  padding: 0;
  margin: 0 0 6px;
  color: #f6e5bd;
  font: 750 11px/15px ui-monospace, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .14em;
}
#hangar-bura {
  position: absolute;
  top: 0;
  right: 0;
  color: #e2e5db;
  font: 600 11px/15px system-ui, sans-serif;
  text-shadow: 0 1px 4px #07171a;
}
.hangar-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.hangar-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(33px, .70fr) minmax(0, 1fr);
  align-items: center;
  gap: 3px;
  min-height: 65px;
  padding: 6px 5px;
  cursor: pointer;
  border: 1px solid #648084;
  border-radius: 4px;
  background: linear-gradient(115deg, #243d42 0%, #10252b 54%, #0b1b21 100%);
}
.hangar-card:hover {
  border-color: #cddbd3;
}
.hangar-card:has(input:checked) {
  background: linear-gradient(115deg, #51513e 0%, #273637 52%, #17282c 100%);
  border-color: var(--hangar-active);
  box-shadow: inset 3px 0 var(--hangar-active);
}
.hangar-card:has(input:focus-visible) {
  outline: 2px solid white;
  outline-offset: 2px;
}
.hangar-card input {
  appearance: none;
  position: absolute;
  right: 5px;
  top: 5px;
  width: 11px;
  height: 11px;
  margin: 0;
  border: 1px solid #9caca8;
  border-radius: 50%;
  cursor: pointer;
}
.hangar-card input:checked {
  border-color: var(--hangar-active);
  background: radial-gradient(circle, var(--hangar-active) 0 42%, transparent 48%);
}
.hangar-aircraft {
  display: block;
  width: 100%;
  height: 54px;
  object-fit: contain;
  pointer-events: none;
}
.hangar-caption {
  display: grid;
  gap: 2px;
  color: #d7e1dc;
  font: 580 11px/1.15 system-ui, sans-serif;
}
.hangar-caption strong {
  margin: 0 9px 1px 0;
  color: #fff5dc;
  font: 780 17px/1.05 system-ui, sans-serif;
  letter-spacing: -.025em;
}

/* Short game canvases still need a reachable launch button in every language. */
.overlay.cover:has(#hangar:not([hidden])) {
  justify-content: safe center;
  overflow-y: auto;
  pointer-events: auto;
}
.overlay.cover:has(#hangar:not([hidden])) > * {
  flex-shrink: 0;
}
@container (max-width: 465px) {
  .overlay.cover:has(#hangar:not([hidden])) {
    padding: 12px 14px;
  }
  .overlay.cover:has(#hangar:not([hidden])) h1 {
    font-size: clamp(26px, 8.4cqw, 40px);
    margin: 6px 0 7px;
  }
  .overlay.cover:has(#hangar:not([hidden])) #description {
    max-width: 43ch;
    font-size: 12px;
    line-height: 1.23;
    margin-bottom: 8px;
  }
  #hangar {
    margin-bottom: 9px;
  }
  .hangar-choices {
    gap: 5px;
  }
  .hangar-card {
    min-height: 54px;
    padding: 4px;
    grid-template-columns: minmax(29px, .60fr) minmax(0, 1fr);
  }
  .hangar-aircraft {
    height: 43px;
  }
  .hangar-caption {
    font-size: 10.5px;
    gap: 1px;
  }
  .hangar-caption strong {
    font-size: 15px;
  }
  .overlay.cover:has(#hangar:not([hidden])) .overlay-actions {
    gap: 4px;
  }
  .overlay.cover:has(#hangar:not([hidden])) .overlay-actions button {
    min-height: 32px;
    padding: 5px 6px;
    font-size: 11px;
  }
  .overlay.cover:has(#hangar:not([hidden])) .overlay-actions .primary {
    padding-inline: 10px;
    font-size: 13px;
  }
  .overlay.cover:has(#hangar:not([hidden])) :is(.hint, .credit) {
    max-width: 100%;
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.25;
  }
}
@media (max-width: 640px) {
  .stage:has(.cover:not([hidden]) #hangar:not([hidden])) {
    min-height: min(332px, 85svh);
  }
}
@media (forced-colors: active) {
  .hangar-card input {
    appearance: auto;
  }
  .hangar-card:has(input:checked) {
    outline: 1px solid Highlight;
  }
}

/* While choosing an aircraft, let the menu size the stage. The page owns
   scrolling, so swiping a short screen never traps a finger inside the cover. */
@media (pointer: coarse) and (max-width: 640px),
       (pointer: coarse) and (orientation: landscape) and (max-height: 540px) {
  .cabinet:has(#overlay.cover:not([hidden])) {
    grid-template-areas: "top" "stage";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .cabinet:has(#overlay.cover:not([hidden])) :is(.rail, .touch) {
    display: none;
  }
  .cabinet:has(#overlay.cover:not([hidden])) .top .chip {
    min-height: 44px;
  }
  #overlay.cover:has(#hangar) {
    position: relative;
    inset: auto;
    grid-area: 1 / 1;
    align-self: stretch;
    justify-self: stretch;
    justify-content: center;
    overflow: visible;
    padding: clamp(14px, 4vw, 24px);
  }
  #overlay.cover:has(#hangar) .overlay-actions {
    gap: 6px;
  }
  #overlay.cover:has(#hangar) .overlay-actions button {
    min-height: 44px;
    padding-inline: 10px;
    font-size: 12px;
  }
  #overlay.cover .overlay-actions #start {
    font-size: 14px;
  }
  #hangar .hangar-card {
    min-height: 64px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  #hangar .hangar-card input {
    width: 14px;
    height: 14px;
  }
  #hangar .hangar-caption {
    font-size: 11px;
  }
  #hangar .hangar-caption strong {
    font-size: 17px;
    margin-right: 14px;
  }
  .language-intro:not([hidden]) {
    align-items: safe center;
  }
  .language-intro .language-panel {
    max-height: none;
    overflow: visible;
  }
  .language-intro :is(.language-choice, #confirm-language) {
    min-height: 44px;
  }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 540px) and (min-width: 520px) {
  .cabinet:has(#overlay.cover:not([hidden])) {
    --field-height: clamp(150px, calc(100svh - 76px), 420px);
  }
  .cabinet .stage:has(#overlay.cover:not([hidden])) {
    min-height: 0;
  }
  #overlay.cover:has(#hangar) {
    display: grid;
    align-content: center;
    grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr);
    grid-template-areas:
      "eyebrow     hangar"
      "heading     hangar"
      "description actions"
      "credit      hint"
      ".           bonus";
    align-items: start;
    gap: 5px clamp(14px, 3vw, 26px);
    padding: 12px clamp(14px, 3vw, 24px);
    background-color: #0b2026;
    background-blend-mode: normal, luminosity;
  }
  #overlay.cover #eyebrow { grid-area: eyebrow; }
  #overlay.cover #heading {
    grid-area: heading;
    margin: 0;
    font-size: clamp(27px, 5cqw, 42px);
  }
  #overlay.cover #heading.long-title { font-size: clamp(23px, 4cqw, 33px); }
  #overlay.cover #description {
    grid-area: description;
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
  }
  #overlay.cover #hangar {
    grid-area: hangar;
    margin: 0;
  }
  #overlay.cover .overlay-actions { grid-area: actions; }
  #overlay.cover #hint { grid-area: hint; }
  #overlay.cover #bonus-status { grid-area: bonus; }
  #overlay.cover #creator-credit { grid-area: credit; }
  #overlay.cover :is(#hint, #bonus-status, #creator-credit) {
    max-width: 100%;
    margin: 0;
    font-size: 11px;
    line-height: 1.3;
  }
  .language-intro:not([hidden]) {
    padding-block: 8px;
  }
  .language-intro .language-panel {
    width: min(100%, 720px);
    padding: 12px 16px;
  }
  .language-panel .language-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  .language-panel h2 { margin: 4px 0 9px; }
  .language-panel .language-confirm { margin-top: 8px; }
}
