/* 星海边境 · ORBITAL FRONTIER v2 — fleet strategy UI */
:root {
  --bg: #02050b;
  --panel: rgba(4, 13, 23, .84);
  --ink: #eafcff; --ink-dim: #93b2bc; --muted: #5a7681;
  --cyan: #6ef7ff; --cyan-soft: #37c8da; --aqua: #5bffd8; --amber: #ffc766; --rose: #ff6f9c;
  --line: rgba(110, 247, 255, .16); --line-strong: rgba(110, 247, 255, .34);
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", "Noto Sans Mono", Consolas, monospace;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", Georgia, serif;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px); --safe-right: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overscroll-behavior: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }
#app { position: fixed; inset: 0; overflow: hidden; touch-action: none; }
#stage { position: absolute; inset: 0; display: block; width: 100%; height: 100%; z-index: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; background: #030812; }
/* every HUD layer is positioned: give the canvas one a low explicit stacking slot so panels/handles win */
#startScreen { z-index: 40; }

.panel { background: linear-gradient(160deg, rgba(5, 18, 29, .9), rgba(3, 9, 16, .78)); border: 1px solid var(--line); backdrop-filter: blur(12px) saturate(115%); box-shadow: 0 20px 60px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.03); }
.micro-label { font-family: var(--mono); font-size: 8px; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }

