/* Periodic Fleet web client. No images: layout, Unicode, Font Awesome symbols, SVG. */

:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-2: #0b1120;
  --surface: #0f1729;
  --surface-2: #142038;
  --surface-3: #1b2a48;
  --line: #22314f;
  --line-2: #2f4370;
  --text: #dbe5f7;
  --muted: #8b9cbb;
  --faint: #5d6d8c;
  --accent: #5ad1ff;
  --accent-2: #2aa7e0;
  --accent-ink: #04121c;
  --good: #5be3a2;
  --warn: #ffbf4d;
  --bad: #ff6b7a;
  --violet: #ab8cff;
  --radius: 14px;
  --radius-sm: 9px;
  --gap: 12px;
  --tabbar-h: 62px;
  --topbar-h: 50px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1px 1px at 12% 18%, #ffffff55 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 8%, #ffffff40 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 62%, #9fd8ff50 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 78%, #ffffff35 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 44%, #ffffff28 50%, transparent 51%),
    radial-gradient(900px 600px at 85% -10%, #12305a55, transparent 60%),
    radial-gradient(700px 500px at -10% 110%, #2a145055, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.noscript { padding: 24px; }

.ico { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -0.125em; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.hidden { display: none !important; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack.tight { gap: 6px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.small { font-size: 12.5px; }
.tiny { font-size: 11px; letter-spacing: .02em; }
.center { text-align: center; }

/* --- Shell ------------------------------------------------------------- */

.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  height: calc(var(--topbar-h) + var(--safe-t)); padding: var(--safe-t) 12px 0;
  background: linear-gradient(#070b14f2, #070b14d9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #ffffff0d;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 650; letter-spacing: .02em; }
/* The logo is a periodic-table tile for element 119, the next one nobody has made. */
.pf-tile {
  position: relative; display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 14px;
  border-radius: 16px; border: 1.5px solid #5ad1ffaa;
  background: radial-gradient(circle at 30% 20%, #5ad1ff33, transparent 60%), linear-gradient(160deg, #15304d, #0b1120);
  box-shadow: 0 0 30px #2aa7e033, inset 0 1px 0 #ffffff14;
}
.pf-tile i { position: absolute; top: 7px; left: 9px; font: 600 11px var(--mono); font-style: normal; color: var(--muted); }
.pf-tile b { font: 800 36px/1 var(--sans); color: var(--accent); letter-spacing: -.02em; text-shadow: 0 0 18px #5ad1ff66; }
.pf-tile span { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 8px; letter-spacing: .06em; color: var(--muted); }
.pf-tile.small { width: 30px; height: 30px; margin: 0; border-radius: 8px; box-shadow: none; }
.pf-tile.small i { top: 2px; left: 3px; font-size: 6px; }
.pf-tile.small b { font-size: 14px; text-shadow: none; }
.clock { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.sync { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); transition: background .3s; }
.sync.busy { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.sync.down { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--surface-2); color: var(--text); }
.icon-btn .ico { font-size: 18px; }

.resbar {
  position: sticky; top: calc(var(--topbar-h) + var(--safe-t)); z-index: 19;
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px;
  background: #070b14cc; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #ffffff08; scrollbar-width: none;
}
.resbar::-webkit-scrollbar { display: none; }
.resbar:empty { display: none; }

.view {
  flex: 1; width: 100%; max-width: 760px; margin: 0 auto;
  padding: 14px 12px calc(var(--tabbar-h) + var(--safe-b) + 24px);
  outline: none;
}
.view-title { display: flex; align-items: center; gap: 10px; margin: 2px 2px 12px; }
.view-title h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: .01em; }
.view-title .back { margin-left: -8px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
  background: linear-gradient(#0b1120e6, #070b14fa);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #ffffff10;
}
.tab {
  flex: 1 1 0; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .03em;
  position: relative;
}
.tab .ico { font-size: 20px; }
.tab.active { color: var(--accent); }
.tab.active::before {
  content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
.tab .badge {
  position: absolute; top: 7px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 10px; line-height: 16px; text-align: center;
}

@media (min-width: 1100px) {
  .view { max-width: 1000px; }
}
@media (min-width: 900px) {
  .app { padding-left: 92px; }
  .tabbar {
    top: 0; right: auto; width: 92px; height: 100%; flex-direction: column; justify-content: flex-start;
    padding: calc(var(--topbar-h) + 18px) 0 0; border-top: 0; border-right: 1px solid #ffffff10;
  }
  .tab { flex: 0 0 72px; max-width: none; }
  .tab.active::before { top: 18px; left: 0; width: 3px; height: 36px; border-radius: 0 3px 3px 0; }
  .view { padding-bottom: 40px; }
}

/* --- Cards and controls ------------------------------------------------ */

.card {
  background: linear-gradient(180deg, #ffffff06, #ffffff00 40%), var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; position: relative;
}
.card.flat { background: var(--bg-2); }
.card.glow { border-color: #2a6ea0; box-shadow: 0 0 0 1px #5ad1ff22, 0 8px 30px #2aa7e01a; }
.card.dim { opacity: .62; }
.card h2, .card h3 { margin: 0; }
.card h2 { font-size: 16px; font-weight: 650; }
.card h3 { font-size: 14.5px; font-weight: 650; }
.card .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-head { display: flex; align-items: flex-start; gap: 10px; }
.card-icon {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 11px; background: var(--surface-3); color: var(--accent);
}
.card-icon .ico { font-size: 17px; }
.card-icon.violet { color: var(--violet); }
.card-icon.warn { color: var(--warn); }
.card-icon.good { color: var(--good); }
.section-label {
  margin: 18px 4px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.list { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 14px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s;
  touch-action: manipulation;
}
.btn:hover { border-color: #3d5891; }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .icon-btn:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: linear-gradient(180deg, #6fdcff, #2fb0e8); border-color: #7fe2ff; color: var(--accent-ink); }
.btn.primary:hover { background: linear-gradient(180deg, #86e3ff, #3bbcf2); }
.btn.danger { border-color: #7a2b3a; color: #ffb3bd; background: #2a1119; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .42; cursor: default; transform: none; }
.btn .ico { font-size: 14px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.segmented { display: flex; padding: 3px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 14px; }
.segmented a, .segmented button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.segmented .on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 #ffffff10 inset; }

.stepper { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg-2); }
.stepper button { width: 36px; height: 36px; border: 0; background: transparent; color: var(--text); cursor: pointer; border-radius: 10px; }
.stepper button:disabled { opacity: .35; }
.stepper .val { min-width: 34px; text-align: center; font-family: var(--mono); font-size: 14px; }

.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + span { background: #12405a; border-color: var(--accent-2); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

input.field {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
}
input.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #5ad1ff22; }
label.lbl { display: block; font-size: 12.5px; color: var(--muted); margin: 0 2px 6px; }

/* Progress bars: --p is set from JS (0..1). */
.bar { position: relative; height: 6px; border-radius: 3px; background: #ffffff10; overflow: hidden; }
.bar > i {
  position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%);
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 3px;
  box-shadow: 0 0 10px #5ad1ff66;
}
.bar.violet > i { background: linear-gradient(90deg, #7d5cf0, var(--violet)); box-shadow: 0 0 10px #ab8cff66; }
.bar.good > i { background: linear-gradient(90deg, #2fb57c, var(--good)); box-shadow: none; }
.bar.warn > i { background: linear-gradient(90deg, #d08c1a, var(--warn)); box-shadow: none; }
.bar.thick { height: 10px; border-radius: 5px; }

/* Element and item chips. --c is the element's color. */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 3px; flex: none;
  border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; white-space: nowrap;
}
.chip .sym {
  display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 6px;
  background: color-mix(in srgb, var(--c, #8899aa) 26%, #0b1120); color: color-mix(in srgb, var(--c, #8899aa) 75%, white);
  border: 1px solid color-mix(in srgb, var(--c, #8899aa) 55%, transparent);
  font: 700 11px/1 var(--sans);
}
.chip .ico { font-size: 12px; color: var(--muted); margin-left: 3px; }
.chip.missing { border-color: #6a2834; background: #22101a; color: #ffb3bd; }
.chip.missing.repair { cursor: pointer; border-style: dashed; }
.chip.missing.planned { border-color: #6b5222; background: #241c0c; color: #ffd796; }
.chip.plain { padding: 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.el-tile {
  position: relative; aspect-ratio: 1; border-radius: 12px; padding: 7px 8px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c, #8899aa) 30%, #0f1729), #0b1120 85%);
  border: 1px solid color-mix(in srgb, var(--c, #8899aa) 45%, transparent);
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
.el-tile .sym { font: 750 20px/1 var(--sans); color: color-mix(in srgb, var(--c, #8899aa) 70%, white); }
.el-tile .name { font-size: 10.5px; color: var(--muted); }
.el-tile .amt { font: 650 13px/1 var(--mono); text-align: right; }
.el-tile.zero { opacity: .35; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--muted); white-space: nowrap;
}
.pill.good { background: #0f3326; color: var(--good); }
.pill.warn { background: #3a2a0c; color: var(--warn); }
.pill.bad { background: #3a121b; color: var(--bad); }
.pill.accent { background: #0c3346; color: var(--accent); }
.pill.violet { background: #241a45; color: var(--violet); }

.note { font-size: 13px; color: var(--muted); }
.blocker { display: flex; gap: 7px; align-items: flex-start; font-size: 13px; color: var(--warn); margin-top: 8px; }
.blocker .ico { margin-top: 2px; }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty .ico { font-size: 34px; color: var(--faint); display: block; margin: 0 auto 10px; }

/* --- Guidance / tasks -------------------------------------------------- */

.guide { overflow: hidden; }
.guide::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(400px 140px at 0% 0%, #5ad1ff1c, transparent 70%);
}
.guide .chapter { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.guide h2 { font-size: 18px; margin: 4px 0 4px; }
.steps { display: flex; gap: 4px; margin: 12px 0 2px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: #ffffff14; }
.steps i.done { background: var(--accent-2); }
.steps i.now { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.task { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; }
.task .card-icon { width: 34px; height: 34px; grid-row: span 2; }
.task .t-name { font-weight: 600; font-size: 14px; }
.task .t-time { font: 600 12.5px var(--mono); color: var(--muted); text-align: right; }
.task .bar { grid-column: 2 / 4; }

/* --- Toasts and sheets ------------------------------------------------- */

.toasts {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); width: min(92vw, 460px);
  display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 13px;
  background: #142038f2; border: 1px solid var(--line-2); box-shadow: 0 10px 30px #0008;
  font-size: 14px; animation: toast-in .22s ease-out; pointer-events: auto; white-space: pre-line;
}
.toast .ico { margin-top: 2px; color: var(--accent); }
.toast.good .ico { color: var(--good); }
.toast.bad { border-color: #6a2834; }
.toast.bad .ico { color: var(--bad); }
.toast.leave { animation: toast-out .2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

.scrim {
  position: fixed; inset: 0; z-index: 50; background: #02050bb3; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center; animation: fade-in .18s;
}
.sheet {
  width: 100%; max-width: 640px; max-height: 86vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 20px 20px 0 0; padding: 8px 16px calc(18px + var(--safe-b));
  box-shadow: 0 -20px 60px #000a; animation: sheet-in .24s cubic-bezier(.2, .9, .3, 1);
}
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 2px auto 12px; }
.sheet h2 { margin: 0 0 4px; font-size: 19px; }
@media (min-width: 700px) {
  .scrim { align-items: center; }
  .sheet { border-radius: 20px; border-bottom: 1px solid var(--line-2); padding-bottom: 18px; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }

/* --- Login --------------------------------------------------------------- */

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: min(100%, 380px); padding: 26px 22px; }
.login h1 { text-align: center; margin: 0 0 4px; font-size: 24px; }
.login p { text-align: center; color: var(--muted); margin: 0 0 20px; }
.login .err { color: var(--bad); font-size: 13.5px; min-height: 20px; text-align: center; }
.app.booting .topbar, .app.booting .tabbar, .app.booting .resbar, .app.login-mode .topbar,
.app.login-mode .tabbar, .app.login-mode .resbar { display: none; }
.app.login-mode .view { max-width: none; padding: 0; }

/* --- Star map and system (SVG) ----------------------------------------- */

.map-wrap {
  position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 50%, #0e1d38, #060a13 75%);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.map-wrap svg { display: block; width: 100%; height: auto; }
.map-tools { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; }
.map-tools .icon-btn { background: #0b1120cc; border: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.sys-star { cursor: pointer; }
.sys-hit { fill: transparent; cursor: pointer; }
.grid-line { stroke: #ffffff08; stroke-width: .02; }
.range-ring { fill: none; stroke: #5ad1ff30; stroke-width: .03; stroke-dasharray: .12 .1; }
.sys-label { font: 600 .32px var(--sans); fill: var(--muted); text-anchor: middle; pointer-events: none; }
.ring-unlockable { fill: none; stroke: var(--accent); stroke-width: .05; stroke-dasharray: .14 .1; }
.ring-current { fill: none; stroke: #fff; stroke-width: .045; }
.ring-scouting { fill: none; stroke: var(--warn); stroke-width: .05; stroke-dasharray: .08 .08; }
.ring-selected { fill: none; stroke: var(--accent); stroke-width: .06; }
.route-dot { fill: var(--good); }
@media (prefers-reduced-motion: no-preference) {
  .ring-unlockable, .ring-scouting { animation: dash 3s linear infinite; }
  @keyframes dash { to { stroke-dashoffset: -2.4; } }
}

.orbit { fill: none; stroke: #ffffff14; stroke-width: 1; stroke-dasharray: 3 5; }
.body-hit { cursor: pointer; }
.body-label { font: 600 11px var(--sans); fill: var(--muted); text-anchor: middle; pointer-events: none; }
.body-selected { fill: none; stroke: var(--accent); stroke-width: 2; }
.saved-mark { fill: var(--good); }

/* --- Mining grid --------------------------------------------------------- */

.mine-wrap { width: 100%; max-width: 560px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #05080f; touch-action: manipulation; }
.mine-wrap svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.tile { cursor: pointer; }
.tile-sym { font: 750 13px var(--sans); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.tile-val { font: 600 8.5px var(--mono); text-anchor: end; fill: #ffffffb0; pointer-events: none; }
.tile-dmg { font: 800 10px var(--mono); text-anchor: middle; dominant-baseline: central; fill: #fff; paint-order: stroke; stroke: #000; stroke-width: 3px; pointer-events: none; }
.hit { fill: #5ad1ff33; stroke: var(--accent); stroke-width: 2; pointer-events: none; }
.hit.blocked { fill: #ff6b7a26; stroke: var(--bad); }
.aim { fill: none; stroke: #fff; stroke-width: 2.5; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .hit { animation: pulse 1.1s ease-in-out infinite alternate; }
  @keyframes pulse { from { opacity: .65; } to { opacity: 1; } }
}
.tools { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.tools::-webkit-scrollbar { display: none; }
.tool {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 78px; height: 64px; padding: 0 3px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); cursor: pointer; font-size: 11px; font-weight: 600;
}
.tool .ico { font-size: 18px; color: var(--muted); }
.tool .cnt { font: 650 11px var(--mono); color: var(--muted); }
.tool.on { border-color: var(--accent); background: #0f2a40; box-shadow: 0 0 0 1px var(--accent) inset; }
.tool.on .ico { color: var(--accent); }
.tool:disabled { opacity: .35; }
.cargo { display: flex; align-items: center; gap: 10px; }
.slot-btn { flex: 1; min-width: 0; text-align: left; justify-content: flex-start; flex-direction: column; align-items: stretch; min-height: 54px; padding: 6px 10px; gap: 2px; }
.slot-btn .small { font-weight: 500; color: var(--muted); }

/* --- Misc ---------------------------------------------------------------- */

.spark { width: 100%; height: 70px; display: block; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark path.area { fill: url(#spark-fill); }
.loading { display: grid; place-items: center; padding: 60px 0; color: var(--faint); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #ffffff14; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
details.fold > summary { list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .chev { transition: transform .15s; }
details.fold[open] > summary .chev { transform: rotate(90deg); }
.log { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.log div { padding-left: 12px; border-left: 2px solid var(--line); }
hr.sep { border: 0; height: 1px; background: var(--line); margin: 12px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
