:root {
  --panel: rgba(16, 21, 33, 0.82);
  --panel-2: rgba(30, 38, 56, 0.9);
  --line: rgba(170, 190, 230, 0.14);
  --text: #e3e8f2;
  --muted: #8e9ab3;
  --gold: #eec27a;
  --btn: #2b3651;
  --btn-hover: #36446a;
  --primary: #3f6db3;
  --primary-hover: #4b7dc8;
  --good: #8fd19e;
  --bad: #e58a7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05070c; color: var(--text);
  font: 14px/1.4 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: var(--text); background: var(--btn); border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 12px; cursor: pointer; transition: background .15s; white-space: nowrap; }
button:hover:not(:disabled) { background: var(--btn-hover); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--primary); border-color: transparent; }
button.primary:hover:not(:disabled) { background: var(--primary-hover); }
button.link { background: none; border: none; color: var(--muted); padding: 2px 6px; }
button.link:hover { color: var(--text); background: none; }
button.small { padding: 3px 8px; font-size: 12px; }

.card, header, aside, #sel, #log { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); }

/* top bar */
header { position: fixed; top: 12px; left: 12px; right: 372px; height: 52px; border-radius: 12px; display: flex; align-items: center;
  gap: 20px; padding: 0 16px; }
.brand { font-weight: 700; letter-spacing: .18em; font-size: 13px; color: #c9d3e8; }
.money { display: flex; align-items: baseline; gap: 8px; }
#credits { font-size: 22px; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }
#income { color: var(--good); font-variant-numeric: tabular-nums; }
#ores { display: flex; gap: 14px; }
.ore-chip { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.ore-chip small { color: var(--muted); }
.ore-chip.locked { opacity: .35; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 6px currentColor; }
.spacer { flex: 1; }
.user { color: var(--muted); display: flex; align-items: center; gap: 4px; }

/* side panel */
aside { position: fixed; top: 12px; right: 12px; bottom: 12px; width: 348px; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
#tabs { display: flex; border-bottom: 1px solid var(--line); }
#tabs button { flex: 1; border: none; border-radius: 0; background: none; padding: 13px 0; color: var(--muted); border-bottom: 2px solid transparent; }
#tabs button.on { color: var(--text); border-bottom-color: var(--gold); }
#panel { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
#panel h3 { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.item { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.item.dim { opacity: .55; }
.item .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item .name { font-weight: 600; }
.item .desc { color: var(--muted); font-size: 12.5px; }
.item .stats { display: flex; gap: 12px; color: var(--muted); font-size: 12px; }
.item .stats b { color: var(--text); font-weight: 500; }
.item .actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.pips { display: flex; gap: 3px; }
.pips i { width: 14px; height: 5px; border-radius: 2px; background: rgba(255,255,255,.1); }
.pips i.on { background: var(--gold); }
.toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; color: var(--muted); font-size: 13px; }
.toggle input { accent-color: var(--primary); width: 16px; height: 16px; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.summary b { color: var(--text); font-weight: 500; float: right; }
.price-up { color: var(--good); }
.price-down { color: var(--bad); }
.meter { height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--gold); }

/* selection panel */
#sel { position: fixed; left: 12px; bottom: 12px; width: 360px; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
#sel .title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
#sel .title .close { margin-left: auto; }
#sel .sub { color: var(--muted); font-size: 13px; }
.send-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.send-row small { color: var(--muted); }

/* log */
#log { position: fixed; left: 384px; right: 372px; bottom: 12px; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--muted);
  max-height: 86px; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
#log div:last-child { color: var(--text); }
#help { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); color: rgba(220,228,245,.5); font-size: 12px; pointer-events: none; }

/* asteroid labels and floating numbers */
.ast-label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 5px; font-size: 11px; color: #cdd6ea;
  background: rgba(10,14,22,.55); padding: 2px 7px 2px 6px; border-radius: 10px; white-space: nowrap; }
.ast-label.sel { background: rgba(60,48,20,.75); color: #fff; }
.ast-label .bar { width: 28px; height: 3px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; }
.ast-label .bar i { display: block; height: 100%; background: #cdd6ea; }
.ast-label .dot { width: 7px; height: 7px; }
.floater { position: absolute; left: 0; top: 0; font-weight: 600; font-size: 13px; text-shadow: 0 1px 3px #000; white-space: nowrap; }

#toast { position: fixed; top: 76px; left: 50%; transform: translate(-50%, -10px); background: #3a2326; border: 1px solid #6a3b3b;
  color: #ffd9d2; padding: 8px 16px; border-radius: 8px; opacity: 0; transition: .25s; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* login + report */
#login, #report { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(3,5,10,.35); }
#login .card, #report .card { width: 340px; border-radius: 14px; padding: 26px; display: flex; flex-direction: column; gap: 12px; }
#login h1 { margin: 0; font-size: 30px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: #e9eef8; }
#login .sub { margin: -8px 0 8px; color: var(--gold); letter-spacing: .25em; text-transform: uppercase; font-size: 11px; }
#login label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
#login input { font: inherit; color: var(--text); background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; }
#login input:focus { outline: none; border-color: var(--primary); }
#lerr { color: var(--bad); min-height: 1.2em; margin: 0; font-size: 13px; }
.row { display: flex; gap: 8px; }
.row button { flex: 1; padding: 9px; }
#report .card { width: 400px; }
#report h2 { margin: 0; font-size: 20px; }
#report ul { margin: 0; padding-left: 18px; color: var(--muted); }
#report .big { font-size: 26px; color: var(--gold); font-weight: 600; }

/* asteroid probe stepper */
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper b { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }

/* tutorial */
#tut { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); width: 440px; max-width: calc(100vw - 760px);
  min-width: 320px; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; z-index: 5;
  border-color: rgba(238, 194, 122, 0.45); box-shadow: 0 8px 30px rgba(0,0,0,.45); }
#tut h4 { margin: 0; font-size: 16px; }
#tut p { margin: 0; color: #c9d2e4; font-size: 13.5px; }
#tut .tut-count { color: var(--gold); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
#tut .tut-wait { color: var(--gold); font-style: italic; }
#tut .row { justify-content: space-between; margin-top: 4px; }
#tut .row button { flex: none; padding: 6px 16px; }
.tut-hl { outline: 2px solid var(--gold); outline-offset: 2px; animation: tutPulse 1.4s ease-in-out infinite; }
@keyframes tutPulse { 50% { outline-color: rgba(238, 194, 122, 0.25); } }
.ore-chip.hazard { color: var(--gold); font-weight: 600; }

/* menu */
#menuBtn { padding: 5px 12px; }
#muteBtn { font-size: 16px; }
#menu { position: fixed; top: 72px; right: 372px; width: 280px; border-radius: 12px; padding: 14px 16px; z-index: 20;
  display: flex; flex-direction: column; gap: 9px; }
#menu h4 { margin: 4px 0 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
#menu .slider { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
#menu input[type=range] { width: 100%; accent-color: var(--gold); }
#menu .track { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
#menu .track b { color: var(--text); font-weight: 600; }
#menu > button { text-align: left; }
