:root {
  --cream: #f2e8d2;
  --cream-dim: rgba(242, 232, 210, 0.72);
  --amber: #ffd68c;
  --brass: #d9a54a;
  --red: #ff5c46;
  --blue: #9ec3e6;
  --green: #78dc8c;
  --panel: rgba(14, 17, 15, 0.62);
  --panel-solid: rgba(14, 17, 15, 0.88);
  --line: rgba(255, 214, 140, 0.28);
  --font: "Avenir Next Condensed", "DIN Condensed", "Futura", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Baskerville", "Georgia", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0d0c; color: var(--cream); font-family: var(--font); -webkit-font-smoothing: antialiased; user-select: none; }
#app, #app canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button, select, input { font-family: var(--font); }

/* ---------------------------------------------------------------- screens */
.screen { position: fixed; inset: 0; display: none; z-index: 20; }
.screen.on { display: block; animation: fadeIn 0.35s ease; }
.screen.dim { background: radial-gradient(ellipse at center, rgba(8, 10, 9, 0.55), rgba(8, 10, 9, 0.88)); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.eyebrow { font-size: 13px; letter-spacing: 0.32em; color: var(--brass); font-weight: 600; }
h1, h2 { font-weight: 700; letter-spacing: 0.04em; margin: 0; }
h2 { font-size: 44px; text-transform: uppercase; margin: 6px 0 18px; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5); }
h4 { letter-spacing: 0.24em; font-size: 13px; color: var(--brass); margin: 22px 0 8px; }

#title { background: linear-gradient(90deg, rgba(6, 8, 7, 0.82) 0%, rgba(6, 8, 7, 0.45) 38%, rgba(6, 8, 7, 0) 62%); }
.title-block { position: absolute; left: 7vw; top: 13vh; }
.title-block h1 { font-size: clamp(64px, 9vw, 132px); line-height: 0.86; letter-spacing: 0.02em; text-shadow: 0 6px 40px rgba(0, 0, 0, 0.55); }
.title-block h1 span { color: var(--amber); }
.title-block .tag { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--cream-dim); margin: 16px 0 0; }
.menu { display: flex; flex-direction: column; gap: 8px; width: 330px; }
#title .menu { position: absolute; left: 7vw; top: calc(13vh + clamp(64px, 9vw, 132px) * 1.72 + 90px); }
.menu.inline { flex-direction: row; width: auto; gap: 12px; }
.menu button {
  appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--cream);
  font-size: 17px; letter-spacing: 0.18em; text-transform: uppercase; text-align: left; padding: 13px 18px; cursor: pointer;
  backdrop-filter: blur(6px); display: flex; justify-content: space-between; align-items: center; transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.menu button:focus { outline: none; }
body[data-input="kbm"] .menu button:hover { border-color: var(--amber); background: rgba(40, 34, 20, 0.75); transform: translateX(3px); }
.menu button.primary { background: var(--amber); color: #1a1408; border-color: var(--amber); font-weight: 700; }
body[data-input="kbm"] .menu button.primary:hover { background: #ffe3a8; }
.footer-note { position: absolute; left: 7vw; bottom: 4vh; font-size: 12px; letter-spacing: 0.24em; color: var(--cream-dim); text-transform: uppercase; }
.screen-head { position: absolute; left: 7vw; top: 9vh; }
#campaign .menu.inline, #settings .menu.inline, #controls .menu.inline { position: absolute; left: 7vw; bottom: 6vh; }
#campaign, #settings, #controls, #quick, #briefing, #career { background: rgba(8, 10, 9, 0.72); backdrop-filter: blur(3px); }

/* campaign cards */
.cards { position: absolute; left: calc(7vw - 12px); right: calc(7vw - 12px); top: calc(26vh - 12px); display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 24px - 4 * 14px) / 5); gap: 14px; padding: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scroll-padding: 12px; scrollbar-width: none; }
.cards::-webkit-scrollbar { display: none; }
.card { scroll-snap-align: start; }
.card { border: 1px solid var(--line); background: var(--panel-solid); padding: 18px 16px 16px; cursor: pointer; min-height: 290px; display: flex; flex-direction: column; transition: transform 0.18s, border-color 0.18s; position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; inset: 0; background: var(--art, none) center / cover; opacity: 0.32; transition: opacity 0.2s; }
.card > * { position: relative; }
.card:focus { outline: none; }
body[data-input="kbm"] .card:hover { transform: translateY(-4px); border-color: var(--amber); }
body[data-input="kbm"] .card:hover::before { opacity: 0.38; }
.card .num { font-size: 52px; font-weight: 700; color: var(--amber); line-height: 1; }
.card .t { font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 10px; }
.card .p { font-size: 13px; letter-spacing: 0.2em; color: var(--brass); margin-top: 6px; text-transform: uppercase; }
.card .d { font-family: var(--serif); font-size: 15px; line-height: 1.45; color: var(--cream-dim); margin-top: 14px; flex: 1; }
.card .ac { font-size: 12px; letter-spacing: 0.18em; color: var(--cream-dim); text-transform: uppercase; margin-top: 12px; }
.card .st { color: var(--amber); font-size: 20px; letter-spacing: 0.15em; margin-top: 6px; }

