:root {
  --ink: #26303a;
  --muted: #66707a;
  --page: #e4e9ed;
  --panel: #b9c1c8;
  --panel2: #a9b2ba;
  --edge: #8c959e;
  --screen: #1f262d;
  --label: #f7f8f9;
  --green: #3fd27a;
  --amber: #f0a52a;
  --red: #e0443a;
  --magenta: #e06ad8;
  --cyan: #46d6f0;
  --glow: #ffd23a;
  --card: #fbfaf6;
  --accent: #2f6fd0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--page); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; user-select: none; }
.hidden { display: none !important; }
kbd { display: inline-block; min-width: 1.4em; padding: 0 4px; border: 1px solid #c4bdad; border-bottom-width: 2px; border-radius: 4px;
  background: #fffdf7; font: 600 11px/1.5 ui-monospace, Consolas, monospace; text-align: center; }
button { font: 700 12px system-ui, sans-serif; cursor: pointer; }

#stage { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; background: var(--panel); overflow: hidden; }

/* windshield */
#viewBox { position: absolute; left: 0; top: 0; width: 1600px; height: 330px; overflow: hidden; background: #cfe3f3; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; }
#frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#frame path { fill: var(--panel2); }

/* glareshield */
#glare { position: absolute; left: 0; top: 330px; width: 1600px; height: 110px; background: linear-gradient(#9aa4ad, #aab3bb); display: flex; align-items: center;
  gap: 8px; padding: 0 10px; border-top: 3px solid #7f8992; border-bottom: 3px solid #7f8992; }
.lights { display: flex; flex-direction: column; gap: 6px; width: 74px; }
.annun { height: 34px; border-radius: 4px; background: #5d666e; color: #8b939a; font: 800 12px system-ui; display: flex; flex-direction: column; align-items: center;
  justify-content: center; line-height: 1; cursor: pointer; border: 2px solid #4a525a; }
.annun small { font-size: 8px; font-weight: 700; }
.annun.red.on { background: var(--red); color: #fff; animation: blink .5s steps(2) infinite; }
.annun.amber.on { background: var(--amber); color: #3a2600; animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { filter: brightness(.65); } }
.clock { font: 700 14px ui-monospace, Consolas, monospace; text-align: center; color: #26303a; background: #d6dbe0; border-radius: 4px; padding: 6px 0; }
.efisbox { width: 80px; background: #59626a; border-radius: 6px; padding: 6px; color: var(--label); text-align: center; }
.efisbox .row { display: flex; justify-content: space-between; align-items: center; }
.efisbox button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #333c44; background: #3c454d; color: #fff; padding: 0; }
.efisbox span { font: 700 15px ui-monospace, monospace; color: var(--green); }
#mcp { flex: 1; height: 96px; background: #59626a; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.25); }
.grp { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 4px; border-radius: 6px; position: relative; }
.grp .row { display: flex; gap: 6px; align-items: center; }
.lbl { font: 800 9px system-ui; letter-spacing: 1px; color: var(--label); text-transform: uppercase; white-space: nowrap; }
.lbl.small { font-size: 8px; }
.win { background: #1b2025; color: #ffb648; font: 700 19px ui-monospace, Consolas, monospace; padding: 2px 8px; border-radius: 3px; min-width: 70px; text-align: center; letter-spacing: 1px; }
#wVs:empty::after { content: '     '; white-space: pre; }
.knob { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #8e979f, #3b434b 70%); border: 2px solid #2b3238; cursor: ew-resize; position: relative; }
.knob::after { content: ''; position: absolute; left: 50%; top: 3px; width: 3px; height: 10px; margin-left: -1.5px; background: #eef1f3; border-radius: 2px; transform-origin: 50% 14px; transform: rotate(var(--rot, 0deg)); }
.knob.big { width: 40px; height: 40px; } .knob.big::after { transform-origin: 50% 17px; }
.knob.small { width: 26px; height: 26px; } .knob.small::after { height: 7px; transform-origin: 50% 10px; }
.knob:hover { box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.wheel { width: 22px; height: 40px; border-radius: 5px; background: repeating-linear-gradient(#2c3238 0 4px, #6d767e 4px 7px); border: 2px solid #2b3238; cursor: ns-resize; background-position: 0 var(--off, 0px); }
.mode { width: 66px; height: 34px; border-radius: 4px; border: 2px solid #2b3238; background: #d8dde1; color: #1f262d; font: 800 10.5px system-ui; position: relative; padding-top: 8px; }
.mode::before { content: ''; position: absolute; left: 10px; right: 10px; top: 4px; height: 4px; border-radius: 2px; background: #6b747c; }
.mode.lit::before { background: var(--green); box-shadow: 0 0 6px var(--green); }
.mode.dim { opacity: .55; cursor: not-allowed; }
.grp.btns { gap: 6px; }
.grp.ap .row { gap: 4px; }
.mode.cmd { width: 58px; }
.disc { width: 120px; height: 14px; font-size: 8px; border-radius: 3px; border: 1px solid #2b3238; background: #c9ced2; padding: 0; }
.toggle { width: 46px; height: 26px; border-radius: 4px; border: 2px solid #2b3238; background: #3d454d; color: #9aa2a9; font: 800 10px system-ui; }
.toggle.on { background: #d8dde1; color: #1f262d; box-shadow: inset 0 -4px 0 var(--green); }
button.small { height: 22px; padding: 0 6px; border-radius: 3px; border: 1px solid #2b3238; background: #d8dde1; font-size: 10px; }

/* main panel */
#panel { position: absolute; left: 0; top: 440px; width: 1000px; height: 270px; background: var(--panel); }
.screen { position: absolute; top: 8px; width: 270px; height: 256px; border-radius: 6px; border: 6px solid #4b545c; background: var(--screen); }
#pfd { left: 14px; } #nd { left: 292px; } #eicas { left: 570px; width: 240px; }
#gearBox { position: absolute; left: 820px; top: 8px; width: 172px; height: 256px; background: var(--panel2); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gearLights { display: flex; gap: 4px; }
.gl { width: 48px; height: 30px; border-radius: 3px; background: #5d666e; color: #8b939a; font: 800 8px/1.1 system-ui; display: flex; align-items: center; justify-content: center; text-align: center; }
.gl.down { background: var(--green); color: #063018; }
.gl.transit { background: var(--red); color: #fff; }
#gearLever { display: flex; gap: 8px; align-items: center; height: 92px; position: relative; padding: 2px 6px; border-radius: 6px; }
#gearLever .slot { display: flex; flex-direction: column; justify-content: space-between; height: 88px; }
#gearLever .slot span { font: 800 12px system-ui; color: #26303a; background: #d6dbe0; border-radius: 4px; padding: 4px 8px; cursor: pointer; }
#gearHandle { width: 18px; height: 88px; background: #3b434b; border-radius: 9px; position: relative; }
#gearHandle i { position: absolute; left: -10px; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fafafa, #bfc5ca); border: 3px solid #555e66; transition: top .3s; top: 0; }
#gearHandle.dn i { top: 50px; }
#abBox { display: flex; flex-direction: column; align-items: center; padding: 3px; border-radius: 6px; }
#abBox .lbl { color: #26303a; }
.dial { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 3px; }
.dial button { width: 44px; height: 22px; border-radius: 3px; border: 1px solid #4b545c; background: #d6dbe0; font-size: 10px; padding: 0; }
.dial button.on { background: #26303a; color: #fff; }

/* pedestal */
#pedestal { position: absolute; left: 0; top: 710px; width: 1000px; height: 190px; background: #a3acb4; border-top: 3px solid var(--edge); display: flex; gap: 8px; padding: 8px 12px; }
.radio { background: #59626a; border-radius: 8px; padding: 8px; color: var(--label); display: flex; flex-direction: column; gap: 6px; position: relative; }
.radio .freqs { display: flex; gap: 6px; align-items: center; }
.radio .freqs div { background: #1b2025; border-radius: 3px; padding: 2px 6px; text-align: center; }
.radio .freqs small { display: block; font: 700 8px system-ui; color: #9aa3ab; letter-spacing: 1px; }
.radio .freqs b { font: 700 18px ui-monospace, Consolas, monospace; color: #ffb648; }
.radio .freqs button { width: 30px; height: 26px; border-radius: 4px; border: 1px solid #2b3238; background: #d8dde1; font-size: 15px; padding: 0; }
.radio .x { color: #9aa3ab; }
.radio .knobs { display: flex; gap: 12px; align-items: center; }
.radio .knobs > div { display: flex; flex-direction: column; align-items: center; }
.radio .knobs small { font-size: 8px; color: #c7cdd2; }
.radio .note { font-size: 10px; color: #c7cdd2; max-width: 150px; }
.ident { font: 700 11px ui-monospace, monospace; color: var(--green); }
#navBox { width: 230px; } #comBox { width: 200px; } #xpdrBox { width: 150px; }
.digits { display: flex; gap: 4px; }
.digits b { width: 26px; height: 34px; background: #1b2025; color: #ffb648; font: 700 22px ui-monospace, monospace; display: flex; align-items: center; justify-content: center; border-radius: 3px; cursor: pointer; }
.digits b:hover { outline: 2px solid #fff4; }
#quadrant { flex: 1; display: flex; gap: 8px; background: #8f99a2; border-radius: 8px; padding: 6px; }
#quadrant .lbl { color: #1f262d; text-align: center; }
#sbrkBox, #flapBox { width: 74px; display: flex; flex-direction: column; align-items: center; border-radius: 6px; padding: 2px; }
.track { display: flex; flex-direction: column; gap: 2px; margin-top: 3px; width: 100%; }
.track button { height: 16px; font-size: 9px; padding: 0; border-radius: 3px; border: 1px solid #4b545c; background: #d6dbe0; }
.track button.on { background: #26303a; color: #fff; }
#flapTrack { gap: 1px; } #flapTrack button { height: 14px; font-size: 8.5px; line-height: 1; }
#thrBox { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 6px; }
.thrTrack { position: relative; width: 120px; height: 104px; background: #5d666e; border-radius: 6px; display: flex; justify-content: center; gap: 22px; cursor: ns-resize; }
.tl { position: relative; width: 12px; height: 100%; }
.tl i { position: absolute; left: -12px; width: 36px; height: 16px; border-radius: 4px; background: #e9ecee; border: 2px solid #2b3238; top: calc(var(--pos, 1) * 84px); }
#thrBox .row { display: flex; gap: 6px; }
#thrBox .row button { height: 24px; border-radius: 4px; border: 1px solid #2b3238; background: #d6dbe0; padding: 0 10px; }
#bRev.on { background: var(--amber); }
#pbBox { width: 70px; display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 6px; padding: 2px; }
#bPb { width: 60px; height: 34px; border-radius: 4px; border: 2px solid #2b3238; background: #d6dbe0; }
#bPb.on { background: var(--red); color: #fff; }

/* highlighted by "Show me" */
.glow { outline: 3px solid var(--glow); outline-offset: 2px; box-shadow: 0 0 18px 4px rgba(255, 210, 58, .8); animation: pulse 0.9s ease-in-out infinite; border-radius: 8px; }
@keyframes pulse { 50% { outline-color: rgba(255, 210, 58, .25); box-shadow: 0 0 6px 1px rgba(255, 210, 58, .3); } }

/* radio */
#radio { position: absolute; left: 1010px; top: 448px; width: 578px; height: 444px; background: var(--card); border-radius: 10px; border: 1px solid #8c959e; display: flex; flex-direction: column;
  box-shadow: 0 4px 16px rgba(40, 50, 60, .25); }
#radioHead { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid #e0ddd3; font-size: 13px; }
#timeCtl { display: flex; gap: 4px; align-items: center; }
#timeCtl button { height: 24px; padding: 0 7px; border-radius: 5px; border: 1px solid #c4bdad; background: #fff; font-size: 11px; }
#timeCtl button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
#tPause.on { background: var(--amber); border-color: var(--amber); }
#speeds { display: flex; gap: 3px; }
#warp { position: absolute; right: 50px; top: 26px; display: flex; align-items: center; gap: 6px; background: rgba(251, 250, 246, .88); border-radius: 10px;
  padding: 5px 8px; box-shadow: 0 2px 10px rgba(40, 50, 60, .2); }
#warp span { font: 800 11px system-ui; letter-spacing: 2px; color: var(--muted); }
#warp .speeds { display: flex; gap: 4px; }
#warp button { height: 30px; min-width: 42px; border-radius: 6px; border: 1px solid #c4bdad; background: #fff; font-size: 14px; }
#warp button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
#msgs { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.38; }
.m { padding: 6px 10px; border-radius: 8px; max-width: 92%; }
.m b { display: block; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 1px; }
.m.ATC { background: #e6eefb; align-self: flex-start; } .m.ATC b { color: var(--accent); }
.m.CAPT { background: #fdf0de; align-self: flex-start; } .m.CAPT b { color: #b5651d; }
.m.YOU { background: #e7f4ea; align-self: flex-end; } .m.YOU b { color: #23874a; }
.m.SYS { background: transparent; color: var(--muted); font-size: 12px; align-self: center; padding: 0; }
.m.urgent { border: 2px solid var(--red); }
.m.old { opacity: .7; }
#replies { border-top: 1px solid #e0ddd3; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
#replies .row { display: flex; gap: 6px; }
#replies button { flex: 1; height: 34px; border-radius: 8px; border: 1px solid #c4bdad; background: #fff; font-size: 13px; }
#replies button:hover { background: #f3f0e8; }
#replies button.show { background: #fff6d6; border-color: #e3c25a; }
#scripted button { width: 100%; height: auto; padding: 8px; background: #23874a; border-color: #23874a; color: #fff; text-align: left; animation: pulse2 1.2s infinite; }
@keyframes pulse2 { 50% { filter: brightness(1.15); } }

/* menu and results */
.overlay { position: fixed; inset: 0; background: rgba(214, 222, 228, .72); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; overflow-y: auto;
  backdrop-filter: blur(3px); }
.card { background: var(--card); border: 1px solid #d9d4c6; border-radius: 16px; padding: 22px 28px; width: min(780px, 100%); box-shadow: 0 12px 40px rgba(60,60,50,.18); max-height: 100%; overflow-y: auto; }
.card.small { width: min(400px, 100%); text-align: center; }
h1 { margin: 0 0 6px; font-size: 38px; color: var(--ink); letter-spacing: .5px; }
h2 { margin: 4px 0 6px; }
h3 { margin: 14px 0 6px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.lead { line-height: 1.5; margin: 4px 0; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { text-align: left; padding: 10px 12px; border-radius: 10px; border: 2px solid #d9d4c6; background: #fff; font-weight: 400; }
.choice b { display: block; font-size: 15px; margin-bottom: 3px; }
.choice span { font-size: 12px; color: var(--muted); line-height: 1.35; display: block; }
.choice.sel { border-color: var(--accent); background: #eef3fd; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 14px; }
.opts label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.go { margin-top: 18px; display: flex; gap: 10px; justify-content: center; }
.go button { border-radius: 8px; padding: 9px 18px; font-size: 14px; border: 1px solid #c4bdad; background: #fff; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 17px; padding: 11px 30px; }
.how { margin-top: 14px; font-size: 14px; }
.how summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.how li { margin: 5px 0; line-height: 1.4; }
.kind { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.kind.good { color: #23874a; } .kind.bad { color: var(--red); }
#endScore { font: 900 40px system-ui; margin: 6px 0; }
#endRows { width: 100%; border-collapse: collapse; font-size: 14px; }
#endRows td { padding: 4px 6px; border-bottom: 1px solid #ebe6da; }
#endRows td.r { text-align: right; font-weight: 700; }
