/* Cockpit navigation display: display-unit bezel, black ND screen and EFIS range keys. */

    #cockpit-nd {
      --nd-screen-h: clamp(220px, 27vh, 300px);
      --nd-screen-w: calc(var(--nd-screen-h) * 1.34);
      position: absolute;
      left: 50%;
      bottom: 142px;
      z-index: 1204;
      transform: translateX(-50%) translateY(8px);
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
      font-family: "Pretendard Variable", Pretendard, ui-sans-serif, sans-serif;
      font-variant-numeric: tabular-nums;
    }
    #cockpit-nd.visible {
      opacity: 1;
      visibility: visible;
      transform: translateX(-50%) translateY(0);
      transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
    }
    .cockpit-nd-unit {
      position: relative;
      padding: 9px 9px 0;
      border-radius: 12px 12px 10px 10px;
      background:
        radial-gradient(circle at 12px 12px, #6b7077 0 1.6px, #23262a 2.2px, transparent 3.2px),
        radial-gradient(circle at calc(100% - 12px) 12px, #6b7077 0 1.6px, #23262a 2.2px, transparent 3.2px),
        linear-gradient(180deg, #3a3e44 0%, #2c2f34 46%, #24272b 100%);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5),
        0 10px 26px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(0, 0, 0, 0.55);
    }
    .cockpit-nd-bezel {
      position: relative;
      width: var(--nd-screen-w);
      height: var(--nd-screen-h);
      border-radius: 4px;
      overflow: hidden;
      background: #020304;
      box-shadow: inset 0 0 0 2px #0b0c0e, inset 0 2px 8px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.08);
    }
    .cockpit-nd-bezel::after {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 38%),
        radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.35) 100%);
    }
    .cockpit-nd-screen {
      display: block;
      width: 100%;
      height: 100%;
    }
    .cockpit-nd-efis {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      padding: 7px 2px 8px;
      pointer-events: auto;
    }
    .cockpit-nd-efis-label {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      margin-right: 6px;
      font-size: 9.5px;
      font-weight: 700;
      line-height: 1.15;
      letter-spacing: 0.14em;
      color: #d9dde2;
      opacity: 0.82;
    }
    .cockpit-nd-efis-label span {
      color: #9aa1aa;
    }
    .cockpit-nd-key {
      position: relative;
      width: 44px;
      height: 30px;
      padding: 0 0 5px;
      border: 1px solid #0d0e10;
      border-radius: 3px;
      background: linear-gradient(180deg, #2a2d32 0%, #1c1e22 100%);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.6);
      color: #e8ebee;
      font: 650 12.5px/1 "Pretendard Variable", Pretendard, ui-sans-serif, sans-serif;
      letter-spacing: 0.03em;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      transition: transform 0.15s ease, background-color 0.15s ease;
    }
    .cockpit-nd-key::after {
      content: "";
      position: absolute;
      left: 9px;
      right: 9px;
      bottom: 4px;
      height: 3px;
      border-radius: 1px;
      background: #2a3a30;
      transition: background-color 0.18s ease, box-shadow 0.18s ease;
    }
    .cockpit-nd-key.active::after {
      background: #46f08c;
      box-shadow: 0 0 6px rgba(70, 240, 140, 0.85);
    }
    .cockpit-nd-key:active {
      transform: translateY(1px);
    }
    .cockpit-nd-key:focus-visible {
      outline: 2px solid rgba(160, 210, 255, 0.95);
      outline-offset: 2px;
    }
    body.airshow-cockpit-nd-on .cockpit-hud-heading {
      visibility: hidden;
    }
    /* Phone: the centre reticle needs the middle of the short screen, so the speed and altitude
       tapes step out to the screen edges and a squarer ND sits bottom-left, between the speed tape
       (ends near 80px) and the view buttons, above the map credit line. */
    html.airshow-mobile-runtime body.airshow-cockpit-nd-on #cockpit-hud {
      --airshow-cockpit-panel-lateral-shift: calc(32.25vw - 19.4px);
    }
    html.airshow-mobile-runtime #cockpit-nd {
      --nd-screen-w: min(196px, calc(50vw - 250px));
      --nd-screen-h: calc(var(--nd-screen-w) * 0.97);
      left: 90px;
      bottom: 80px;
      transform: translateY(8px);
    }
    html.airshow-mobile-runtime #cockpit-nd.visible {
      transform: translateY(0);
    }
    html.airshow-mobile-runtime .cockpit-nd-unit {
      padding: 5px 5px 0;
      border-radius: 9px 9px 8px 8px;
    }
    html.airshow-mobile-runtime .cockpit-nd-efis {
      gap: 3px;
      padding: 4px 0 5px;
    }
    html.airshow-mobile-runtime .cockpit-nd-efis-label {
      display: none;
    }
    html.airshow-mobile-runtime .cockpit-nd-key {
      flex: 1 1 0;
      width: auto;
      min-width: 0;
      height: 24px;
      padding-bottom: 4px;
      font-size: 11px;
    }
    html.airshow-mobile-runtime .cockpit-nd-key::after {
      left: 7px;
      right: 7px;
      bottom: 3px;
      height: 2px;
    }
    @media (prefers-reduced-motion: reduce) {
      #cockpit-nd,
      #cockpit-nd.visible,
      .cockpit-nd-key,
      .cockpit-nd-key::after {
        transition: none;
      }
    }