/* top HUD */
.top-hud { position: absolute; top: calc(12px + var(--safe-top)); left: calc(12px + var(--safe-left)); right: calc(12px + var(--safe-right)); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; pointer-events: none; }
.top-hud > * { pointer-events: auto; }
.minimap-panel { width: 300px; padding: 9px; }
.minimap-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 5px; font-family: var(--mono); font-size: 8px; letter-spacing: .14em; color: var(--cyan-soft); }
.minimap-head b { color: var(--muted); font-weight: 400; }
#minimap { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; border: 1px solid rgba(110,247,255,.14); background: rgba(2,7,13,.9); cursor: crosshair; touch-action: manipulation; }
.zoom-ctl { position: absolute; right: 12px; top: 30px; display: grid; gap: 5px; }
.zoom-ctl button { width: 32px; height: 32px; display: grid; place-items: center; font-size: 16px; color: #bfeffa; background: rgba(3,14,23,.86); border: 1px solid rgba(110,247,255,.35); }
.zoom-ctl button:active { background: rgba(24,74,88,.9); color: #fff; }
.minimap-foot { display: flex; gap: 10px; padding-top: 5px; font-family: var(--mono); font-size: 7px; color: var(--muted); }
.minimap-foot span { display: inline-flex; align-items: center; gap: 4px; }
.lg-mine { width: 7px; height: 7px; border-radius: 50%; background: #5eead4; display: inline-block; box-shadow: 0 0 6px #5eead4; }
.lg-enemy { width: 7px; height: 7px; border-radius: 50%; background: #ff6b9d; display: inline-block; }
.lg-neutral { width: 7px; height: 7px; border-radius: 50%; border: 1px solid #98a5af; display: inline-block; }
.legend-brand { font-family: var(--mono); font-size: 9px; letter-spacing: .22em; color: #d9faff; margin-right: 6px; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #fff, #7ee7ff); display: inline-block; }
.lg-ring { width: 8px; height: 8px; border-radius: 50%; border: 1.5px dashed rgba(160,170,180,.85); display: inline-block; }
.lg-fleet { width: 9px; height: 9px; background: #7dd3fc; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); display: inline-block; }
.status-panel { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 12px; position: relative; flex-wrap: wrap; justify-content: flex-end; }
.self-panel-inner { display: flex; align-items: center; gap: 10px; }
.menu-toggle { width: 40px; height: 38px; font-size: 17px; }
.hud-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 220px; padding: 6px;
  background: linear-gradient(160deg, rgba(5,18,29,.97), rgba(3,9,16,.95)); border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px rgba(0,0,0,.5); display: grid; gap: 2px; }
.hud-menu button { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 10px 12px; font-size: 12px; color: #cdeef3; text-align: left; border: 1px solid transparent; }
.hud-menu button:hover { background: rgba(24,74,88,.5); border-color: var(--line); color: #fff; }
.hud-menu kbd { font-family: var(--mono); font-size: 9px; color: var(--muted); }
.hud-menu button[data-menu="leave"] { color: #ffb3c4; margin-top: 4px; border-top: 1px solid rgba(255,111,156,.2); }
.elim-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(2,5,11,.72); backdrop-filter: blur(4px); }
.elim-card { width: min(400px, calc(100vw - 32px)); padding: 26px 24px; text-align: center; border-color: rgba(255,111,156,.3); }
.elim-card h2 { margin: 8px 0 6px; font-family: var(--serif); font-size: 32px; letter-spacing: .1em; color: #ffe9ee; }
.elim-card p { margin: 0; font-size: 11px; line-height: 1.7; color: #8fa7af; }
.elim-count { margin-top: 18px; display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.elim-count b { font-family: var(--mono); font-size: 46px; font-weight: 300; color: var(--rose); }
.elim-count span { font-family: var(--mono); font-size: 10px; color: #7a5964; }
.dialog { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; z-index: 55; padding: 22px; }
.dialog h2 { margin: 4px 0 14px; font-family: var(--serif); font-size: 24px; font-weight: 900; letter-spacing: .1em; }
.status-body { display: grid; gap: 8px; font-size: 12px; color: #a9c9d1; }
.status-body .row { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(110,247,255,.08); padding-bottom: 5px; }
.self-badge { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--cyan); font-family: var(--mono); font-size: 12px; clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%); }
.self-name { display: grid; gap: 1px; min-width: 90px; }
.self-name strong { font-size: 14px; letter-spacing: .06em; }
.self-name span { font-family: var(--mono); font-size: 7px; color: var(--muted); letter-spacing: .1em; }
.self-stats { display: flex; gap: 16px; padding-left: 14px; border-left: 1px solid var(--line); }
.self-stats div { display: grid; gap: 2px; }
.self-stats span { font-family: var(--mono); font-size: 7px; letter-spacing: .12em; color: var(--muted); }
.self-stats b { font-family: var(--mono); font-size: 16px; font-weight: 400; color: #e3fdff; }
.energy-meter { display: grid; gap: 3px; width: 74px; }
.energy-meter i { display: block; height: 4px; background: rgba(110,247,255,.1); position: relative; overflow: hidden; }
.energy-meter i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--v, 0%); background: linear-gradient(90deg, #2b9f8f, var(--aqua)); transition: width .3s; }
.hud-right { display: flex; gap: 8px; align-items: flex-start; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(3, 10, 18, .72); color: var(--ink-dim); transition: .2s; position: relative; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover, .icon-btn.active { color: var(--cyan); border-color: var(--line-strong); }
.icon-btn.muted { color: var(--rose); }
.icon-btn .badge { position: absolute; right: -5px; top: -5px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--aqua); color: #03201b; font-family: var(--mono); font-size: 8px; font-weight: 700; display: grid; place-items: center; }

/* map */
.map-wrap { position: absolute; inset: 0; pointer-events: none; }
#hud { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
#hud > .top-hud, #hud > .faction-panel, #hud > .order-panel, #hud > .bottom-bar,
#hud > .chat-panel, #hud > .help-panel, #hud > .dialog, #hud > .elim-overlay, #hud .panel,
#hud button, #hud input, #hud .planet-item, #hud .minimap-panel, #hud .zoom-ctl { pointer-events: auto; }
.map-bracket { position: absolute; inset: calc(8px + var(--safe-top)) calc(8px + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(8px + var(--safe-left)); pointer-events: none; }
.map-bracket span { position: absolute; width: 18px; height: 18px; border: 0 solid rgba(110, 247, 255, .4); }
.map-bracket span:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.map-bracket span:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.map-bracket span:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.map-bracket span:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.map-coords { position: absolute; left: 50%; bottom: calc(14px + var(--safe-bottom)); transform: translateX(-50%); font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: #5f8791; pointer-events: none; white-space: nowrap; }
.map-coords b { color: var(--cyan-soft); font-weight: 400; }

/* left faction panel */
.faction-panel { position: absolute; left: calc(12px + var(--safe-left)); top: calc(300px + var(--safe-top)); width: 300px; max-height: calc(100% - 380px); padding: 12px 12px 10px; overflow-y: auto; scrollbar-width: thin; }
.panel-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.panel-title strong { font-size: 13px; letter-spacing: .12em; }
.panel-title span { font-family: var(--mono); font-size: 7px; color: var(--aqua); }
.tab-row { display: flex; gap: 4px; margin-bottom: 8px; }
.tab-row button { flex: 1; padding: 5px 0; font-size: 10px; color: var(--muted); border: 1px solid rgba(110,247,255,.1); background: rgba(3,10,18,.5); letter-spacing: .08em; }
.tab-row button.on { color: var(--cyan); border-color: var(--line-strong); background: rgba(20,64,78,.3); }
.planet-list { display: grid; gap: 4px; }
.planet-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; padding: 6px 7px; border: 1px solid transparent; background: rgba(3, 12, 20, .5); cursor: pointer; transition: .15s; text-align: left; width: 100%; }
.planet-item:hover { border-color: rgba(110,247,255,.22); background: rgba(10,30,42,.6); }
.planet-item.sel { border-color: rgba(110,247,255,.55); background: rgba(20,64,78,.35); }
.planet-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--cyan)); box-shadow: 0 0 8px var(--c, var(--cyan)); }
.pmeta { display: grid; gap: 1px; min-width: 0; }
.pname { font-size: 11px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planet-item.home .pname::after { content: " ★"; color: var(--amber); }
.pstat { font-family: var(--mono); font-size: 7px; color: var(--muted); }
.pstat b { color: #c9eef2; font-weight: 400; }
.pbadge { font-family: var(--mono); font-size: 7px; padding: 1px 4px; border: 1px solid rgba(110,247,255,.2); color: var(--ink-dim); }
.pbadge.ex { color: #ff9f6b; border-color: rgba(255,143,107,.4); }
.faction-list { display: grid; }
.faction-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid rgba(110,247,255,.06); font-size: 11px; }
.faction-row .fdot { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.faction-row .fname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.faction-row .fnum { font-family: var(--mono); font-size: 8px; color: var(--ink-dim); }
.faction-row.me .fname { color: var(--aqua); }
.faction-row.ally .fname::after { content: " 盟"; color: #a78bfa; font-family: var(--mono); font-size: 7px; }

/* right order panel */
.order-panel { position: absolute; right: calc(12px + var(--safe-right)); top: calc(88px + var(--safe-top)); width: 316px; max-height: calc(100% - 120px); overflow-y: auto; padding: 13px; scrollbar-width: thin; }
.op-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.op-head h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: .06em; font-family: var(--serif); font-weight: 900; }
.op-close { width: 24px; height: 24px; color: var(--muted); font-size: 18px; line-height: 1; }
.op-close:hover { color: var(--cyan); }
.op-chevron { display: none; width: 26px; height: 26px; color: var(--cyan); font-size: 14px; line-height: 1; }
.order-panel.collapsed .op-tags, .order-panel.collapsed .op-grid, .order-panel.collapsed .bar-grid,
.order-panel.collapsed .slider-block, .order-panel.collapsed .action-grid, .order-panel.collapsed .op-note,
.order-panel.collapsed .progress-line, .order-panel.collapsed .op-chevron { display: none; }
.order-panel.collapsed { max-height: none; }
.op-tags { display: flex; gap: 5px; margin: 9px 0 10px; flex-wrap: wrap; }
.tag { font-family: var(--mono); font-size: 8px; letter-spacing: .08em; padding: 3px 6px; border: 1px solid rgba(110,247,255,.16); color: var(--ink-dim); }
.tag.own { color: var(--cyan); border-color: rgba(110,247,255,.4); }
.tag.ex { color: #ffb08a; border-color: rgba(255,143,107,.36); }
.tag.warn { color: var(--amber); border-color: rgba(255,199,102,.36); }
.op-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.stat { border: 1px solid rgba(110,247,255,.1); padding: 6px 8px; background: rgba(3,10,18,.5); display: grid; gap: 2px; }
.stat span { font-family: var(--mono); font-size: 7px; color: var(--muted); letter-spacing: .1em; }
.stat b { font-family: var(--mono); font-size: 14px; font-weight: 400; color: #e4feff; }
.stat b small { font-size: 8px; color: var(--muted); }
.bar { height: 4px; background: rgba(110,247,255,.1); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan-soft), var(--cyan)); }
.bar.res i { background: linear-gradient(90deg, #b7791f, var(--amber)); }
.bar.en i { background: linear-gradient(90deg, #2b9f8f, var(--aqua)); }
.bar-grid { display: grid; gap: 6px; margin-bottom: 11px; }
.bar-row { display: grid; grid-template-columns: 34px 1fr 46px; gap: 8px; align-items: center; font-family: var(--mono); font-size: 8px; color: var(--ink-dim); }
.bar-row span:last-child { text-align: right; color: #c9eef2; }
.slider-block { margin-bottom: 10px; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.slider-head span { font-family: var(--mono); font-size: 8px; color: var(--muted); letter-spacing: .1em; }
.slider-head b { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--cyan); }
input[type=range] { -webkit-appearance: none; width: 100%; height: 18px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: rgba(110,247,255,.15); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(110,247,255,.7); }
input[type=range]::-moz-range-track { height: 4px; background: rgba(110,247,255,.15); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--cyan); }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btn { padding: 9px 8px; font-size: 11px; letter-spacing: .06em; border: 1px solid rgba(110,247,255,.22); background: rgba(16,48,60,.32); color: #cdeef3; transition: .15s; }
.btn:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(24,74,88,.5); color: #fff; }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn.primary { grid-column: 1 / -1; background: linear-gradient(120deg, #d6ffff, #6ef7ff 40%, #43d9e8); color: #00181c; font-weight: 800; border: 0; }
.btn.danger { color: #ffb3c4; border-color: rgba(255,111,156,.35); background: rgba(80,16,32,.28); }
.btn.wide { grid-column: 1 / -1; }
.op-note { margin-top: 9px; font-size: 9px; line-height: 1.6; color: #70909a; }
.progress-line { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-family: var(--mono); font-size: 9px; color: var(--amber); }
.progress-line .bar { flex: 1; }
.progress-line .bar i { background: linear-gradient(90deg, #ff8a5b, var(--amber)); }
.op-actions-faction { display: grid; gap: 6px; margin-top: 4px; }

/* bottom bar */
.bottom-bar { position: absolute; left: calc(12px + var(--safe-left)); right: calc(12px + var(--safe-right)); bottom: calc(12px + var(--safe-bottom)); display: flex; gap: 10px; align-items: flex-end; pointer-events: none; }
.bottom-bar > * { pointer-events: auto; }
.legend { display: flex; gap: 14px; padding: 7px 12px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 8px; color: var(--ink-dim); letter-spacing: .04em; }
.legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend i.sq { border-radius: 1px; }
.hint-bar { flex: 1; padding: 7px 12px; display: flex; gap: 12px; align-items: center; min-width: 0; }
.hint-bar .step { font-family: var(--mono); font-size: 8px; color: var(--cyan); white-space: nowrap; }
.hint-bar p { margin: 0; font-size: 10px; color: #9dbec6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint-bar b { color: var(--cyan); font-weight: 500; }
.mode-tag { padding: 7px 12px; font-family: var(--mono); font-size: 8px; letter-spacing: .1em; color: var(--aqua); white-space: nowrap; }
.mode-tag.busy { color: var(--amber); }

/* overlays */
.toast { position: absolute; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translate(-50%, 8px); padding: 8px 16px; background: rgba(3, 14, 23, .9); border: 1px solid rgba(110,247,255,.24); color: #baf6ff; font-size: 11px; letter-spacing: .06em; opacity: 0; pointer-events: none; transition: .25s; z-index: 30; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255,111,156,.45); color: #ffc2d0; }
.net-banner { position: absolute; left: 50%; top: calc(70px + var(--safe-top)); transform: translateX(-50%); padding: 7px 14px; background: rgba(24, 14, 5, .92); border: 1px solid rgba(255,199,102,.4); color: #ffd99c; font-family: var(--mono); font-size: 9px; z-index: 30; }
.event-feed { position: absolute; right: calc(12px + var(--safe-right)); bottom: calc(64px + var(--safe-bottom)); width: 300px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; pointer-events: none; }
.feed-item { font-size: 10px; padding: 4px 9px; background: rgba(3, 10, 18, .82); border: 1px solid rgba(110,247,255,.12); color: #a9c9d1; max-width: 100%; animation: fin .25s ease both; }
.feed-item b { color: #e5feff; font-weight: 500; }
.feed-item em { font-style: normal; color: var(--amber); }
.feed-item.bad b { color: #ffb3c4; }
@keyframes fin { from { opacity: 0; transform: translateY(4px); } }

/* chat & help */
.chat-panel { position: absolute; left: 50%; bottom: calc(64px + var(--safe-bottom)); transform: translateX(-50%); width: min(580px, calc(100vw - 24px)); padding: 10px; z-index: 25; }
.chat-log { max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; font-size: 10px; scrollbar-width: thin; }
.chat-line { color: #9dc1c9; display: flex; gap: 7px; }
.chat-line .who { font-weight: 600; flex: 0 0 auto; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-line .txt { color: #c8e8ed; word-break: break-word; }
.chat-line.sys { font-family: var(--mono); font-size: 8px; color: #648691; }
.chat-form { display: flex; gap: 8px; margin-top: 8px; border-top: 1px solid rgba(110,247,255,.1); padding-top: 8px; }
.chat-form input { flex: 1; min-width: 0; height: 32px; background: rgba(2,9,15,.7); border: 1px solid rgba(110,247,255,.16); outline: 0; padding: 0 10px; font-size: 11px; color: #d6f9fc; }
.chat-form button { padding: 0 14px; background: rgba(110,247,255,.15); border: 1px solid rgba(110,247,255,.28); color: var(--cyan); font-size: 10px; }
.help-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: calc(100% - 40px); overflow-y: auto; padding: 22px; z-index: 26; }
.help-panel h2 { margin: 4px 0 14px; font-family: var(--serif); font-size: 26px; font-weight: 900; letter-spacing: .1em; }
.help-list { display: grid; gap: 9px; }
.help-list div { display: grid; grid-template-columns: 108px 1fr; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(110,247,255,.08); }
.help-list b { font-size: 11px; color: #dcf9fc; }
.help-list span { font-size: 10px; line-height: 1.6; color: #86a4ad; }

/* start screen */
.start-screen { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; padding: calc(22px + var(--safe-top)) calc(40px + var(--safe-right)) calc(22px + var(--safe-bottom)) calc(40px + var(--safe-left)); overflow-y: auto; scrollbar-width: none; background: radial-gradient(ellipse at 18% 46%, rgba(4, 13, 23, .94) 0%, rgba(3, 8, 15, .72) 34%, transparent 66%), linear-gradient(180deg, rgba(2,5,11,.72), rgba(2,5,11,.12) 40%, rgba(2,5,11,.88)); transition: opacity .6s ease, transform .6s ease, visibility .6s; }
.start-screen::-webkit-scrollbar { display: none; }
.start-screen.leaving { opacity: 0; transform: scale(1.02); visibility: hidden; pointer-events: none; }
.start-inner { max-width: 1460px; width: 100%; margin: auto; display: grid; grid-template-columns: minmax(420px, .9fr) minmax(360px, .8fr); gap: clamp(30px, 6vw, 120px); align-items: center; padding: 3vh 0; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 9px; letter-spacing: .24em; color: var(--cyan-soft); text-transform: uppercase; margin-bottom: 20px; }
.eyebrow-line { width: 38px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan)); }
.title { margin: 0 0 20px; display: flex; align-items: flex-end; gap: clamp(16px, 2vw, 30px); line-height: .84; }
.title-cn { font-family: var(--serif); font-weight: 900; font-size: clamp(72px, 8vw, 132px); letter-spacing: -.07em; color: transparent; background: linear-gradient(158deg, #fff 0%, #d9fdff 30%, #82eff8 58%, #2c91a8 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 26px rgba(62,196,219,.14)); }
.title-en { font-family: var(--mono); font-size: clamp(10px, 1vw, 13px); line-height: 1.65; letter-spacing: .32em; color: var(--muted); padding-bottom: clamp(10px, 1.8vw, 24px); white-space: nowrap; }
.title-en em { font-style: normal; color: var(--cyan); text-shadow: 0 0 16px rgba(110,247,255,.5); }
.lede { margin: 0 0 26px; max-width: 560px; font-size: clamp(13px, 1.05vw, 15px); line-height: 1.85; color: #a6c0c8; letter-spacing: .02em; }
.join-form label { display: flex; gap: 8px; font-family: var(--mono); font-size: 9px; letter-spacing: .2em; color: var(--ink-dim); margin-bottom: 9px; }
.join-form label span { color: var(--muted); }
.join-control { display: flex; gap: 9px; }
.callsign-field { flex: 1; display: flex; align-items: center; min-width: 0; height: 50px; border: 1px solid var(--line); background: rgba(3, 11, 20, .78); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.callsign-field:focus-within { border-color: var(--line-strong); box-shadow: inset 0 0 30px rgba(61,212,230,.07); }
.field-prefix { font-family: var(--mono); font-size: 10px; color: var(--cyan-soft); padding: 0 12px 0 16px; border-right: 1px solid var(--line); margin-right: 12px; }
.callsign-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 15px; letter-spacing: .08em; }
.callsign-field input::placeholder { color: #4d6671; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; height: 50px; padding: 0 22px; min-width: 164px; color: #00181c; background: linear-gradient(120deg, #d6ffff, #6ef7ff 40%, #43d9e8); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); font-size: 14px; font-weight: 800; letter-spacing: .1em; box-shadow: 0 0 28px rgba(62,223,240,.25); transition: .18s; }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:disabled { filter: grayscale(.4); cursor: wait; }
.form-note { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-family: var(--mono); font-size: 9px; color: #58727c; }
.tiny-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--aqua); }
.feature-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 30px; }
.feature-cards article { padding: 12px; border: 1px solid rgba(110,247,255,.1); background: rgba(4,14,22,.55); display: grid; gap: 4px; }
.feature-cards b { font-size: 11px; color: #d9f6fa; letter-spacing: .04em; }
.feature-cards span { font-size: 9px; color: #6d8b94; line-height: 1.5; }
.start-visual { position: relative; min-height: 420px; display: grid; place-items: center; }
.start-visual .orbit { position: absolute; border: 1px solid rgba(110,247,255,.12); border-radius: 50%; }
.start-visual .orbit.o1 { width: 72%; aspect-ratio: 1; border-style: dashed; animation: spin 60s linear infinite; }
.start-visual .orbit.o2 { width: 96%; aspect-ratio: 1; border-color: rgba(110,247,255,.06); }
@keyframes spin { to { transform: rotate(360deg); } }
.start-visual .planet-demo { width: min(56%, 260px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #7fe9d9 0%, #2b8f86 32%, #0d2a33 68%, #050b12 100%); box-shadow: 0 0 80px rgba(110,247,255,.25), inset -24px -18px 60px rgba(0,0,0,.6); position: relative; }
.start-visual .planet-demo::after { content: ""; position: absolute; inset: -14%; border-radius: 50%; border: 1px solid rgba(110,247,255,.18); }
.start-footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 14px; border-top: 1px solid rgba(110,247,255,.1); font-family: var(--mono); font-size: 8px; letter-spacing: .08em; color: #45616d; }
.server-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--line); font-family: var(--mono); font-size: 9px; color: var(--ink-dim); }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 8px var(--aqua); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

@media (max-width: 1180px) { .faction-panel { width: 208px; } .order-panel { width: 270px; } }
@media (max-width: 900px) {
  /* top HUD: minimap on the left, status + menu on the right, nothing stretched across the map */
  .top-hud { align-items: flex-start; gap: 8px; }
  .minimap-panel { width: 168px; padding: 6px; }
  .minimap-head { font-size: 8px; padding-bottom: 3px; }
  .minimap-foot { display: none; }
  .zoom-ctl { right: 8px; top: 24px; }
  .zoom-ctl button { width: 28px; height: 28px; font-size: 14px; }
  .status-panel { flex-direction: column; align-items: stretch; gap: 6px; padding: 7px 9px; min-width: 0; }
  .status-panel .self-panel-inner { gap: 7px; }
  .self-stats { justify-content: space-between; padding-left: 0; border-left: 0; gap: 6px; }
  .energy-meter { width: 44px; }
  .icon-btn.menu-toggle { position: absolute; right: 6px; top: 6px; width: 32px; height: 30px; }
  .status-panel { padding-right: 46px; }
  .faction-panel { display: none; }
  .faction-panel.open { display: block; position: absolute; left: calc(8px + var(--safe-left)); right: calc(8px + var(--safe-right));
    top: auto; bottom: calc(8px + var(--safe-bottom)); width: auto; max-height: 56%; z-index: 30; }
  .faction-panel .sheet-close { display: grid; }
  .order-panel { width: auto; left: calc(8px + var(--safe-left)); right: calc(8px + var(--safe-right)); top: auto;
    bottom: calc(8px + var(--safe-bottom)); max-height: 52%; padding: 12px 14px; }
  .order-panel .op-head h2 { font-size: 18px; }
  .op-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat b { font-size: 13px; }
  .bar-grid { gap: 5px; margin-bottom: 9px; }
  .action-grid { gap: 5px; }
  .btn { padding: 10px 8px; }
  .start-inner { grid-template-columns: 1fr; }
  .start-visual { display: none; }
  .title-cn { font-size: clamp(64px, 17vw, 110px); }
  .faction-panel { display: none; }
  .order-panel { width: min(300px, calc(100vw - 24px)); max-height: 58%; }
  .hint-bar p { white-space: normal; }
  .legend { display: none; }
  .self-stats { gap: 10px; }
  .self-panel { gap: 9px; padding: 7px 10px; }
  .minimap-panel { width: 168px; }
  .minimap-foot { display: none; }
  .event-feed { width: 220px; }
}
@media (max-width: 560px) {
  .top-hud { gap: 6px; }
  .minimap-panel { width: 148px; }
  .status-panel { padding: 6px 44px 6px 8px; }
  .self-stats div span { font-size: 6px; }
  .self-stats b { font-size: 12px; }
  .order-panel { padding: 10px 12px; max-height: 56%; }
  .order-panel .op-head h2 { font-size: 16px; }
  .stat { padding: 5px 7px; }
  .slider-block { margin-bottom: 8px; }
  .self-name span { display: none; }
  .status-panel { gap: 8px; padding: 6px 8px; }
  .self-stats { gap: 8px; padding-left: 8px; }
  .hud-menu { min-width: 200px; }
  .self-name strong { font-size: 12px; }
  .self-name { min-width: 0; }
  .self-badge { width: 28px; height: 28px; font-size: 10px; }
  .self-stats span { font-size: 6px; }
  .self-stats b { font-size: 13px; }
  .energy-meter { width: 52px; }
  .icon-btn { width: 32px; height: 32px; }
  .order-panel { top: auto; bottom: calc(8px + var(--safe-bottom)); max-height: 56%; }
  .order-panel:not(.collapsed) .op-chevron { display: grid; place-items: center; }
  .order-panel.collapsed { padding: 8px 12px; }
  .order-panel.collapsed .op-chevron { display: grid; }
  .order-panel.collapsed .op-head h2 { font-size: 16px; }
  .hud-right { gap: 4px; }
  .bottom-bar { display: none; }
  .event-feed { display: none; }
  .map-coords { font-size: 8px; }
  .help-list div { grid-template-columns: 1fr; gap: 2px; }
  .join-control { flex-direction: column; }
  .primary-button { width: 100%; }
  .feature-cards { grid-template-columns: 1fr; }
  .start-footer { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

.faction-panel .sheet-close { display: none; position: absolute; right: 8px; top: 6px; width: 26px; height: 26px; place-items: center; color: var(--muted); font-size: 17px; }