/* briefing */
.brief-grid { position: absolute; inset: 8vh 7vw; display: grid; grid-template-columns: 1fr 380px; gap: 5vw; }
.brief-date { font-size: 15px; letter-spacing: 0.3em; color: var(--cream-dim); text-transform: uppercase; }
.brief-text p { font-family: var(--serif); font-size: 19px; line-height: 1.6; color: var(--cream); max-width: 760px; margin: 16px 0 0; }
.brief-objectives { list-style: none; padding: 0; margin: 0; }
.brief-objectives li { font-size: 18px; letter-spacing: 0.06em; padding: 6px 0 6px 24px; position: relative; }
.brief-objectives li::before { content: '◆'; position: absolute; left: 0; color: var(--amber); font-size: 12px; top: 10px; }
.brief-side { display: flex; flex-direction: column; gap: 16px; padding-top: 30px; }
.brief-side .menu { width: 100%; margin-top: 10px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; letter-spacing: 0.24em; color: var(--brass); font-weight: 600; }
label small { letter-spacing: 0.1em; color: var(--cream-dim); font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--cream); letter-spacing: 0.1em; font-size: 15px; }
select, input[type=range] { width: 100%; }
select { appearance: none; background: var(--panel-solid); color: var(--cream); border: 1px solid var(--line); padding: 11px 12px; font-size: 15px; letter-spacing: 0.06em; }
select:focus { outline: none; border-color: var(--amber); }
.aircraft-info { font-family: var(--serif); font-size: 15px; line-height: 1.5; color: var(--cream-dim); min-height: 66px; }
.quick-form { position: absolute; left: 7vw; top: 28vh; width: 420px; display: flex; flex-direction: column; gap: 18px; }
.quick-form .menu { width: 100%; }
.settings-grid { position: absolute; left: 7vw; top: calc(9vh + 150px); width: min(980px, 86vw); display: none; grid-template-columns: 1fr 1fr; gap: 14px 36px; }
.settings-grid.on { display: grid; }
.tips p { font-family: var(--serif); font-size: 16px; line-height: 1.5; color: var(--cream-dim); }
.tips b { color: var(--cream); font-family: var(--font); letter-spacing: 0.06em; }
.center-block { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; display: flex; flex-direction: column; align-items: center; }
.center-block .menu { margin-top: 18px; }
.center-block.wide { width: min(820px, 90vw); }
.stars { font-size: 46px; color: var(--amber); letter-spacing: 0.25em; margin: 4px 0 6px; text-shadow: 0 0 18px rgba(255, 214, 140, 0.5); }
.stars .off { color: rgba(255, 214, 140, 0.2); text-shadow: none; }
#debriefReason { font-family: var(--serif); font-size: 18px; color: var(--cream-dim); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 6px; width: 100%; }
.stats div { border: 1px solid var(--line); background: var(--panel); padding: 12px; }
.stats b { display: block; font-size: 30px; color: var(--cream); }
.stats span { font-size: 11px; letter-spacing: 0.24em; color: var(--brass); }
.loading { background: #0b0d0c; z-index: 50; }
.loading-inner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; width: 360px; }
.brand-small { font-size: 26px; letter-spacing: 0.3em; font-weight: 700; color: var(--amber); }
#loadingText { margin: 14px 0; font-family: var(--serif); font-style: italic; color: var(--cream-dim); font-size: 17px; }
.loadbar { height: 2px; background: rgba(255, 214, 140, 0.15); }
.loadbar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width 0.3s; }
.loading.overlay { background: rgba(8, 10, 9, 0.8); }
.hint-overlay { pointer-events: none; z-index: 15; }
.hint-overlay div { position: absolute; left: 50%; top: 15vh; transform: translateX(-50%); padding: 14px 26px; background: var(--panel); border: 1px solid var(--line); font-size: 16px; letter-spacing: 0.3em; text-align: center; animation: pulse 1.8s ease-in-out infinite; }
.hint-overlay small { display: block; font-size: 11px; letter-spacing: 0.18em; color: var(--cream-dim); margin-top: 6px; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ---------------------------------------------------------------- HUD */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-family: var(--font); color: var(--cream); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75); }
.hud.hidden { display: none; }
.hud-canvas { position: absolute; inset: 0; }
.hud.cinematic > :not(.hud-title):not(.hud-radio):not(.hud-banner):not(.hud-canvas) { opacity: 0; transition: opacity 0.4s; }
.hud > * { transition: opacity 0.4s; }
.hud-top { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); text-align: center; min-width: 420px; }
.hud-mission { font-size: 12px; letter-spacing: 0.32em; color: var(--brass); }
.hud-objectives { list-style: none; padding: 0; margin: 8px 0 0; font-size: 15px; letter-spacing: 0.08em; }
.hud-objectives li { padding: 2px 0; }
.hud-objectives li.done { color: var(--green); text-decoration: line-through; opacity: 0.7; }
.hud-objectives li.failed { color: var(--red); text-decoration: line-through; }
.hud-objectives li.opt { color: var(--cream-dim); }
.hud-bars { display: flex; gap: 18px; justify-content: center; margin-top: 8px; }
.mbar { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.22em; }
.mbar .bar { width: 150px; height: 6px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 214, 140, 0.25); }
.mbar .fill { height: 100%; transition: width 0.3s; }
.mbar .pct { width: 38px; text-align: right; font-weight: 700; }
.mbar.danger { color: var(--red); animation: pulse 0.8s infinite; }
.hud-score { position: absolute; top: 18px; right: 26px; text-align: right; }
.hud-score .value { font-size: 34px; font-weight: 700; letter-spacing: 0.06em; }
.hud-score .label { font-size: 11px; letter-spacing: 0.32em; color: var(--brass); }
.hud-feed { position: absolute; top: 86px; right: 26px; text-align: right; font-size: 14px; letter-spacing: 0.08em; }
.hud-feed div { margin: 3px 0; animation: feedIn 0.3s ease; }
.hud-feed b { color: var(--amber); margin-left: 10px; }
@keyframes feedIn { from { transform: translateX(20px); opacity: 0; } }
.hud-radio { position: absolute; left: 26px; top: 20vh; width: 360px; padding: 12px 16px; background: var(--panel); border-left: 3px solid var(--amber); opacity: 0; transform: translateX(-12px); transition: opacity 0.25s, transform 0.25s; }
.hud-radio.on { opacity: 1; transform: none; }
.hud-radio .who { font-size: 11px; letter-spacing: 0.26em; color: var(--amber); margin-bottom: 4px; }
.hud-radio .text { font-family: var(--serif); font-size: 17px; line-height: 1.4; }
.hud-flight { position: absolute; left: 26px; bottom: 26px; display: flex; gap: 22px; align-items: flex-end; }
.readout .v { font-size: 34px; font-weight: 700; letter-spacing: 0.02em; min-width: 72px; }
.readout .v.hot { color: var(--red); }
.readout .l { font-size: 11px; letter-spacing: 0.3em; color: var(--brass); }
.hud-throttle { width: 8px; height: 58px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 214, 140, 0.3); position: relative; }
.hud-throttle .fill { position: absolute; bottom: 0; left: 0; right: 0; background: var(--amber); }
.hud-throttle.boost .fill { background: #ff9a4a; box-shadow: 0 0 10px #ff9a4a; }
.hud-throttle .tlabel { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); font-size: 9px; letter-spacing: 0.2em; color: var(--brass); }
.hud-status { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); width: 340px; }
.hud-status .row { display: flex; align-items: center; gap: 10px; margin: 4px 0; font-size: 11px; letter-spacing: 0.24em; color: var(--brass); }
.hud-status .k { width: 88px; }
.hud-status .bar { flex: 1; height: 5px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 214, 140, 0.25); }
.hud-status .fill { height: 100%; background: var(--cream); transition: width 0.15s; }
.hud-status .heat .fill { background: linear-gradient(90deg, #ffd68c, #ff6a3a); }
.hud-status .row.danger { color: var(--red); animation: pulse 0.6s infinite; }
.hud-status .row.danger .fill { background: var(--red); }
.hud-status .weapon { text-align: center; font-size: 12px; letter-spacing: 0.22em; margin-top: 6px; color: var(--cream-dim); text-transform: uppercase; }
.hud-wing { position: absolute; left: 26px; bottom: 120px; font-size: 12px; letter-spacing: 0.16em; width: 210px; }
.hud-wing .h { color: var(--brass); letter-spacing: 0.26em; font-size: 11px; margin-bottom: 4px; }
.hud-wing .w { display: flex; align-items: center; gap: 8px; margin: 3px 0; text-transform: uppercase; }
.hud-wing .w span { width: 110px; color: var(--green); }
.hud-wing .w i { display: block; height: 4px; background: var(--green); max-width: 80px; flex: none; }
.hud-wing .w.dead span { color: var(--red); text-decoration: line-through; }
.hud-wing .keys { font-size: 10px; color: var(--cream-dim); margin-top: 4px; letter-spacing: 0.2em; }
.hud-radar { position: absolute; right: 18px; bottom: 18px; text-align: center; }
.hud-radar canvas { width: 190px; height: 190px; }
.hud-radar .rlabel { font-size: 10px; letter-spacing: 0.3em; color: var(--brass); margin-top: -6px; }
.hud-flash { position: absolute; left: 50%; top: 28vh; transform: translateX(-50%); font-size: 16px; letter-spacing: 0.3em; color: var(--amber); opacity: 0; transition: opacity 0.3s; white-space: nowrap; }
.hud-flash.on { opacity: 1; }
.hud-banner { position: absolute; left: 0; right: 0; top: 36vh; text-align: center; opacity: 0; transition: opacity 0.5s; }
.hud-banner.on { opacity: 1; }
.hud-banner .b { display: inline-block; font-size: 54px; font-weight: 700; letter-spacing: 0.18em; padding: 10px 40px; background: linear-gradient(90deg, transparent, rgba(10, 12, 11, 0.7), transparent); }
.hud-banner .b.good { color: var(--amber); }
.hud-banner .b.bad { color: var(--red); }
.hud-banner .sub { font-size: 14px; letter-spacing: 0.32em; color: var(--cream-dim); margin-top: 6px; }
.hud-title { position: absolute; left: 7vw; bottom: 18vh; opacity: 0; transition: opacity 0.8s; }
.hud-title.on { opacity: 1; }
.hud-title .n { font-size: 14px; letter-spacing: 0.4em; color: var(--brass); }
.hud-title .t { font-size: 64px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.hud-title .s { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--cream-dim); }
.hud-title .skip { font-size: 11px; letter-spacing: 0.3em; color: var(--cream-dim); margin-top: 18px; opacity: 0.7; }
.hud-warn { position: absolute; left: 50%; top: 62vh; transform: translateX(-50%); font-size: 22px; font-weight: 700; letter-spacing: 0.4em; color: var(--red); opacity: 0; }
.hud-warn.on { opacity: 1; animation: pulse 0.5s infinite; }
.hud-hint { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); font-size: 12px; letter-spacing: 0.12em; color: var(--cream-dim); background: rgba(10, 12, 11, 0.5); padding: 8px 16px; opacity: 0; transition: opacity 1s; white-space: nowrap; }
.hud-hint.on { opacity: 1; }
.hud.cockpit .hud-flight { opacity: 0.55; }
@media (max-width: 1100px) { .cards { grid-auto-columns: calc((100% - 24px - 2 * 14px) / 3); top: 22vh; } .card { min-height: 220px; } }
.hud.cockpit .hud-status { left: auto; right: 236px; transform: none; width: 260px; }
.hud-top::before { content: ''; position: absolute; left: -60px; right: -60px; top: -18px; bottom: -10px; background: radial-gradient(ellipse at center top, rgba(8, 10, 9, 0.45), rgba(8, 10, 9, 0) 70%); z-index: -1; }


/* ---------------------------------------------------------------- glyphs (buttons, keys, mouse) */
.glyphs { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.gl { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 22px; min-width: 22px; vertical-align: middle; font-family: var(--font); font-weight: 700; font-size: 12px; line-height: 1; letter-spacing: 0.02em; color: var(--cream); text-shadow: none; flex: none; }
.gl-svg { display: block; width: 100%; height: 100%; }
.gl-face { width: 22px; border-radius: 50%; background: #1b1f1d; border: 1.5px solid var(--c, var(--cream)); color: var(--c, var(--cream)); font-size: 12.5px; }
.gl-face.gl-ps { border-color: rgba(242, 232, 210, 0.55); padding: 0; }
.gl-face.gl-generic { border-color: rgba(242, 232, 210, 0.6); padding: 2px; color: var(--cream); }
.gl-bumper, .gl-trigger { min-width: 30px; padding: 0 5px; background: #1b1f1d; border: 1.5px solid rgba(242, 232, 210, 0.6); font-size: 11px; }
.gl-bumper { border-radius: 6px 6px 4px 4px; height: 18px; }
.gl-trigger { border-radius: 11px 11px 4px 4px; }
.gl-stick { width: 22px; border-radius: 50%; background: radial-gradient(circle, #2a2f2c 52%, #1b1f1d 54%); border: 1.5px solid rgba(242, 232, 210, 0.6); position: relative; font-size: 9.5px; }
.gl-stick i { font-style: normal; position: relative; z-index: 1; }
.gl-stick.gl-dir { width: 26px; height: 26px; }
.gl-stick .gl-arrows { position: absolute; inset: -1px; color: var(--amber); }
.gl-stick.gl-click { box-shadow: inset 0 0 0 3px #1b1f1d, inset 0 0 0 4.5px rgba(242, 232, 210, 0.45); }
.gl-dpad { width: 22px; color: var(--cream); }
.gl-sys { width: 22px; border-radius: 50%; background: #1b1f1d; border: 1.5px solid rgba(242, 232, 210, 0.6); padding: 2px; }
.gl-pill { padding: 0 6px; height: 18px; border-radius: 9px; background: #1b1f1d; border: 1.5px solid rgba(242, 232, 210, 0.6); font-size: 9px; letter-spacing: 0.08em; }
.gl-touch { border-radius: 4px; }
.gl-key { min-width: 22px; padding: 0 6px; border-radius: 4px; background: linear-gradient(#2a2e2b, #1b1e1c); border: 1px solid rgba(242, 232, 210, 0.45); border-bottom-width: 2.5px; font-size: 11px; font-weight: 600; text-transform: none; }
.gl-key.wide { padding: 0 8px; }
.gl-mouse { width: 26px; height: 24px; color: var(--cream); }
.gl-plus { margin: 0 2px; color: var(--cream-dim); font-weight: 700; }

/* ---------------------------------------------------------------- press start */
.press-start { position: absolute; left: 7vw; top: calc(13vh + clamp(64px, 9vw, 132px) * 1.72 + 110px); display: flex; align-items: center; gap: 10px; appearance: none; background: none; border: 0; padding: 0; color: var(--cream); font-family: var(--font); font-size: 18px; letter-spacing: 0.3em; text-transform: uppercase; cursor: pointer; animation: pulse 1.8s ease-in-out infinite; }
.press-start .gl { transform: scale(1.25); margin: 0 6px; }
.press-start .sep { color: var(--cream-dim); }
.press-start .w { margin-left: 8px; }
.press-start .ps-label { color: var(--amber); }
#title:not(.attract) .press-start { display: none; }
#title.attract .menu { display: none; }

/* ---------------------------------------------------------------- focus ring (pad & keyboard) */
.menu button:focus, .card:focus, .field.nav:focus { outline: none; }
.menu button.focused { border-color: var(--amber); background: rgba(40, 34, 20, 0.75); transform: translateX(3px); box-shadow: 0 0 0 2px var(--amber), 0 0 22px rgba(255, 214, 140, 0.35); }
.menu button.primary.focused { background: #ffe3a8; box-shadow: 0 0 0 2px #fff4d6, 0 0 26px rgba(255, 214, 140, 0.6); }
.card.focused { transform: translateY(-4px); border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber), 0 8px 34px rgba(255, 214, 140, 0.25); }
.card.focused::before { opacity: 0.42; }
.field.nav.focused { border-color: var(--amber); background: rgba(40, 34, 20, 0.78); box-shadow: 0 0 0 2px var(--amber), 0 0 22px rgba(255, 214, 140, 0.25); }

/* ---------------------------------------------------------------- fields (select / range / toggle) */
.field { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 13px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; transition: border-color 0.15s, background 0.15s; position: relative; }
.field.wide { grid-column: 1 / -1; }
.field .fl { font-size: 12px; letter-spacing: 0.24em; color: var(--brass); font-weight: 600; }
.field small { letter-spacing: 0.1em; color: var(--cream-dim); font-size: 11px; }
.field .native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ctl { display: flex; align-items: center; gap: 12px; min-height: 30px; color: var(--cream); font-size: 17px; letter-spacing: 0.06em; }
.ctl-select .ctl-val { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ctl-select .ctl-val b { font-weight: 600; }
.ctl-select .ctl-val small { font-size: 12px; color: var(--cream-dim); letter-spacing: 0.08em; margin-top: 2px; }
.ctl-arr { appearance: none; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); color: var(--amber); width: 30px; height: 30px; font-size: 20px; line-height: 1; cursor: pointer; font-family: var(--font); flex: none; }
.ctl-arr:hover { border-color: var(--amber); }
.field.nav.focused .ctl-arr { border-color: var(--amber); background: rgba(255, 214, 140, 0.12); }
.ctl-select.single .ctl-arr { visibility: hidden; }
.ctl-dots { position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%); display: flex; gap: 4px; }
.ctl-dots i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 214, 140, 0.25); }
.ctl-dots i.on { background: var(--amber); }
.ctl-range .ctl-track { flex: 1; height: 6px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 214, 140, 0.3); position: relative; cursor: pointer; }
.ctl-range .ctl-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--amber); }
.ctl-range .ctl-knob { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--cream); transform: translate(-50%, -50%); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.4); }
.field.nav.focused .ctl-knob { background: var(--amber); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.4), 0 0 12px var(--amber); }
.ctl-range .ctl-val { width: 62px; text-align: right; font-weight: 600; }
.ctl-toggle { cursor: pointer; }
.ctl-sw { width: 42px; height: 22px; border-radius: 11px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 214, 140, 0.35); position: relative; flex: none; transition: background 0.15s; }
.ctl-sw i { position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--cream-dim); transition: left 0.15s, background 0.15s; }
.ctl-toggle.on .ctl-sw { background: rgba(255, 214, 140, 0.25); border-color: var(--amber); }
.ctl-toggle.on .ctl-sw i { left: 23px; background: var(--amber); }
.brief-side .field, .quick-form .field { background: var(--panel-solid); }

