/* Seedfall UI: HTML over the WebGL canvas (art.md section 9). Quiet, flat, square panels with a stepped notch. */

html, body { margin: 0; height: 100%; background: #07080c; overflow: hidden; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
#ui { position: fixed; inset: 0; pointer-events: none; }

:root {
  --text: #e8ecf4;
  --quiet: #8a94a8;
  --dim: #5c6678;
  --panel: rgba(12, 15, 22, 0.86);
  --panel-solid: #0c0f16;
  --row: rgba(255, 255, 255, 0.025);
  --border: #2a3242;
  --border-hi: #3a4458;
  --hi: #ffffff0f;
  --accent: #ffd870;
  --good: #5ad88a;
  --warn: #ffb35c;
  --bad: #ff5a4a;
  --cash: #e0c040;
  --data: #7fe8ff;
  --shard: #c9a0ff;
  --m: 8px; /* screen margin */
  --bar: 74px;
  --fs: clamp(11px, 1.6vh + 5px, 15px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-height: 700px) {
  :root { --m: 12px; --bar: 160px; }
}

.ui {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  color: var(--text);
  font: 500 var(--fs) / 1.3 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}
.ui * { box-sizing: border-box; }
.ui button { font: inherit; color: inherit; }

.ic { display: inline-block; flex: none; background: center / 100% 100% no-repeat; image-rendering: pixelated; vertical-align: middle; }
.n { font-variant-numeric: tabular-nums; }
@media (min-height: 700px) { .ic.s1 { zoom: 1.5; } .ic.s2 { zoom: 1.5; } .hud .lifttick .ic { zoom: 1; } }
.q { color: var(--quiet); }
.cash { color: var(--cash); }
.data { color: var(--data); }
.shard { color: var(--shard); }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.b { font-weight: 650; }

/* ---------------------------------------------------------------- the panel look
   Square, 1 px border, a 2 px stepped notch at each corner, an inner top highlight, a hard 2 px offset shadow. */
.pn {
  --pb: var(--border);
  --pf: var(--panel);
  position: relative;
  border: 1px solid var(--pb);
  background:
    linear-gradient(var(--pb), var(--pb)) 1px 1px / 2px 2px no-repeat border-box,
    linear-gradient(var(--pb), var(--pb)) calc(100% - 1px) 1px / 2px 2px no-repeat border-box,
    linear-gradient(var(--pb), var(--pb)) 1px calc(100% - 1px) / 2px 2px no-repeat border-box,
    linear-gradient(var(--pb), var(--pb)) calc(100% - 1px) calc(100% - 1px) / 2px 2px no-repeat border-box,
    linear-gradient(var(--hi), var(--hi)) 0 0 / 100% 1px no-repeat padding-box,
    var(--pf) padding-box;
  clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 1px, calc(100% - 1px) 1px, calc(100% - 1px) 2px, 100% 2px,
    100% calc(100% - 2px), calc(100% - 1px) calc(100% - 2px), calc(100% - 1px) calc(100% - 1px), calc(100% - 2px) calc(100% - 1px), calc(100% - 2px) 100%,
    2px 100%, 2px calc(100% - 1px), 1px calc(100% - 1px), 1px calc(100% - 2px), 0 calc(100% - 2px),
    0 2px, 1px 2px, 1px 1px, 2px 1px);
}
.sh { filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.4)); }

