:root {
  --bg: #05070d; --panel: rgba(13, 19, 30, 0.92); --panel-solid: #0d131e; --line: rgba(160, 185, 215, 0.16);
  --text: #e6edf5; --muted: #8696a9; --accent: #f2c14e; --blue: #59a8ff; --green: #7bd88f; --red: #e5534b; --orange: #ff9a52;
  --r: 10px; --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
b.stars, .stars { color: var(--accent); }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: #182131; font: 700 11px var(--font); color: var(--text); text-align: center; }

/* ---------- Buttons & inputs ---------- */
.btn { font: 700 13px var(--font); letter-spacing: 0.04em; color: var(--text); background: #1a2433; border: 1px solid rgba(160,185,215,0.25); border-radius: 8px; padding: 10px 16px; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; position: relative; }
.btn:hover:not(:disabled) { background: #223047; border-color: rgba(160,185,215,0.45); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #f5cd5f, #dba834); color: #1a1406; border-color: #f7d77a; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #f8d672, #e3b241); }
.btn.accent { border-color: var(--accent); color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.big { padding: 15px 28px; font-size: 15px; min-width: 240px; }
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn[data-cd]:not([data-cd=""])::after { content: attr(data-cd); position: absolute; right: 6px; top: -8px; font-size: 10px; background: #2a3442; padding: 1px 5px; border-radius: 6px; color: var(--muted); }
.btn.pulse { animation: pulse 0.8s infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(242,193,78,0.5); } to { box-shadow: 0 0 0 8px rgba(242,193,78,0); } }
input { font: 14px var(--font); color: var(--text); background: #0b111b; border: 1px solid rgba(160,185,215,0.25); border-radius: 8px; padding: 11px 12px; width: 100%; outline: none; }
input:focus { border-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.row.between { justify-content: space-between; }

/* ---------- Screens ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10; }
.menu-box { text-align: center; max-width: 520px; padding: 20px; }
.title-kicker, .kicker { font: 700 11px var(--font); letter-spacing: 0.28em; color: var(--accent); }
.title { font: 800 54px/1.02 var(--font); letter-spacing: 0.02em; margin: 14px 0 10px; text-shadow: 0 4px 30px rgba(0,0,0,0.6); }
.title span { font-size: 32px; letter-spacing: 0.22em; color: #b8c7d9; font-weight: 700; }
.tagline { color: #aab8c8; margin: 0 0 34px; }
.menu-actions { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.menu-form { display: flex; flex-direction: column; gap: 14px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.menu-form label { font: 700 11px var(--font); letter-spacing: 0.12em; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.menu-form .row { justify-content: space-between; margin: 4px 0 0; }
.menu-error { color: var(--red); min-height: 20px; font-size: 13px; }
.menu-foot { color: var(--muted); font-size: 12px; margin-top: 26px; }
#rejoinBox { font-size: 13px; color: var(--muted); }
#rejoinBox .btn { width: 100%; margin-top: 6px; }

/* ---------- Lobby ---------- */
.lobby-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; width: min(1060px, 94vw); max-height: 92vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; backdrop-filter: blur(6px); }
.lobby-wrap h2 { margin: 6px 0 18px; font-size: 24px; }
.invite { background: #0a1019; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.invite label { font: 700 11px var(--font); letter-spacing: 0.12em; color: var(--muted); }
.invite-row { display: flex; gap: 8px; margin: 8px 0; }
.invite-row input { font-size: 13px; }
.invite-row .btn { white-space: nowrap; }
.code { font-size: 13px; color: var(--muted); }
.invite-note { font-size: 12px; color: #f5dc9a; margin: 8px 0 0; line-height: 1.45; }
.invite-note:empty { display: none; }
.code b { color: var(--accent); letter-spacing: 0.3em; font-size: 18px; margin-left: 6px; }
h4.sub { font: 700 11px var(--font); letter-spacing: 0.2em; color: var(--muted); margin: 22px 0 10px; }
.crew { display: flex; flex-direction: column; gap: 8px; }
.crew-row { display: flex; align-items: center; gap: 12px; background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.crew-row canvas { width: 34px; height: 40px; }
.crew-row .nm { font-weight: 700; flex: 1; }
.crew-row .nm small { display: block; font-weight: 700; font-size: 10px; letter-spacing: 0.14em; }
.crew-row .st { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 6px; }
.dot.off { background: #4b5563; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card { text-align: left; background: #0f1724; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; cursor: pointer; color: var(--text); font: inherit; transition: border-color .15s, background .15s; }
.role-card:hover:not(:disabled) { background: #142034; }
.role-card.mine { border-color: var(--accent); background: #1a1d16; }
.role-card:disabled { opacity: 0.5; cursor: default; }
.role-card h5 { margin: 0 0 6px; font-size: 13px; letter-spacing: 0.12em; }
.role-card ul { margin: 0; padding-left: 16px; font-size: 12px; color: #aab8c8; line-height: 1.5; }
.role-card .taken { font-size: 11px; color: var(--muted); margin-top: 6px; }
.lobby-actions { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.lobby-actions .btn.big { min-width: 0; }
#btnReady.on { border-color: var(--green); color: var(--green); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }
.topbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.tb-item { display: flex; flex-direction: column; padding: 2px 12px; border-right: 1px solid var(--line); }
.tb-item span { font: 700 9px var(--font); letter-spacing: 0.2em; color: var(--muted); }
.tb-item b { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-item.wide b { font-size: 13px; }
.tb-sep { width: 6px; }
.tb-btn { font: 700 10px var(--font); letter-spacing: 0.14em; color: #c9d6e4; background: #172131; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; cursor: pointer; }
.tb-btn:hover { border-color: rgba(160,185,215,0.45); }

.duties { position: absolute; top: 12px; left: 12px; width: 330px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.duties-head { display: flex; border-bottom: 1px solid var(--line); }
.duties.collapsed .duties-head { border-bottom: 0; }
.dh-toggle, .dh-brief { font: 700 11px var(--font); letter-spacing: 0.14em; color: var(--text); background: transparent; border: 0; padding: 10px 12px; cursor: pointer; }
.dh-toggle { flex: 1; text-align: left; }
.dh-toggle b { color: var(--accent); margin-left: 4px; font-size: 10px; letter-spacing: 0.06em; }
.dh-toggle i { float: right; font-style: normal; color: var(--muted); }
.duties.collapsed .dh-toggle i { transform: rotate(180deg); display: inline-block; }
.dh-brief { border-left: 1px solid var(--line); color: var(--accent); }
.duties.collapsed ul { display: none; }
.duties ul { list-style: none; margin: 0; padding: 4px 0 6px; }
.duties li { display: flex; gap: 7px; padding: 3px 12px; font-size: 12px; line-height: 1.3; align-items: flex-start; }
.duties li .box { width: 13px; height: 13px; border: 1.5px solid #5b6b80; border-radius: 3px; flex: none; margin-top: 2px; }
.duties li.done { color: var(--muted); text-decoration: line-through; }
.duties li.done .box { background: var(--green); border-color: var(--green); }
.duties li.avail .box { border-color: var(--accent); }
.duties li.mine { color: #fff; }
.duties li .rl { font-size: 9.5px; font-weight: 800; letter-spacing: 0.12em; margin-left: auto; white-space: nowrap; padding-left: 6px; }
.duties .chhead { font: 700 10px var(--font); letter-spacing: 0.14em; color: var(--muted); padding: 9px 12px 3px; display: flex; justify-content: space-between; gap: 8px; }
.duties .chhead b { color: var(--accent); }
.duties li .tt { flex: 1; }
.duties li .tt small { display: block; font-size: 10.5px; font-weight: 700; margin-top: 1px; text-decoration: none; }
.duties li em { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; color: #5b6b80; white-space: nowrap; }
.duties li.locked { color: #7d8b9c; }
.duties li.mine.avail { background: rgba(242,193,78,0.07); }
.duties li.note { color: var(--muted); font-size: 12px; }
.brief .assign { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.brief .arow { display: flex; gap: 8px; align-items: baseline; background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; }
.brief .arow span { flex: 1; } .brief .arow i { font-style: normal; font-weight: 700; } .brief .arow em { font-style: normal; color: var(--muted); font-size: 11px; }
.brief .chal li i span { font-style: normal; }
.room-banner { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); font: 800 22px var(--font); letter-spacing: 0.3em; color: #e6edf5; text-shadow: 0 2px 12px rgba(0,0,0,0.8); opacity: 0; pointer-events: none !important; white-space: nowrap; }
.room-banner.show { animation: roomin 2.2s ease-out forwards; }
@keyframes roomin { 0% { opacity: 0; transform: translate(-50%, -6px); } 15% { opacity: 1; transform: translate(-50%, 0); } 70% { opacity: 1; } 100% { opacity: 0; } }

#minimap { position: absolute; top: 12px; right: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
#minimap canvas { display: block; }
.mm-label { font: 700 11px var(--font); letter-spacing: 0.2em; color: #c9d6e4; text-align: center; padding-top: 4px; }

.dashboard { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 8px; }
.res { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 40px; }
.res .lbl { font: 800 9px var(--font); letter-spacing: 0.1em; color: var(--muted); }
.res .segs { display: flex; flex-direction: column-reverse; gap: 2px; }
.res .segs i { width: 26px; height: 5px; border-radius: 1px; background: rgba(255,255,255,0.08); }
.res .segs i.on { background: #e9eef4; box-shadow: 0 0 6px rgba(233,238,244,0.4); }
.res.warn .segs i.on { background: var(--orange); box-shadow: 0 0 6px rgba(255,154,82,0.5); }
.res.crit .segs i.on { background: var(--red); box-shadow: 0 0 6px rgba(229,83,75,0.6); animation: blink 0.8s infinite; }
@keyframes blink { 50% { opacity: 0.45; } }
.res .val { font: 700 12px var(--font); font-variant-numeric: tabular-nums; }

.interact { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 14px; font-weight: 700; font-size: 13px; }
.interact span { margin-left: 6px; }

.chat { position: absolute; left: 12px; bottom: 12px; width: 330px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.chat-head { width: 100%; text-align: left; font: 700 11px var(--font); letter-spacing: 0.16em; color: var(--text); background: transparent; border: 0; padding: 10px 12px; cursor: pointer; }
.chat-head i { float: right; font-style: normal; color: var(--muted); }
.chat.min .chat-head i { transform: rotate(180deg); display: inline-block; }
#chatUnread { color: var(--accent); }
.chat.min .chat-body { display: none; }
.chat-msgs { height: 128px; overflow-y: auto; padding: 4px 12px; font-size: 13px; line-height: 1.4; border-top: 1px solid var(--line); }
.chat-msgs p { margin: 4px 0; word-wrap: break-word; }
.chat-msgs b { font-weight: 700; }
.chat-msgs .t { color: var(--muted); font-size: 10px; margin-right: 4px; }
#chatForm { border-top: 1px solid var(--line); }
#chatForm input { border: 0; border-radius: 0; background: transparent; font-size: 13px; }
.lobby-chat { margin-top: 18px; }
.lobby-chat .chat { position: static; width: 100%; }
.lobby-chat .chat-msgs { height: 150px; }

.qbanner { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--blue); border-radius: 8px; padding: 8px 14px; font-size: 13px; }

/* ---------- Flight dock ---------- */
.flight-dock { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 10px; max-width: calc(100vw - 720px); min-width: 420px; justify-content: center; flex-wrap: wrap; }
.dock-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 230px; font-size: 12px; }
.dock-card h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.16em; }
.dock-card h4 .muted { font-size: 9px; letter-spacing: 0.04em; font-weight: 600; }
.dock-card p { margin: 4px 0 8px; color: #b6c3d2; }
.dock-card .btn { width: 100%; margin-top: 6px; }
.dock-card .row { margin: 0; flex-wrap: nowrap; gap: 6px; }
.dock-card .row .btn { margin-top: 6px; }
.seg { display: flex; gap: 4px; }
.seg button { flex: 1; font: 700 11px var(--font); padding: 7px 0; background: #172131; color: var(--text); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.seg button.on { border-color: var(--orange); color: var(--orange); background: #241a12; }
.lanes .lane { display: flex; align-items: center; gap: 6px; margin: 3px 0; font-size: 11px; }
.lanes .lane span { width: 28px; color: var(--muted); font-weight: 700; }
.lanes .bar { flex: 1; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.lanes .bar i { display: block; height: 100%; }
.lanes b { width: 22px; text-align: right; }
.keys-ind { display: flex; gap: 6px; }
.keys-ind span { flex: 1; text-align: center; padding: 6px; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; font-size: 11px; color: var(--muted); }
.keys-ind span.on { border-color: var(--blue); color: var(--blue); }

/* ---------- Windows ---------- */
.window { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, 94vw); max-height: 88vh; overflow: auto; background: var(--panel-solid); border: 1px solid rgba(160,185,215,0.25); border-radius: 12px; z-index: 20; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.phead { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.phead h3 { margin: 0 0 3px; font-size: 17px; letter-spacing: 0.04em; }
.phead .muted { font-size: 12px; }
.x { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; width: 30px; height: 30px; cursor: pointer; font-size: 14px; }
.x:hover { color: var(--text); }
.taskbar { background: #1e1a0e; color: var(--accent); font: 700 11px var(--font); letter-spacing: 0.14em; padding: 8px 18px; border-bottom: 1px solid rgba(242,193,78,0.25); }
.pbody { padding: 14px 18px 18px; }
.lead { margin: 0 0 12px; color: #c8d4e2; font-size: 14px; line-height: 1.5; }
.warn { color: var(--orange); font-size: 13px; }
.feedback { min-height: 20px; margin-top: 10px; font-size: 13px; font-weight: 600; }
.feedback.ok { color: var(--green); }
.feedback.err { color: var(--red); }
.window.glitch .pbody { animation: glitch 2.6s infinite; }
@keyframes glitch { 0%, 92%, 100% { opacity: 1; transform: none; } 93% { opacity: 0.4; transform: translateX(3px); } 95% { opacity: 0.9; transform: translateX(-2px); } 97% { opacity: 0.5; } }

.gyros { display: flex; gap: 14px; justify-content: space-between; margin-bottom: 14px; }
.gyro { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; background: #0a111c; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.gyro label { font: 700 10px var(--font); letter-spacing: 0.14em; color: var(--muted); }
.gyro input[type=range] { width: 100%; padding: 0; accent-color: var(--accent); }
.gyro .val { font-weight: 800; font-size: 16px; }
.gyro .tgt { font-size: 11px; color: var(--green); }

.sgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 8px; }
.cell { border: 2px solid transparent; border-radius: 6px; color: var(--text); padding: 8px 4px; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; }
.cell span { font-size: 9px; color: rgba(255,255,255,0.6); letter-spacing: 0.08em; }
.cell b { font-size: 16px; }
.cell.flag { border-color: var(--red); box-shadow: inset 0 0 0 2px rgba(229,83,75,0.4); }

.routemap { width: 100%; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 10px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { background: #0f1724; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.card.chosen { border-color: var(--accent); }
.card h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.1em; }
.card ul { margin: 0 0 10px; padding-left: 16px; font-size: 12.5px; color: #b6c3d2; line-height: 1.6; }
.card .btn { width: 100%; }
ul.check { list-style: none; padding: 0; font-size: 13px; }
ul.check li { padding: 4px 0 4px 24px; position: relative; color: var(--muted); }
ul.check li::before { content: ''; position: absolute; left: 0; top: 6px; width: 13px; height: 13px; border: 1.5px solid #5b6b80; border-radius: 3px; }
ul.check li.done { color: var(--text); }
ul.check li.done::before { background: var(--green); border-color: var(--green); }

.sections { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sec { text-align: left; background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--text); font: inherit; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.sec span { font-size: 10px; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.sec.ok span { color: var(--green); }
.sec.dmg { border-color: rgba(229,83,75,0.5); }
.sec.dmg span { color: var(--red); }
.sec:disabled { cursor: default; }
.list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.item { display: flex; gap: 10px; align-items: center; background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 13px; cursor: pointer; }
.item input { width: auto; accent-color: var(--accent); }
pre.log { background: #070c14; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 12px/1.6 ui-monospace, Menlo, Consolas, monospace; color: #9fe0b0; overflow-x: auto; }
.alarms { display: flex; gap: 8px; margin: 10px 0 14px; }
.alarm { flex: 1; display: flex; align-items: center; gap: 8px; background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--muted); font: 700 11px var(--font); letter-spacing: 0.08em; cursor: pointer; }
.alarm i { width: 10px; height: 10px; border-radius: 50%; background: #2a3442; }
.alarm.on { color: var(--text); border-color: rgba(229,83,75,0.5); }
.alarm.on i { background: var(--red); animation: blink 0.6s infinite; }
.chart { width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.cluebox { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: #1e1a0e; border: 1px solid rgba(242,193,78,0.35); font-size: 13px; color: #f5dc9a; }
.cluebox.none { background: #0f1724; border-color: var(--line); color: var(--muted); }
.chip { font: 600 12px var(--font); color: var(--text); background: #172131; border: 1px solid var(--line); border-radius: 16px; padding: 6px 12px; cursor: pointer; }
.chip.on { border-color: var(--accent); color: var(--accent); background: #1e1a0e; }
.modules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.module { background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 12px 8px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.module span { font-size: 10px; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; min-height: 26px; }
.module.hint { border-color: var(--accent); }
.module.bad span { color: var(--red); } .module.good span { color: var(--green); }
.helm { display: flex; gap: 20px; align-items: center; }
.helm canvas { border-radius: 50%; border: 2px solid #2a3442; }
.thr { flex: 1; }
.thr label { font: 700 11px var(--font); letter-spacing: 0.1em; color: var(--muted); display: block; margin-bottom: 10px; }
.thr input { accent-color: var(--accent); padding: 0; }
.wires { width: 100%; border-radius: 8px; border: 1px solid var(--line); touch-action: none; cursor: crosshair; }
.breakers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.breaker { background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 14px 8px; color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.breaker .lever { width: 22px; height: 46px; border-radius: 6px; background: #2a3442; position: relative; }
.breaker .lever::after { content: ''; position: absolute; left: 3px; right: 3px; height: 18px; bottom: 3px; border-radius: 4px; background: #8a96a6; transition: bottom .15s; }
.breaker.on .lever::after { bottom: 25px; background: var(--green); }
.breaker b { font-size: 12px; text-align: center; }
.breaker i { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.14em; color: var(--muted); }
.breaker.on i { color: var(--green); }
table.shop { width: 100%; border-collapse: collapse; font-size: 13px; }
table.shop th { text-align: left; font: 700 10px var(--font); letter-spacing: 0.14em; color: var(--muted); padding: 6px; border-bottom: 1px solid var(--line); }
table.shop td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.mini { display: inline-block; width: 60px; height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.mini i { display: block; height: 100%; background: #e9eef4; }
h5 { font: 700 10px var(--font); letter-spacing: 0.18em; color: var(--muted); margin: 16px 0 6px; }
.req { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; }
.req .btn { margin-left: 4px; }
.ls .lsrow { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.ls .lsrow span { width: 64px; color: var(--muted); }
.ls .bar { flex: 1; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
.ls .bar i { display: block; height: 100%; background: #e9eef4; }
.ls .bar i.low { background: var(--red); }
.ls b { width: 32px; text-align: right; }
.logcols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; font-size: 13px; }
.logcols p { margin: 4px 0; line-height: 1.45; }
.logcols .clue { color: #f5dc9a; }
.events { max-height: 52vh; overflow: auto; }
.ev span { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; margin-right: 4px; }
.ev.alert { color: #ff8f86; } .ev.success { color: #a6e7b4; } .ev.warn { color: #ffbd8a; } .ev.decision { color: #9fcfff; } .ev.clue { color: #f5dc9a; }

/* Briefing */
.brief .bbody { padding: 16px 20px 20px; }
.brief .mtitle { font: 800 22px var(--font); margin: 4px 0 8px; letter-spacing: 0.04em; }
.brief .bgrid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; margin-top: 10px; }
.brief p { font-size: 14px; line-height: 1.55; color: #c8d4e2; }
.brief ol { padding-left: 18px; font-size: 13px; color: #c8d4e2; line-height: 1.6; margin: 0; }
.brief .chal { background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.brief .chal.cur { border-color: rgba(242,193,78,0.5); }
.brief .chal h6 { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.12em; }
.brief .chal ul { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.brief .chal li { padding: 2px 0; color: #b6c3d2; }
.brief .chal li.done { color: var(--muted); text-decoration: line-through; }
.brief .chal li i { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; margin-left: 6px; }
.brief .bfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

/* Question */
.question { width: min(560px, 94vw); border-color: rgba(89,168,255,0.5); }
.question .qbody { padding: 18px 20px 20px; }
.question .qtopic { font: 700 10px var(--font); letter-spacing: 0.2em; color: var(--blue); }
.question h3 { font-size: 18px; line-height: 1.4; margin: 8px 0 16px; }
.question .choices { display: grid; gap: 8px; }
.question .choice { text-align: left; font: 600 14px var(--font); color: var(--text); background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; cursor: pointer; }
.question .choice:hover:not(:disabled) { border-color: var(--blue); }
.question .choice.correct { border-color: var(--green); background: #10241a; }
.question .choice.wrong { border-color: var(--red); background: #2a1414; }
.question .timer { height: 3px; background: rgba(255,255,255,0.08); margin-top: 14px; border-radius: 2px; overflow: hidden; }
.question .timer i { display: block; height: 100%; background: var(--blue); }
.question .expl { font-size: 13px; color: #c8d4e2; margin-top: 12px; line-height: 1.5; }
.question .verdict { font-weight: 800; font-size: 16px; }
.question .verdict.ok { color: var(--green); } .question .verdict.bad { color: var(--red); }

/* Results */
.results { background: rgba(3,5,9,0.92); overflow: auto; align-items: flex-start; padding: 40px 0; }
.res-box { width: min(980px, 94vw); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; padding: 28px; margin: auto; }
.res-box .outcome { font: 800 34px var(--font); letter-spacing: 0.06em; margin: 6px 0 4px; }
.res-box .outcome.excellent { color: var(--green); } .res-box .outcome.partial { color: var(--accent); } .res-box .outcome.failure { color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 18px 0; }
.stat { background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.stat span { font: 700 9.5px var(--font); letter-spacing: 0.16em; color: var(--muted); display: block; }
.stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.res-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.res-cols ul { padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: #c8d4e2; }
.res-actions { display: flex; gap: 10px; margin-top: 18px; }

/* Toasts & connection */
#toasts { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--panel-solid); border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 8px; padding: 9px 14px; font-size: 13px; font-weight: 600; max-width: 560px; animation: tin .25s ease-out; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.toast.success { border-left-color: var(--green); } .toast.warn { border-left-color: var(--orange); } .toast.alert { border-left-color: var(--red); } .toast.clue { border-left-color: var(--accent); color: #f5dc9a; }
body.flying #toasts { top: auto; bottom: 196px; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }
.conn { position: fixed; bottom: 50%; left: 50%; transform: translateX(-50%); z-index: 40; background: #2a1414; border: 1px solid var(--red); padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: 13px; }

@media (max-width: 1100px) {
  .flight-dock { max-width: 96vw; bottom: 210px; }
  .lobby-wrap { grid-template-columns: 1fr; }
  .duties { width: 250px; }
  .title { font-size: 40px; } .title span { font-size: 22px; }
}

/* ---------- Mission 02 ---------- */
.mission-pick { display: flex; gap: 8px; margin: -6px 0 16px; flex-wrap: wrap; align-items: center; }
.mpick { text-align: left; background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; color: var(--text); font: inherit; cursor: pointer; }
.mpick span { display: block; font: 700 9.5px var(--font); letter-spacing: 0.16em; color: var(--muted); }
.mpick b { font-size: 13px; }
.mpick.on { border-color: var(--accent); background: #1a1d16; }
.mpick:disabled { cursor: default; }
.mpick:disabled:not(.on) { opacity: 0.5; }
.suit-hud { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; display: flex; align-items: center; gap: 10px; font-size: 12px; flex-wrap: wrap; justify-content: center; max-width: 520px; }
.suit-hud span { font: 800 10px var(--font); letter-spacing: 0.16em; color: var(--muted); }
.suit-hud .bar { width: 160px; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
.suit-hud .bar i { display: block; height: 100%; background: #4fc3f7; }
.suit-hud.crit { border-color: var(--red); }
.suit-hud.crit .bar i { background: var(--red); animation: blink 0.8s infinite; }
.suit-hud em { font-style: normal; color: var(--accent); width: 100%; text-align: center; }
.suit-hud em.st { color: #ffb08a; }
.sites { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.site { text-align: left; background: #0f1724; border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.site span { font-size: 12.5px; color: #c8d4e2; line-height: 1.4; }
.site i { font-style: normal; font-size: 11px; color: var(--muted); }
.site em { font-style: normal; font-weight: 800; }
.sig-strong { color: #7bd88f; } .sig-medium { color: #f2c14e; } .sig-none { color: #8696a9; }
.site.flag { border-color: var(--accent); background: #1e1a0e; }
.drill { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.tag { font: 800 9.5px var(--font); letter-spacing: 0.12em; padding: 2px 7px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.tag.ok { color: var(--green); border-color: rgba(123,216,143,0.5); }
.minerals-key { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; color: #aab8c8; margin-bottom: 10px; }
.sample { background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.sample p { margin: 4px 0 0; font-size: 13px; color: #c8d4e2; }
.sample.done { border-color: rgba(123,216,143,0.45); }
.sigbar { height: 10px; background: rgba(255,255,255,0.08); border-radius: 5px; overflow: hidden; }
.sigbar i { display: block; height: 100%; }

.tb-btn.accent { color: var(--accent); border-color: rgba(242,193,78,0.5); }
.assign-t select { background: #0b111b; color: var(--text); border: 1px solid rgba(160,185,215,0.25); border-radius: 6px; padding: 6px 8px; font: 13px var(--font); width: 100%; }
.assign-t td:first-child { width: 48%; }
#logWin .assign { display: flex; flex-direction: column; gap: 6px; }
#logWin .arow { display: flex; gap: 8px; align-items: baseline; background: #0f1724; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; }
#logWin .arow span { flex: 1; } #logWin .arow em { font-style: normal; color: var(--muted); }
.duties li.capnote { color: #f5dc9a; display: block; line-height: 1.5; }

/* ---------- Flight: hide everything except the flight view, the role controls and the question ---------- */
body.flying #duties, body.flying #dashboard, body.flying #minimap, body.flying .topbar, body.flying #interactHint, body.flying #suitHud { display: none !important; }
body.flying #chat { display: none; }
body.flying #chat.chat-open { display: block; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 6; }
body.flying .flight-dock { left: auto; right: 12px; top: 12px; bottom: auto; transform: none; flex-direction: column; flex-wrap: nowrap; max-width: none; min-width: 0; width: 250px; max-height: calc(100vh - 24px); overflow-y: auto; justify-content: flex-start; }
body.flying .dock-card { width: 100%; }
body.flying #toasts { top: auto; bottom: 22px; left: calc(50% - 134px); }
@media (max-width: 899px) { body.flying .flight-dock { right: auto; left: 50%; top: auto; bottom: 12px; transform: translateX(-50%); flex-direction: row; flex-wrap: wrap; width: auto; max-width: 96vw; } }
.tb-btn.full { font-size: 13px; padding: 6px 9px; }

.duties li .tt small.loc { color: #f5dc9a; font-weight: 600; letter-spacing: 0; }

.saved { margin: 26px auto 0; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; max-width: 520px; }
.saved h4 { margin: 0 0 8px; font: 700 11px var(--font); letter-spacing: 0.2em; color: var(--accent); }
.saved-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.saved-row span { color: var(--muted); font-size: 12px; }
.saved-row .row { margin: 0; flex-wrap: nowrap; }
.rejoin-list { margin-top: 8px; } .rejoin-list .btn { width: auto; margin: 4px 4px 0 0; }

.duties .chhead { padding: 6px 12px 2px; }
.duties .chhead i { font-style: normal; color: var(--green); letter-spacing: 0.04em; margin-left: 6px; }
.duties li.one .tt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duties li .own { font-size: 10.5px; font-weight: 700; color: #aab8c8; white-space: nowrap; margin-left: auto; }
.duties li .tt small.inl { display: inline; font-size: 10.5px; font-weight: 700; }
.duties li.duty .box { border-radius: 50%; }
.duties li .box { width: 11px; height: 11px; margin-top: 2px; }
.dashboard .res.you { border-left: 1px solid var(--line); padding-left: 10px; margin-left: 2px; }
.dashboard .res.you .segs i.on { background: #9fd3ff; box-shadow: 0 0 6px rgba(159,211,255,0.4); }

.tb-item small.clock { font: 700 9.5px var(--font); letter-spacing: 0.08em; color: #aab8c8; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.clock i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.clock i.sun { background: #f2c14e; box-shadow: 0 0 6px #f2c14e; }
.clock i.moon { background: transparent; box-shadow: inset -3px -1px 0 0 #c9d6e4; }
.eva-banner { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; background: linear-gradient(90deg, rgba(90,36,18,0.95), rgba(40,18,12,0.95)); border: 1px solid rgba(255,154,82,0.6); box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 0 4px rgba(255,120,60,0.08); max-width: 760px; }
.eva-banner .eva-t { display: flex; flex-direction: column; }
.eva-banner .eva-t span { font: 800 10px var(--font); letter-spacing: 0.24em; color: #ffb08a; }
.eva-banner .eva-t b { font-size: 16px; letter-spacing: 0.06em; }
.eva-banner .eva-t em { font-style: normal; font-size: 12px; color: #f0d2c0; }
.eva-banner .btn { white-space: nowrap; }
.eva-banner kbd, .suit-hud kbd { background: rgba(0,0,0,0.25); color: inherit; border-color: rgba(0,0,0,0.3); }
.suit-hud small { width: 100%; text-align: center; }
.suit-hud .btn { margin-left: 4px; }
.airlock-fx { position: fixed; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; }
.airlock-fx .door { position: absolute; top: 0; bottom: 0; width: 50%; background: repeating-linear-gradient(135deg, #3a414c 0 26px, #2e343d 26px 52px); border: 3px solid #1a1f27; }
.airlock-fx .door::after { content: ''; position: absolute; top: 0; bottom: 0; width: 24px; background: repeating-linear-gradient(45deg, #f0c43f 0 14px, #1a1f27 14px 28px); }
.airlock-fx .door.l { left: 0; transform: translateX(-100%); } .airlock-fx .door.l::after { right: 0; }
.airlock-fx .door.r { right: 0; transform: translateX(100%); } .airlock-fx .door.r::after { left: 0; }
.airlock-fx .afx-text { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; opacity: 0; }
.airlock-fx .afx-text b { display: block; font: 800 28px var(--font); letter-spacing: 0.3em; color: #f0c43f; text-shadow: 0 2px 12px #000; }
.airlock-fx .afx-text span { font-size: 14px; color: #e6edf5; text-shadow: 0 2px 8px #000; }
.airlock-fx.run .door.l { animation: doorL 2.1s ease-in-out forwards; } .airlock-fx.run .door.r { animation: doorR 2.1s ease-in-out forwards; }
.airlock-fx.run .afx-text { animation: afxT 2.1s ease-in-out forwards; }
@keyframes doorL { 0% { transform: translateX(-100%); } 25%, 65% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
@keyframes doorR { 0% { transform: translateX(100%); } 25%, 65% { transform: translateX(0); } 100% { transform: translateX(100%); } }
@keyframes afxT { 0%, 20% { opacity: 0; } 30%, 60% { opacity: 1; } 75%, 100% { opacity: 0; } }
.duty-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.duty-steps button { padding: 14px 6px; }
.duty-steps button.ok { border-color: var(--green); color: var(--green); }
.duty-order { font-size: 13px; color: #c8d4e2; }
.duty-order b.on { color: var(--green); }
.duty-switch { padding: 0 18px 16px; }

/* top bar sits between the To-Do panel and the minimap, and shrinks instead of overlapping */
.topbar { left: 354px; transform: none; max-width: calc(100vw - 354px - 316px); min-width: 0; }
.tb-item { padding: 2px 10px; min-width: 0; }
.tb-item.wide { flex: 1 1 auto; overflow: hidden; }
.tb-item.wide b { overflow: hidden; text-overflow: ellipsis; display: block; }
.tb-btn { padding: 7px 8px; flex: none; }

.eva-steps { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: #f0d2c0; white-space: nowrap; }
.eva-steps i { font-style: normal; padding: 3px 8px; border: 1px solid rgba(255,154,82,0.4); border-radius: 6px; }
.eva-steps i.ok { color: var(--green); border-color: rgba(123,216,143,0.5); }

/* ---- Mission Design Lab ---- */
.design-lab { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; }
.design-lab:empty { display: none; }
.dl-head { display: flex; gap: 18px; align-items: center; justify-content: space-between; }
.dl-head h3 { margin: 4px 0 6px; font-size: 19px; }
.dl-head canvas { flex: none; background: radial-gradient(circle at 50% 50%, #142033, #0a0f18); border: 1px solid var(--line); border-radius: 10px; }
.dgauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0 10px; }
.dg { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.dg-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; letter-spacing: .08em; color: var(--muted, #8b98a8); }
.dg-top b { color: var(--text, #e8eef5); font-size: 13px; letter-spacing: 0; }
.dg-top b small { color: var(--muted, #8b98a8); font-weight: 400; }
.dg-top b.bad { color: var(--red); }
.dg.sci .dg-top b { color: var(--accent); font-size: 18px; }
.dg-bar { height: 7px; background: #1b2431; border-radius: 4px; margin-top: 6px; overflow: hidden; }
.dg-bar i { display: block; height: 100%; background: var(--green, #7bd88f); transition: width .35s ease; }
.dg-bar i.warn { background: #f2c14e; } .dg-bar i.bad { background: var(--red); }
.dissues { font-size: 13px; color: var(--red); margin-bottom: 10px; display: grid; gap: 3px; }
.dissues.good { color: var(--green, #7bd88f); }
.dparts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dpart { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.dpart.locked { opacity: .78; }
.dpart-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.rolechip { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.dopts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px; }
.dopt { text-align: left; background: #111a26; border: 1px solid #263244; border-radius: 8px; padding: 7px 8px; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: border-color .15s, background .15s, transform .1s; }
.dopt:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.dopt:disabled { cursor: not-allowed; }
.dopt.on { border-color: var(--accent); background: rgba(79,195,247,.12); box-shadow: inset 0 0 0 1px var(--accent); }
.dopt b { font-size: 12.5px; } .dopt small { font-size: 11px; color: var(--accent); } .dopt em { font-style: normal; font-size: 11px; color: var(--muted, #8b98a8); line-height: 1.3; }
@media (max-width: 900px) { .dgauges { grid-template-columns: 1fr 1fr; } .dparts { grid-template-columns: 1fr; } .dl-head canvas { display: none; } }

/* ---- Solar flare banner ---- */
.spe-banner { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-radius: 12px; background: linear-gradient(90deg, rgba(110,80,0,.95), rgba(60,40,0,.95)); border: 1px solid rgba(255,214,79,.7); box-shadow: 0 10px 40px rgba(0,0,0,.5); max-width: 720px; z-index: 900; animation: spePulse 1.2s ease-in-out infinite; }
.spe-banner.active { background: linear-gradient(90deg, rgba(120,20,20,.96), rgba(70,10,10,.96)); border-color: rgba(255,90,90,.8); }
.spe-banner.safe { animation: none; border-color: rgba(123,216,143,.8); }
.spe-icon { font-size: 30px; color: #ffd54f; animation: speSpin 4s linear infinite; }
.spe-t { display: flex; flex-direction: column; min-width: 120px; }
.spe-t span { font: 800 10px var(--font); letter-spacing: .2em; color: #ffe08a; }
.spe-t b { font-size: 26px; color: #fff; }
.spe-msg { font-size: 13px; line-height: 1.35; color: #fff4d6; }
@keyframes spePulse { 0%, 100% { box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 0 0 rgba(255,214,79,.5); } 50% { box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 0 10px rgba(255,214,79,0); } }
@keyframes speSpin { to { transform: rotate(360deg); } }
body.flying .spe-banner { display: none; }
/* ---- Results: score, leaderboard, design ---- */
.res-score { display: grid; grid-template-columns: 180px 1fr 1fr; gap: 14px; margin: 16px 0; }
.rs-total { background: linear-gradient(160deg, rgba(79,195,247,.18), rgba(79,195,247,.04)); border: 1px solid rgba(79,195,247,.5); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.rs-total span { font-size: 11px; letter-spacing: .2em; color: var(--accent); }
.rs-total b { font-size: 44px; line-height: 1.1; }
.rs-total small { color: var(--muted, #8b98a8); }
.rs-parts { display: grid; gap: 3px; font-size: 12.5px; align-content: start; }
.rs-parts div, .rd-grid div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed rgba(255,255,255,.08); padding: 2px 0; }
.rs-parts b { color: var(--green, #7bd88f); } .rs-parts b.neg { color: var(--red); }
.rs-board ol { margin: 0; padding-left: 22px; font-size: 12.5px; display: grid; gap: 3px; }
.rs-board li b { display: inline-block; min-width: 44px; } .rs-board li small { color: var(--muted, #8b98a8); margin-left: 6px; }
.rs-board li span { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.rs-board li.me { color: var(--accent); font-weight: 700; }
.res-design { margin-bottom: 14px; }
.rd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 18px; font-size: 12.5px; }
.rd-grid span { color: var(--muted, #8b98a8); }
@media (max-width: 900px) { .res-score { grid-template-columns: 1fr; } .rd-grid { grid-template-columns: 1fr; } }

/* ---- Short mission briefing (title + setting only) ---- */
.window.brief.brief-small { width: min(460px, 92vw); text-align: center; overflow: hidden; animation: briefIn .5s cubic-bezier(.2,.8,.2,1); }
.brief-small .bsm { padding: 26px 30px 24px; background: radial-gradient(ellipse at 50% 0%, rgba(79,195,247,.14), transparent 70%); }
.brief-small .mtitle { font: 800 22px var(--font); margin: 6px 0 12px; letter-spacing: .04em; }
.brief-small p { font-size: 14.5px; line-height: 1.6; color: #c8d4e2; margin: 0 0 18px; }
@keyframes briefIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ---- Full-screen object close-ups ---- */
.window.closeup { left: 0; top: 0; transform: none; width: 100vw; height: 100vh; max-height: none; border-radius: 0; border: 0; overflow: hidden; display: flex; flex-direction: column; background: #05080d; z-index: 40; animation: cuIn .28s ease-out; }
@keyframes cuIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.closeup .cu-top { flex: none; display: flex; align-items: center; gap: 18px; padding: 10px 18px; background: linear-gradient(180deg, rgba(14,20,30,.98), rgba(10,15,23,.96)); border-bottom: 1px solid rgba(160,185,215,.18); }
.closeup .cu-title { display: flex; flex-direction: column; min-width: 230px; }
.closeup .cu-title b { font: 800 16px var(--font); letter-spacing: .08em; text-transform: uppercase; }
.closeup .cu-task { color: var(--accent); font: 700 12px var(--font); letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }
.closeup .cu-sub { color: var(--muted, #8b98a8); font-size: 11.5px; margin-top: 2px; }
.closeup .cu-hint { flex: 1; font-size: 14.5px; line-height: 1.4; color: #dbe5f0; background: rgba(242,193,78,.08); border: 1px solid rgba(242,193,78,.25); border-radius: 10px; padding: 8px 14px; }
.closeup .cu-hint b { color: #ffd36b; }
.closeup .cu-exit, .closeup .cu-duty { flex: none; background: #1b2431; color: #e6edf5; border: 1px solid rgba(160,185,215,.3); border-radius: 9px; padding: 9px 14px; font: 800 12px var(--font); letter-spacing: .1em; cursor: pointer; }
.closeup .cu-exit:hover, .closeup .cu-duty:hover { border-color: var(--accent); color: var(--accent); }
.closeup .cu-exit kbd { font: 700 10px var(--font); background: #0b1018; border: 1px solid #334; border-radius: 4px; padding: 1px 5px; margin-left: 6px; }
.closeup .cu-duty { letter-spacing: .02em; font-weight: 700; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.closeup .cu-stage { flex: 1; position: relative; min-height: 0; }
.closeup .cu-stage canvas { position: absolute; inset: 0; touch-action: none; }
.window.closeup.glitch .cu-stage { animation: glitch 2.6s infinite; }

/* ---- Auto-hiding top HUD: slides down when the cursor reaches the top edge ---- */
.topbar { transition: transform .38s cubic-bezier(.2,.8,.2,1), opacity .3s ease; will-change: transform; z-index: 6; }
.topbar.tb-hide { transform: translateY(calc(-100% - 22px)); opacity: 0; pointer-events: none; }
.tb-tab { position: absolute; top: 0; left: calc(354px + (100vw - 354px - 316px) / 2 - 34px); width: 68px; height: 6px; border-radius: 0 0 6px 6px; background: rgba(242,193,78,.45); box-shadow: 0 0 10px rgba(242,193,78,.35); pointer-events: auto; transition: opacity .3s ease, height .2s ease; cursor: s-resize; }
.tb-tab:hover { height: 10px; }
.tb-tab.gone { opacity: 0; pointer-events: none; }
body.flying .tb-tab { display: none; }

/* ---- Flight: Engineer propulsion readouts ---- */
.eng-read { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 4px 0 8px; font-size: 11px; }
.eng-read > div { background: #0d141f; border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; display: flex; flex-direction: column; gap: 2px; }
.eng-read > div.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; }
.eng-read span { color: var(--muted, #8b98a8); letter-spacing: .08em; font-size: 10px; }
.eng-read b { font-size: 14px; font-variant-numeric: tabular-nums; }
.eng-read .tbar { flex: 1; height: 7px; background: #1b2533; border-radius: 4px; overflow: hidden; } .eng-read .tbar i { display: block; height: 100%; width: 0; transition: width .2s; }
.ev.report { color: #cfe6ff; background: rgba(79,195,247,.08); border-left: 3px solid #4fc3f7; padding: 4px 8px; border-radius: 4px; }

/* ---------- v0.9 mission process ---------- */
.plan-lab { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; }
.plan-lab:empty { display: none; }
.proc { display: flex; gap: 3px; margin: 8px 0 14px; }
.proc .chev { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 20px; background: rgba(255,255,255,.06); color: #9fb0c4; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); font-size: 13px; cursor: help; }
.proc .chev:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 12px; }
.proc .chev span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.12); font-weight: 900; font-size: 11px; }
.proc .chev.done { background: rgba(123,216,143,.18); color: #bff5cb; }
.proc .chev.done span { background: #7bd88f; color: #082010; }
.proc .chev.cur { background: linear-gradient(90deg, #ff9f43, #f57c00); color: #1b0f00; font-weight: 800; }
.proc .chev.cur span { background: #1b0f00; color: #ffb766; }
.proc.compact { margin: 0; }
.proc.compact .chev { padding: 4px 10px 4px 16px; font-size: 11px; }
.proc.compact .chev b { display: none; }
.proc.compact .chev.cur b { display: inline; }
.proc-hud { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 40; width: min(560px, 46vw); pointer-events: auto; transition: opacity .2s; }
.topbar:not(.tb-hide) ~ .proc-hud, body.flying .proc-hud, .proc-hud:empty { opacity: 0; pointer-events: none; }
/* hidden process bar must never catch clicks meant for the top bar (its chevrons set their own pointer-events) */
.topbar:not(.tb-hide) ~ .proc-hud, .topbar:not(.tb-hide) ~ .proc-hud *, body.flying .proc-hud, body.flying .proc-hud * { visibility: hidden; pointer-events: none !important; }
.pl-lead { margin: 4px 0 12px; color: #c8d4e2; line-height: 1.5; }
.pl-needs, .pl-goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pl-need, .pl-goal { text-align: left; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.pl-need span, .pl-goal span { font-size: 12px; color: #9fb0c4; line-height: 1.4; }
.pl-need.on { border-color: #ff9f43; background: rgba(255,159,67,.12); }
.pl-goal.on { border-color: #7bd88f; background: rgba(123,216,143,.12); }
.pl-need:disabled { cursor: default; opacity: .85; }
.pl-conops { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; max-width: 560px; }
.pl-conops li { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.pl-conops li b { flex: 1; }
.pl-conops .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(79,195,247,.2); font-weight: 900; font-size: 12px; }
.pl-conops button { background: rgba(255,255,255,.08); border: 0; color: #e6edf5; border-radius: 6px; width: 30px; height: 26px; cursor: pointer; }
.pl-conops button:disabled { opacity: .3; cursor: default; }
.pl-err { color: #ff8a80; background: rgba(229,83,75,.12); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.pl-methods { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: #9fb0c4; margin-bottom: 10px; }
.pl-req { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 13px; }
.pl-req th { text-align: left; color: #7fa6c4; font-size: 11px; letter-spacing: 1px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.pl-req td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; }
.pl-req tr.ok td:first-child { color: #7bd88f; } .pl-req tr.bad td:first-child { color: #ff8a80; }
.pl-req .hint { color: #ff8a80; font-size: 12px; margin-top: 4px; }
.pl-m { background: rgba(255,255,255,.06); border: 1px solid var(--line); color: #c8d4e2; border-radius: 6px; padding: 4px 8px; margin: 0 4px 4px 0; font-size: 12px; cursor: pointer; }
.pl-m.on { background: #4fc3f7; color: #03121c; border-color: #4fc3f7; font-weight: 800; }
.pl-reqmini { margin: 0 0 12px; padding-left: 18px; font-size: 13px; color: #c8d4e2; line-height: 1.6; }
.pl-reqmini i { color: #ffb766; font-style: normal; }
.pl-def { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.pl-dc { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.pl-dc.ok { border-color: #7bd88f; background: rgba(123,216,143,.1); }
.pl-dc p { font-size: 12px; color: #9fb0c4; flex: 1; margin: 6px 0 10px; }
.pl-dh { display: flex; justify-content: space-between; align-items: center; }
.pl-dh .mth { font-size: 11px; background: rgba(79,195,247,.2); color: #8fd6ff; padding: 2px 8px; border-radius: 10px; font-weight: 800; }
.pl-df { display: flex; justify-content: space-between; align-items: center; }
.pl-df .okt { color: #7bd88f; }
#dutiesList li.goal.done .box { background: #7bd88f; color: #082010; font-size: 10px; display: grid; place-items: center; }
.proc-hud .proc { background: rgba(8,12,20,.82); border-radius: 12px; padding: 5px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.proc-hud .chev { background: rgba(255,255,255,.08); }
.proc-hud .chev.done { background: #1f4a2c; }

/* ---------- v0.9 Mission Control & communications ---------- */
.comm-line { grid-column: 1 / -1; font-size: 10.5px; color: #9fb0c4; letter-spacing: .5px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 2px; white-space: nowrap; }
.comm-line .ok { color: #7bd88f; } .comm-line .off { color: #ff8a80; }
.mc-screen { position: fixed; inset: 0; z-index: 4; background: radial-gradient(ellipse at top, #13213a, #070b13 70%); overflow: auto; padding: 26px 30px 120px; color: #e6edf5; }
body.mc-mode #duties, body.mc-mode #procHud { display: none; }
.mc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.mc-head h2 { margin: 2px 0 0; } .mc-head h2 small { color: #9fb0c4; font-size: 15px; font-weight: 600; margin-left: 10px; }
.mc-link { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.mc-link b { display: block; letter-spacing: 1px; } .mc-link small { color: #9fb0c4; }
.mc-link .dot { width: 14px; height: 14px; border-radius: 50%; background: #e5534b; box-shadow: 0 0 12px #e5534b; }
.mc-link.open .dot { background: #7bd88f; box-shadow: 0 0 14px #7bd88f; animation: pulse 1.4s infinite; }
.mc-link.open b { color: #7bd88f; } .mc-link.closed b { color: #ff8a80; }
.mc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.mc-card { background: rgba(12,19,32,.85); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.mc-card.wide { grid-column: 1 / -1; }
.mc-card h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: 2px; color: #7fa6c4; display: flex; justify-content: space-between; }
.mc-tl { position: relative; height: 26px; background: rgba(255,255,255,.06); border-radius: 6px; overflow: hidden; }
.mc-tl i { position: absolute; top: 0; bottom: 0; background: rgba(123,216,143,.45); border-left: 2px solid #7bd88f; border-right: 2px solid #7bd88f; }
.mc-tl b { position: absolute; top: -2px; bottom: -2px; width: 3px; background: #ffb766; box-shadow: 0 0 8px #ffb766; }
.mc-tlx { display: flex; justify-content: space-between; font-size: 10px; color: #6f8399; margin: 3px 0 8px; }
.mc-bar { height: 10px; background: rgba(255,255,255,.08); border-radius: 5px; overflow: hidden; flex: 1; }
.mc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4fc3f7, #7bd88f); }
.mc-bar.crit i { background: linear-gradient(90deg, #ff9f43, #e5534b); }
.mc-data { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 5px; max-height: 210px; overflow: auto; }
.mc-data li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; background: rgba(255,255,255,.04); border-radius: 8px; padding: 6px 8px; }
.mc-data .sz { font-weight: 900; color: #8fd6ff; min-width: 24px; } .mc-data .tx { flex: 1; }
.mc-data .pg { width: 70px; height: 8px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; } .mc-data .pg i { display: block; height: 100%; background: #7bd88f; }
.mc-data button { background: rgba(255,255,255,.1); border: 0; color: #fff; border-radius: 6px; width: 28px; height: 24px; cursor: pointer; }
.mc-stat { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #9fb0c4; margin-top: 10px; } .mc-stat b { color: #e6edf5; } .mc-stat .bad b { color: #ff8a80; }
.mc-lost { margin-top: 8px; font-size: 12px; color: #ff8a80; }
.mc-res { display: flex; align-items: center; gap: 10px; font-size: 12px; margin-bottom: 7px; } .mc-res span { width: 40px; color: #9fb0c4; } .mc-res b { width: 30px; text-align: right; }
.mc-res.warn .mc-bar i { background: #f2c14e; } .mc-res.crit .mc-bar i { background: #e5534b; }
.mc-alert { margin-top: 10px; background: rgba(229,83,75,.15); color: #ff8a80; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; font-weight: 700; }
.mc-crew { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13px; } .mc-crew.off { opacity: .45; }
.mc-crew .rl { font-size: 10px; font-weight: 900; letter-spacing: 1px; color: #c8d4e2; width: 80px; } .mc-crew small { color: #9fb0c4; margin-left: auto; }
.mc-goal { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; font-size: 12.5px; padding: 5px 0; } .mc-goal.ok span { color: #7bd88f; } .mc-goal.bad span { color: #ff8a80; } .mc-goal small { color: #9fb0c4; }
#logWin .pbody .mc-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
body.mc-mode .chat { z-index: 5; }
body.mc-mode #dashboard, body.mc-mode #minimap, body.mc-mode .minimap { display: none; }
#logWin.wide { width: min(1180px, 96vw); }
.dashboard .comm-line { position: absolute; right: 0; bottom: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin: 0; }
.seg { display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: .5px; padding: 1px 6px; border-radius: 6px; margin-right: 4px; vertical-align: 1px; }
.seg-launch { background: rgba(255,159,67,.2); color: #ffb766; } .seg-space { background: rgba(79,195,247,.2); color: #8fd6ff; }
.seg-ground { background: rgba(199,146,234,.2); color: #ddb6f5; } .seg-user { background: rgba(123,216,143,.2); color: #a8f0b8; }
/* ---------- v0.9 mission review on the results screen ---------- */
.res-review { margin: 18px 0; text-align: left; }
.res-review h5 { margin: 18px 0 8px; letter-spacing: 2px; color: #7fa6c4; }
.proc.recap .chev { cursor: default; }
.recap-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 14px; font-size: 12.5px; }
.recap-notes div { background: rgba(255,255,255,.04); border-radius: 8px; padding: 7px 10px; } .recap-notes b { display: block; color: #bff5cb; font-size: 12px; } .recap-notes span { color: #c8d4e2; }
.req-check { width: 100%; border-collapse: collapse; font-size: 13px; }
.req-check th { text-align: left; font-size: 11px; color: #7fa6c4; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.req-check td { padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,.05); }
.req-check tr.ok td:last-child b { color: #7bd88f; } .req-check tr.bad td:last-child b { color: #ff6b61; }
.req-check tr.ok td:first-child { border-left: 3px solid #7bd88f; } .req-check tr.bad td:first-child { border-left: 3px solid #e5534b; }
.seg-report { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.sg { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.sg-h { display: flex; justify-content: space-between; align-items: center; } .sg-h i { width: 12px; height: 12px; border-radius: 50%; }
.sg.ok .sg-h i { background: #7bd88f; } .sg.warn .sg-h i { background: #f2c14e; } .sg.bad .sg-h i { background: #e5534b; }
.sg p { margin: 8px 0 0; font-size: 12.5px; color: #c8d4e2; line-height: 1.45; }
