:root {
  --bg: #0d1014;
  --panel: rgba(16, 19, 24, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --text: #e8ebef;
  --muted: #9aa3ad;
  --accent: #ff7a00;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 13px/1.4 system-ui, sans-serif; }
#view { position: fixed; inset: 0; display: block; }
#osd { position: fixed; inset: 0; pointer-events: none; }
#blackbox { position: fixed; left: 10px; bottom: 10px; display: none; border-radius: 6px; pointer-events: none; }
#telemetry { position: fixed; right: 10px; top: 36px; display: none; margin: 0; padding: 10px 12px; background: rgba(10, 12, 16, 0.82);
  border-radius: 6px; font: 11px/1.45 ui-monospace, monospace; white-space: pre; pointer-events: none; max-width: calc(100vw - 20px); overflow: hidden; }
#hud { position: fixed; right: 10px; top: 8px; font: 11px ui-monospace, monospace; color: rgba(255, 255, 255, 0.6); text-shadow: 0 1px 2px #000; pointer-events: none; }
#menubtn { position: fixed; left: 10px; top: 28px; z-index: 30; background: rgba(16,19,24,0.75); color: var(--text); border: 1px solid var(--line);
  border-radius: 5px; padding: 4px 10px; font: bold 11px ui-monospace, monospace; letter-spacing: 0.08em; cursor: pointer; }
#menubtn:hover { background: var(--accent); color: #111; }
#viewname { position: fixed; left: 10px; top: 8px; font: bold 11px ui-monospace, monospace; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.6); text-shadow: 0 1px 2px #000; pointer-events: none; }
#mini { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); font: bold 13px ui-monospace, monospace; text-shadow: 0 1px 3px #000; pointer-events: none; }

#splash { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(5, 7, 10, 0.6); z-index: 20; }
#splash .card { max-width: 520px; margin: 16px; padding: 24px 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
#splash h1 { margin: 0 0 6px; font-size: 22px; }
#splash p { color: var(--muted); }
#splash b { color: var(--text); }
#splash .click { color: var(--accent); font-weight: 600; margin-bottom: 0; }

#menu { position: fixed; inset: 0; display: none; z-index: 10; background: rgba(0, 0, 0, 0.45); }
#menu.open { display: grid; place-items: center; }
.menu-panel { width: min(980px, calc(100vw - 24px)); height: min(680px, calc(100vh - 24px)); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; border-bottom: 1px solid var(--line); }
.tabs button, .menu-panel button { background: #1e232b; color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 6px 12px; cursor: pointer; font: inherit; }
.tabs button.active { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 600; }
.tabs .resume { margin-left: auto; }
.menu-panel button.danger { margin-top: 14px; background: #3a1616; }
.tab-body { padding: 14px 16px; overflow: auto; flex: 1; }
.note { color: var(--muted); margin: 0 0 12px; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
legend { color: var(--accent); font-weight: 700; font-size: 11px; letter-spacing: 0.08em; padding: 0 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; }
.row span { color: var(--muted); }
input[type=number], select { background: #0f1216; color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; font: inherit; width: 110px; }
select { width: auto; max-width: 100%; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.radio-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: 52px 1fr 44px; align-items: center; gap: 8px; padding: 2px 0; font: 11px ui-monospace, monospace; }
.bar-row em { font-style: normal; text-align: right; color: var(--muted); }
.bar { position: relative; height: 10px; background: #0b0d10; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.bar .fill { position: absolute; top: 0; bottom: 0; background: var(--accent); }
.bar .mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.35); }
.bar.small { height: 8px; min-width: 60px; flex: 1; }
.btns { font: 11px ui-monospace, monospace; color: var(--muted); margin-top: 6px; word-break: break-all; }
.map-row { display: flex; align-items: center; gap: 6px; padding: 3px 0; flex-wrap: wrap; }
.map-row > span { width: 70px; font-weight: 600; font-size: 11px; }
.map-row input[type=number] { width: 52px; }
.map-row .inv { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; }
.map-row button { padding: 3px 8px; font-size: 11px; }
.help h3 { color: var(--accent); margin: 8px 0 6px; font-size: 13px; }
.help td { padding: 2px 14px 2px 0; }
.help td:first-child { font-family: ui-monospace, monospace; color: var(--accent); white-space: nowrap; }
.help li { margin: 3px 0; color: var(--muted); }
