/* Cockpit panel overlay (task 15.3). Uses the colour variables of game.css. Every control is at least 44 px
   high and has a visible focus ring; every drawing has a text label, so nothing relies on colour alone (R10.1). */
.cockpit-panel {
  /* Slim overlay on the windshield (design 15.1): level strip and map inset at the top, one text line, one bar row at the bottom. */
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas: "legend map" "text map" "gap gap" "bar bar";
  gap: 4px 8px;
  color: var(--text);
  font-size: 0.85rem;
}
.cp-bar {
  grid-area: bar; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px 20px;
  padding: 4px 12px; background: rgba(16, 21, 28, 0.82); border-top: 1px solid var(--line); pointer-events: auto;
}
.cp-fuel { position: relative; display: flex; flex-direction: column; min-width: 0; }
/* The cost pop-up floats above the fuel counter so it never widens the bar. */
.cockpit-panel .cp-cost-pop { position: absolute; left: 0; bottom: calc(100% + 6px); margin: 0; white-space: nowrap; }
.cp-ice { display: flex; flex-direction: column; gap: 2px; min-width: 190px; }
.cp-ice-row { display: flex; align-items: center; gap: 8px; }
.cp-switch { display: flex; align-items: center; gap: 8px; }
.cp-tape { margin: 0; display: flex; flex-direction: column; }
.cp-map { grid-area: map; margin: 6px 6px 0 0; display: flex; flex-direction: column; min-width: 0; align-self: start; pointer-events: auto; }
.cp-legend {
  grid-area: legend; display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 6px 0 0 6px; padding: 3px 8px; list-style: none;
  background: rgba(16, 21, 28, 0.82); border-radius: 4px; justify-self: start; font-size: 0.8rem;
}
.cp-text-line {
  grid-area: text; margin: 0 0 0 6px; padding: 1px 8px; font-size: 0.78rem; justify-self: start; max-width: 100%;
  background: rgba(16, 21, 28, 0.82); border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-label { color: var(--muted); font-size: 0.78rem; }
.cp-fuel-value { font-size: 1.3rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.cp-ice-meter { flex: 1 1 auto; min-width: 90px; height: 14px; }
/* Revision e (R24.5): tick at 50 (ice gate) over the meter, and the marks in words under it. */
.cp-ice-scale { position: relative; flex: 1 1 auto; display: flex; min-width: 90px; }
.cp-ice-scale .cp-ice-meter { width: 100%; }
.cp-ice-scale::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: #e8edf3; pointer-events: none; }
.cp-ice-marks { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.cp-ice-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-antiice { min-height: 44px; min-width: 44px; padding: 2px 14px; }
.cp-antiice[aria-checked="true"] { border-color: var(--warn); border-width: 2px; font-weight: 600; }
.cp-lamp {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--muted); background: transparent;
}
.cp-lamp-on { background: var(--warn); border-color: #ffffff; }
.cp-lamp-text { color: var(--text); }
.cp-tape-value { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.cp-map-canvas { width: 100%; height: 84px; background: #10161d; display: block; border: 1px solid var(--line); }
.cp-map-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cp-legend-item { display: flex; align-items: center; gap: 6px; }
.cp-swatch { width: 18px; height: 14px; border: 1px solid var(--muted); display: inline-block; }
.cp-level-0 .cp-swatch { background: repeating-linear-gradient(90deg, #9aa3ad 0 1px, transparent 1px 5px); }
.cp-level-1 .cp-swatch { background: transparent; }
.cp-level-2 .cp-swatch { background: radial-gradient(#74d4ff 1px, transparent 1.5px) 0 0 / 5px 5px; }
.cp-level-3 .cp-swatch { background: repeating-linear-gradient(45deg, #ffb347 0 2px, transparent 2px 6px); border-color: var(--orange); }

@media (max-width: 900px) {
  .cockpit-panel { grid-template-columns: minmax(0, 1fr) 110px; }
  .cp-bar { flex-wrap: wrap; }
  .cp-ice { min-width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .cockpit-panel * { transition: none !important; animation: none !important; }
}
/* Frost (task 16.1) is drawn in the WebGL overlay by cockpit3d.js (generated texture, opacity = ice / 100);
   there is no CSS frost layer. The ice gauge text above stays the label, so the effect is never the only cue. */

/* Cost pop-up (task 16.7) */
.cp-cost-pop { display: inline-block; margin-left: 0.5rem; padding: 0.1rem 0.5rem; border-radius: 4px; background: #24313f; color: #ffd84d; font-weight: 600; }
.cp-cost-pop[hidden] { display: none; }

/* Runway and takeoff (task 17.3). The box replaces the controls until the climb ends. */
.lead-box { padding: 8px 12px; border: 1px solid var(--line); background: rgba(16, 21, 28, 0.96); color: var(--text); }
.lead-box[hidden] { display: none; }
/* Departure climb status card, 2D view (task 17.7). Compact: it must not push the layout past one screen. */
.departure-card { padding: 4px 10px; border: 1px solid var(--line); background: rgba(16, 21, 28, 0.96); color: var(--text); font-size: 0.85rem; }
.departure-card[hidden] { display: none; }
.departure-card h3 { margin: 0 0 2px; font-size: 0.9rem; }
.departure-card p { margin: 0 0 2px; }
.departure-card-note { font-size: 0.75rem; opacity: 0.85; }
.lead-box h3 { margin: 0 0 4px; font-size: 1rem; }
.lead-status { margin: 0 0 8px; }
.takeoff-btn { min-height: 44px; min-width: 44px; padding: 4px 18px; font-size: 1rem; font-weight: 600; }
.takeoff-btn[hidden] { display: none; }
body.lead-active #controls { display: none; }

/* Capture mode (revision d, R23.6): only with ?video=1. Bigger texts for 1920 x 1080 recordings, no shortcut row, no pointer.
   The game note, the source line, the level strip and the "here / ahead" text line stay visible. Display only. */
body[data-video="1"], body[data-video="1"] * { cursor: none !important; }
body[data-video="1"] .bottom-buttons { display: none; }
body[data-video="1"] .hud dt { font-size: 0.95rem; }
body[data-video="1"] .hud dd { font-size: 1.65rem; }
body[data-video="1"] .cp-label { font-size: 1.05rem; }
body[data-video="1"] .cp-fuel-value { font-size: 1.75rem; }
body[data-video="1"] .cp-tape-value { font-size: 1.7rem; }
body[data-video="1"] .cp-ice-value, body[data-video="1"] .cp-lamp-text, body[data-video="1"] .cp-antiice { font-size: 1.15rem; }
body[data-video="1"] .cp-text-line { font-size: 1.15rem; }
body[data-video="1"] .cp-legend { font-size: 1.05rem; }
body[data-video="1"] .gate-panel, body[data-video="1"] #gate-panel { font-size: 1.15rem; }
body[data-video="1"] #gate-choices button { font-size: 1.2rem; }
body[data-video="1"] .cp-ice-marks { font-size: 0.95rem; }
body[data-video="1"] .gate-keys { font-size: 1.05rem; }
body[data-video="1"] .cost-rules summary { font-size: 1.1rem; }
body[data-video="1"] .cost-rules ul { font-size: 1.05rem; }