/* ---------------------------------------------------------------- tabs */
.tabs, .scheme-switch { position: absolute; left: 7vw; top: calc(9vh + 92px); display: flex; gap: 6px; align-items: center; }
.tab { appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--cream-dim); font-family: var(--font); font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase; padding: 8px 18px; cursor: pointer; }
.tab.on { color: #1a1408; background: var(--amber); border-color: var(--amber); font-weight: 700; }
.tab:hover { border-color: var(--amber); }
.scheme-switch { left: auto; right: 7vw; }
.scheme-switch::before { content: 'SCHEME'; font-size: 11px; letter-spacing: 0.3em; color: var(--brass); margin-right: 8px; }

/* ---------------------------------------------------------------- prompt bar & toast */
.prompt-bar { position: fixed; right: 3vw; bottom: 3.2vh; z-index: 40; display: none; gap: 22px; align-items: center; }
.prompt-bar.on { display: flex; }
.prompt { appearance: none; background: none; border: 0; padding: 4px 0; display: inline-flex; align-items: center; gap: 8px; color: var(--cream); font-family: var(--font); font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; cursor: pointer; }
.prompt:disabled { cursor: default; color: var(--cream-dim); }
.prompt:not(:disabled):hover span { color: var(--amber); }
.prompt .gl { transform: scale(1.12); }
.toast { position: fixed; top: 3vh; right: 3vw; z-index: 60; padding: 10px 16px; background: var(--panel-solid); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0; transform: translateY(-8px); transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.toast.on { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- controls screen */
.controls-body { position: absolute; left: 7vw; right: 7vw; top: calc(9vh + 150px); bottom: 12vh; }
.controls-pad { height: 100%; display: flex; flex-direction: column; align-items: center; }
.pad-diagram { position: relative; width: min(100%, calc((100vh - 9vh - 150px - 12vh - 70px) * 1.9)); aspect-ratio: 760 / 400; flex: none; }
.pad-diagram > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pad-outline .body path { fill: rgba(30, 34, 31, 0.9); stroke: rgba(255, 214, 140, 0.35); stroke-width: 2; }
.pad-outline .parts > * { fill: #161917; stroke: rgba(242, 232, 210, 0.45); stroke-width: 1.5; }
.pad-outline .parts .inner { fill: #232825; }
.pad-outline .parts .touch { fill: #1d211f; }
.pad-lines polyline { fill: none; stroke: rgba(255, 214, 140, 0.32); stroke-width: 1; }
.callout { position: absolute; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 0.06em; color: var(--cream); white-space: nowrap; }
.callout.l { justify-content: flex-end; text-align: right; }
.callout span { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.scheme-blurb { max-width: 860px; text-align: center; font-family: var(--serif); font-size: 16px; line-height: 1.5; color: var(--cream-dim); margin: 10px 0 0; }
.scheme-blurb b { font-family: var(--font); color: var(--cream); letter-spacing: 0.06em; }
.scheme-blurb em { color: var(--brass); font-style: normal; font-family: var(--font); font-size: 13px; letter-spacing: 0.08em; }
.controls-kbm { display: grid; grid-template-columns: 1.3fr 1fr; gap: 4vw; }
.kbm-chart { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-content: start; }
.kbm-chart .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255, 214, 140, 0.1); }
.kbm-chart .a { color: var(--cream-dim); text-transform: uppercase; font-size: 12px; letter-spacing: 0.14em; }
.kbm-chart .k { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.kbm-chart .k em { flex-basis: 100%; text-align: right; font-style: normal; font-size: 11px; color: var(--cream-dim); letter-spacing: 0.06em; margin-top: 3px; }

/* ---------------------------------------------------------------- HUD prompts, hints, map */
.hud-hint { white-space: normal; max-width: min(1180px, 92vw); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; padding: 9px 18px; bottom: 100px; }
.hud-hint .it { display: inline-flex; align-items: center; gap: 6px; }
.hud-hint .it b { font-weight: 500; color: var(--cream); letter-spacing: 0.1em; text-transform: uppercase; font-size: 11px; }
.hud-hints { position: absolute; left: 50%; bottom: 196px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hud-hints .hint { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; background: rgba(10, 12, 11, 0.62); border: 1px solid var(--line); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; animation: feedIn 0.25s ease; }
.hud-wing .keys { display: flex; align-items: center; gap: 4px; white-space: nowrap; color: var(--cream); }
.hud-wing .keys span { margin-right: 7px; color: var(--cream-dim); }
.hud-wing .keys .gl { width: 18px; height: 18px; min-width: 18px; }
.hud-title .skip { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: 0.9; color: var(--cream); }
.hint-overlay .gl { margin: 0 2px; }
.hud.cinematic > .hud-map { opacity: 0; }
.hud.map-open > :not(.hud-map):not(.hud-canvas):not(.hud-radio):not(.hud-warn) { opacity: 0.25; }
.hud-map { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 28px; background: radial-gradient(ellipse at center, rgba(8, 10, 9, 0.62), rgba(8, 10, 9, 0.85)); opacity: 0; visibility: hidden; transition: opacity 0.14s, visibility 0s 0.14s; }
.hud-map.on { opacity: 1; visibility: visible; transition: opacity 0.14s; }
.map-frame { border: 1px solid var(--line); box-shadow: 0 0 0 4px rgba(10, 12, 11, 0.6), 0 20px 60px rgba(0, 0, 0, 0.5); background: #10161a; line-height: 0; }
.map-side { width: min(360px, 30vw); display: flex; flex-direction: column; gap: 10px; }
.map-title { font-size: 12px; letter-spacing: 0.3em; color: var(--brass); }
.map-h { font-size: 11px; letter-spacing: 0.3em; color: var(--brass); margin-top: 8px; }
.map-objectives { list-style: none; margin: 0; padding: 0; font-size: 16px; letter-spacing: 0.04em; }
.map-objectives li { display: flex; align-items: baseline; gap: 10px; padding: 5px 0; border-bottom: 1px solid rgba(255, 214, 140, 0.08); }
.map-objectives li i { width: 9px; height: 9px; flex: none; border: 1.5px solid var(--amber); transform: rotate(45deg) translateY(-1px); }
.map-objectives li.done { color: var(--green); } .map-objectives li.done i { background: var(--green); border-color: var(--green); }
.map-objectives li.failed { color: var(--red); text-decoration: line-through; } .map-objectives li.failed i { border-color: var(--red); }
.map-objectives li small { font-size: 10px; letter-spacing: 0.2em; color: var(--cream-dim); }
.map-objectives li.none { color: var(--cream-dim); }
.map-bars .mb { display: grid; grid-template-columns: 1fr 120px 40px; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.2em; margin: 4px 0; }
.map-bars .mb b { height: 5px; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 214, 140, 0.25); display: block; }
.map-bars .mb i { display: block; height: 100%; }
.map-bars .mb em { font-style: normal; text-align: right; font-weight: 700; }
.map-bars .mb.danger { color: var(--red); }
.map-wing { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green); }
.map-wing .map-h { flex-basis: 100%; }
.map-wing .dead { color: var(--red); text-decoration: line-through; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cream-dim); margin-top: 6px; }
.map-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 8px; height: 8px; display: inline-block; }
.lg-you i { background: #fff; clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%); }
.lg-wing i { background: #78dc8c; clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%); }
.lg-friend i { background: #82b4ff; clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%); }
.lg-enemy i { background: #ff5c46; clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%); }
.lg-obj-protect i { border: 1.5px solid #82b4ff; transform: rotate(45deg); }
.lg-obj-destroy i { border: 1.5px solid #ff6a52; transform: rotate(45deg); }
.map-close { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--cream-dim); margin-top: 8px; }
@media (max-height: 760px) { .settings-grid { gap: 8px 28px; } .field { padding: 8px 14px 10px; gap: 5px; } }
.sound-toast { position: fixed; left: 50%; bottom: 7vh; transform: translateX(-50%); z-index: 60; padding: 10px 20px; background: var(--panel-solid); border: 1px solid var(--line); color: var(--cream); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; pointer-events: none; animation: fadeIn 0.4s ease; }
.debrief-career { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; margin: 8px 0 4px; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cream-dim); }
.debrief-career .medal { color: var(--amber); }
.debrief-career .unlock { color: var(--green); }
.aircraft-info small { display: block; margin-top: 8px; font-family: var(--font); font-size: 11px; letter-spacing: 0.08em; color: var(--brass); opacity: 0.85; }
.career-grid { position: absolute; left: 7vw; right: 7vw; top: 25vh; bottom: 16vh; display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; }
.career-col { overflow: auto; }
.career-col .stats { grid-template-columns: repeat(4, 1fr); margin-top: 0; }
.rank-bar { height: 4px; background: rgba(255, 214, 140, 0.15); margin: 14px 0 6px; }
.rank-bar i { display: block; height: 100%; background: var(--amber); }
.career-next { font-size: 13px; letter-spacing: 0.14em; color: var(--cream-dim); text-transform: uppercase; }
.career-aircraft, .career-medals { list-style: none; padding: 0; margin: 0; }
.career-aircraft li, .career-medals li { padding: 7px 0; border-bottom: 1px solid rgba(255, 214, 140, 0.08); color: rgba(242, 232, 210, 0.45); }
.career-aircraft li.on, .career-medals li.on { color: var(--cream); }
.career-aircraft b, .career-medals b { font-weight: 600; letter-spacing: 0.06em; }
.career-aircraft small, .career-medals small { display: block; font-family: var(--serif); font-size: 13px; color: var(--cream-dim); margin-top: 2px; }
.career-back { position: absolute; left: 7vw; bottom: 6vh; }

/* ---------------------------------------------------------------- multiplayer */
.mp-only, .host-only, .guest-only { display: none !important; }
body.mp-active .mp-only { display: revert !important; }
body.mp-active .menu button.mp-only { display: flex !important; }
body.mp-active .sp-only { display: none !important; }
body:not(.mp-host) .host-only { display: none !important; }
body.mp-active:not(.mp-host) .guest-only { display: block !important; }
#mp, #mpEntry, #mpLobby { background: rgba(8, 10, 9, 0.74); backdrop-filter: blur(3px); }
.mp-home { top: 26vh; }
.mp-callsign { text-align: left; color: var(--cream); font-family: var(--font); }
.mp-callsign b { font-size: 26px; letter-spacing: 0.08em; }
.mp-callsign small { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); letter-spacing: 0.24em; text-transform: uppercase; }
.mp-callsign.focused { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber), 0 0 22px rgba(255, 214, 140, 0.35); }
.mp-note { font-family: var(--serif); font-size: 15px; line-height: 1.5; color: var(--cream-dim); margin: 0; }
.mp-error { min-height: 1.3em; margin: 0; color: var(--red); letter-spacing: 0.08em; font-size: 15px; }
.mp-entry { position: absolute; left: 7vw; top: calc(9vh + 130px); width: min(760px, 86vw); display: flex; flex-direction: column; gap: 16px; }
.mp-slots { display: flex; gap: 10px; min-height: 76px; align-items: center; }
.mp-slots.code i { width: 64px; height: 76px; border: 1px solid var(--line); background: var(--panel-solid); display: grid; place-items: center; font-style: normal; font-size: 44px; font-weight: 700; color: var(--amber); letter-spacing: 0; }
.mp-slots.code i.cur { border-color: var(--amber); box-shadow: inset 0 -3px 0 var(--amber); }
.mp-slots:not(.code) { border: 1px solid var(--amber); background: var(--panel-solid); padding: 10px 18px; font-size: 38px; font-weight: 700; letter-spacing: 0.06em; }
.mp-slots .caret { width: 3px; height: 40px; background: var(--amber); animation: pulse 1s infinite; margin-left: 4px; }
.keypad { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.keypad.name { grid-template-columns: repeat(10, 1fr); }
.keypad .key { appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--cream); font-family: var(--font); font-size: 22px; font-weight: 700; padding: 11px 0; cursor: pointer; }
.keypad .key.wide { grid-column: span 2; font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase; }
.keypad .key:focus { outline: none; }
.keypad .key.focused { border-color: var(--amber); background: var(--amber); color: #1a1408; box-shadow: 0 0 18px rgba(255, 214, 140, 0.45); }
body[data-input="kbm"] .keypad .key:hover { border-color: var(--amber); }
.room-code { font-size: 64px; letter-spacing: 0.32em; color: var(--amber); }
.mp-conn { font-size: 12px; letter-spacing: 0.24em; color: var(--cream-dim); text-transform: uppercase; }
.lobby-grid { position: absolute; left: 7vw; right: 7vw; top: calc(9vh + 150px); bottom: 4vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(360px, 440px); gap: 4vw; overflow-y: auto; scrollbar-width: none; }
.lobby-grid::-webkit-scrollbar { display: none; }
.lobby-col { display: flex; flex-direction: column; gap: 12px; }
.lobby-col h4 { margin: 0; }
.lobby-col .field { background: var(--panel-solid); }
.lobby-col .menu { width: 100%; }
.field.locked { opacity: 0.75; cursor: default; }
.field.locked .ctl-arr, .field.locked .ctl-dots { visibility: hidden; }
.roster { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.roster li { display: grid; grid-template-columns: 22px minmax(90px, 1.3fr) 1fr auto auto; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); background: var(--panel-solid); font-size: 15px; letter-spacing: 0.08em; transition: border-color 0.15s, box-shadow 0.15s; }
.roster li b { font-size: 19px; letter-spacing: 0.06em; }
.roster li span { color: var(--cream-dim); text-transform: uppercase; font-size: 13px; letter-spacing: 0.16em; }
.roster li em { font-style: normal; font-size: 11px; letter-spacing: 0.24em; color: var(--cream-dim); }
.roster li em.ready, .roster li em.host { color: var(--green); }
.roster li em.side { padding: 2px 6px; border: 1px solid currentColor; }
.roster li em.side.allies { color: var(--blue); } .roster li em.side.axis { color: var(--red); }
.roster li small { color: var(--cream-dim); font-size: 11px; letter-spacing: 0.1em; min-width: 46px; text-align: right; }
.roster li.me { border-color: rgba(255, 214, 140, 0.6); }
.roster li.empty { opacity: 0.45; border-style: dashed; grid-template-columns: 22px 1fr 1fr; }
.roster li.talking { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 16px rgba(120, 220, 140, 0.35); }
/* microphone glyph: off (outline, struck), muted (struck, red), on (filled), talking (green glow) */
.mic { width: 14px; height: 20px; position: relative; display: inline-block; }
.mic::before { content: ''; position: absolute; left: 3px; top: 0; width: 8px; height: 13px; border-radius: 4px; border: 1.5px solid var(--cream-dim); box-sizing: border-box; }
.mic::after { content: ''; position: absolute; left: 0; top: 8px; width: 14px; height: 9px; border: 1.5px solid var(--cream-dim); border-top: none; border-radius: 0 0 8px 8px; box-sizing: border-box; }
.mic.on::before { background: var(--cream); border-color: var(--cream); }
.mic.muted::before { border-color: var(--red); } .mic.muted::after { border-color: var(--red); }
.mic.off, .mic.muted { opacity: 0.6; }
.talking .mic::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 10px var(--green); }
.voice-box { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.voice-intro { font-family: var(--serif); font-size: 15px; line-height: 1.45; color: var(--cream-dim); margin: 0; }
.voice-intro b { font-family: var(--font); color: var(--cream); letter-spacing: 0.08em; }
.voice-intro em { display: block; color: var(--red); font-style: normal; margin-top: 4px; font-family: var(--font); }
#mpVoicePeople { display: flex; flex-direction: column; gap: 8px; }
.field.vol.talking { border-color: var(--green); }
.mp-sortie { font-size: 15px; letter-spacing: 0.06em; margin: 2px 0; line-height: 1.4; }
.mp-sortie b { color: var(--amber); text-transform: uppercase; letter-spacing: 0.1em; }
.mp-sortie small { display: block; font-family: var(--serif); font-size: 14px; color: var(--cream-dim); letter-spacing: 0; margin-top: 4px; }
#mpReady.on { border-color: var(--green); color: var(--green); }
.pause-voice { width: min(420px, 90vw); margin-top: 14px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.pause-voice h4 { margin: 8px 0 0; }
.scores-table { margin: 14px auto 4px; border-collapse: collapse; min-width: min(560px, 90vw); font-size: 15px; letter-spacing: 0.08em; }
.scores-table th { font-size: 11px; letter-spacing: 0.24em; color: var(--brass); font-weight: 600; text-align: right; padding: 4px 10px; }
.scores-table th:first-child, .scores-table td:first-child { text-align: left; }
.scores-table td { padding: 7px 10px; text-align: right; border-top: 1px solid var(--line); }
.scores-table tr.me td { color: var(--amber); }
.scores-table tr.left td { opacity: 0.45; }
/* in flight */
.map-scores { display: none; }
.map-scores.on { display: block; }
.map-scores .scores-table { margin: 0 0 6px; min-width: 0; width: 100%; font-size: 14px; }
.map-scores .scores-table td { padding: 5px 6px; } .map-scores .scores-table th { padding: 3px 6px; }
.scores-table td i.mic { vertical-align: -4px; margin-right: 6px; transform: scale(0.75); }
.hud-net { position: absolute; top: 20px; left: 26px; font-size: 11px; letter-spacing: 0.24em; color: var(--cream-dim); text-transform: uppercase; white-space: nowrap; opacity: 0.8; }
.hud-net.warn { color: var(--red); opacity: 1; font-size: 14px; animation: pulse 0.8s infinite; }
.hud-voice { position: absolute; left: 26px; top: 44px; display: flex; flex-direction: column; gap: 4px; }
.hud-voice div { display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--green); background: rgba(10, 16, 12, 0.55); padding: 3px 9px 3px 6px; border-left: 2px solid var(--green); }
.hud-voice .mic { transform: scale(0.8); }
.hud-voice div.self { color: var(--amber); border-left-color: var(--amber); }
@media (max-width: 1100px) { .lobby-grid { grid-template-columns: 1fr; } .room-code { font-size: 48px; } }