/* ---------------------------------------------------------------- bars */
.bar {
  position: relative;
  width: var(--bar);
  height: 8px;
  border: 1px solid #00000099;
  background: #00000066;
  box-shadow: 0 0 0 1px #ffffff14;
  flex: none;
}
.bar > .fill, .bar > .ghost {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 100%;
  transform-origin: 0 0;
}
.bar > .fill { background: var(--c, var(--text)); box-shadow: inset 0 1px 0 #ffffff55, inset 0 -1px 0 #00000033; }
.bar > .ghost { background: #ffffffcc; transition: transform 0.4s ease-in 0.15s; }
.bar .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px #000a; transition: left 0.25s; }
.bar .tick.amber { background: var(--warn); }
.bar .tick.red { background: var(--bad); }

/* ---------------------------------------------------------------- HUD */
.hud { position: absolute; inset: 0; transition: opacity 0.2s; }
.hud.hide { opacity: 0; }
.hud .tl { position: absolute; left: var(--m); top: var(--m); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.hud .cluster { --pf: rgba(12, 15, 22, 0.62); padding: 4px 7px 3px 4px; display: flex; flex-direction: column; gap: 1px; transition: opacity 0.25s, transform 0.2s var(--ease); }
/* the pod (or what it digs toward) under the cluster: the cluster gets out of the way */
.ui.hud-behind .hud .tl { opacity: 0.28; }
.hud .row { display: flex; align-items: center; gap: 9px; }
.hud .g { display: flex; align-items: center; gap: 4px; height: 17px; transition: opacity 0.3s; }
.hud .tl { transition: opacity 0.25s; }
@media (max-height: 699px) { .hud .g .ic { zoom: 0.78; } .hud .v { font-size: 0.85em; min-width: 2.6em; } }
.hud .g.off { opacity: 0; width: 0; overflow: hidden; margin-left: -14px; }
.hud .barwrap { position: relative; }
.hud .v { min-width: 3em; font-size: 0.92em; }
.hud .cargo .bar > .fill { background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--seg) - 1px), #00000070 calc(var(--seg) - 1px) var(--seg)); background-size: calc(100% / var(--sx, 1)) 100%; }
.hud .cargo .bar { background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--seg) - 1px), #ffffff12 calc(var(--seg) - 1px) var(--seg)); }
.hud .tag { font-size: 0.78em; color: var(--warn); letter-spacing: 0.04em; font-weight: 650; }
.hud .tag:empty { display: none; }
.hud .cargo.full .tag { color: var(--accent); }
.hud .cargo.full .bar { animation: pulse-out 1.2s ease-in-out infinite; }
.hud .cargo.heavy .bar > .fill { --c: #d89a50; }
.hud .cargo.ping .bar { animation: ping 0.24s 2; }
.hud .lifttick { position: absolute; top: -11px; margin-left: -4px; transition: left 0.25s, opacity 0.2s; }
.hud .tick.off, .hud .lifttick.off { opacity: 0; }

.hud .g.amber .bar { animation: pulse-amber 0.9s ease-in-out infinite; }
.hud .g.red .bar, .hud .g.red.flash .bar { animation: pulse-red 0.667s ease-in-out infinite; }
.hud .g.flash:not(.red) .bar { animation: pulse-amber 0.5s steps(2) infinite; }
.hud .g.red .ic, .hud .g.crit .ic { animation: shake 0.2s steps(2) infinite; }
.hud .g.crit .bar { animation-duration: 0.4s; }
.hud .hull.amber .bar > .fill { --c: var(--warn); }
.hud .hull.red .bar > .fill, .hud .fuel.red .bar > .fill { --c: var(--bad); }
.hud .heat.red .bar { animation: pulse-red 0.667s ease-in-out infinite; }

.hud .status {
  font-size: 0.92em; font-weight: 650; color: var(--warn); padding: 2px 7px; background: #0c0f16b0;
  opacity: 0; transform: translateY(-3px); transition: opacity 0.15s, transform 0.15s var(--ease);
}
.hud .status.on { opacity: 1; transform: none; }
.hud .status.bad { color: #ff7a6a; }
.ui.prompting .hud .status { opacity: 0; }

@keyframes pulse-amber { 50% { box-shadow: 0 0 0 1px var(--warn); } }
@keyframes pulse-red { 50% { box-shadow: 0 0 0 1px var(--bad), 0 0 6px #ff5a4a66; } }
@keyframes pulse-out { 50% { box-shadow: 0 0 0 1px var(--accent); } }
@keyframes ping { 50% { box-shadow: 0 0 0 1px #fff; } }
@keyframes shake { 0% { transform: translateX(-1px); } 100% { transform: translateX(1px); } }

.hud .tr { position: absolute; right: calc(var(--m) + 14px); top: var(--m); display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.hud .readout { --pf: rgba(12, 15, 22, 0.72); display: flex; align-items: center; gap: 12px; padding: 4px 9px; }
.hud .readout .r { display: flex; align-items: center; gap: 5px; font-size: 1.06em; font-weight: 650; }
.hud .readout .r .v { min-width: 0; font-size: 1em; }
.hud .goal { max-width: 46vw; font-size: 0.85em; color: #aab4c6; text-align: right; padding: 1px 8px 2px; background: #0c0f16a0; }
.hud .goal:empty { display: none; }
.hud .minimap { width: 96px; height: 128px; margin: 6px 2px 0 0; transition: opacity 0.2s; image-rendering: pixelated; outline: 1px solid #000; box-shadow: 0 0 0 2px #4a5466, 3px 3px 0 1px #0008; }
.hud .minimap.off { opacity: 0; }

.hud .gauge { position: absolute; right: calc(var(--m) - 4px); top: var(--m); bottom: var(--m); width: 12px; height: calc(100% - 2 * var(--m)); }

.hud .hotbar { position: absolute; left: 50%; bottom: var(--m); transform: translateX(-50%); display: flex; gap: 4px; transition: opacity 0.3s, transform 0.3s var(--ease); }
.hud .hotbar.off { opacity: 0; transform: translate(-50%, 8px); }
.hud .slot { --pf: rgba(12, 15, 22, 0.72); position: relative; width: 34px; height: 30px; display: flex; align-items: center; justify-content: center; }
.hud .slot .k { position: absolute; left: 3px; top: 0px; font-size: 0.72em; color: var(--quiet); }
.hud .slot .cnt { position: absolute; right: 3px; bottom: 0px; font-size: 0.8em; font-weight: 650; }
.hud .slot.empty .ic { opacity: 0.3; filter: grayscale(1); }
.hud .slot.empty .cnt { color: var(--dim); }
.hud .slot.used { animation: slot-used 0.3s var(--ease); }
.hud .slot.no { animation: shake 0.08s steps(2) 3; --pb: var(--bad); }
@keyframes slot-used { 0% { --pb: #fff; transform: translateY(-3px); } 100% { transform: none; } }
@media (min-height: 700px) {
  .hud .slot { width: 46px; height: 40px; }
  .hud .readout .r { font-size: 1.1em; }
}

/* ---------------------------------------------------------------- toasts, labels, titles, lines, prompts */
.toasts { position: absolute; left: 50%; top: calc(var(--m) + 66px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.toast {
  --pf: rgba(12, 15, 22, 0.88);
  display: flex; align-items: center; gap: 7px; padding: 4px 11px 4px 7px; white-space: nowrap; font-weight: 650;
  animation: toast-in 0.12s var(--ease) both;
}
.toast.quiet { color: var(--quiet); font-weight: 500; }
.toast.warn { --pb: #6a4a2a; color: var(--warn); }
.toast.bad { --pb: #6a2a2a; color: #ff8a7a; }
.toast.good { --pb: #3a4458; }
.toast.out { animation: toast-out 0.2s ease-in both; }
.toast.bump { animation: toast-bump 0.18s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes toast-bump { 50% { transform: scale(1.05); } }

.labels { position: absolute; inset: 0; }
.wl { position: absolute; left: 0; top: 0; white-space: nowrap; font-weight: 650; font-size: 0.92em; color: var(--text); will-change: transform, opacity;
  text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000, 0 2px 0 #000a; }
.wl.good, .wl.ore { color: #fff2b0; }
.wl.cash { color: var(--cash); }
.wl.warn { color: var(--warn); }
.wl.bad { color: #ff7a6a; }
.wl.quiet { color: #c8d0dc; font-weight: 500; }
.wl.data { color: var(--data); }

.title { position: absolute; left: 0; right: 0; top: 24%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0 12px;
  background: rgba(10, 12, 18, 0.25); opacity: 0; transition: opacity 0.6s; }
.title.on { opacity: 1; transition: opacity 0.4s; }
.title .tn { font-size: 18px; font-weight: 650; letter-spacing: 0.2em; font-variant: small-caps; text-transform: lowercase; text-shadow: 0 1px 0 #000, 0 0 12px #0008; }
.title .tl { height: 1px; width: 0; background: #e8ecf4aa; }
.title.on .tl { width: 180px; transition: width 1.6s var(--ease); }
.title .ts { font-size: 0.9em; color: var(--quiet); letter-spacing: 0.08em; }
@media (min-height: 700px) { .title.on .tl { width: 280px; } }

.lines { position: absolute; left: 50%; bottom: calc(var(--m) + 92px); transform: translateX(-50%); width: min(560px, 80vw); display: flex; justify-content: center; }
.line { position: absolute; bottom: 0; max-width: 100%; text-align: center; padding: 4px 12px; background: rgba(10, 12, 18, 0.55); color: #dfe4ee;
  opacity: 0; transform: translateY(4px); transition: opacity 0.4s, transform 0.4s var(--ease); text-shadow: 0 1px 0 #000; }
.line.on { opacity: 1; transform: none; }
.line .who { color: var(--accent); font-weight: 650; margin-right: 0.5em; }

.prompt { --pf: rgba(12, 15, 22, 0.9); position: absolute; left: 50%; bottom: calc(var(--m) + 44px); transform: translate(-50%, 6px); opacity: 0;
  padding: 7px 14px; text-align: center; transition: opacity 0.15s, transform 0.15s var(--ease); min-width: 220px; }
.prompt.on { opacity: 1; transform: translate(-50%, 0); }
.prompt[data-tone="bad"] { --pb: #6a2a2a; }
.prompt[data-tone="warn"] { --pb: #6a4a2a; }
.prompt[data-tone="good"] { --pb: #6a5a2a; }
.prompt[data-tone="good"] .pt { color: var(--accent); }
.prompt[data-tone="quiet"] .pt { color: var(--quiet); font-size: 0.95em; }
.prompt .pt { font-weight: 650; font-size: 1.08em; }
.prompt[data-tone="bad"] .pt { color: #ff8a7a; }
.prompt[data-tone="warn"] .pt { color: var(--warn); }
.prompt .ps { color: var(--quiet); margin-top: 2px; font-size: 0.92em; }
.prompt .ps:empty { display: none; }
.prompt .chan { width: 100%; margin-top: 6px; }
.prompt .chan.off { display: none; }
kbd { display: inline-block; min-width: 1.5em; padding: 0 4px; margin: 0 3px 0 0; font: 650 0.85em/1.45 inherit; font-family: inherit; text-align: center; color: var(--text);
  background: #1c2230; border: 1px solid #3a4458; border-bottom-width: 2px; }

.launch { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 18vh; gap: 6px; opacity: 0; transition: opacity 0.8s; }
.launch.on { opacity: 1; }
.launch .lb canvas { display: block; }
.launch .lb.in { animation: rise 0.5s var(--ease); }
.launch .ls { color: #dfe4ee; text-shadow: 0 1px 0 #000; }
.launch .lsh { display: flex; align-items: center; gap: 8px; font-size: 1.6em; font-weight: 650; color: #e0ccff; text-shadow: 0 2px 0 #000; padding: 4px 16px; background: rgba(8, 10, 16, 0.62); }
.launch .lsh:empty { display: none; }
.launch .lb:not(:empty), .launch .ls:not(:empty) { padding: 2px 14px; background: rgba(8, 10, 16, 0.5); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); letter-spacing: 0.3em; } }

.dimmer { position: absolute; inset: 0; background: #04060a; opacity: 0; }

/* ---------------------------------------------------------------- screens */
.screens { position: absolute; inset: 0; display: grid; place-items: center; }
.screens.on > * { pointer-events: auto; }
.scrim { position: absolute; inset: 0; }
.screens:not(.on) .scrim { pointer-events: none; }
.scrwrap { grid-area: 1 / 1; opacity: 0; transform: translateY(6px) scale(0.985); transition: opacity 0.14s, transform 0.16s var(--ease); z-index: 1; }
.scrwrap.in { opacity: 1; transform: none; }
.scrwrap.out { opacity: 0; transform: translateY(4px) scale(0.99); transition: opacity 0.1s, transform 0.12s; }

.scr {
  --pf: #0c0f16;
  display: flex; flex-direction: column;
  width: min(640px, calc(100vw - 24px)); height: min(360px, calc(100vh - 20px));
}
.scr.card { width: min(420px, calc(100vw - 24px)); height: auto; max-height: min(360px, calc(100vh - 20px)); }
@media (min-height: 700px) and (min-width: 1000px) {
  /* at large sizes the content grows (bigger type, bigger grids) and the panel fits it instead of leaving a third empty */
  .scr { font-size: 1.08em; }
  .scr.std { width: 820px; height: auto; min-height: 380px; max-height: min(680px, calc(100vh - 60px)); }
  .scr.wide { width: min(1040px, calc(100vw - 80px)); height: auto; min-height: 440px; max-height: min(700px, calc(100vh - 60px)); }
  .scr.card { width: 520px; max-height: 640px; }
  .scr .row { min-height: 2.3em; }
}
/* Panels in the world's language: a steel plate header with rivets and the building's accent along its foot. */
.scr { --acc: #9aa4b4; --pb: #3a4458; }
.scr.s-workshop { --acc: #d8a030; }
.scr.s-lab { --acc: #7fe8ff; }
.scr.s-rigs { --acc: #c8a060; }
.scr.s-launch { --acc: #c9a0ff; }
.scr.s-supply { --acc: #e0604a; }
.scr.s-market { --acc: #e0c040; }
.scr.s-fuel { --acc: #ffb35c; }
.scr.s-log, .scr.s-achievements { --acc: #b08a5a; }
.scr .head {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 16px 7px; min-height: 2.5em;
  background: linear-gradient(#ffffff0c, #ffffff0c) 0 0 / 100% 1px no-repeat, #151a24;
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--acc) 55%, #000), inset 0 -3px 0 #000;
}
.scr .head .rv { position: absolute; top: 50%; width: 3px; height: 3px; margin-top: -2px; background: #6a7488; box-shadow: 0 0 0 1px #05070a, 1px 1px 0 1px #ffffff18; }
.scr .head .rv.l { left: 5px; }
.scr .head .rv.r { right: 5px; }
.scr .ttl canvas { display: block; }
.scr .ttl { white-space: nowrap; display: flex; align-items: center; }
.scr .who { flex: 1; min-width: 0; color: var(--quiet); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.92em; padding-left: 6px; }
.scr .who .nm { color: var(--accent); font-weight: 650; margin-right: 0.45em; }
.scr.card .head { flex-wrap: wrap; row-gap: 2px; }
.scr.card .who { order: 3; flex-basis: 100%; padding-left: 0; white-space: normal; }
.scr.card .who:empty { display: none; }
.scr .bal { display: flex; gap: 12px; font-weight: 650; }
.scr .bi { display: flex; align-items: center; gap: 4px; }
.scr .tabs { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--border); }
.scr .tabs.off { display: none; }
.scr .tab { background: none; border: 0; padding: 5px 10px 4px; color: var(--quiet); cursor: pointer; position: relative; font-weight: 650; }
.scr .tab:hover { color: var(--text); }
.scr .tab.on { color: var(--text); }
.scr .tab.on::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -1px; height: 2px; background: var(--acc, var(--accent)); }
.scr .body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; padding: 6px 8px; }
.scr .body > * { flex: 1; min-height: 0; }
.scr .body.swap > * { animation: swap 0.16s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateX(6px); } }
.scr .foot { display: flex; align-items: center; gap: 10px; padding: 5px 10px 6px; border-top: 1px solid #ffffff0a; min-height: 2em; font-size: 0.85em; }
.scr .hints { display: flex; gap: 12px; color: var(--quiet); white-space: nowrap; overflow: hidden; }
.scr .hint { display: flex; align-items: center; }
.scr .foot .status { margin-left: auto; color: var(--quiet); opacity: 0; transition: opacity 0.2s; white-space: nowrap; font-weight: 650; }
.scr .foot .status.in { opacity: 1; }
.scr .foot .status.bad { color: #ff8a7a; }

.scroll { overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #3a4458 transparent; }
/* scrolled lists fade at their edges so a half row never reads as a stray fragment */
.pgrid, .lgrid, .agrid, .cards, .list.scroll { -webkit-mask-image: linear-gradient(transparent, #000 10px, #000 calc(100% - 10px), transparent); mask-image: linear-gradient(transparent, #000 10px, #000 calc(100% - 10px), transparent); padding-top: 4px; padding-bottom: 6px; }
.lead { margin: 2px 2px 6px; }
.sh2 { font-size: 0.78em; letter-spacing: 0.12em; text-transform: uppercase; color: var(--quiet); margin: 2px 0 4px; font-weight: 650; }
.tag { display: inline-block; font-size: 0.76em; line-height: 1.5; padding: 0 5px; border: 1px solid #3a4458; color: var(--quiet); margin-left: 4px; white-space: nowrap; font-weight: 650; letter-spacing: 0.02em; }
.tag.gate { border-color: #6a5a2a; color: var(--accent); }
.tag.tier { border-color: #2a5a6a; color: var(--data); }

/* rows: the common selectable line */
.list { display: flex; flex-direction: column; gap: 2px; }
.row {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 2.05em; padding: 2px 8px 2px 8px;
  background: var(--row); border: 1px solid transparent; cursor: pointer; transition: background 0.08s, border-color 0.08s;
}
.row::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px; background: var(--accent); transform: scaleY(0); transition: transform 0.12s var(--ease); }
.row.sel { background: #ffffff0d; border-color: #3a4458; }
.row.sel::before { transform: none; }
.row .k { width: 0.8em; font-size: 0.8em; text-align: center; flex: none; }
.row .nm { white-space: nowrap; font-weight: 650; }
.row .fx { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .arr { color: var(--dim); }
.row .nx { color: var(--text); }
.row .tags { flex: none; display: flex; }
.row .buy { flex: none; min-width: 6.6em; display: flex; justify-content: flex-end; white-space: nowrap; }
.deny { animation: deny 0.24s steps(6) !important; border-color: var(--bad) !important; }
@keyframes deny { 0%, 33%, 66% { transform: translateX(-2px); } 16%, 50%, 83% { transform: translateX(2px); } 100% { transform: none; } }

.price { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.15; font-weight: 650; }
.price .p { display: inline-flex; align-items: center; gap: 3px; }
.price.ok { flex-direction: row; align-items: center; gap: 3px; padding: 1px 7px; color: #1a1406; background: var(--accent); box-shadow: inset 0 1px 0 #fff8, inset 0 -1px 0 #0003; }
.price.ok.data { background: var(--data); color: #06161a; }
.price.ok.shard { background: var(--shard); color: #14081e; }
.row.sel .price.ok { background: #ffe8a8; }
.price.short { color: var(--quiet); }
.price.short .more { font-size: 0.78em; font-weight: 500; color: var(--dim); }
.price.max { color: var(--dim); font-weight: 650; font-size: 0.92em; }
.price.max.good { color: var(--good); }

.pips { display: inline-flex; gap: 1px; width: calc(21 * 4px); flex: none; }
.pips i { width: 3px; height: 8px; background: #252c3a; }
.pips i.on { background: #c8d0dc; }
.pips i.next { background: #4a5466; }
.row.sel .pips i.next { background: var(--accent); animation: blink 1s steps(2) infinite; }
.pips i.gate { box-shadow: 0 -2px 0 var(--accent); }
.pips i.on:last-of-type { transition: background 0.15s; }
@keyframes blink { 50% { opacity: 0.35; } }
@media (min-height: 700px) { .pips { width: calc(21 * 5px); } .pips i { width: 4px; height: 10px; } }

.btn { --pf: #1a2030; border: 1px solid #3a4458; background: #1a2030; padding: 5px 14px; font-weight: 650; cursor: pointer; }
.btn.sel, .btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #1a1406; border-color: var(--accent); }
.btn.primary.sel { background: #ffe8a8; box-shadow: 0 0 0 1px #fff4; }
.btn.danger { color: #ff8a7a; }
.btn.danger.sel { background: #3a1818; border-color: var(--bad); }
.btn.wide { width: 100%; margin-top: 10px; padding: 7px; }

.confirm { position: absolute; inset: 0; display: grid; place-items: center; background: #04060acc; z-index: 5; animation: fade 0.12s; }
.confirm .cbox { --pf: #0c0f16; padding: 14px 16px; max-width: 360px; }
.confirm .ct { margin-bottom: 12px; line-height: 1.45; }
.confirm .cb { display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }

/* ---------------------------------------------------------------- workshop */
.split { display: flex; gap: 8px; }
.split .side { display: none; }
.split .list { flex: 1; }
.up .nm { width: 6.6em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up .lv { font-weight: 500; }
.up.dis .nm, .up.dis .fx { opacity: 0.75; }
.up.maxed .pips i.on { background: var(--good); }
.liftcol { display: inline-flex; gap: 2px; width: calc(21 * 4px); flex: none; }
.liftcol i { width: 10px; height: 8px; border: 1px solid #3a4458; }
.liftcol i.built { background: var(--bc); border-color: var(--bc); box-shadow: inset 0 1px 0 #fff6; }
.liftcol i.next { border: 1px dashed var(--accent); }
.row.lift { margin-top: 4px; }
@media (min-height: 700px) and (min-width: 1000px) {
  .liftcol { width: calc(21 * 5px); }
  .liftcol i { width: 13px; height: 10px; }
  .split .side { display: block; width: 210px; flex: none; }
  .detail { display: flex; flex-direction: column; gap: 6px; padding: 4px; }
  .podview { height: 190px; display: grid; place-items: center; background: #ffffff05; border: 1px solid #ffffff0a; margin-bottom: 4px; }
  .split .side { width: 250px; }
  .stepbar { position: relative; height: 8px; background: #252c3a; box-shadow: 0 0 0 1px #00000080; }
  .stepbar .now { position: absolute; left: 0; top: 0; bottom: 0; background: #c8d0dc; box-shadow: inset 0 1px 0 #fff8; }
  .stepbar .add { position: absolute; top: 0; bottom: 0; background: var(--accent); animation: blink 1s steps(2) infinite; }
  .detail .cmp { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; background: #ffffff05; }
  .detail .cmp > div { display: flex; flex-direction: column; line-height: 1.35; }
  .detail .cmp .q { font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.08em; }
  .detail .cmp .nx > span:last-child { color: var(--accent); font-weight: 650; }
  .detail .dt { font-weight: 650; font-size: 1.1em; }
  .detail .dd { line-height: 1.4; }
  .detail .tier { color: var(--data); }
  .detail .gate { color: var(--accent); }
}
.mods { display: flex; flex-direction: column; gap: 6px; }
.mh { font-size: 0.9em; flex: none; }
.socks { display: flex; gap: 6px; flex: none; }
.sock { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 4px; border: 1px dashed #3a4458; cursor: pointer; transition: border-color 0.1s, background 0.1s; }
.sock.full { border-style: solid; background: #ffffff08; }
.sock .empty { width: 27px; height: 27px; border: 1px dashed #2a3242; }
.sock .sk { font-size: 0.78em; }
.sock .sn { font-size: 0.88em; font-weight: 650; white-space: nowrap; }
.sock.sel { border-color: var(--accent); background: #ffd87010; }
.sock.lockedslot { opacity: 0.55; cursor: default; }
.cards { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 5px; align-content: start; }
.mcard { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 7px; align-items: center; padding: 5px 6px; background: var(--row); border: 1px solid transparent; cursor: pointer; transition: border-color 0.1s, background 0.1s; }
.mcard .mi { grid-row: 1 / 3; }
.mcard .mt { font-weight: 650; font-size: 0.95em; line-height: 1.2; padding-right: 1.4em; }
.mcard .mx { font-size: 0.8em; line-height: 1.25; }
.mcard { align-items: start; }
.mcard .mi { align-self: center; }
.mcard .mslot { position: absolute; right: 0; top: 0; min-width: 1.4em; text-align: center; font-size: 0.75em; font-weight: 650; color: #06140c; background: var(--good); line-height: 1.4; }
.mcard.on { border-color: #2a5a3a; background: #5ad88a0c; }
.mcard.sel { border-color: var(--accent); background: #ffffff0d; }
.mcard.locked .mt { color: var(--quiet); }
@media (min-height: 700px) { .cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; } .mcard { padding: 8px; } }
.mcard .mp { grid-column: 2; justify-self: start; margin-top: 2px; }
.mcard.sale, .mcard.owned { grid-template-rows: auto auto auto; }
.mcard .mp.good { font-size: 0.82em; font-weight: 650; }
.mcard .mp .q { font-size: 0.8em; }

/* ---------------------------------------------------------------- supply */
.items { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 6px; }
.item { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 6px 8px 6px; background: var(--row); border: 1px solid transparent; cursor: pointer; transition: border-color 0.1s, background 0.1s; }
.item .k { position: absolute; left: 6px; top: 4px; font-size: 0.8em; }
.item .ii { height: 34px; display: grid; place-items: center; }
.item .it { font-weight: 650; }
.item .ix { font-size: 0.82em; line-height: 1.25; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .ib { display: flex; width: 100%; justify-content: space-between; align-items: flex-end; }
.item .carry { display: flex; gap: 2px; margin: 2px 0 4px; }
.item .carry i { width: 6px; height: 6px; border: 1px solid #4a5466; }
.item .carry i.on { background: var(--text); border-color: var(--text); }
.item .own { font-weight: 650; }
.item.sel { border-color: var(--accent); background: #ffffff0d; }
.item.locked { opacity: 0.6; }
@media (min-height: 700px) { .item .ii { height: 48px; } }

/* ---------------------------------------------------------------- rigs */
.rigwrap { display: flex; flex-direction: column; gap: 8px; }
.rigs { flex: 1; }
.rig .nm { width: 8.4em; overflow: hidden; text-overflow: ellipsis; }
.rig .pips { width: calc(10 * 4px); }
.rig .out { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rig .ob { width: 54px; height: 6px; background: #252c3a; position: relative; overflow: hidden; flex: none; }
.rig .ob i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: #c8a070; transform-origin: 0 0; box-shadow: inset 0 1px 0 #fff5; }
.rig .ob.run i { animation: mine var(--d, 2s) linear infinite; }
.rig .ob.full i { background: var(--warn); }
.rig .ob.stop i { background: #4a5466; transform: scaleX(0.2); }
@keyframes mine { from { transform: scaleX(0); } 92% { transform: scaleX(1); opacity: 1; } to { transform: scaleX(1); opacity: 0; } }
.rig .st { width: 5.4em; font-size: 0.88em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rig.unbuilt .nm { color: var(--quiet); }
@keyframes flow { to { background-position: 9px 0; } }
.silo { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); flex: none; }
.silo .bar.wide { width: auto; flex: 1; }
@media (min-height: 700px) { .rig .pips { width: calc(10 * 5px); } .rig .ob { width: 90px; } }

/* ---------------------------------------------------------------- market and fuel */
.marketwrap { display: flex; flex-direction: column; gap: 5px; }
.marketwrap > .orders, .marketwrap > .today, .marketwrap > .sh2 { flex: none; }
.today { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.today .sh2 { margin: 0; }
.today .mk { display: inline-flex; align-items: center; gap: 5px; }
.today .mult { color: var(--cash); font-weight: 650; }
.pgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 6px; align-content: start; }
.pr { display: flex; align-items: center; gap: 7px; padding: 2px 6px; border: 1px solid transparent; background: var(--row); }
.pr .nm { flex: 1; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr.sel { border-color: #3a4458; background: #ffffff0d; }
.pr.boost { background: #e0c04012; }
.board .mk { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.board .mult { color: var(--cash); font-weight: 650; }
.orders .oh { display: flex; align-items: center; gap: 5px; font-size: 0.82em; color: var(--quiet); margin-bottom: 2px; }
.ord { display: flex; align-items: center; gap: 7px; padding: 3px 6px; background: var(--row); border: 1px solid transparent; transition: background 0.3s; }
.ord .ot { flex: 1; min-width: 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ord .ob { color: var(--accent); font-weight: 650; white-space: nowrap; }
.ord.done { background: #5ad88a18; border-color: #2a5a3a; animation: met 0.5s 2; }
.ord.done .ob { color: var(--good); }
.ord.sel { border-color: #3a4458; }
.orders.big { display: flex; flex-direction: column; gap: 3px; }
@keyframes met { 50% { background: #5ad88a40; } }
.svc .row { min-height: 2.3em; }
.tg .sw { width: 26px; height: 14px; border: 1px solid #3a4458; background: #1a2030; position: relative; flex: none; transition: background 0.15s; }
.tg .sw i { position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; background: var(--quiet); transition: transform 0.15s var(--ease), background 0.15s; }
.tg.on .sw { background: #1e3a2a; border-color: #2a6a42; }
.tg.on .sw i { transform: translateX(12px); background: var(--good); }
.svc .tg .nm { width: 7.5em; }

/* ---------------------------------------------------------------- lab */
.labwrap { display: flex; flex-direction: column; gap: 6px; }
.labrow { display: flex; align-items: center; gap: 8px; padding: 3px 8px; background: var(--row); border: 1px solid transparent; cursor: pointer; flex: none; }
.labrow > span:nth-child(2) { flex: 1; }
.labrow.sel { border-color: #3a4458; background: #ffffff0d; }
.labmain { flex: 1; min-height: 0; display: flex; gap: 8px; }
.graphwrap { flex: 1; min-width: 0; overflow: auto; padding: 4px 2px; }
.graph { position: relative; margin: auto 0; }
.links { position: absolute; left: 0; top: 0; overflow: visible; }
.links path { fill: none; stroke: #2a3242; stroke-width: 1; shape-rendering: crispEdges; }
.links path.lit { stroke: #ffd87080; }
.links path.done { stroke: #7fe8ff90; }
.branch { position: absolute; left: 0; display: flex; align-items: center; justify-content: flex-end; font-size: 0.74em; letter-spacing: 0.04em; color: var(--quiet); text-transform: uppercase; font-weight: 650; }
.node { position: absolute; display: grid; place-items: center; border: 1px solid #2a3242; background: #10141c; cursor: pointer; transition: transform 0.1s var(--ease), border-color 0.1s, box-shadow 0.1s; }
/* done is filled, buyable is outlined, open-but-short is a dim outline, locked is dim */
.node.bought { border-color: #7fe8ff; background: #1f6070; box-shadow: inset 0 1px 0 #ffffff40, inset 0 -2px 0 #0003; }
.node.open { border: 1px dashed #6a5a2a; background: #0c0f16; }
.node.open.can { border: 2px solid var(--accent); background: #0c0f16; }
.node.open.can::after { content: ""; position: absolute; inset: -4px; border: 1px solid #ffd87055; animation: breathe 1.6s ease-in-out infinite; }
.node.locked { opacity: 0.55; }
.node.locked .ic:not(.lk .ic) { filter: grayscale(1) brightness(0.7); }
.node .lk, .node .ok { position: absolute; right: -4px; bottom: -4px; }

@keyframes breathe { 50% { opacity: 0.2; } }
.labmain > .side { width: 190px; flex: none; border-left: 1px solid #ffffff0a; padding-left: 8px; }
.ndetail { display: flex; flex-direction: column; gap: 5px; }
.ndetail .nt { font-weight: 650; font-size: 1.08em; }
.ndetail .nb { font-size: 0.82em; text-transform: uppercase; letter-spacing: 0.08em; }
.ndetail .nx { line-height: 1.4; }
.ndetail .nm { display: flex; align-items: center; gap: 4px; color: var(--data); }
.ndetail .nn { font-size: 0.9em; display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.ndetail .nh { font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.08em; }
.ndetail .need { display: flex; align-items: center; gap: 6px; color: var(--quiet); }
.ndetail .need.met { color: var(--good); }
.ndetail .nart { display: grid; place-items: center; height: 64px; background: #ffffff05; border: 1px solid #ffffff0a; margin-bottom: 4px; }
.ndetail .nart.bought { border-color: #2a5a6a; background: #7fe8ff0a; }
.ndetail .nart.locked .ic { filter: grayscale(1) brightness(0.6); }
@media (min-height: 700px) { .ndetail .nart { height: 120px; } }
@media (min-height: 700px) { .labmain > .side { width: 230px; } }

/* ---------------------------------------------------------------- launch site */
.launchwrap { display: grid; grid-template-columns: 0.8fr 1.3fr 1fr; gap: 12px; }
.lcol, .mcol, .rcol { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.planet { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 6px; }
.planet .pn2 { font-weight: 650; font-size: 1.1em; letter-spacing: 0.12em; text-transform: uppercase; }
.parts { display: flex; flex-direction: column; gap: 2px; }
.part.owned .nm { color: var(--good); }
.part .nm { flex: 1; }
.hearts .hrow { display: flex; gap: 4px; margin-bottom: 2px; }
.hearts .hs.have { animation: beat 2s ease-in-out infinite; }
@keyframes beat { 10% { transform: scale(1.12); } 20% { transform: none; } }
.ready { font-weight: 650; line-height: 1.35; }
.shbig { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border: 1px solid #ffffff0a; background: #c9a0ff0a; }
.shbig .sv { display: flex; align-items: center; gap: 8px; font-size: 2.2em; font-weight: 650; line-height: 1.1; }
.keeps { display: flex; flex-direction: column; gap: 2px; font-size: 0.9em; }
.keeps .ck { display: flex; align-items: center; gap: 5px; }
.perks .perk .nm { width: 9.6em; overflow: hidden; text-overflow: ellipsis; }
.perks .pips { width: calc(10 * 4px); }
.closed { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--quiet); }
.worldwrap { display: flex; flex-direction: column; }
.worlds { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.world { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 8px; background: var(--row); border: 1px solid transparent; cursor: pointer; transition: border-color 0.1s, background 0.1s; }
.world .wn { font-weight: 650; font-size: 1.1em; letter-spacing: 0.1em; text-transform: uppercase; }
.world .wt { font-size: 0.88em; line-height: 1.3; }
.world .wm { font-size: 0.86em; color: var(--accent); line-height: 1.35; }
.world.sel { border-color: var(--accent); background: #ffffff0d; }

/* ---------------------------------------------------------------- log, achievements */
.logwrap { display: flex; gap: 10px; }
.lmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lhead { display: flex; justify-content: space-between; gap: 8px; font-size: 0.92em; flex: none; }
.lgrid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4em, 1fr)); gap: 4px; align-content: start; }
.lcell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; aspect-ratio: 1; background: #ffffff05; border: 1px solid transparent; cursor: pointer; }
.lcell .ln { font-size: 0.66em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; color: var(--quiet); }
.lcell.tinted { background: color-mix(in srgb, var(--bt) 9%, #0c0f16); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--bt) 45%, transparent); }
.lcell .qm { position: absolute; right: 4px; top: 2px; font-size: 0.8em; font-weight: 650; color: #6a7488; }
.lcell.sel { border-color: var(--accent); background: #ffffff0d; }
.logwrap > .side { width: 200px; flex: none; border-left: 1px solid #ffffff0a; padding-left: 10px; }
.ldetail { display: flex; flex-direction: column; gap: 6px; }
.ldetail .lt { font-weight: 650; font-size: 1.08em; }
.ldetail .lx { line-height: 1.45; }
.ldetail .lf { font-size: 0.88em; }
@media (min-height: 700px) { .logwrap > .side { width: 260px; } .lgrid { grid-template-columns: repeat(auto-fill, minmax(6.2em, 1fr)); } }
.achwrap { display: flex; flex-direction: column; gap: 6px; }
.agrid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px; align-content: start; }
.ach { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 5px 7px; background: var(--row); border: 1px solid transparent; }
.ach .ic { grid-row: 1 / 4; }
.ach .an { font-weight: 650; }
.ach .ax { font-size: 0.85em; line-height: 1.25; }
.ach .ar { font-size: 0.8em; color: var(--dim); }
.ach.done .ar { color: var(--data); }
.ach:not(.done) .an { color: var(--quiet); }
.ach.sel { border-color: #3a4458; background: #ffffff0d; }

/* ---------------------------------------------------------------- settings, offline, cargo, pause */
.settings .row { min-height: 2.3em; }
.settings .row .nm { width: 6em; }
.slider { flex: 1; display: flex; align-items: center; gap: 10px; }
.slider .track { position: relative; flex: 1; height: 6px; background: #252c3a; cursor: pointer; }
.slider .track::before { content: ""; position: absolute; inset: -8px 0; }
.slider .sfill { position: absolute; left: 0; top: 0; bottom: 0; background: #c8d0dc; transition: width 0.08s; }
.slider .knob { position: absolute; top: 50%; width: 8px; height: 14px; margin: -7px 0 0 -4px; background: var(--text); box-shadow: 0 0 0 1px #000; transition: left 0.08s; }
.slider .sv { width: 2em; text-align: right; color: var(--quiet); }
.row.sel .slider .sfill, .row.sel .slider .knob { background: var(--accent); }
.set.muted .slider { opacity: 0.4; }
.sep { height: 8px; }
.reset .nm { width: 6em; }
.away { display: flex; flex-direction: column; gap: 7px; padding: 4px 4px 0; }
.away .ar { display: flex; align-items: center; gap: 8px; }
.away .ar > span:nth-child(2) { flex: 1; }
.away .ah { line-height: 1.4; font-size: 0.92em; }
.offwrap { padding: 2px 4px 4px; }
.cargowrap { display: flex; flex-direction: column; gap: 6px; }
.cargo .crow .nm { flex: 1; }
.cargo .crow .n { width: 4.6em; text-align: right; }
.cargo .crow .cnt { width: 2.6em; }
.dump { background: #1a2030; border: 1px solid #3a4458; padding: 0 7px; font-size: 0.82em; cursor: pointer; color: var(--quiet); }
.dump:hover, .row.sel .dump { color: var(--text); border-color: var(--bad); }
.ctot { display: flex; justify-content: space-between; gap: 10px; padding: 5px 8px; border-top: 1px solid var(--border); flex: none; }
.cargowrap .empty { padding: 14px; text-align: center; }
.pausewrap { display: flex; gap: 14px; }
.menu { display: flex; flex-direction: column; gap: 2px; width: 13em; flex: none; }
.menu .row { min-height: 2.3em; }
.keys { flex: 1; display: grid; grid-template-columns: auto 1fr; align-content: start; gap: 3px 6px; font-size: 0.86em; }
.keys .kr { display: contents; }
.keys kbd { justify-self: end; }

/* ---------------------------------------------------------------- the depot card */
.depot { position: absolute; left: var(--m); top: calc(var(--m) + 50px); bottom: var(--m); width: min(300px, 44vw); display: flex; flex-direction: column; justify-content: flex-start;
  opacity: 0; transform: translateX(-10px); transition: opacity 0.18s, transform 0.22s var(--ease); pointer-events: none; }
.depot.on { opacity: 1; transform: none; }
.depot.out { opacity: 0; transform: translateX(-6px); transition: opacity 0.14s, transform 0.14s; }
.dcard { --pf: rgba(12, 15, 22, 0.96); padding: 5px 8px 6px; display: flex; flex-direction: column; gap: 2px; max-height: 100%; overflow: hidden; }
.dhead { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.85em; }
.dhead .t { font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--quiet); }
.tally { display: grid; grid-template-columns: 1fr; gap: 1px; }
.tally.two { grid-template-columns: 1fr 1fr; column-gap: 8px; }
.srow { display: flex; align-items: center; gap: 5px; line-height: 1.15; min-height: 1.3em; opacity: 0; transform: translateX(-4px); transition: opacity 0.08s, transform 0.12s var(--ease); white-space: nowrap; }
.srow.in { opacity: 1; transform: none; }
.srow .nm { overflow: hidden; text-overflow: ellipsis; }
.srow .x { font-size: 0.88em; }
.srow .val { margin-left: auto; font-weight: 650; }
.srow .new { font-size: 0.72em; color: #06161a; background: var(--data); padding: 0 4px; font-weight: 650; animation: stamp 0.3s var(--ease); }
.srow.costs { font-size: 0.86em; }
.srow.empty { opacity: 1; transform: none; }
@keyframes stamp { from { transform: scale(1.6) rotate(-6deg); opacity: 0; } }
.tally.two { column-gap: 14px; }
.total { display: flex; align-items: center; gap: 5px; font-size: 1.3em; line-height: 1.2; font-weight: 650; color: var(--cash); padding-top: 3px; border-top: 1px solid #ffffff10; margin-top: 2px; }
.total .plus { color: var(--cash); }
.total.land { animation: land 0.3s var(--ease); }
.total .best { font-size: 0.6em; color: #1a1406; background: var(--cash); padding: 0 5px; margin-left: auto; letter-spacing: 0.04em; }
@keyframes land { 40% { transform: scale(1.06); } }
.summary { font-size: 0.86em; }
.lower { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.sug { display: flex; gap: 8px; align-items: center; padding: 3px 7px; border: 1px solid #3a4458; background: #ffffff06; }
.sug.can { border-color: #6a5a2a; background: #ffd8700c; }
.sug .sl { flex: 1; min-width: 0; }
.sug .sx { font-size: 0.9em; line-height: 1.3; }
.sug .sn { font-size: 0.84em; }
.sug .sb { flex: none; font-weight: 650; }
.sug .key { display: flex; align-items: center; color: var(--accent); }
.next { position: relative; padding: 3px 7px; border: 1px solid var(--border); overflow: hidden; font-size: 0.88em; }
.next .nf { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: #ffd87018; transform-origin: 0 0; transition: transform 0.5s var(--ease); }
.next .nt { position: relative; line-height: 1.35; }
.next .gate { color: var(--quiet); }
.next .gate.met { color: var(--good); }
.next.open { border-color: #2a5a3a; }
.next.open .nf { background: #5ad88a18; }
.lower .orders { display: flex; flex-direction: column; gap: 2px; }
.lower .ord { padding: 2px 5px; font-size: 0.9em; }
.market { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.86em; align-items: center; }
.market .mk { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.coin { position: absolute; z-index: 20; pointer-events: none; }
@media (min-height: 700px) { .depot { width: 380px; } }
.hud.town .hotbar { opacity: 0; transform: translate(-50%, 8px); }

/* town: the dock card takes the left; the dive cluster steps aside and toasts move right of the card */
.ui.depot-on .hud .status { opacity: 0; }
.ui.depot-on .hud .tl { transform: scale(0.72); transform-origin: 0 0; }
.ui.depot-on .depot { top: calc(var(--m) + 34px); }
@media (min-height: 700px) { .ui.depot-on .hud .tl { transform: none; } .ui.depot-on .depot { top: calc(var(--m) + 72px); } }
.ui.depot-on .hud .goal { opacity: 0; }
/* under a modal at small sizes the panel's header carries the money: the HUD numbers step aside so nothing doubles */
.ui.modal .hud .tl, .ui.modal .hud .tr, .ui.modal .hud .hotbar { opacity: 0; }
.ui.depot-on .toasts { left: calc(50% + min(150px, 22vw)); }
@media (min-height: 700px) { .ui.depot-on .toasts { left: 50%; } }

/* ---------------------------------------------------------------- onboarding */
.intro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; padding-top: 4vh; pointer-events: none; opacity: 0; transition: opacity 0.7s; }
.intro.on { opacity: 1; pointer-events: auto; cursor: pointer; }
.intro .in-logo { filter: drop-shadow(0 3px 0 #00000055); animation: logo-in 1.2s var(--ease) both; }
.intro .in-logo canvas { display: block; image-rendering: pixelated; }
.intro .in-key { font-size: 0.95em; font-weight: 650; color: #fff8e8; letter-spacing: 0.14em; text-transform: uppercase; text-shadow: 0 1px 0 #000, 0 0 6px #000a, 0 0 2px #000; animation: breathe-text 2.4s ease-in-out infinite; }
@keyframes logo-in { from { opacity: 0; transform: translateY(-14px); } }
@keyframes breathe-text { 50% { opacity: 0.45; } }
.ui.intro-on .hud { opacity: 0; }

.hintbar { --pf: rgba(12, 15, 22, 0.82); --pb: #3a4458; font-weight: 500; color: #dfe4ee; padding: 6px 14px; min-width: 0; white-space: nowrap; }
.hintbar kbd { margin: 0 2px; }
@media (min-height: 700px) { .hintbar { font-size: 1.1em; padding: 8px 18px; } }
@media (min-height: 700px) { .pgrid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } }

.ptext { image-rendering: pixelated; vertical-align: middle; }
.hud .readout .r canvas, .total canvas { display: block; }

.hintbar.above { bottom: auto; transform: translate(-50%, -100%); }
.hintbar.above.on { transform: translate(-50%, -100%); }
.shaftarrow { position: absolute; left: 0; top: 0; width: 14px; height: 18px; margin: -18px 0 0 -7px; opacity: 0; pointer-events: none; transition: opacity 0.3s;
  background: linear-gradient(var(--accent), var(--accent)) 5px 0 / 4px 9px no-repeat; }
.shaftarrow::after { content: ""; position: absolute; left: 0; top: 9px; border: 7px solid transparent; border-top: 8px solid var(--accent); border-bottom: 0; filter: drop-shadow(0 1px 0 #000); }
.shaftarrow.on { opacity: 1; animation: bob 0.9s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 5px; } }
@media (min-height: 700px) { .intro .in-key { font-size: 1.25em; } .intro { gap: 18px; } }
@media (min-height: 700px) { .prompt { bottom: calc(var(--m) + 58px); } .lines { bottom: calc(var(--m) + 112px); } }

/* the "more below" cue sits in the panel foot, never over a row */
.scr .morecue { display: none; color: var(--accent); font-weight: 650; letter-spacing: 0.04em; white-space: nowrap; animation: bob 1.2s ease-in-out infinite; }
.scrwrap.more .morecue { display: block; }
.pgrid, .lgrid, .agrid, .cards { min-height: 0; }
/* perks: the text is what a player buys on; it wraps */
.perks .perk .fx { white-space: normal; line-height: 1.25; overflow: visible; }
/* lab: the selection is a white ring that pulses, louder than any node frame */
.node.sel { transform: scale(1.14); box-shadow: 0 0 0 2px #05070a, 0 0 0 4px #ffffff, 0 0 0 5px #05070a, 0 0 14px 4px #ffffff55; z-index: 2; animation: sel-pulse 1.1s ease-in-out infinite; }
@keyframes sel-pulse { 50% { box-shadow: 0 0 0 2px #05070a, 0 0 0 4px #ffffffaa, 0 0 0 5px #05070a, 0 0 8px 2px #ffffff22; } }
