/* Postbox 12 — one stylesheet, one set of tokens, one set of components.
   CRT terminal x tactical HUD: slate, thin borders, corner ticks, monospace, scanlines, cyan accent.
   Red is for damage, death and warnings only. Loot tiers own their border colours. */

/* ===================================================================== tokens */
:root {
  /* surfaces */
  --bg: #0f151a;
  --bg-2: #121a20;
  --panel: #151e25;
  --panel-2: #1a252d;
  --panel-3: #213039;
  --line: #2a3a45;
  --line-2: #3a5160;
  --line-faint: #20323b;
  --bg-deep: #0d1418;
  /* text */
  --text: #d8e4ea;
  --text-dim: #93a8b4;
  --text-faint: #6c818d;
  /* accent: cold cyan */
  --cyan: #5fd4e6;
  --cyan-hi: #a6efff;
  --cyan-dim: #2f8494;
  --cyan-deep: #123a42;
  --cyan-wash: color-mix(in srgb, var(--cyan) 8%, transparent);
  --cyan-glow: color-mix(in srgb, var(--cyan) 35%, transparent);
  --on-cyan: #071418;
  /* signal red: damage, death, warnings */
  --red: #ff5b4f;
  --red-dim: #8f2f29;
  --red-wash: color-mix(in srgb, var(--red) 10%, transparent);
  --red-glow: color-mix(in srgb, var(--red) 40%, transparent);
  /* loot tiers, lowest to highest */
  --t-trash: #6f7a82;
  --t-general: #b9c4cb;
  --t-personal: #c8a27c;
  --t-industrial: #e08c3a;
  --t-medical: #5cc47c;
  --t-special: #4f93ea;
  --t-valuable: #e8c94e;
  --t-epic: #b46ee8;
  --t-insane: #ff63b4;
  /* type */
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  --fs-xs: 0.8125rem;
  --fs-s: 0.875rem;
  --fs-m: 1rem;
  --fs-l: 1.1875rem;
  --fs-xl: 1.5rem;
  --fs-xxl: 2.25rem;
  --fs-hero: clamp(2.5rem, 11vw, 4.75rem);
  --lh: 1.5;
  /* space */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --gutter: 16px;
  /* shape */
  --bw: 1px;
  --tick: 10px;
  --tap: 44px;
  --maxw: 1120px;
  --glow: 0 0 6px var(--cyan-glow);
  --t-fast: 120ms;
  --tier: var(--t-trash);
  color-scheme: dark;
}

html { font-size: 17px; }
html[data-text="s"] { font-size: 16px; }
html[data-text="m"] { font-size: 17px; }
html[data-text="l"] { font-size: 19px; }

/* ===================================================================== base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% -10%, color-mix(in srgb, var(--cyan) 7%, transparent), transparent 60%),
    linear-gradient(var(--bg), var(--bg-2));
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-m);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}
/* CRT: scanlines and a soft vignette over everything, never blocking input. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.16) 2px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.35) 100%);
}
::selection { background: var(--cyan); color: var(--on-cyan); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
blockquote { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
svg { display: block; }
/* line icons: stroked, never filled */
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
h1:focus-visible, h2:focus-visible { outline-color: transparent; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.warn { color: var(--red); }
.ok { color: var(--cyan); }
.neg { color: var(--red); }
.pos { color: var(--cyan); }
.label { color: var(--text-dim); }
.empty { color: var(--text-dim); padding: var(--sp-3) 0; }
.reason { color: var(--text-dim); font-size: var(--fs-s); margin: var(--sp-1) 0 0; }
.mono-note { color: var(--text-dim); font-size: var(--fs-s); word-break: break-word; }

/* Blinking block cursor (prompts, boot). */
.cursor {
  display: inline-block; width: 0.6em; height: 1.1em; margin-left: 0.15em; vertical-align: text-bottom;
  background: var(--cyan); box-shadow: var(--glow);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===================================================================== app shell */
.app { min-height: 100dvh; }
.view { min-height: 100dvh; }
.boot-msg {
  min-height: 100dvh; display: grid; place-items: center; margin: 0; padding: var(--gutter);
  color: var(--cyan); text-shadow: var(--glow); text-align: center;
}
.boot-msg--error { color: var(--red); text-shadow: 0 0 6px var(--red-glow); }

.screen {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--sp-6);
}
.screen__head {
  display: flex; align-items: center; gap: var(--sp-3);
  margin: var(--sp-4) 0;
}
.screen__title {
  font-size: var(--fs-xl); color: var(--cyan); text-shadow: var(--glow);
  letter-spacing: 0.02em;
}
.screen__title::after {
  content: ""; display: inline-block; width: 0.55em; height: 0.9em; margin-left: 0.3em;
  vertical-align: -0.08em; background: var(--cyan); opacity: 0.85;
  animation: blink 1.05s steps(1) infinite;
}
.screen__body { min-width: 0; }

/* ----- PMC header (status strip) */
.pmcbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: var(--sp-2) var(--sp-4);
  margin: 0 calc(-1 * var(--gutter));
  padding: var(--sp-2) var(--gutter);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: var(--bw) solid var(--line);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--cyan) 8%, transparent), 0 6px 18px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.pmcbar__id { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.pmcbar__callsign {
  font-weight: 700; color: var(--cyan); text-shadow: var(--glow);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pmcbar__level { font-size: var(--fs-s); color: var(--text-dim); }
.pmcbar__money { grid-row: 1; grid-column: 2; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pmcbar__xp { grid-column: 1 / -1; display: grid; gap: 2px; }
.pmcbar__xplabel { font-size: var(--fs-xs); color: var(--text-dim); font-variant-numeric: tabular-nums; }

.badge-prestige {
  display: inline-grid; place-items: center; min-width: 2.2em; height: 2.2em; padding: 0 0.3em;
  font-size: var(--fs-s); font-weight: 700; color: var(--on-cyan); background: var(--cyan);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  box-shadow: var(--glow);
}

/* ===================================================================== components */

/* ----- panel: thin border, corner ticks, a status-bar title */
.panel {
  position: relative;
  background: var(--panel);
  border: var(--bw) solid var(--line);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  margin: 0 0 var(--sp-4);
  min-width: 0;
}
.panel::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  --c: var(--cyan-dim);
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--tick) 2px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 2px var(--tick) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--tick) 2px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 2px var(--tick) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--tick) 2px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 2px var(--tick) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--tick) 2px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 2px var(--tick) no-repeat;
}
.panel__title {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap;
  margin: calc(-1 * var(--sp-3)) calc(-1 * var(--sp-4)) var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  background: var(--panel-2);
  border-bottom: var(--bw) solid var(--line);
  font-size: var(--fs-m); color: var(--cyan);
}
.panel__title::before {
  content: ""; width: 8px; height: 8px; flex: none; background: var(--cyan); box-shadow: var(--glow);
  margin-right: auto; order: -1; display: none;
}
/* Titles outside a panel (tab bodies) use the same bar look without the bleed. */
.tasks > .panel__title, .corrupt .panel__title {
  margin: var(--sp-4) 0 var(--sp-3); border: var(--bw) solid var(--line);
}
.panel__aside { color: var(--text-dim); font-size: var(--fs-s); font-weight: 400; }
.panel__sub { font-size: var(--fs-m); color: var(--cyan); margin: var(--sp-4) 0 var(--sp-2); }
.panel__note { color: var(--text-dim); font-size: var(--fs-s); }
.panel__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-3); color: var(--text-dim); font-size: var(--fs-s); font-variant-numeric: tabular-nums;
}
.panel__bar .seg { margin-left: auto; }
.panel--loss { border-color: var(--red-dim); }
.panel--loss::before { --c: var(--red); }
.panel--loss .panel__title { color: var(--red); background: var(--red-wash); border-bottom-color: var(--red-dim); }

/* ----- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: var(--sp-2) var(--sp-4);
  background: var(--cyan-wash); color: var(--cyan);
  border: var(--bw) solid var(--cyan-dim); border-radius: 0;
  font-weight: 700; text-align: center; line-height: 1.2;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover:not(:disabled) { border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 16%, transparent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] {
  cursor: not-allowed; color: var(--text-faint); background: transparent; border-color: var(--line); border-style: dashed;
}
.btn .icon { width: 1.2em; height: 1.2em; flex: none; }
.btn--primary { background: var(--cyan); color: var(--on-cyan); border-color: var(--cyan); box-shadow: 0 0 12px color-mix(in srgb, var(--cyan) 25%, transparent); }
.btn--primary:hover:not(:disabled) { background: var(--cyan-hi); border-color: var(--cyan-hi); }
.btn--primary:disabled { box-shadow: none; }
.btn--danger { background: var(--red-wash); color: var(--red); border-color: var(--red-dim); }
.btn--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 20%, transparent); border-color: var(--red); }
.btn--money { font-variant-numeric: tabular-nums; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn--ghost:hover:not(:disabled) { color: var(--cyan); background: var(--cyan-wash); border-color: var(--line); }
.btn--small { min-height: var(--tap); padding: var(--sp-1) var(--sp-3); font-size: var(--fs-s); }
.btn--big { min-height: 56px; padding: var(--sp-3) var(--sp-5); font-size: var(--fs-l); width: 100%; }
.btn--icon { width: var(--tap); padding: 0; }
.btn--back { padding-left: var(--sp-2); }

.actions { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); }
.actions > .btn { width: 100%; }
.actions--row { flex-direction: row; flex-wrap: wrap; }
.actions--row > .btn { width: auto; flex: 1 1 0; }

/* ----- tags and chips */
.tag, .chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px;
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.5;
  border: var(--bw) solid var(--line-2); color: var(--text-dim); white-space: nowrap;
}
.tag--tier { border-color: var(--tier); color: var(--tier); }
.tag--fir { border-color: var(--cyan-dim); color: var(--cyan); }
.tag--soon { border-style: dashed; }
.chip--bad { border-color: var(--red-dim); color: var(--red); background: var(--red-wash); }
.chip--good { border-color: var(--cyan-dim); color: var(--cyan); background: var(--cyan-wash); }

/* ----- meters (bars) */
.meter {
  position: relative; display: block; height: 8px; min-width: 40px;
  background: var(--bg); border: var(--bw) solid var(--line-2); overflow: hidden;
}
.meter__fill {
  position: absolute; inset: 0 auto 0 0; background: var(--cyan); box-shadow: var(--glow);
  transition: width 300ms ease-out;
}
/* tick marks every 10% */
.meter::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to right, transparent 0 calc(10% - 1px), color-mix(in srgb, var(--bg) 70%, transparent) calc(10% - 1px) 10%);
}
.meter--hp { height: 12px; }
.meter--warn .meter__fill, .meter--enemy .meter__fill { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }
.is-low .meter--hp .meter__fill { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }

/* ----- tabs and segmented controls */
.tabs, .branchtabs {
  display: flex; gap: 0; margin: 0 0 var(--sp-4);
  border-bottom: var(--bw) solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar, .branchtabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: var(--sp-2) var(--sp-3);
  background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--text-dim); font-weight: 700; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--cyan-wash); }
.tab.is-active { color: var(--cyan); border-bottom-color: var(--cyan); text-shadow: var(--glow); }
.tab__count {
  min-width: 1.6em; padding: 0 4px; font-size: var(--fs-xs); text-align: center;
  border: var(--bw) solid currentColor; line-height: 1.4;
}
.seg { display: inline-flex; border: var(--bw) solid var(--line-2); }
.seg__btn {
  min-height: var(--tap); min-width: var(--tap); padding: 0 var(--sp-3);
  background: transparent; border: 0; border-right: var(--bw) solid var(--line-2);
  color: var(--text-dim); font-weight: 700; font-size: var(--fs-s); cursor: pointer;
}
.seg__btn:last-child { border-right: 0; }
.seg__btn:hover { color: var(--text); background: var(--cyan-wash); }
.seg__btn.is-active { background: var(--cyan); color: var(--on-cyan); }

/* ----- notices */
.notices { display: grid; gap: var(--sp-2); margin: var(--sp-3) 0; }
.notice {
  display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--cyan-wash); border-left: 3px solid var(--cyan); color: var(--text);
}
.notices .notice { margin: 0; }
.notice .icon { width: 1.2em; height: 1.2em; flex: none; color: var(--cyan); }
.notice--warn { background: var(--red-wash); border-left-color: var(--red); }
.warnlist { display: grid; gap: var(--sp-1); margin: var(--sp-3) 0; }
.warnlist li { color: var(--red); padding-left: 1.4em; position: relative; }
.warnlist li::before { content: "!"; position: absolute; left: 0; width: 1.1em; text-align: center; font-weight: 700; border: 1px solid var(--red-dim); line-height: 1.2; top: 0.15em; font-size: var(--fs-xs); }

/* ----- forms */
.field__label { display: block; margin-bottom: var(--sp-2); color: var(--cyan); font-weight: 700; }
.field__help { color: var(--text-dim); font-size: var(--fs-s); margin: var(--sp-2) 0 0; }
.field__error { color: var(--red); min-height: 1.5em; margin: var(--sp-1) 0 var(--sp-3); font-size: var(--fs-s); }
.field__input, .field__area {
  width: 100%; min-height: var(--tap); padding: var(--sp-2) var(--sp-3);
  background: var(--bg); color: var(--text); border: var(--bw) solid var(--line-2); border-radius: 0;
  font-size: max(16px, 1rem);
}
.field__input:focus, .field__area:focus { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), var(--glow); outline: none; }
.field__area { min-height: 6em; resize: vertical; word-break: break-all; font-size: max(16px, var(--fs-s)); margin: var(--sp-2) 0; }
.field__input--small { width: 9em; flex: 1 1 6em; }

/* Terminal prompt: "> callsign█" */
.prompt {
  position: relative; display: flex; align-items: center; gap: var(--sp-2);
  padding: 0 var(--sp-3); background: var(--bg); border: var(--bw) solid var(--line-2);
}
.prompt:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), var(--glow); }
.prompt__ps { color: var(--cyan); font-weight: 700; text-shadow: var(--glow); flex: none; width: 1ch; }
.prompt .field__input { border: 0; background: transparent; padding-left: 0; padding-right: 0; flex: 1; min-width: 0; font-size: max(16px, var(--fs-l)); min-height: 52px; }
.prompt .field__input:focus { box-shadow: none; }
.prompt .cursor { position: absolute; left: calc(var(--sp-3) + 1ch + var(--sp-2)); top: 50%; transform: translateY(-50%); margin: 0; display: none; pointer-events: none; }
.prompt .field__input:placeholder-shown { caret-color: transparent; }
.prompt .field__input:placeholder-shown + .cursor { display: inline-block; }

/* ----- switch */
.setting { display: grid; gap: var(--sp-2); padding: var(--sp-3) 0; border-bottom: 1px dashed var(--line); }
.setting:last-child { border-bottom: 0; }
.setting__label { font-weight: 700; }
.switch {
  display: inline-flex; align-items: center; gap: var(--sp-3); min-height: var(--tap);
  background: transparent; border: 0; padding: 0; cursor: pointer; text-align: left; font-weight: 700;
}
.switch__track { position: relative; width: 52px; height: 26px; flex: none; border: var(--bw) solid var(--line-2); background: var(--bg); }
.switch__knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: var(--text-faint); transition: left var(--t-fast), background var(--t-fast); }
.switch.is-on .switch__track { border-color: var(--cyan); }
.switch.is-on .switch__knob { left: 29px; background: var(--cyan); box-shadow: var(--glow); }

/* ----- stats table */
.stats { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: var(--sp-3) 0; border-top: 1px solid var(--line); }
.stats dt, .stats dd { padding: var(--sp-1) 0; border-bottom: 1px solid var(--line); }
.stats dt { color: var(--text-dim); padding-right: var(--sp-4); }
.stats dd { text-align: right; font-variant-numeric: tabular-nums; word-break: break-word; }

/* ----- cards (quests, tasks) */
.cards { display: grid; gap: var(--sp-3); }
.card {
  position: relative; background: var(--panel); border: var(--bw) solid var(--line);
  border-left: 3px solid var(--cyan-dim); padding: var(--sp-3) var(--sp-4);
}
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-2); flex-wrap: wrap; }
.card__title { font-size: var(--fs-m); color: var(--cyan); }
.card__meta { color: var(--text-dim); font-size: var(--fs-s); font-variant-numeric: tabular-nums; }

/* ----- the item tile: icon, tier border, qty, FIR, condition or uses */
.tier-trash { --tier: var(--t-trash); }
.tier-general { --tier: var(--t-general); }
.tier-personal { --tier: var(--t-personal); }
.tier-industrial { --tier: var(--t-industrial); }
.tier-medical { --tier: var(--t-medical); }
.tier-special { --tier: var(--t-special); }
.tier-valuable { --tier: var(--t-valuable); }
.tier-epic { --tier: var(--t-epic); }
.tier-insane { --tier: var(--t-insane); }

.item {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  width: 100%; height: 100%; min-height: 84px; padding: 6px;
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--tier) 16%, transparent), color-mix(in srgb, var(--tier) 4%, transparent)),
    var(--panel-2);
  border: 2px solid var(--tier); border-radius: 0;
  color: var(--text); text-align: left; font-size: var(--fs-s); line-height: 1.2;
  overflow: hidden;
}
button.item { cursor: pointer; }
button.item:hover { background-color: var(--panel-3); box-shadow: inset 0 0 0 1px var(--tier), 0 0 10px color-mix(in srgb, var(--tier) 40%, transparent); }
.item__icon { display: block; width: 30px; height: 30px; color: var(--tier); }
.item__icon .icon { width: 100%; height: 100%; }
.item__name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  width: 100%; font-weight: 700; font-size: var(--fs-xs); overflow-wrap: anywhere; hyphens: auto; margin-top: 4px;
}
.item__qty {
  position: absolute; top: 4px; right: 5px; font-size: var(--fs-xs); font-weight: 700;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.item__fir {
  position: absolute; top: 22px; right: 4px; padding: 0 3px; font-size: 0.6875rem; font-weight: 700; line-height: 1.3;
  color: var(--on-cyan); background: var(--cyan);
}
.item__uses { position: absolute; bottom: 4px; right: 5px; font-size: var(--fs-xs); color: var(--text-dim); }
.item__durwrap { display: block; width: 100%; height: 4px; margin-top: 4px; background: var(--bg); flex: none; }
.item__dur { display: block; height: 100%; background: var(--cyan); }
.item__dur.is-poor { background: var(--t-valuable); }
.item__dur.is-bad { background: var(--red); }
.item.is-selected { box-shadow: inset 0 0 0 2px var(--cyan), 0 0 12px var(--cyan-glow); }
.item.is-selected::after {
  content: ""; position: absolute; bottom: 4px; right: 4px; width: 14px; height: 14px; background: var(--cyan);
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 70%);
}
/* mini tile: icon only, used next to a name in rows */
.item--mini { width: 52px; height: 52px; min-height: 52px; flex: none; padding: 0; justify-content: center; align-items: center; }
.item--mini .item__name, .item--mini .item__fir, .item--mini .item__uses { display: none; }
.item--mini .item__qty { top: 1px; right: 3px; }
.item--mini .item__durwrap { position: absolute; left: 3px; right: 3px; bottom: 3px; width: auto; height: 3px; margin: 0; }
.item--mini .item__icon { width: 30px; height: 30px; }
.item--add {
  --tier: var(--line-2);
  border-style: dashed; background: transparent; color: var(--text-dim); cursor: pointer; align-items: center; justify-content: center;
}
.item--add .item__icon { color: var(--cyan); font-size: 1.6rem; line-height: 30px; text-align: center; }
.item--add .item__name { text-align: center; }
.item--add:hover { color: var(--cyan); border-color: var(--cyan-dim); }

/* slot grids (stash, container) */
.slotgrid {
  --cols: 4;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: 88px; gap: 4px;
  padding: 4px; background: var(--bg); border: var(--bw) solid var(--line);
}
.slotcell { min-width: 0; }
.slotcell.span-2 { grid-column: span 2; }
.slotcell.span-3 { grid-column: span 3; }
.slotcell.span-4 { grid-column: span 4; }
.slotcell--empty {
  border: 1px dashed var(--line);
  background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--line) 25%, transparent) 6px 7px);
}

/* row list (trader stock, sell, repair, loot, bag) — same tile at the left */
.shop { display: grid; gap: var(--sp-2); }
.shop__row {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-2); background: var(--panel); border: var(--bw) solid var(--line); border-left: 3px solid var(--tier);
}
.shop__row.is-locked { opacity: 0.6; }
.shop__item {
  display: flex; align-items: center; gap: var(--sp-3); flex: 1 1 14em; min-width: 0; min-height: var(--tap);
  padding: 0; background: transparent; border: 0; text-align: left; cursor: pointer;
}
div.shop__item { cursor: default; }
.shop__text { display: grid; min-width: 0; }
.shop__name { font-weight: 700; overflow-wrap: anywhere; }
.shop__meta { color: var(--text-dim); font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.shop__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-left: auto; justify-content: flex-end; }
.shop__lock { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: var(--fs-s); min-height: var(--tap); }
.shop__lock .icon { width: 1.1em; height: 1.1em; }

/* pick list (loadout candidates) */
.picklist { display: grid; gap: var(--sp-2); }
.pick {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 64px; padding: var(--sp-2);
  background: var(--panel); border: var(--bw) solid var(--line); border-left: 3px solid var(--tier);
  text-align: left; cursor: pointer;
}
.pick:hover { background: var(--panel-2); border-color: var(--cyan-dim); border-left-color: var(--tier); }
.pick__name { font-weight: 700; flex: 1; }
.pick__meta { color: var(--text-dim); font-size: var(--fs-s); }
.picklist--grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); grid-auto-rows: 92px; }

/* ----- sheet (modal) */
.sheet {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(4, 8, 10, 0.72);
  animation: fade 140ms ease-out;
}
.sheet__panel {
  position: relative; display: flex; flex-direction: column;
  width: 100%; max-width: 560px; max-height: 90dvh;
  background: var(--panel); border: var(--bw) solid var(--line-2); border-top: 2px solid var(--cyan);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px color-mix(in srgb, var(--cyan) 6%, transparent);
  animation: rise 180ms ease-out;
}
.sheet__panel--wide { max-width: 980px; }
.sheet__bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-4);
  background: var(--panel-2); border-bottom: var(--bw) solid var(--line);
}
.sheet__title { font-size: var(--fs-l); color: var(--cyan); text-shadow: var(--glow); overflow-wrap: anywhere; }
.sheet__body { padding: var(--sp-4); overflow-y: auto; overscroll-behavior: contain; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } }

/* ----- toasts */
.toasts {
  position: fixed; left: 50%; top: calc(8px + env(safe-area-inset-top)); transform: translateX(-50%);
  z-index: 300; display: grid; gap: var(--sp-2); width: min(560px, calc(100% - 2 * var(--gutter)));
  pointer-events: none;
}
.toast {
  padding: var(--sp-2) var(--sp-3); background: var(--panel-2); color: var(--text); font-size: var(--fs-s);
  border: var(--bw) solid var(--cyan-dim); border-left: 3px solid var(--cyan);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: drop 160ms ease-out; transition: opacity 400ms, transform 400ms;
}
.toast--ok { border-left-color: var(--cyan); }
.toast--error { border-color: var(--red-dim); border-left-color: var(--red); }
.toast.is-out { opacity: 0; transform: translateY(-8px); }

/* ===================================================================== title, corrupt */
.title, .corrupt { min-height: 100dvh; display: grid; place-items: center; padding-top: var(--sp-5); padding-bottom: var(--sp-5); }
.title__card {
  position: relative; width: 100%; max-width: 600px;
  padding: var(--sp-5) var(--sp-4);
  background: var(--panel); border: var(--bw) solid var(--line);
}
.title__card::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  --c: var(--cyan);
  background:
    linear-gradient(var(--c), var(--c)) top left / 18px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 2px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 18px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 2px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 18px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 2px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 18px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 2px 18px no-repeat;
}
.title__stamp {
  display: inline-block; margin-bottom: var(--sp-4); padding: 2px var(--sp-2);
  border: 1px solid var(--line-2); color: var(--text-dim); font-size: var(--fs-s);
}
.title__name {
  font-size: var(--fs-hero); line-height: 0.95; letter-spacing: -0.02em; font-weight: 800;
  color: var(--cyan);
  text-shadow: 0 0 2px var(--cyan), 0 0 18px var(--cyan-glow), 3px 0 0 color-mix(in srgb, var(--red) 0%, transparent);
  margin-bottom: var(--sp-4);
}
.title__name--small { font-size: var(--fs-xxl); }
.title__name.warn { color: var(--red); text-shadow: 0 0 14px var(--red-glow); }
.title__lede { color: var(--text); max-width: 46ch; }
.title__form { margin: var(--sp-5) 0 var(--sp-4); }
.title__form .btn--big { margin-top: var(--sp-2); }
.title__note { color: var(--text-dim); font-size: var(--fs-s); border-top: 1px dashed var(--line); padding-top: var(--sp-3); }
.corrupt .title__card > .btn { width: 100%; margin-top: var(--sp-2); }
.corrupt .title__card > .field__input { margin-top: var(--sp-2); }

/* ===================================================================== hideout */
.hideout .notices { margin-top: var(--sp-4); }
.bunker-wrap {
  position: relative; margin: var(--sp-4) calc(-1 * var(--gutter)) var(--sp-2);
  border-top: var(--bw) solid var(--line); border-bottom: var(--bw) solid var(--line);
  background: var(--bg-deep);
}
.bunker-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--cyan-dim) transparent; }
.bunker { width: 100%; height: auto; font-family: var(--mono); }
.bunker--wide { display: none; }
.bunker--tall .station__art *, .bunker--tall .station__hit { vector-effect: non-scaling-stroke; }
.bunker__bg { fill: var(--bg-deep); }
.bunker .ln { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bunker .ln-dim { fill: none; stroke: var(--cyan-dim); stroke-width: 1.5; stroke-linecap: round; }
.bunker .ln-faint { fill: none; stroke: var(--line-faint); stroke-width: 1.2; }
.bunker .ln-cone { fill: none; stroke: var(--cyan); stroke-opacity: 0.18; stroke-width: 1.2; stroke-dasharray: 6 8; }
.bunker .ln-thread { fill: none; stroke: var(--cyan); stroke-width: 1.2; stroke-dasharray: 3 4; }
.bunker .ln-screen { fill: var(--cyan-deep); stroke: var(--cyan); stroke-width: 1.5; }
.bunker .ln-glow { fill: none; stroke: var(--cyan-hi); stroke-width: 2; filter: drop-shadow(0 0 3px var(--cyan)); }
.bunker .ln-warn { fill: none; stroke: var(--red); stroke-width: 2; stroke-opacity: 0.8; }
.bunker .fill { fill: var(--cyan); }
.bunker .fill-glow { fill: var(--cyan-hi); animation: blink 1.05s steps(1) infinite; }
.bunker__stencil { fill: var(--cyan-dim); font-size: 22px; font-weight: 800; letter-spacing: 0.1em; opacity: 0.55; }
.bunker__room { pointer-events: none; }

.station { cursor: pointer; outline: none; }
.station__hit { fill: transparent; stroke: transparent; stroke-width: 2; stroke-dasharray: 8 6; }
.station__art { transition: filter var(--t-fast); }
.station__label rect { fill: var(--panel); stroke: var(--cyan-dim); stroke-width: 1.5; }
.station__label text { fill: var(--cyan); font-weight: 700; }
.station:hover .station__hit, .station:focus-visible .station__hit { fill: color-mix(in srgb, var(--cyan) 6%, transparent); stroke: var(--cyan); }
.station:hover .station__art, .station:focus-visible .station__art { filter: drop-shadow(0 0 4px var(--cyan)); }
.station:hover .station__label rect, .station:focus-visible .station__label rect { fill: var(--cyan); stroke: var(--cyan); }
.station:hover .station__label text, .station:focus-visible .station__label text { fill: var(--on-cyan); }
.station.is-soon { cursor: default; }
.station.is-soon .station__art { opacity: 0.32; filter: grayscale(1); }
.station.is-soon .station__label rect { fill: var(--bg); stroke: var(--line-2); stroke-dasharray: 4 3; }
.station.is-soon .station__label text { fill: var(--text-faint); }
.station__soon rect { fill: var(--bg); stroke: var(--text-faint); stroke-width: 1.2; }
.station__soon text { fill: var(--text-dim); font-weight: 700; }

.hideout__caption { color: var(--text-dim); font-size: var(--fs-s); margin: var(--sp-2) 0 var(--sp-4); }
.stations { display: grid; gap: var(--sp-2); grid-template-columns: 1fr; }
.station-row {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 60px; padding: var(--sp-2) var(--sp-3);
  background: var(--panel); border: var(--bw) solid var(--line); border-left: 3px solid var(--cyan-dim);
  text-align: left; cursor: pointer;
}
.station-row:hover { background: var(--panel-2); border-color: var(--cyan-dim); border-left-color: var(--cyan); }
.station-row__icon { width: 32px; height: 32px; flex: none; color: var(--cyan); }
.station-row__icon .icon { width: 100%; height: 100%; }
.station-row__text { display: grid; flex: 1; min-width: 0; }
.station-row__name { font-weight: 700; color: var(--cyan); }
.station-row__blurb { color: var(--text-dim); font-size: var(--fs-s); }
.station-row.is-soon { border-left-color: var(--line-2); border-style: dashed; cursor: default; }
.station-row.is-soon .station-row__icon, .station-row.is-soon .station-row__name { color: var(--text-faint); }

/* ===================================================================== stash */
.stash { display: grid; gap: 0 var(--sp-4); }

/* ===================================================================== item sheet */
.itemdetail__head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.itemdetail__head > div { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.itemdetail__icon {
  width: 64px; height: 64px; flex: none; padding: 10px; color: var(--tier);
  border: 2px solid var(--tier); background: color-mix(in srgb, var(--tier) 12%, var(--panel-2));
}
.itemdetail__icon .icon { width: 100%; height: 100%; }
.itemdetail__desc { color: var(--text); font-style: italic; }

/* ===================================================================== traders */
.traders { display: grid; gap: var(--sp-4); }
.traderlist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-1); }
.trader-pick {
  display: grid; width: 100%; min-height: 56px; padding: var(--sp-2);
  background: var(--panel); border: var(--bw) solid var(--line); text-align: left; cursor: pointer;
}
.trader-pick:hover { border-color: var(--cyan-dim); }
.trader-pick__name { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trader-pick__meta { font-size: var(--fs-xs); color: var(--text-dim); }
.trader-pick.is-active { border-color: var(--cyan); background: var(--cyan-wash); box-shadow: inset 0 -2px 0 var(--cyan); }
.trader-pick.is-active .trader-pick__name { color: var(--cyan); }
.trader-pick.is-locked .trader-pick__name { color: var(--text-faint); }
.traders__main { min-width: 0; }
.trader__name { font-size: var(--fs-xl); color: var(--cyan); text-shadow: var(--glow); margin-bottom: var(--sp-2); }
.trader__greeting {
  margin: 0 0 var(--sp-2); padding: var(--sp-2) var(--sp-3);
  border-left: 3px solid var(--cyan); background: var(--cyan-wash); color: var(--text);
}
.trader__greeting::before { content: "\201C"; color: var(--cyan); }
.trader__greeting::after { content: "\201D"; color: var(--cyan); }
.trader__blurb { color: var(--text-dim); }
.trader--locked .notice { align-items: flex-start; }
.loyalty {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-2) var(--sp-3);
  margin: var(--sp-3) 0 var(--sp-4); padding: var(--sp-2) var(--sp-3); border: var(--bw) solid var(--line); background: var(--panel);
  font-size: var(--fs-s);
}
.loyalty__level { font-weight: 700; color: var(--cyan); }
.loyalty__pts { color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* ===================================================================== quests */
.objectives { display: grid; gap: var(--sp-1); margin: var(--sp-2) 0 var(--sp-3); }
.objective { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-2); align-items: baseline; }
.objective__mark { color: var(--text-faint); }
.objective.is-done .objective__mark { color: var(--cyan); }
.objective.is-done .objective__text { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--cyan-dim); }
.objective__count { color: var(--text-dim); font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.quest__brief { color: var(--text-dim); font-style: italic; }
.quest__rewards { font-size: var(--fs-s); }
.quest--done { border-left-color: var(--line-2); opacity: 0.8; }
.quest--active { border-left-color: var(--cyan); }
.task .meter { margin: var(--sp-2) 0 var(--sp-3); }
.task.is-claimed { opacity: 0.6; border-left-color: var(--line-2); }
.task .actions { flex-direction: row; }
.task .actions > .btn { width: auto; }

/* ===================================================================== loadout */
.loadout { display: grid; gap: 0 var(--sp-4); }
.kitgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.kitslot { display: grid; gap: var(--sp-1); align-content: start; min-width: 0; }
.kitslot__label { font-size: var(--fs-s); color: var(--text-dim); font-weight: 700; }
.kitslot__btn { display: block; width: 100%; height: 92px; padding: 0; background: transparent; border: 0; cursor: pointer; }
.kitslot__btn .item { height: 92px; }
.kitslot__btn--empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px dashed var(--line-2); color: var(--text-faint); font-size: var(--fs-s);
  background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--line) 25%, transparent) 6px 7px);
}
.kitslot__btn--empty:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.kitslot__ghost { width: 32px; height: 32px; opacity: 0.6; }
.kitslot__ghost .icon { width: 100%; height: 100%; }
.kitslot .btn--small { width: 100%; }
.kitlist { margin-bottom: var(--sp-4); }
.kitlist:last-child { margin-bottom: 0; }
.kitlist__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-2); }
.kitlist__head h3 { font-size: var(--fs-m); }
.kitlist__cap { color: var(--text-dim); font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.kitlist__items { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-auto-rows: 88px; gap: 4px; }
.sumrow { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-1) 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.sumrow + .meter { margin: var(--sp-1) 0 var(--sp-2); }
.modlist { display: grid; gap: 2px; margin: var(--sp-3) 0 0; font-size: var(--fs-s); }
.modlist li::before { content: "\25B8 "; color: var(--cyan-dim); }
.presets { display: grid; gap: var(--sp-3); }
.preset { padding: var(--sp-2) var(--sp-3); border: var(--bw) solid var(--line); background: var(--panel-2); }
.preset__name { font-weight: 700; color: var(--cyan); }
.preset__meta { color: var(--text-dim); font-size: var(--fs-s); }
.preset .actions { margin-top: var(--sp-2); }
.loadout__side > .btn--big { margin-bottom: var(--sp-4); }

/* ===================================================================== skills */
.skillbars { display: grid; gap: var(--sp-3); }
.skillbar__top { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-1); }
.skillbar__name { font-weight: 700; color: var(--cyan); }
.skillbar__lvl { font-weight: 700; }
.skillbar__bonus { margin-left: auto; color: var(--text-dim); font-size: var(--fs-s); }
.skillbar__foot { display: flex; justify-content: space-between; color: var(--text-dim); font-size: var(--fs-s); margin-top: var(--sp-1); font-variant-numeric: tabular-nums; }
.points { color: var(--cyan); font-weight: 700; font-size: var(--fs-m); }
.tree { display: grid; gap: var(--sp-3); }
.branch { display: none; min-width: 0; }
.branch.is-open { display: block; }
.branch__title { font-size: var(--fs-m); color: var(--cyan); padding-bottom: var(--sp-2); margin-bottom: var(--sp-2); border-bottom: 1px solid var(--line); }
.branch--veteran .branch__title { color: var(--text); }
.branch__nodes { display: grid; gap: 0; counter-reset: node; }
.node {
  position: relative; padding: var(--sp-3) var(--sp-3) var(--sp-3) calc(var(--sp-3) + 18px);
  background: var(--panel-2); border: var(--bw) solid var(--line); margin-bottom: 14px;
}
/* chain line between nodes: the branch is a sequence */
.node::before {
  counter-increment: node; content: counter(node);
  position: absolute; left: -1px; top: -1px; width: 20px; height: 20px; display: grid; place-items: center;
  font-size: var(--fs-xs); font-weight: 700; color: var(--text-dim); background: var(--bg); border: 1px solid var(--line);
}
.node + .node::after {
  content: ""; position: absolute; left: 9px; top: -15px; width: 2px; height: 14px; background: var(--line-2);
}
.node.is-owned { border-color: var(--cyan-dim); }
.node.is-owned::before { color: var(--on-cyan); background: var(--cyan); border-color: var(--cyan); }
.node.is-owned + .node::after { background: var(--cyan-dim); }
.node.is-buyable { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan-dim), 0 0 12px color-mix(in srgb, var(--cyan) 12%, transparent); }
.node__head { display: flex; justify-content: space-between; gap: var(--sp-2); align-items: center; }
.node__name { font-weight: 700; }
.node__rank { display: inline-flex; gap: 3px; flex: none; }
.pip { width: 10px; height: 10px; border: 1px solid var(--cyan-dim); }
.pip.is-on { background: var(--cyan); border-color: var(--cyan); box-shadow: var(--glow); }
.node__desc { font-size: var(--fs-s); margin: var(--sp-1) 0; }
.node__meta { font-size: var(--fs-xs); color: var(--text-dim); margin-bottom: var(--sp-2); }
.node__ok { color: var(--cyan); font-weight: 700; font-size: var(--fs-s); }
.node .btn { width: 100%; }

/* ===================================================================== deploy */
.deploy { display: grid; gap: 0 var(--sp-4); }
.maplist { display: grid; gap: var(--sp-2); }
.mapcard {
  display: grid; gap: 2px; width: 100%; min-height: 60px; padding: var(--sp-2) var(--sp-3);
  background: var(--panel-2); border: var(--bw) solid var(--line); border-left: 3px solid var(--cyan-dim);
  text-align: left; cursor: pointer;
}
button.mapcard:hover:not(:disabled) { border-color: var(--cyan-dim); border-left-color: var(--cyan); }
.mapcard.is-active { border-color: var(--cyan); border-left-color: var(--cyan); background: var(--cyan-wash); }
.mapcard__name { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--cyan); }
.mapcard__name .icon { width: 1em; height: 1em; }
.mapcard__meta { color: var(--text-dim); font-size: var(--fs-s); }
.mapcard__blurb { color: var(--text-dim); font-size: var(--fs-s); }
.mapcard.is-sealed { cursor: default; background: transparent; border-style: dashed; border-left-style: solid; border-left-color: var(--line-2); }
.mapcard.is-sealed .mapcard__name { color: var(--text-faint); }
.mapcard.is-sealed .mapcard__blurb { color: var(--text-faint); }
.mapcard.is-endgame { border: 1px solid var(--line-2); border-left: 3px solid var(--text-dim); background: repeating-linear-gradient(-45deg, transparent 0 10px, color-mix(in srgb, var(--line-2) 18%, transparent) 10px 11px); }
.mapcard.is-endgame .mapcard__name { color: var(--text); }
.mapcard.is-endgame .mapcard__meta { color: var(--text); font-weight: 700; }
.weather__name { font-size: var(--fs-l); font-weight: 700; color: var(--cyan); }
.weather__text { color: var(--text-dim); margin-top: var(--sp-1); }
.extracts { display: grid; gap: var(--sp-1); }
.extract { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); }
.extract:last-child { border-bottom: 0; }
.extract__name { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.extract__name .icon { width: 1.1em; height: 1.1em; color: var(--cyan); }
.extract__state { color: var(--text-dim); font-size: var(--fs-s); }
.extract.is-closed .extract__name { color: var(--text-faint); text-decoration: line-through; }
.extract.is-closed .extract__name .icon { color: var(--red); }
.extract.is-closed .extract__state { color: var(--red); }
.kitline { font-variant-numeric: tabular-nums; }
.deploy__detail > .btn--deploy { margin-bottom: var(--sp-4); }

/* ===================================================================== raid */
.screen.raid {
  display: flex; flex-direction: column; height: 100dvh; max-width: 920px; padding: 0;
}
.hud {
  flex: none; padding: var(--sp-2) var(--gutter);
  background: color-mix(in srgb, var(--bg) 96%, transparent); border-bottom: var(--bw) solid var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); font-size: var(--fs-s);
}
.hud__hp { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-2); }
.hud__hp .hud__k { display: inline-flex; align-items: center; gap: 4px; color: var(--cyan); font-weight: 700; }
.hud__hp .hud__k .icon { width: 1.1em; height: 1.1em; }
.hud__hp > .hud__v { font-weight: 700; font-variant-numeric: tabular-nums; font-size: var(--fs-m); }
.hud__hp.is-low .hud__k, .hud__hp.is-low > .hud__v { color: var(--red); }
.hud__effects { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.hud__effects:empty { display: none; }
.hud__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: var(--sp-2);
  background: var(--line); border: 1px solid var(--line);
}
.hud__cell { display: grid; padding: 2px 6px; background: var(--panel); min-width: 0; }
.hud__k { color: var(--text-dim); font-size: var(--fs-xs); }
.hud__v { font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud__cell.is-warn .hud__v { color: var(--red); }
.hud__cell--noise { grid-column: span 2; }
.hud__cell--gun { grid-column: span 2; }
.hud__cell--gun .hud__v { white-space: normal; }
.hud__gun { color: var(--cyan); }
.hud__cond { font-weight: 400; color: var(--text-dim); }
.hud__cond.warn { color: var(--red); }
.hud__cell--gun .chip { margin-left: 6px; }
.noise { display: flex; gap: 2px; align-items: center; height: 1.4em; }
.noise__seg { flex: 1; height: 10px; border: 1px solid var(--line-2); background: var(--bg); }
.noise__seg.is-on { background: var(--cyan); border-color: var(--cyan); }
.noise__seg.is-on.is-hot { background: var(--red); border-color: var(--red); }

.feed {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--sp-3) var(--gutter) var(--sp-5);
  scroll-behavior: smooth;
}
.sceneblock { padding: var(--sp-3) 0; border-bottom: 1px dashed var(--line); }
.sceneblock:last-child { border-bottom: 0; }
.sceneblock.is-past { opacity: 0.5; }
.sceneblock.is-past .sceneblock__extras { display: none; }
.sceneblock__title { font-size: var(--fs-l); color: var(--cyan); text-shadow: var(--glow); margin-bottom: var(--sp-2); }
.sceneblock.is-past .sceneblock__title { font-size: var(--fs-m); text-shadow: none; }
.sceneblock__title::before { content: "// "; color: var(--cyan-dim); }
.sceneblock__text .line { margin: 0 0 var(--sp-2); max-width: 66ch; }
/* Contact (pass 4): the line that says someone turned up starts the encounter, set apart from the scenery. */
.sceneblock__text .line--contact {
  margin-top: var(--sp-3); padding: 4px 8px; border-left: 3px solid var(--red); background: var(--red-wash);
  color: var(--text); font-weight: 700; letter-spacing: 0.01em;
}
.sceneblock__text .line--contact::before { content: "CONTACT  "; color: var(--red); font-size: var(--fs-s); letter-spacing: 0.12em; }
.sceneblock.is-current .sceneblock__text .line:last-child::after {
  content: ""; display: inline-block; width: 0.55em; height: 1em; margin-left: 0.2em; vertical-align: -0.12em;
  background: var(--cyan); animation: blink 1.05s steps(1) infinite;
}
.sceneblock--result .sceneblock__title { color: var(--text); }
.rolllog { display: grid; gap: 2px; margin-bottom: var(--sp-2); font-size: var(--fs-s); }
.rolllog:empty { display: none; }
.rolllog__row { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 2px 6px; border-left: 2px solid var(--line-2); color: var(--text-dim); }
.rolllog__v { font-weight: 700; white-space: nowrap; }
.rolllog__row.is-success .rolllog__v, .rolllog__row.is-crit .rolllog__v { color: var(--cyan); }
.rolllog__row.is-success, .rolllog__row.is-crit { border-left-color: var(--cyan); }
.rolllog__row.is-fail .rolllog__v, .rolllog__row.is-fumble .rolllog__v { color: var(--red); }
.rolllog__row.is-fail, .rolllog__row.is-fumble { border-left-color: var(--red-dim); }

.hint {
  margin: var(--sp-3) 0; padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--cyan-dim); border-left: 3px solid var(--cyan); background: var(--cyan-wash);
}
.hint__tag { display: inline-block; font-size: var(--fs-xs); font-weight: 700; color: var(--on-cyan); background: var(--cyan); padding: 0 6px; margin-bottom: var(--sp-1); }
.hint p { margin: 0; }

.enemy {
  margin: var(--sp-3) 0; padding: var(--sp-2) var(--sp-3);
  background: var(--panel); border: 1px solid var(--line-2); border-left: 3px solid var(--red);
  display: grid; grid-template-columns: 1fr auto; gap: var(--sp-1) var(--sp-3); align-items: center;
}
.enemy__head { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; align-items: baseline; }
.enemy__name { font-weight: 700; font-size: var(--fs-l); }
.enemy__type { color: var(--text-dim); font-size: var(--fs-s); }
.enemy__hp { font-variant-numeric: tabular-nums; font-size: var(--fs-s); font-weight: 700; }
.enemy--boss { border-color: var(--red-dim); }
.enemy--boss .enemy__name { color: var(--red); text-shadow: 0 0 6px var(--red-glow); }

/* options */
.options { margin-top: var(--sp-3); }
.opts { display: grid; gap: var(--sp-2); }
.opt {
  position: relative; display: grid; gap: 2px; width: 100%; min-height: 56px;
  padding: var(--sp-2) var(--sp-4) var(--sp-2) calc(var(--sp-4) + 14px);
  background: var(--panel); color: var(--text); text-align: left;
  border: 1px solid var(--cyan-dim); border-radius: 0; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.opt::before {
  content: ""; position: absolute; left: var(--sp-3); top: calc(var(--sp-2) + 0.5em); width: 7px; height: 7px;
  border-top: 2px solid var(--cyan); border-right: 2px solid var(--cyan); transform: rotate(45deg);
}
.opt:hover:not(:disabled) { background: var(--cyan-wash); border-color: var(--cyan); }
.opt:hover:not(:disabled) .opt__label { color: var(--cyan-hi); }
.opt__label { font-weight: 700; font-size: var(--fs-l); color: var(--cyan); line-height: 1.3; }
.opt__hint { color: var(--text-dim); font-size: var(--fs-s); }
.opt__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.opt__check { font-size: var(--fs-xs); font-weight: 700; padding: 1px 6px; border: 1px solid var(--line-2); color: var(--text); }
.opt__cost { font-size: var(--fs-xs); font-weight: 700; padding: 1px 6px; border: 1px dashed var(--line-2); color: var(--text-dim); }
.opt__reason { color: var(--text-dim); font-size: var(--fs-s); }
.opt__reason::before { content: "\2715  "; }
.opt:disabled { cursor: not-allowed; border-style: dashed; border-color: var(--line-2); background: transparent; }
.opt:disabled::before { border-color: var(--text-faint); }
.opt:disabled .opt__label { color: var(--text-faint); }
.options .btn--big { width: 100%; }

/* loot picker */
.loot { margin: 0 0 var(--sp-3); padding: var(--sp-3); background: var(--panel); border: 1px solid var(--line-2); }
.loot__title { font-size: var(--fs-m); color: var(--cyan); margin-bottom: var(--sp-2); }
.loot__note { color: var(--text-dim); font-size: var(--fs-s); }
.loot__list { display: grid; gap: var(--sp-2); }
.loot__row {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 64px; padding: var(--sp-2);
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--tier);
  text-align: left; cursor: pointer;
}
.loot__row:hover { border-color: var(--cyan-dim); border-left-color: var(--tier); }
.loot__check { width: 24px; height: 24px; flex: none; border: 1px solid var(--line-2); padding: 2px; color: transparent; }
.loot__check .icon { width: 100%; height: 100%; }
.loot__row.is-selected { background: var(--cyan-wash); border-color: var(--cyan); border-left-color: var(--tier); }
.loot__row.is-selected .loot__check { background: var(--cyan); border-color: var(--cyan); color: var(--on-cyan); }
.loot__text { display: grid; min-width: 0; }
.loot__name { font-weight: 700; }
.loot__meta { color: var(--text-dim); font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.loot__total { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin: var(--sp-3) 0 var(--sp-2); font-size: var(--fs-s); font-variant-numeric: tabular-nums; font-weight: 700; }
.loot > .btn { width: 100%; }

/* raid bar */
.raidbar {
  flex: none; display: flex; gap: 1px;
  padding: 0 0 env(safe-area-inset-bottom);
  background: var(--line); border-top: 1px solid var(--line);
}
.btn--bar { flex: 1 1 0; min-height: 56px; border: 0; background: var(--panel); flex-direction: column; gap: 2px; font-size: var(--fs-s); }
.btn--bar .icon { width: 22px; height: 22px; }
.btn--bar:disabled { border: 0; background: var(--panel); }
.btn--luck:not(:disabled) { color: var(--on-cyan); background: var(--cyan); }
.btn--luck:not(:disabled):hover { background: var(--cyan-hi); }
.hud-skip { flex: 1 1 0; min-height: 56px; border: 0; background: var(--panel-2); color: var(--cyan); }

/* ----- dice */
.dice { display: none; }
.dice.is-shown {
  display: grid; justify-items: center; gap: var(--sp-2);
  margin: var(--sp-2) 0 var(--sp-3); padding: var(--sp-4) var(--sp-3);
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--cyan) 8%, transparent), transparent 70%),
    var(--bg);
  border: 1px solid var(--line);
  text-align: center;
}
.dice__label { font-weight: 700; color: var(--text-dim); }
.dice__pair { display: flex; gap: var(--sp-5); justify-content: center; perspective: 600px; }
.die { display: block; width: clamp(104px, 30vw, 148px); aspect-ratio: 1; transition: opacity 220ms, transform 220ms, filter 220ms; }
.die__svg { width: 100%; height: 100%; overflow: visible; }
/* Skin colours come from SVG attributes (ui/skins.js); CSS only sets weights and states. */
.die__body { stroke-width: 2.5; stroke-linejoin: round; }
.die__face { fill: rgba(255, 255, 255, 0.06); stroke-width: 1.4; stroke-linejoin: round; stroke-opacity: 0.8; }
.die__edges { fill: none; stroke-width: 1.1; stroke-linecap: round; stroke-opacity: 0.8; }
.die__outline { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.die__num { font-family: var(--mono); font-size: 25px; font-weight: 800; stroke-width: 3.2px; stroke-opacity: 0.55; paint-order: stroke; stroke-linejoin: round; }
.die__static { opacity: 0; }
.die__smoke { opacity: 0; }
.die.is-rolling .die__svg { animation: tumble 560ms cubic-bezier(.2, .7, .3, 1) both; }
.die.is-settled .die__svg { animation: settle 220ms ease-out; }
.die.is-dropped { opacity: 0.28; transform: scale(0.84); filter: grayscale(1); }
/* crit and natural 1 read on top of any skin: a thick coloured outline and glow */
.die.is-crit .die__outline { stroke: var(--cyan-hi); stroke-width: 5; filter: drop-shadow(0 0 6px var(--cyan)); }
.die.is-crit .die__svg { filter: drop-shadow(0 0 12px var(--cyan)); }
.die.is-fumble .die__outline { stroke: var(--red); stroke-width: 5; filter: drop-shadow(0 0 6px var(--red)); }
.die.is-fumble .die__svg { filter: drop-shadow(0 0 12px var(--red-glow)); }
/* effects */
.die__svg.fx-glow, .die__svg.fx-pulse { filter: drop-shadow(0 0 6px var(--fx, var(--cyan))); }
.die__svg.fx-pulse { animation: pulse 1.8s ease-in-out infinite; }
.die.is-rolling .die__svg.fx-pulse { animation: tumble 560ms cubic-bezier(.2, .7, .3, 1) both; }
.die.fx-smoke.is-rolling .die__smoke { animation: smoke 560ms ease-out both; }
.die.is-static .die__static { animation: static 200ms steps(4) both; }
.die.is-static .die__num { opacity: 0; }
@keyframes pulse { 50% { filter: drop-shadow(0 0 14px var(--fx, var(--cyan))); } }
@keyframes smoke { 0% { opacity: 0.7; transform: translateY(0) scale(0.6); } 100% { opacity: 0; transform: translateY(-36px) scale(1.6); } }
@keyframes static { 0% { opacity: 0.9; transform: translateX(-3px); } 50% { opacity: 0.5; transform: translateX(3px); } 100% { opacity: 0.8; transform: none; } }
.die__smoke { transform-box: fill-box; transform-origin: center; }
html[data-motion="reduced"] .die__svg { filter: none !important; }
@media (prefers-reduced-motion: reduce) { .die__svg { filter: none !important; } }
@keyframes tumble {
  0% { transform: translateY(-40px) rotate(-200deg) scale(0.7); opacity: 0.2; }
  45% { transform: translateY(8px) rotate(40deg) scale(1.04); opacity: 1; }
  70% { transform: translateY(-6px) rotate(-14deg); }
  100% { transform: none; }
}
@keyframes settle { 0% { transform: scale(1.08); } 100% { transform: none; } }
.dice__mode { color: var(--text-dim); font-size: var(--fs-s); min-height: 0; }
.dice__mode:empty { display: none; }
.dice__mods { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px var(--sp-2); font-size: var(--fs-s); }
.dice__mods:empty { display: none; }
.dice__mod { padding: 1px 6px; border: 1px solid var(--line-2); color: var(--text); animation: pop 160ms ease-out; }
.dice__mod.neg { border-color: var(--red-dim); }
.dice__modval { font-weight: 700; }
.dice__mods .pos .dice__modval { color: var(--cyan); }
.dice__mods .neg .dice__modval { color: var(--red); }
.dice__total { font-variant-numeric: tabular-nums; min-height: 1.6em; }
.dice__totalnum { font-size: var(--fs-xxl); font-weight: 800; color: var(--text); line-height: 1; }
.dice__vs { color: var(--text-dim); font-size: var(--fs-m); }
.dice__verdict { min-height: 1.6em; font-size: var(--fs-xl); font-weight: 800; letter-spacing: 0.06em; }
.dice__verdict:empty { min-height: 0; }
/* What happened after the roll (roll.outcome): plain line; tone shown by colour and by a leading mark. */
.dice__outcome { display: block; margin-top: 0.25em; font-size: var(--fs-m, 1rem); font-weight: 700; }
.dice__outcome:empty { display: none; }
.dice__outcome.tone-good, .rolllog__outcome.tone-good { color: var(--cyan); }
.dice__outcome.tone-bad, .rolllog__outcome.tone-bad { color: var(--red, #e5484d); }
.dice__outcome.tone-good::before, .rolllog__outcome.tone-good::before { content: '+ '; }
.dice__outcome.tone-bad::before, .rolllog__outcome.tone-bad::before { content: '! '; }
.rolllog__outcome { display: block; flex: 1 0 100%; font-size: 0.92em; color: var(--text); }
.rolllog__row { flex-wrap: wrap; row-gap: 0; }
.dice__verdict.is-success, .dice__verdict.is-crit { color: var(--cyan); text-shadow: var(--glow); animation: pop 200ms ease-out; }
.dice__verdict.is-fail, .dice__verdict.is-fumble { color: var(--red); text-shadow: 0 0 8px var(--red-glow); animation: pop 200ms ease-out; }
.dice__verdict.is-neutral { color: var(--text); }
.dice.flash-crit { animation: flash-crit 700ms ease-out; }
.dice.flash-fumble { animation: flash-fumble 700ms ease-out; }
@keyframes flash-crit { 0% { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--cyan) 35%, transparent); border-color: var(--cyan); } 100% { box-shadow: none; } }
@keyframes flash-fumble { 0% { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--red) 35%, transparent); border-color: var(--red); } 100% { box-shadow: none; } }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } }

/* ----- node map */
.mapview { display: grid; gap: var(--sp-4); }
.mapview__scroll { overflow-x: auto; border: 1px solid var(--line); background: var(--bg); }
.nodemap { width: 100%; height: auto; font-family: var(--mono); }
.mapview__zoom { justify-self: end; }
.mapview.is-zoomed .nodemap { width: 200%; }
@media (max-width: 759px) {
  .mapview:not(.is-zoomed) .mnode:not(.is-current):not(.is-reachable) .mnode__label { display: none; }
}
@media (min-width: 760px) { .mapview__zoom { display: none; } }
.nodemap__bg { fill: var(--bg-deep); }
.nodemap__grid line { stroke: var(--line-faint); stroke-width: calc(var(--u, 1) * 0.15px); }
.edge { stroke: var(--cyan-dim); stroke-width: calc(var(--u, 1) * 0.6px); stroke-linecap: round; fill: none; }
.edge--main { stroke: var(--cyan-dim); stroke-width: calc(var(--u, 1) * 0.7px); }
.edge--quiet { stroke: var(--cyan-dim); stroke-width: calc(var(--u, 1) * 0.55px); stroke-dasharray: calc(var(--u, 1) * 0.5px) calc(var(--u, 1) * 1.4px); }
.edge--loud { stroke: var(--text-dim); stroke-width: calc(var(--u, 1) * 1.1px); stroke-dasharray: calc(var(--u, 1) * 2.4px) calc(var(--u, 1) * 1px); }
.edge--unknown { stroke: var(--line-2); }
.edge--here { stroke: var(--cyan); }
.mnode__dot { fill: var(--panel-2); stroke: var(--cyan-dim); stroke-width: 0.5; }
.mnode.is-visited .mnode__dot { fill: var(--cyan-dim); }
.mnode.is-current .mnode__dot { fill: var(--cyan); stroke: var(--cyan-hi); }
.mnode__ring { fill: none; stroke: var(--cyan); stroke-width: 0.4; animation: ring 1.6s ease-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes ring { 0% { opacity: 1; transform: scale(0.6); } 100% { opacity: 0; transform: scale(1.4); } }
.mnode.is-reachable .mnode__dot { stroke: var(--cyan); stroke-width: 0.7; }
.mnode.is-unknown .mnode__dot { fill: var(--bg); stroke-dasharray: 0.8 0.6; }
.mnode__q { fill: var(--cyan); font-size: 2.6px; font-weight: 700; }
.mnode__label { fill: var(--text); font-size: 2.7px; font-weight: 700; paint-order: stroke; stroke: var(--bg-deep); stroke-width: 0.9px; stroke-linejoin: round; }
.mnode.is-unknown .mnode__label { fill: var(--text-dim); }
.mnode.is-current .mnode__label { fill: var(--cyan-hi); }
.mnode__exit { fill: none; stroke-width: 0.6; }
.mnode__exit.is-open { stroke: var(--cyan); }
.mnode__exit.is-closed { stroke: var(--red); stroke-dasharray: 0.8 0.6; }
.mnode__hit { fill: transparent; }
.mnode[role="button"] { cursor: pointer; outline: none; }
.mnode[role="button"]:hover .mnode__dot, .mnode[role="button"]:focus-visible .mnode__dot { fill: var(--cyan); stroke: var(--cyan-hi); }
.mnode[role="button"]:focus-visible .mnode__hit { stroke: var(--cyan); stroke-width: 0.4; }
.mroom__bg { fill: var(--panel-2); stroke: var(--text-dim); stroke-width: 0.3; }
.mroom__icon { fill: none; stroke: var(--text-dim); stroke-width: 0.35; stroke-linejoin: round; }
.mroom.is-marked .mroom__icon { fill: var(--t-epic); stroke: var(--t-epic); }
.mroom.is-marked .mroom__bg { stroke: var(--t-epic); }
.mroom.has-key .mroom__bg { stroke: var(--cyan); fill: var(--cyan-deep); }
.mroom.has-key .mroom__icon { stroke: var(--cyan-hi); }
.mroom.is-looted { opacity: 0.45; }
.maplegend { display: grid; gap: var(--sp-3); font-size: var(--fs-s); }
.maplegend h3 { font-size: var(--fs-s); color: var(--cyan); margin-bottom: var(--sp-1); }
.maplegend__keys { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); color: var(--text-dim); }
.maplegend__keys li { display: inline-flex; align-items: center; gap: 6px; }
.maplegend__list { display: grid; gap: 2px; }
.maplegend__list li.is-closed { color: var(--red); }
.maplegend__list li.has-key { color: var(--cyan); }
.lg { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--cyan-dim); }
.lg--quiet { border-top-style: dotted; }
.lg--loud { border-top: 3px dashed var(--text-dim); }
.lg--exit { width: 12px; height: 12px; border: 2px solid var(--cyan); }
.lg--room { width: 12px; height: 12px; border: 1px solid var(--text-dim); border-radius: 50%; }
.lg--marked { width: 12px; height: 12px; background: var(--t-epic); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border: 0; }

/* ----- bag drawer */
.bag { display: grid; gap: var(--sp-4); }
.bag__group h3 { font-size: var(--fs-m); color: var(--cyan); margin-bottom: var(--sp-2); padding-bottom: var(--sp-1); border-bottom: 1px solid var(--line); }
.bag__count { color: var(--text-dim); font-weight: 400; font-size: var(--fs-s); }
.bag__list { display: grid; gap: var(--sp-2); }
.bag__row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.bag__name { display: grid; flex: 1 1 9em; min-width: 0; font-weight: 700; }
.bag__meta { font-weight: 400; color: var(--text-dim); font-size: var(--fs-s); }
.bag__actions { display: flex; gap: var(--sp-2); margin-left: auto; }
.bag .empty { padding: 0; }

/* ===================================================================== result and death */
.result { padding-top: var(--sp-5); max-width: 860px; }
.death, .extracted {
  position: relative; text-align: center; padding: var(--sp-6) var(--sp-4); margin-bottom: var(--sp-4);
  border: 1px solid var(--line); background: var(--panel);
}
.death { border-color: var(--red-dim); background: radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--red) 14%, transparent), transparent 70%), var(--panel); }
.death__kia { display: inline-block; padding: 2px var(--sp-2); color: var(--red); border: 1px solid var(--red-dim); font-weight: 700; margin-bottom: var(--sp-4); }
.death__by { color: var(--text-dim); margin: 0; }
.death__killer {
  font-size: clamp(2.25rem, 10vw, 4.25rem); line-height: 1.05; color: var(--red); overflow-wrap: anywhere;
  text-shadow: 0 0 2px var(--red), 0 0 20px var(--red-glow); margin: var(--sp-2) 0 var(--sp-4);
}
.death__line { font-size: var(--fs-l); max-width: 36ch; margin: 0 auto var(--sp-4); }
.death__pmc { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); color: var(--text-dim); margin: 0; }
.extracted { border-color: var(--cyan-dim); background: radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--cyan) 14%, transparent), transparent 70%), var(--panel); }
.extracted__tag { display: inline-block; padding: 2px var(--sp-2); color: var(--on-cyan); background: var(--cyan); font-weight: 700; margin-bottom: var(--sp-3); }
.extracted__title { font-size: clamp(2rem, 8vw, 3.25rem); color: var(--cyan); text-shadow: 0 0 2px var(--cyan), 0 0 18px var(--cyan-glow); margin-bottom: var(--sp-3); }
.extracted__line { color: var(--text); max-width: 40ch; margin: 0 auto; }
.result__cols { display: grid; gap: 0 var(--sp-4); }
.resultlist { display: grid; gap: 0; }
.resultlist li { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-1) 0; border-bottom: 1px solid var(--line); }
.resultlist li:last-child { border-bottom: 0; }
.resultlist__qty { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.stats--result { margin: 0; }
.result__go { margin-top: var(--sp-4); }

/* ===================================================================== prestige */
.keeplist { display: grid; gap: var(--sp-1); margin-bottom: var(--sp-3); }
.keeplist li { padding-left: 1.2em; position: relative; }
.keeplist li::before { content: "+"; position: absolute; left: 0; color: var(--cyan); font-weight: 700; }
.prestige h3 { font-size: var(--fs-m); margin: var(--sp-3) 0 var(--sp-1); }
.big-req { font-size: var(--fs-xl); font-weight: 700; color: var(--cyan); text-shadow: var(--glow); }
.pp-line {
  margin-top: var(--sp-4); padding: var(--sp-2) var(--sp-3); color: var(--text-dim); font-style: italic;
  border: 1px dashed var(--line-2);
}
.pick-count { font-weight: 700; color: var(--cyan); font-variant-numeric: tabular-nums; }
.prestige .field__input { margin: var(--sp-2) 0 var(--sp-3); }

/* ===================================================================== settings */
.settings .btn { margin: var(--sp-2) 0; }

/* ===================================================================== dev panel */
.dev { position: static; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); max-width: var(--maxw); margin: 0 auto; padding: var(--sp-3) var(--gutter) var(--sp-6); border-top: 1px dashed var(--line); }
.dev__toggle { display: flex; min-width: var(--tap); padding: 0 var(--sp-3); background: transparent; border-style: dashed; color: var(--text-dim); }
.dev__body { display: grid; gap: var(--sp-2); padding: var(--sp-3); width: 100%; max-width: 420px; background: var(--panel); border: 1px dashed var(--cyan-dim); }
.dev__row { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.dev__row .btn { flex: 1 0 auto; }
.dev-only { border-style: dashed; }

/* ===================================================================== flea market (from site/src/ui/market.js) */
.screen--market { max-width: 980px; height: 100dvh; padding: var(--sp-3) var(--gutter); display: flex; flex-direction: column; }
.market-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.market { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0;
  background: var(--bg); color: var(--text); border: 1px solid var(--cyan);
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: 16px; line-height: 1.35;
  text-shadow: 0 0 4px color-mix(in srgb, var(--cyan) 35%, transparent); overflow: hidden; }
.market::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.18) 2px 3px);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6); }
.market__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-bottom: 1px solid var(--cyan); color: var(--cyan);
  text-transform: uppercase; letter-spacing: 0.08em; }
.market__exit { font: inherit; color: var(--cyan); background: transparent;
  border: 1px solid var(--cyan); border-radius: 0; min-height: 44px; padding: 0 14px; cursor: pointer; }
.market__screen { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; overscroll-behavior: contain; }
.market__line { margin: 0; white-space: pre; overflow-x: auto; min-height: 1.35em; }
.market__line--echo { color: var(--cyan); }
.market__prompt { display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-top: 1px solid var(--line); }
.market__ps { color: var(--cyan); }
.market__cursor { width: 0.6em; height: 1.1em; background: var(--cyan);
  animation: market-blink 1s steps(1) infinite; display: none; }
.market__prompt--empty .market__cursor { display: inline-block; }
.market__prompt--empty .market__input { caret-color: transparent; }
.market__input { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: inherit; background: transparent;
  border: 0; outline: none; padding: 8px 0; caret-color: var(--cyan); }
.market__prompt:focus-within { box-shadow: inset 0 0 0 1px var(--cyan); }
.market__suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px 10px; }
.market__chip { font: inherit; font-size: 16px; color: var(--cyan); background: color-mix(in srgb, var(--cyan) 6%, transparent);
  border: 1px solid var(--cyan); border-radius: 0; min-height: 44px; padding: 0 12px; cursor: pointer; }
.market__chip:focus-visible, .market__exit:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
@keyframes market-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .market__cursor { animation: none; } }
/* market additions: keep it inside the shared shell */
.market__title { font-weight: 700; }

/* ===================================================================== responsive */
@media (min-width: 560px) {
  .stations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kitgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .traderlist { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .opts { grid-template-columns: 1fr; }
  .presets { grid-template-columns: 1fr 1fr; }
  .result__cols { grid-template-columns: 1fr 1fr; }
  .slotgrid--stash { --cols: 6; }
}

@media (min-width: 760px) {
  :root { --gutter: 24px; }
  .pmcbar { grid-template-columns: auto 1fr auto; }
  .pmcbar__xp { grid-column: auto; max-width: 420px; justify-self: center; width: 100%; }
  .bunker-wrap { margin-left: 0; margin-right: 0; border: 1px solid var(--line); }
  .bunker--wide { display: block; }
  .bunker--tall { display: none; }
  .tree { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .branch { display: block; }
  .branchtabs { display: none; }
  .sheet { align-items: center; padding: var(--sp-5); }
  .sheet__panel { border-top-width: 1px; border-color: var(--cyan-dim); }
  .hud__grid { grid-template-columns: 2fr 0.8fr 1.4fr 0.9fr 1fr 0.7fr 3fr; }
  .hud__cell--gun, .hud__cell--noise { grid-column: auto; }
}

@media (min-width: 960px) {
  .stash { grid-template-columns: minmax(0, 2.4fr) minmax(260px, 1fr); align-items: start; }
  .slotgrid--stash { --cols: 8; }
  .traders { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .traderlist { grid-template-columns: 1fr; }
  .traders__nav { position: sticky; top: 110px; }
  .loadout { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); align-items: start; }
  .loadout__side { position: sticky; top: 90px; }
  .kitgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .deploy { grid-template-columns: minmax(280px, 1fr) minmax(0, 1.4fr); align-items: start; }
  .stations { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .skills { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0 var(--sp-4); align-items: start; }
  .opts { grid-template-columns: 1fr 1fr; }
  .opts > .opt:only-child { grid-column: 1 / -1; }
}

/* ===================================================================== motion */
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* trader stock filter */
.seg--filter { display: flex; width: 100%; margin-bottom: var(--sp-3); }
.seg--filter .seg__btn { flex: 1 1 0; padding: 0 var(--sp-1); }
.seg__count { font-weight: 400; opacity: 0.8; margin-left: 0.35em; }

/* phone: four tabs must fit without scrolling so none is hidden */
@media (max-width: 559px) {
  .tab { flex: 1 1 auto; padding: var(--sp-2) 6px; font-size: var(--fs-s); gap: 4px; }
  .tab__count { border: 0; min-width: 0; padding: 0; color: var(--text-faint); }
  .tab.is-active .tab__count { color: var(--cyan); }
}

/* Terminal output keeps its columns: the whole screen scrolls sideways together on a phone,
   instead of each line scrolling on its own. */
.market__screen { overflow-x: auto; }
.market__line { overflow-x: visible; width: max-content; min-width: 100%; }
@media (max-width: 559px) {
  .screen--market { padding: var(--sp-2); }
  .market, .market__input, .market__chip { font-size: 15px; }
}

/* ===================================================================== round 2: medals */
.medal { flex: none; overflow: visible; }
.medal--s { width: 22px; height: 22px; }
.medal--m { width: 48px; height: 48px; }
.medal--l { width: 64px; height: 64px; }
.medal--xl { width: 96px; height: 96px; }
.medal { --m: var(--cyan); }
.medal--bronze { --m: #c98a55; }
.medal--silver { --m: #c9d3da; }
.medal--gold { --m: #e8c94e; }
.medal--single { --m: var(--cyan); }
.medal__shape { fill: color-mix(in srgb, var(--m) 14%, var(--panel-2)); stroke: var(--m); stroke-width: 2.2; stroke-linejoin: round; }
.medal__detail { fill: none; stroke: var(--m); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.medal__mark { fill: none; stroke: var(--m); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.medal__dot { fill: var(--m); }
.medal__q { fill: var(--text-faint); font-family: var(--mono); font-size: 22px; font-weight: 800; }
.medal.is-earned { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--m) 55%, transparent)); }
.medal.is-unearned { --m: var(--line-2); }
.medal.is-unearned .medal__shape { fill: transparent; stroke-dasharray: 4 3; }
.medal.is-hidden { --m: var(--line-2); }
.medal.is-hidden .medal__shape { fill: transparent; stroke-dasharray: 2 3; }

/* medal pop-ups: top of the screen, one at a time */
.medaltoasts { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 350; width: min(520px, calc(100% - 2 * var(--gutter))); pointer-events: none; }
.medaltoast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-2) var(--sp-3);
  background: var(--panel-2); color: var(--text); text-align: left; cursor: pointer;
  border: 1px solid var(--cyan-dim); border-left: 3px solid var(--cyan); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 18px color-mix(in srgb, var(--cyan) 15%, transparent);
  animation: slidein 260ms cubic-bezier(.2, .8, .3, 1);
}
.medaltoast.is-out { opacity: 0; transform: translateY(-12px); transition: opacity 240ms, transform 240ms; }
.medaltoast__art { flex: none; display: grid; place-items: center; width: 64px; height: 64px; }
.medaltoast__art--die .die__svg { width: 60px; height: 60px; }
.medaltoast__art--fig .fig { width: 40px; height: 64px; }
.medaltoast__text { display: grid; min-width: 0; }
.medaltoast__kicker { font-size: var(--fs-xs); color: var(--cyan); font-weight: 700; }
.medaltoast__name { font-weight: 800; font-size: var(--fs-l); line-height: 1.2; }
.medaltoast__reward { font-size: var(--fs-s); color: var(--text-dim); }
.medal-tier--gold { border-left-color: #e8c94e; }
.medal-tier--silver { border-left-color: #c9d3da; }
.medal-tier--bronze { border-left-color: #c98a55; }
@keyframes slidein { from { transform: translateY(-120%); opacity: 0; } }

/* ===================================================================== service record */
.record { display: grid; gap: 0 var(--sp-4); }
.record > .tabs { grid-column: 1 / -1; }
.identity { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--sp-3) var(--sp-4); align-items: start; }
.identity__fig { display: block; padding: 4px; background: var(--bg); border: 1px solid var(--line); cursor: pointer; }
.identity__fig:hover { border-color: var(--cyan-dim); }
.identity__fig .fig { width: 100%; height: auto; }
.identity__name { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xl); font-weight: 800; color: var(--cyan); text-shadow: var(--glow); overflow-wrap: anywhere; line-height: 1.15; }
.identity__title { color: var(--text); font-style: italic; margin: var(--sp-1) 0 0; }
.identity__level { color: var(--text-dim); font-size: var(--fs-s); }
.identity .actions { margin-top: 0; }
.pinned { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.pinned__slot { display: grid; justify-items: center; text-align: center; gap: 4px; min-height: 96px; padding: var(--sp-2) 4px; border: 1px solid var(--line); background: var(--bg); }
.pinned__slot.is-empty { border-style: dashed; color: var(--text-faint); align-content: center; }
.pinned__ghost { width: 40px; height: 40px; border: 1px dashed var(--line-2); border-radius: 50%; }
.pinned__btn { display: grid; justify-items: center; gap: 4px; background: transparent; border: 0; padding: 0; cursor: pointer; width: 100%; }
.pinned__name { font-size: var(--fs-xs); font-weight: 700; line-height: 1.25; }
.skinline { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-2); background: var(--bg); border: 1px solid var(--line); text-align: left; cursor: pointer; }
.skinline:hover { border-color: var(--cyan-dim); }
.skinline--static { cursor: default; }
.skinline__die .die__svg { width: 56px; height: 56px; }
.skinline__text { display: grid; min-width: 0; }
.skinline__name { font-weight: 800; color: var(--cyan); }
.skinline__meta { font-size: var(--fs-s); color: var(--text-dim); }
.raidlog { display: grid; gap: 0; }
.raidlog__row { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto; gap: 0 var(--sp-2); padding: var(--sp-1) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
.raidlog__row:last-child { border-bottom: 0; }
.raidlog__outcome { font-weight: 800; }
.raidlog__row.is-out .raidlog__outcome { color: var(--cyan); }
.raidlog__row.is-dead .raidlog__outcome { color: var(--red); }
.raidlog__map { font-weight: 700; }
.raidlog__when { color: var(--text-faint); text-align: right; }
.raidlog__meta { grid-column: 2 / -1; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.medalgroup { margin-bottom: var(--sp-4); }
.medalgroup__title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-m); color: var(--cyan); padding-bottom: var(--sp-1); margin-bottom: var(--sp-2); border-bottom: 1px solid var(--line); }
.medalgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: var(--sp-2); }
.medaltile { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 72px; padding: var(--sp-2); background: var(--panel-2); border: 1px solid var(--line); text-align: left; cursor: pointer; }
.medaltile:hover { border-color: var(--cyan-dim); }
.medaltile.is-earned { border-color: var(--cyan-dim); }
.medaltile.is-unearned, .medaltile.is-hidden { background: transparent; }
.medaltile.is-unearned .medaltile__name, .medaltile.is-hidden .medaltile__name { color: var(--text-dim); }
.medaltile.is-pinned { box-shadow: inset 3px 0 0 var(--cyan); }
.medaltile__text { display: grid; gap: 3px; min-width: 0; flex: 1; }
.medaltile__name { font-weight: 700; line-height: 1.25; }
.medaltile__meta { font-size: var(--fs-xs); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.meter--medal { height: 6px; }
.medaldetail { display: grid; gap: var(--sp-3); justify-items: start; }
.medaldetail__head { display: flex; gap: var(--sp-4); align-items: center; }
.medaldetail__fam { color: var(--cyan); font-weight: 700; margin: 0; }
.medaldetail__count { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.tierlist { display: grid; width: 100%; border-top: 1px solid var(--line); }
.tierrow { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
.tierrow__name { font-weight: 700; }
.tierrow__reward { color: var(--text-dim); }
.tierrow__state { color: var(--cyan); font-weight: 700; }
.medaldetail .actions { width: 100%; }
.pick--plain { min-height: var(--tap); }
.pick.is-active { border-color: var(--cyan); background: var(--cyan-wash); }
.earned { display: grid; gap: var(--sp-2); }
.earned__row { display: flex; align-items: center; gap: var(--sp-3); font-weight: 700; }
.earned__die .die__svg { width: 44px; height: 44px; }
.earned__fig .fig { width: 30px; height: 50px; }

/* wardrobe */
.wardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-2); }
.wardtile, .skintile {
  display: grid; justify-items: center; gap: 4px; width: 100%; height: 100%; padding: var(--sp-2) var(--sp-1);
  background: var(--panel-2); border: 1px solid var(--line); text-align: center; cursor: pointer;
}
.wardtile:hover, .skintile:hover { border-color: var(--cyan-dim); }
.wardtile.is-locked, .skintile.is-locked { background: transparent; border-style: dashed; }
.wardtile.is-equipped, .skintile.is-equipped { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan), 0 0 10px color-mix(in srgb, var(--cyan) 20%, transparent); }
.wardtile__fig .fig { width: 84px; height: 140px; }
.wardtile.is-locked .wardtile__fig { opacity: 0.8; }
.wardtile__name, .skintile__name { font-weight: 700; font-size: var(--fs-s); line-height: 1.25; }
.skintile__tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.outfitpreview { display: grid; gap: var(--sp-3); }
.outfitpreview__fig { display: grid; place-items: center; padding: var(--sp-3); background: var(--bg); border: 1px solid var(--line); }
.outfitpreview__fig .fig { width: 150px; height: 250px; }

/* ===================================================================== dice locker */
.tag--rarity { border-color: var(--rar, var(--line-2)); color: var(--rar, var(--text-dim)); }
.rarity-common { --rar: var(--t-general); }
.rarity-uncommon { --rar: var(--t-medical); }
.rarity-rare { --rar: var(--t-special); }
.rarity-epic { --rar: var(--t-epic); }
.rarity-legendary { --rar: var(--t-valuable); }
.rarity-mythic { --rar: var(--t-insane); }
.rarity-seasonal { --rar: var(--red); }
.lockerbar { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.seg--wrap { display: flex; flex-wrap: wrap; }
.seg--wrap .seg__btn { flex: 1 0 auto; border-bottom: 1px solid var(--line-2); }
.skingroup { margin-bottom: var(--sp-4); }
.skingroup__title { display: flex; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-m); color: var(--cyan); padding-bottom: var(--sp-1); margin-bottom: var(--sp-2); border-bottom: 1px solid var(--line); }
.skingroup__rarity { font-size: var(--fs-xs); color: var(--text-dim); font-weight: 400; }
.skingrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-2); }
.skintile__die .die__svg { width: 76px; height: 76px; }
.skintile.is-locked .skintile__die { opacity: 0.85; }
.skinpreview { display: grid; gap: var(--sp-3); }
.skinpreview__stage .dice.is-shown { margin: 0; }
.skinpreview__still { display: grid; place-items: center; padding: var(--sp-4); background: var(--bg); border: 1px solid var(--line); }
.skinpreview__still .die__svg { width: 140px; height: 140px; }
.skinpreview__tags { display: flex; gap: var(--sp-2); }
.skinhow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); padding: var(--sp-2) var(--sp-3); border: 1px dashed var(--line-2); color: var(--text); }
.skinhow__price { font-weight: 800; font-size: var(--fs-l); color: var(--cyan); }

/* ===================================================================== PMC figure */
.fig { display: block; overflow: visible; }
.fig__ln { fill: none; stroke: var(--cyan); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fig__dim { fill: none; stroke: var(--cyan-dim); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.fig__glow { fill: color-mix(in srgb, var(--cyan) 12%, transparent); stroke: var(--cyan-hi); stroke-width: 1.4; stroke-linejoin: round; }
.fig__wound { fill: color-mix(in srgb, var(--red) 25%, transparent); stroke: var(--red); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.fig__weapon .fig__ln { stroke-width: 1.8; }
.fig.is-hurt .fig__ln, .fig.is-hurt .fig__dim { stroke: var(--red); }
.fig.is-hurt .fig__glow { stroke: var(--red); fill: color-mix(in srgb, var(--red) 12%, transparent); }
/* outfit mode: palette fills, cyan-family outline */
.ofit__ln { stroke: var(--cyan-hi); stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; }
.ofit__fill { stroke: none; }
.ofit__detail { stroke-linecap: round; stroke-linejoin: round; }
.ofit__glow { stroke: none; filter: drop-shadow(0 0 2px currentColor); }
.sumfig { display: grid; place-items: center; margin: 0 0 var(--sp-3); padding: var(--sp-2); background: var(--bg); border: 1px solid var(--line); }
.sumfig .fig { width: 110px; height: 184px; }

/* in a raid: side panel on desktop, faint backdrop behind the status area on phones */
.raid__body { flex: 1; min-height: 0; display: flex; }
.raid__body > .feed { flex: 1; min-width: 0; }
.raid__fig { display: none; }
.hud { position: relative; overflow: hidden; }
.hud > * { position: relative; }
.hud > .hud__fig { position: absolute; right: 2px; top: -6px; width: 92px; height: 150px; opacity: 0.12; pointer-events: none; }
.hud__fig .fig { width: 100%; height: 100%; }
@media (min-width: 1000px) {
  .screen.raid { max-width: 1120px; }
  .raid__fig { display: grid; place-items: start center; }
  .raid__fig .fig { width: 130px; height: 216px; }
  .hud > .hud__fig { display: none; }
}

/* ===================================================================== node map: branches */
.edge--unknown { stroke: var(--line-2); stroke-dasharray: calc(var(--u, 1) * 1.2px) calc(var(--u, 1) * 1px); }
.edge--quiet.edge--unknown { stroke-dasharray: calc(var(--u, 1) * 0.5px) calc(var(--u, 1) * 1.2px); }
.edge--loud.edge--unknown { stroke: var(--text-faint); stroke-dasharray: calc(var(--u, 1) * 2px) calc(var(--u, 1) * 1px); stroke-width: calc(var(--u, 1) * 1px); }
.edge--here { stroke: var(--cyan); opacity: 1; }
.edge--here.edge--unknown { stroke: var(--cyan-dim); }
.kindmark circle { fill: var(--bg-deep); stroke: var(--cyan-dim); stroke-width: 0.3; }
.kindmark rect { fill: var(--bg-deep); stroke: var(--text-dim); stroke-width: 0.3; }
.kindmark text { fill: var(--text-dim); font-size: 2.2px; font-weight: 800; font-family: var(--mono); }
.mnode.is-unknown .mnode__dot { fill: var(--bg-deep); stroke: var(--line-2); stroke-dasharray: 0.8 0.6; stroke-width: 0.5; }
.mnode.is-unknown .mnode__q { fill: var(--text-dim); font-size: 2.8px; }
.mnode.is-unknown.is-reachable .mnode__dot { stroke: var(--cyan-dim); fill: color-mix(in srgb, var(--cyan) 8%, transparent); }
.mnode.is-unknown.is-reachable .mnode__q { fill: var(--cyan); }
.lg--unknown { width: 14px; height: 14px; border: 1px dashed var(--line-2); border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; color: var(--text-dim); }
.lgmark { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1px solid var(--cyan-dim); border-radius: 50%; font-size: 10px; font-weight: 800; color: var(--text-dim); margin-left: -4px; }
.lgmark--loud { border-radius: 0; border-color: var(--text-dim); }
.opt.is-hinted { border-color: var(--cyan); box-shadow: 0 0 0 2px var(--cyan), 0 0 16px var(--cyan-glow); }

@media (min-width: 960px) {
  .record { grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 559px) {
  .identity { grid-template-columns: 80px minmax(0, 1fr); }
  .skingrid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .wardgrid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .wardtile__fig .fig { width: 66px; height: 110px; }
}
html[data-motion="reduced"] .medaltoast { animation: none; }
.wardtile, .skintile { align-content: start; }
.wardtile__name, .skintile__name { max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 559px) { .skintile__name, .wardtile__name { font-size: var(--fs-xs); } }

/* contact sheets (used by the UI check to judge every outfit and dice skin at once) */
.contactsheet { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; padding: 16px; }
.contactsheet--dice { grid-template-columns: repeat(5, minmax(220px, 1fr)); }
.contactsheet__cell { margin: 0; display: grid; justify-items: center; gap: 6px; padding: 10px; background: var(--panel); border: 1px solid var(--line); }
.contactsheet__cell .fig { width: 150px; height: 250px; }
.contactsheet__pair { display: flex; gap: 8px; }
.contactsheet__pair .die__svg { width: 92px; height: 92px; }
.contactsheet figcaption { font-size: var(--fs-s); font-weight: 700; text-align: center; }

.record > .panel { grid-column: 1 / -1; }

/* ===================================================================== painted art (spec 13) */
/* Dice: painted image under the code-drawn numeral. The numeral gets a heavier halo on paint. */
.die__mask { mask-type: alpha; }
.die__ph { opacity: 0.3; stroke-width: 2; }
.die__svg.has-art .die__num { stroke-width: 4.6px; stroke-opacity: 0.88; font-size: 27px; }
.die__tint { mix-blend-mode: color; opacity: 0.5; }
/* crit and natural 1 on a painted die: an outline that follows the die's own silhouette.
   Not motion, so it stays under reduced motion (beats the reduced-motion filter reset). */
.die.is-crit .die__svg.has-art { filter: drop-shadow(0 0 1.5px var(--cyan-hi)) drop-shadow(0 0 1.5px var(--cyan-hi)) drop-shadow(0 0 10px var(--cyan)) !important; }
.die.is-fumble .die__svg.has-art { filter: drop-shadow(0 0 1.5px var(--red)) drop-shadow(0 0 1.5px var(--red)) drop-shadow(0 0 10px var(--red-glow)) !important; }
.die__svg.has-art.fx-glow, .die__svg.has-art.fx-pulse { filter: none; }

/* Effects: transform / opacity only, looped. Colour comes from --fx (look.effectColour). */
.die__fx * { transform-box: view-box; }
.fxl-spin, .fxl-halo, .fxl-ping { transform-origin: 50px 50px; }
.fxl-ring { fill: none; stroke: var(--fx, var(--cyan)); stroke-width: 1.4; opacity: 0.22; }
.fxl-stop { stop-color: var(--fx, var(--cyan)); stop-opacity: 0.85; }
.fxl-stop--mid { stop-opacity: 0.32; }
.fxl-stop--hot { stop-color: #fff; stop-opacity: 1; }
.fxl-stop--clear { stop-opacity: 0; }
.fxl-stop--white { stop-color: #fff; }
.fxl-stop--white:not(.fxl-stop--clear) { stop-opacity: 0.75; }
.fxl-halo { opacity: 0.45; }
.fxl-breathe { animation: fx-breathe 3.2s ease-in-out infinite; }
.fxl-throb { animation: fx-throb 1.8s ease-in-out infinite; }
.fxl-beat { animation: fx-beat 1.15s ease-out infinite; }
.fxl-flicker { animation: fx-flicker 2.6s steps(1, end) infinite; }
.fxl-flicker--in { opacity: 0.4; mix-blend-mode: screen; }
.fxl-spin { animation: fx-spin 2.4s linear infinite; }
.fxl-spin--orbit { animation-duration: 2.6s; }
.fxl-spin--slow { animation-duration: 5.5s; }
.fxl-spin--sweep { animation-duration: 3s; }
.fxl-head { opacity: 1; }
.fxl-tail { fill: var(--fx, var(--cyan)); }
.fxl-tail--1 { opacity: 0.75; } .fxl-tail--2 { opacity: 0.55; } .fxl-tail--3 { opacity: 0.4; } .fxl-tail--4 { opacity: 0.26; } .fxl-tail--5 { opacity: 0.14; }
.fxl-blob { opacity: 0.85; }
.fxl-wisp { opacity: 0; animation: fx-wisp 4.2s ease-out infinite; }
.fxl-wisp--1 { animation-delay: -1.05s; } .fxl-wisp--2 { animation-delay: -2.1s; } .fxl-wisp--3 { animation-delay: -3.15s; }
.fxl-wisp { transform-box: fill-box; transform-origin: center; }
.fxl-sweep { opacity: 0.55; }
.fxl-sweepline { stroke: var(--fx, var(--cyan)); stroke-width: 1.2; opacity: 0.9; }
.fxl-ping { fill: none; stroke: var(--fx, var(--cyan)); stroke-width: 1.2; opacity: 0; animation: fx-ping 3s ease-out infinite; }
.fxl-masked { pointer-events: none; }
.fxl-glint { opacity: 0.85; animation: fx-glint 4.2s ease-in-out infinite; }
.fxl-star { fill: #fff; opacity: 0; animation: fx-star 2.8s ease-in-out infinite; }
.die__svg .fxl-star { transform-box: fill-box; transform-origin: center; }
.fxl-star--1 { animation-delay: -0.6s; } .fxl-star--2 { animation-delay: -1.3s; } .fxl-star--3 { animation-delay: -1.9s; } .fxl-star--4 { animation-delay: -2.3s; } .fxl-star--5 { animation-delay: -0.9s; }
.die__svg.fx-frost .fxl-star, .die__svg.fx-frost .fxl-halo { --fx: #dff6ff; }
.fxl-mist { opacity: 0; animation: fx-mist 5s ease-in-out infinite; }
.fxl-mist--1 { animation-delay: -2.5s; }
.fxl-ember { fill: var(--fx); opacity: 0; animation: fx-ember 2.4s ease-out infinite; }
.fxl-ember--1 { animation-delay: -0.5s; } .fxl-ember--2 { animation-delay: -1s; } .fxl-ember--3 { animation-delay: -1.5s; } .fxl-ember--4 { animation-delay: -1.9s; }
.fxl-noise { opacity: 0; animation: fx-noise 3.4s steps(1, end) infinite; }
.fxl-bar { fill: var(--fx); opacity: 0.55; }
.fxl-drop { fill: var(--fx); opacity: 0; animation: fx-drop 3.6s ease-in infinite; }
.die__svg .fxl-drop { transform-box: fill-box; transform-origin: 50% 0; }
.fxl-drop--1 { animation-delay: -1.2s; } .fxl-drop--2 { animation-delay: -2.4s; }
.fxl-irid { opacity: 0.2; mix-blend-mode: overlay; animation: fx-irid 6s ease-in-out infinite alternate; }
.die__svg.fx-heartbeat.has-art .die__art { transform-box: view-box; transform-origin: 50px 50px; animation: fx-beat-art 1.15s ease-out infinite; }
.die__svg.fx-pulse.has-art .die__art { transform-box: view-box; transform-origin: 50px 50px; animation: fx-throb-art 1.8s ease-in-out infinite; }
/* off screen: paused (ui/art.js toggles is-off) */
.die__svg.is-off .die__fx *, .die__svg.is-off .die__art { animation-play-state: paused; }
@keyframes fx-spin { to { transform: rotate(360deg); } }
@keyframes fx-breathe { 0%, 100% { opacity: 0.32; } 50% { opacity: 0.62; } }
@keyframes fx-throb { 0%, 100% { opacity: 0.3; transform: scale(0.94); } 50% { opacity: 0.75; transform: scale(1.04); } }
@keyframes fx-beat { 0% { opacity: 0.35; transform: scale(0.95); } 12% { opacity: 0.85; transform: scale(1.05); } 24% { opacity: 0.45; transform: scale(0.98); } 36% { opacity: 0.75; transform: scale(1.03); } 70%, 100% { opacity: 0.35; transform: scale(0.95); } }
@keyframes fx-beat-art { 0%, 70%, 100% { transform: scale(1); } 12% { transform: scale(1.035); } 24% { transform: scale(1); } 36% { transform: scale(1.02); } }
@keyframes fx-throb-art { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes fx-flicker { 0% { opacity: 0.55; } 7% { opacity: 0.2; } 9% { opacity: 0.6; } 31% { opacity: 0.45; } 33% { opacity: 0.7; } 54% { opacity: 0.25; } 56% { opacity: 0.6; } 58% { opacity: 0.3; } 61% { opacity: 0.65; } 88% { opacity: 0.5; } }
@keyframes fx-wisp { 0% { opacity: 0; transform: translate(0, 4px) scale(0.6); } 30% { opacity: 0.55; } 100% { opacity: 0; transform: translate(0, -46px) scale(1.7); } }
@keyframes fx-ping { 0% { opacity: 0.8; transform: scale(0.2); } 70%, 100% { opacity: 0; transform: scale(1.5); } }
@keyframes fx-glint { 0% { transform: translateX(-10px); opacity: 0; } 8% { opacity: 0.85; } 34% { transform: translateX(130px); opacity: 0.85; } 40%, 100% { transform: translateX(130px); opacity: 0; } }
@keyframes fx-star { 0%, 60%, 100% { opacity: 0; transform: scale(0.2) rotate(0deg); } 75% { opacity: 1; transform: scale(1.2) rotate(45deg); } }
@keyframes fx-mist { 0%, 100% { opacity: 0.15; transform: translateX(-8px); } 50% { opacity: 0.5; transform: translateX(8px); } }
@keyframes fx-ember { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(4px, -60px); } }
@keyframes fx-noise { 0%, 100% { opacity: 0; transform: none; } 70% { opacity: 0.9; transform: translateY(6px); } 72% { opacity: 0.4; transform: translateY(-14px); } 74% { opacity: 0.85; transform: translateY(22px); } 76% { opacity: 0; } 92% { opacity: 0.7; transform: translateY(-4px); } 93% { opacity: 0; } }
@keyframes fx-drop { 0% { opacity: 0; transform: translateY(0) scaleY(0.3); } 30% { opacity: 1; transform: translateY(0) scaleY(1); } 55% { opacity: 1; transform: translateY(1px) scaleY(1.3); } 100% { opacity: 0; transform: translateY(26px) scaleY(1.1); } }
@keyframes fx-irid { from { transform: translateX(0); } to { transform: translateX(-100px); } }
/* reduced motion: no effects at all (the static silhouette glow stays for crit / natural 1) */
html[data-motion="reduced"] .die__fx { display: none; }
@media (prefers-reduced-motion: reduce) { .die__fx { display: none; } }

/* Medals: painted metal in the frame; tier chevrons / ring stay below for colour-blind reading. */
.medal__art { pointer-events: none; }
.medal.has-art .medal__mark { stroke-width: 2.4; }
.medal.has-art.is-earned { filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 4px color-mix(in srgb, var(--m) 35%, transparent)); }
.medal.is-unearned .medal__art { filter: grayscale(1) brightness(0.55); opacity: 0.55; }

/* Outfit / PMC figure: painted image in the same 120x200 frame as the line figure */
.fig__paint { pointer-events: none; }
.fig__paint--kit { opacity: 0.7; }
.fig.has-paint .fig__kit { opacity: 0.9; }
.fig.has-paint .fig__kit .fig__ln, .fig.has-paint .fig__kit .fig__dim { stroke-width: 1.4; }
.fig.is-hurt .fig__paint { filter: sepia(0.8) saturate(3) hue-rotate(-40deg) brightness(0.85); }


/* ===================================================================== raid: tap to roll, modes, map (11 Nov) */
/* the log keeps its newest lines (and the option buttons) at the bottom edge, so buttons stay put between rounds */
.feed { display: flex; flex-direction: column; }
.feed::before { content: ""; flex: 1 0 0; }
.sceneblock { flex: none; }

/* dice: one throw can carry several rolls (hit + location); each is a slot */
.dice__slots { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3) var(--sp-5); width: 100%; }
.dice__slot { display: grid; justify-items: center; align-content: start; gap: var(--sp-1); min-width: 0; }
.dice__slots.is-multi .die { width: clamp(84px, 24vw, 124px); }
.dice__label, .dice__mode, .dice__mods, .dice__total, .dice__verdict, .dice__pair { display: flex; }
.dice__label { font-weight: 700; color: var(--text-dim); }
.dice__mode:empty, .dice__mods:empty, .dice__verdict:empty { display: none; }
.dice__mods { flex-wrap: wrap; justify-content: center; }
.dice__mod { padding: 1px 6px; border: 1px solid var(--line-2); color: var(--text); }
.dice__total { align-items: baseline; gap: 4px; min-height: 1.4em; }
.dice__throw {
  display: grid; justify-items: center; gap: var(--sp-2); width: 100%; padding: var(--sp-2);
  background: transparent; color: inherit; border: 1px dashed var(--cyan-dim); cursor: pointer; font: inherit;
}
.dice__throw:hover { background: var(--cyan-wash); border-color: var(--cyan); }
.dice__throw:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.dice__prompt { font-size: var(--fs-l); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-cyan); background: var(--cyan); padding: 4px 14px; }
.dice__prompt::after { content: " \25B6"; }
.dice.is-armed .die__svg { animation: idle-bob 1.6s ease-in-out infinite; }
.dice.is-armed .die__svg.fx-pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes idle-bob { 50% { transform: translateY(-4px) rotate(-3deg); } }
.dice.is-armed .dice__totalnum:empty + .dice__vs { font-size: var(--fs-m); color: var(--text); }

/* mode banner: icon + word, colour coded, readable without colour */
.mode {
  display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-2); padding: 6px var(--sp-3);
  border: 1px solid var(--m, var(--cyan-dim)); border-left-width: 4px; background: var(--panel); --m: var(--cyan);
}
.mode__icon { display: inline-grid; color: var(--m); }
.mode__icon .icon { width: 22px; height: 22px; }
.mode__word { font-weight: 800; letter-spacing: 0.14em; color: var(--m); }
.mode__sub { color: var(--text-dim); font-size: var(--fs-s); margin-left: auto; text-align: right; }
.mode--fight { --m: var(--red); background: var(--red-wash); }
.mode--move { --m: var(--cyan); }
.mode--loot { --m: var(--t-valuable); }
.mode--search { --m: var(--t-industrial); }
.mode--talk { --m: var(--t-medical); }
.mode--extract { --m: var(--cyan-hi); background: var(--cyan-wash); }
.mode--event { --m: var(--t-epic); }

/* a new fight below the end of the last one */
.sceneblock__earlier { opacity: 0.55; border-left: 2px solid var(--line-2); padding-left: var(--sp-2); margin-bottom: var(--sp-2); }
.sceneblock__earlierhead { font-size: var(--fs-s); color: var(--text-dim); margin-bottom: var(--sp-1); }
.sceneblock__earlierhead::before { content: "\25B4 "; }
.sceneblock__divider { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-2) 0; color: var(--red); font-weight: 800; font-size: var(--fs-s); letter-spacing: 0.08em; text-transform: uppercase; }
.sceneblock__divider::before, .sceneblock__divider::after { content: ""; flex: 1; border-top: 2px solid var(--red-dim); }
.sceneblock__divider[hidden], .sceneblock__earlier[hidden] { display: none; }
.enemy__round { font-weight: 800; font-size: var(--fs-s); color: var(--text); border: 1px solid var(--line-2); padding: 0 6px; }

/* numbered routes and the step towards the destination */
.opt.has-num { padding-left: calc(var(--sp-4) + 30px); }
.opt.has-num::before { display: none; }
.opt__num { position: absolute; left: var(--sp-2); top: var(--sp-2); display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--cyan); color: var(--cyan); font-weight: 800; border-radius: 50%; }
.opt.is-route { border-color: var(--cyan); box-shadow: inset 3px 0 0 var(--cyan); }
.opt.is-route .opt__num { background: var(--cyan); color: var(--on-cyan); }
.opt__route { font-size: var(--fs-s); font-weight: 800; color: var(--cyan-hi); }

/* status: where you are heading */
.hud__heading { margin: var(--sp-1) 0 0; font-size: var(--fs-s); font-weight: 700; color: var(--cyan); display: flex; flex-wrap: wrap; gap: 0 4px; align-items: center; }
.hud__heading:empty { display: none; }
.hud__heading .hud__k { display: inline-flex; color: var(--cyan); }
.hud__heading .icon { width: 1em; height: 1em; }
.hud__heading .warn { color: var(--red); }
.hud__heading .ok { color: var(--text-dim); }

/* phone / tablet map strip: one line under the status bar */
.raidstrip {
  flex: none; display: flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 4px var(--gutter);
  background: var(--bg-2); border-bottom: 1px solid var(--line); font-size: var(--fs-s); overflow: hidden;
}
.raidstrip:empty { display: none; }
.strip__toggle { flex: none; width: 32px; height: 32px; background: transparent; border: 1px solid var(--line-2); color: var(--cyan); cursor: pointer; }
.strip__here { flex: 0 1 auto; min-width: 3em; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip__line + .strip__map, .strip__here + .strip__map { margin-left: auto; }
.strip__you { color: var(--on-cyan); background: var(--cyan); padding: 0 4px; font-size: var(--fs-xs); }
.strip__line { flex: 1 1 auto; min-width: 0; display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.strip__arrow { color: var(--text-dim); }
.strip__chip { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 8px; background: var(--panel); border: 1px solid var(--line-2); color: var(--text); white-space: nowrap; cursor: pointer; font: inherit; font-size: var(--fs-xs); }
.strip__chip.is-route { border-color: var(--cyan); color: var(--cyan-hi); }
.strip__num { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid currentColor; font-weight: 800; }
.strip__chip.is-route .strip__num { background: var(--cyan); color: var(--on-cyan); border-color: var(--cyan); }
.strip__map { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 8px; background: var(--panel); border: 1px solid var(--cyan-dim); color: var(--cyan); cursor: pointer; font: inherit; font-size: var(--fs-xs); }
.strip__map .icon { width: 16px; height: 16px; }

/* desktop side panel: mini map above the figure */
.raid__side { display: none; }
.raid__sidehead { font-size: var(--fs-s); color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase; }
.minimap { display: grid; gap: 4px; width: 100%; padding: 4px; background: var(--bg); border: 1px solid var(--line); cursor: pointer; color: var(--text-dim); font: inherit; font-size: var(--fs-xs); }
.minimap:hover, .minimap:focus-visible { border-color: var(--cyan); }
.minimap .nodemap { display: block; }
@media (min-width: 1000px) {
  .raidstrip { display: none; }
  .raid__side { display: flex; flex-direction: column; gap: var(--sp-2); flex: 0 0 300px; padding: var(--sp-3); border-left: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 60%, transparent); overflow-y: auto; }
}

/* node map additions */
.edge--route { stroke: var(--cyan); stroke-opacity: 0.35; stroke-width: calc(var(--u, 1) * 3px); stroke-linecap: round; }
.edge.is-route { stroke: var(--cyan-hi); }
.routenum circle { fill: var(--bg-deep); stroke: var(--cyan); stroke-width: 0.45; }
.routenum text { fill: var(--cyan); font-size: 2.6px; font-weight: 800; font-family: var(--mono); }
.routenum.is-route circle { fill: var(--cyan); }
.routenum.is-route text { fill: var(--on-cyan); }
.mtag { font-size: 2.1px; font-weight: 800; letter-spacing: 0.08em; paint-order: stroke; stroke: var(--bg-deep); stroke-width: 0.8px; font-family: var(--mono); }
.mtag--you { fill: var(--cyan-hi); }
.mtag--exit { fill: var(--cyan); }
.mtag--closed { fill: var(--red); }
.mtag--dest { fill: var(--t-valuable); }
.mnode__destring { fill: none; stroke: var(--t-valuable); stroke-width: 0.5; stroke-dasharray: 1 0.6; }
.mnode.is-known .mnode__dot { fill: var(--panel-2); stroke: var(--cyan-dim); }
.nodemap--compact .nodemap__grid { display: none; }
.lg--you { width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); border: 0; box-shadow: 0 0 0 2px var(--bg-deep), 0 0 0 3px var(--cyan); }
.lg--visited { width: 12px; height: 12px; border-radius: 50%; background: var(--cyan-dim); border: 0; }
.lg--known { width: 12px; height: 12px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--cyan-dim); }
.lg--route { width: 22px; height: 6px; border: 0; background: color-mix(in srgb, var(--cyan) 45%, transparent); }
.lgnum { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--cyan); color: var(--cyan); font-size: 10px; font-weight: 800; }
.lgtext { font-weight: 800; color: var(--text); }
.maplegend__dest { padding: var(--sp-2) var(--sp-3); border: 1px solid var(--t-valuable); background: var(--panel); }
.maplegend__dest p { margin: 0; }
.maplegend__list li.is-route { color: var(--cyan-hi); font-weight: 700; }
.maplegend__exits li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px var(--sp-2); align-items: center; padding: 2px 0; }

/* tips */
.hint { position: relative; padding-right: 88px; }
.hint__close { position: absolute; right: 6px; top: 6px; min-height: 32px; }

/* briefing cards */
.screen.briefing { max-width: 560px; margin: 0 auto; padding: var(--sp-5) var(--gutter); display: grid; gap: var(--sp-4); }
.briefing__head { font-size: var(--fs-s); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.brief { display: grid; gap: var(--sp-3); }
.brief__body { display: grid; gap: var(--sp-2); padding: var(--sp-4); background: var(--panel); border: 1px solid var(--cyan-dim); min-height: 320px; align-content: start; }
.brief__art { display: grid; place-items: center; height: 120px; color: var(--cyan); }
.brief__art > .icon { width: 72px; height: 72px; stroke-width: 1.3; }
.brief__art--die .die__svg { width: 112px; height: 112px; }
.brief__art--fig .fig { width: 72px; height: 120px; }
.brief__step { margin: 0; font-size: var(--fs-xs); color: var(--text-dim); letter-spacing: 0.1em; }
.brief__title { font-size: var(--fs-xl); color: var(--cyan); text-shadow: var(--glow); }
.brief__text { margin: 0; max-width: 52ch; }
.brief__dots { display: flex; gap: 6px; justify-content: center; }
.brief__dot { width: 8px; height: 8px; border: 1px solid var(--cyan-dim); }
.brief__dot.is-on { background: var(--cyan); border-color: var(--cyan); }
.brief__nav { display: flex; gap: var(--sp-2); justify-content: flex-end; flex-wrap: wrap; }
.brief__nav [data-brief="skip"] { margin-right: auto; }
.btn--help .icon { width: 18px; height: 18px; }
.hideout__captionrow { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }

/* redeem code */
.redeem { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.redeem .field__input { flex: 1 1 160px; text-transform: uppercase; letter-spacing: 0.1em; }
.redeem__msg { margin: var(--sp-2) 0 0; font-weight: 700; }
.redeem__msg:empty { display: none; }
.redeem__msg.ok { color: var(--cyan); }
.redeem__msg.warn { color: var(--red); }
.strip__line:empty { display: none; }
.strip__line:not(:empty) ~ .strip__map { margin-left: 0; }
.raidstrip .strip__here:has(+ .strip__line:not(:empty)) { max-width: 40%; }

/* tap / hover explanations */
.tip { appearance: none; background: transparent; border: 0; border-bottom: 1px dotted var(--text-faint); padding: 0; margin: 0; font: inherit; color: inherit; text-align: inherit; cursor: help; }
.tip:hover, .tip:focus-visible { border-bottom-color: var(--cyan); color: var(--cyan-hi); outline: none; }
.dice__mod.tip, .dice__vs.tip { border: 1px solid var(--line-2); padding: 1px 6px; }
.dice__mod.tip.neg { border-color: var(--red-dim); }
.dice__mode.tip { border: 0; border-bottom: 1px dotted var(--text-faint); }
.dice__vs.tip { color: var(--text); }
.dice__totalnum:not(:empty) + .dice__vs::before { content: "vs "; color: var(--text-dim); }
.dice__mode { color: var(--text-dim); font-size: var(--fs-s); }
.hud__k.tip { display: inline-flex; align-items: center; gap: 4px; justify-self: start; border-bottom-color: var(--line-2); }
.hud__hp .hud__k.tip { color: var(--cyan); font-weight: 700; }
.tipbubble { position: fixed; z-index: 90; padding: var(--sp-2) var(--sp-3); background: var(--panel-3); color: var(--text); border: 1px solid var(--cyan); font-size: var(--fs-s); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); pointer-events: none; }

/* armed die: each die is the button; the panel is a tap target too */
.dice.is-armed { border-style: dashed; border-color: var(--cyan-dim); cursor: pointer; }
.dice__throw { width: auto; padding: 2px; border: 0; background: transparent; display: inline-flex; }
.dice__throw:hover { background: transparent; }
.dice.is-armed > .dice__prompt { justify-self: center; }

/* callouts on the guide pictures */
.callout { cursor: pointer; }
.callout-pop { position: sticky; bottom: 10px; z-index: 30; display: grid; grid-template-columns: 26px 1fr; gap: var(--sp-2); margin-top: var(--sp-2); padding: 10px 12px; background: var(--panel); border: 2px solid var(--t-valuable); color: var(--text); font-size: var(--fs-s); line-height: 1.4; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.75); cursor: pointer; }
.callout-pop[hidden] { display: none; }
.has-callout { position: relative; }
.callout {
  position: absolute; top: -9px; left: -9px; z-index: 2; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--t-valuable); color: #1a1405; font-size: 12px; font-weight: 800; box-shadow: 0 0 0 2px var(--bg); cursor: pointer; pointer-events: auto;
}
.has-callout.is-lit { outline: 2px solid var(--t-valuable); outline-offset: 3px; box-shadow: 0 0 18px rgba(232, 201, 78, 0.35); }
.guide { display: grid; gap: var(--sp-3); }
.guide__title { font-size: var(--fs-m); color: var(--cyan); }
.guide__pic { padding: var(--sp-3) var(--sp-3) var(--sp-2); border: 1px solid var(--line); background: var(--bg); display: grid; gap: var(--sp-2); }
.guide__pic .dice.is-shown { margin: 0; }
.guide__pic .enemy { margin: 0; }
.guide__cap { margin: var(--sp-1) 0 0; font-size: var(--fs-xs); color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }
.guide__pic--hud { padding: var(--sp-3); }
.hud--demo { border: 1px solid var(--line); box-shadow: none; overflow: visible; }
.guide__list { display: grid; gap: 4px; }
.guide__row { display: grid; grid-template-columns: 26px 1fr; gap: var(--sp-2); width: 100%; padding: 6px var(--sp-2); text-align: left; background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: var(--fs-s); cursor: pointer; }
.guide__row.is-lit { border-color: var(--t-valuable); background: rgba(232, 201, 78, 0.08); }
.guide__num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--t-valuable); color: #1a1405; font-weight: 800; font-size: 12px; }
.brief__guide { display: grid; gap: var(--sp-5); margin-top: var(--sp-2); }
.helpsheet { display: grid; gap: var(--sp-3); }
.helpsheet__tabs { display: flex; width: 100%; }
.helpsheet__tabs .seg__btn { flex: 1 1 0; }
.helpsheet .brief__body { min-height: 0; }

/* skill tree cards: name, effect, cost and requirement each on their own line */
.node__head { flex-wrap: wrap; }
.node__name { min-width: 0; overflow-wrap: anywhere; }
.node__cost { margin: 0 0 2px; font-size: var(--fs-s); font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node__req { margin: 0 0 var(--sp-2); font-size: var(--fs-xs); color: var(--text-dim); }
.node .reason { font-size: var(--fs-xs); margin: 0; }
.node .btn.is-confirm { background: var(--t-valuable); border-color: var(--t-valuable); color: #1a1405; white-space: normal; }
.points__money { color: var(--text-dim); font-weight: 400; }
.btn--money.is-confirm { background: var(--t-valuable); color: #1a1405; white-space: normal; text-align: left; }
.dice__vs:empty { display: none; }
.dice__label.has-callout, .dice__mode.has-callout, .dice__total.has-callout, .dice__verdict.has-callout, .dice__vs.has-callout, .dice__mods.has-callout { padding-left: 18px; }
.dice__prompt.has-callout { padding-left: 26px; }
/* the guide's status bar is drawn narrow: keep the phone layout so every label fits */
.hud--demo .hud__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hud--demo .hud__cell--noise, .hud--demo .hud__cell--gun { grid-column: span 2; }
.hud--demo .hud__cell { padding-top: 8px; }

/* "i" beside option buttons with a roll: explains DC / advantage on tap */
.optbox { position: relative; display: grid; }
.optbox > .opt { padding-right: 48px; }
.optinfo.tip {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--line-2); border-radius: 50%; background: var(--bg); color: var(--text-dim);
  font-weight: 800; font-style: italic; font-family: Georgia, serif; font-size: 16px; cursor: help;
}
.optinfo.tip:hover, .optinfo.tip:focus-visible { border-color: var(--cyan); color: var(--cyan); }

/* ===================================================================== phone raid: compact status (two rows) */
@media (max-width: 559px) {
  .screen.raid .hud { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px 3px; padding: 6px 10px; font-size: var(--fs-xs); }
  .screen.raid .hud__grid { display: contents; }
  .screen.raid .hud__hp { grid-column: 1 / span 4; grid-row: 1; gap: 4px; }
  .screen.raid .hud__hp > .hud__v { font-size: var(--fs-s); }
  .screen.raid .hud__effects { grid-column: 1 / -1; gap: 3px; }
  .screen.raid .hud__effects .chip { font-size: 11px; padding: 0 4px; line-height: 1.4; }
  .screen.raid .hud__hp { grid-template-columns: auto 1fr auto; }
  .screen.raid .hud__hp > .hud__v { overflow: visible; }
  .screen.raid .hud__cell { padding: 1px 4px; border: 1px solid var(--line); background: var(--panel); }
  .screen.raid .hud__cell--gun { grid-column: 5 / span 2; grid-row: 1; }
  .screen.raid .hud__cell--gun .hud__k { display: none; }
  .screen.raid .hud__cell--gun .hud__v { font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .screen.raid .hud__cell--gun .hud__cond { display: none; }
  .screen.raid .hud__cell--noise { grid-column: auto; }
  .screen.raid .hud__cell { grid-row: 2; }
  .screen.raid .hud__cell--gun { grid-row: 1; }
  .screen.raid .hud__k { font-size: 11px; line-height: 1.2; }
  .screen.raid .hud__v { font-size: 12px; line-height: 1.3; }
  .screen.raid .noise { height: 1em; gap: 1px; }
  .screen.raid .noise__seg { height: 7px; }
  .screen.raid .hud__heading { grid-column: 1 / -1; margin: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .screen.raid .hud__heading > * { display: inline; }
  .screen.raid .raidstrip { min-height: 34px; padding: 2px 10px; }
  .screen.raid .strip__toggle, .screen.raid .strip__map { height: 28px; min-height: 28px; }
  /* landed dice shrink so the result and the first choice fit together */
  .screen.raid .dice.is-shown { padding: var(--sp-2); margin: var(--sp-1) 0 var(--sp-2); gap: 4px; }
  .screen.raid .dice.is-landed .die { width: 68px; }
  .screen.raid .dice.is-landed .dice__slots { gap: 4px var(--sp-3); }
  .screen.raid .dice.is-landed .dice__totalnum { font-size: var(--fs-xl); }
  .screen.raid .dice.is-landed .dice__verdict { font-size: var(--fs-l); min-height: 0; }
  .screen.raid .dice.is-landed .dice__mods { font-size: var(--fs-xs); }
  /* fight actions: two columns of short buttons */
  .screen.raid .opts--fight { grid-template-columns: 1fr 1fr; gap: 6px; }
  .screen.raid .opts--fight .opt { min-height: 48px; padding: 6px 8px 6px 22px; }
  .screen.raid .opts--fight .opt::before { left: 8px; }
  .screen.raid .opts--fight .opt__label { font-size: var(--fs-m); }
  .screen.raid .opts--fight .optbox > .opt { padding-right: 34px; }
  .screen.raid .opts--fight .optinfo.tip { width: 26px; height: 26px; font-size: 13px; top: 4px; right: 4px; }
  .screen.raid .mode { padding: 4px 10px; margin-bottom: 6px; }
  .screen.raid .enemy { margin: 6px 0; padding: 6px 10px; }
  .screen.raid .sceneblock { padding: var(--sp-2) 0; }
}
@media (max-width: 559px) {
  .screen.raid .hud__unit { display: none; }
  .screen.raid .hud__heading .icon { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; }
  .screen.raid .mode__sub { font-size: var(--fs-xs); }
}

/* search / filter bar (traders, stash) */
.filterbar { display: grid; gap: 6px; margin-bottom: var(--sp-3); }
.filterbar__row { display: flex; gap: 6px; align-items: center; }
.filterbar__icon { display: grid; color: var(--text-dim); }
.filterbar__icon .icon { width: 18px; height: 18px; }
.filterbar__input { flex: 1 1 auto; min-width: 0; min-height: 40px; }
.filterbar__input::-webkit-search-cancel-button { display: none; }
.filterbar__clear { flex: none; min-width: 40px; min-height: 40px; padding: 0; display: grid; place-items: center; }
.filterbar__clear .icon { width: 16px; height: 16px; }
.filterbar__sort { flex: none; min-height: 40px; max-width: 42%; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); font: inherit; font-size: var(--fs-s); padding: 0 6px; }
.filterbar__chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip-btn { flex: none; min-height: 34px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line-2); color: var(--text-dim); font: inherit; font-size: var(--fs-s); cursor: pointer; white-space: nowrap; }
.chip-btn.is-active { background: var(--cyan-wash); border-color: var(--cyan); color: var(--cyan-hi); font-weight: 700; }
.filterbar__afford { margin-left: 6px; border-style: dashed; }
.filterbar__count { margin: 0; font-size: var(--fs-xs); color: var(--text-dim); }
.filterbar__empty { padding: var(--sp-3); border: 1px dashed var(--line-2); display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.filterbar__empty p { margin: 0; }
.filterbar__empty[hidden], .shop__row[hidden], .slotcell[hidden] { display: none; }
.trader-pick--all .trader-pick__name { display: inline-flex; gap: 4px; align-items: center; }
.trader-pick--all .icon { width: 16px; height: 16px; }
@media (max-width: 959px) {
  .traderlist > li:first-child { grid-column: 1 / -1; }
  .trader-pick--all { min-height: 36px; grid-template-columns: 1fr auto; align-items: center; }
}

/* ===================================================================== the physical die (hover, hold, throw) */
.dice.is-armed { user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.dice.is-armed .dice__throw { touch-action: none; -webkit-touch-callout: none; }
.die { position: relative; isolation: isolate; }
.die::before {
  content: ""; position: absolute; inset: -20%; border-radius: 50%; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--fx, var(--cyan)) 55%, transparent) 0%, transparent 64%);
  transition: opacity 180ms;
}
.dice.is-armed.is-hover .die::before { opacity: 0.5; }
.dice.is-held .die::before { opacity: calc(0.6 + 0.4 * var(--charge, 0)); transform: scale(calc(1 + 0.3 * var(--charge, 0))); transition: none; }
.dice.is-flying .die::before { opacity: 0.65; }
.dice.is-armed.is-hover .die__svg { animation: die-wobble 2.6s ease-in-out infinite; }
.dice.is-held .die__svg, .dice.is-flying .die__svg { animation: none; }
.dice.is-held .die, .dice.is-flying .die { transition: none; will-change: transform; }
@keyframes die-wobble {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  25% { transform: rotate(5deg) translateY(-6px); }
  50% { transform: rotate(9deg) translateY(-2px); }
  75% { transform: rotate(-3deg) translateY(-7px); }
}
/* effects: full strength while it is awake, faster and brighter in the hand and in the air */
.dice.is-hover .fxl-halo, .dice.is-flying .fxl-halo { opacity: 0.8; }
.dice.is-hover .fxl-ring { opacity: 0.45; }
.dice.is-held .fxl-halo { opacity: 1; }
.dice.is-held .fxl-ring { opacity: 0.7; }
.dice.is-held .fxl-spin, .dice.is-flying .fxl-spin { animation-duration: 0.85s; }
.dice.is-held .fxl-wisp, .dice.is-flying .fxl-wisp { animation-duration: 1.5s; }
.dice.is-held .fxl-ember, .dice.is-flying .fxl-ember { animation-duration: 1s; }
.dice.is-held .fxl-star, .dice.is-flying .fxl-star { animation-duration: 1.1s; }
.dice.is-held .fxl-glint, .dice.is-flying .fxl-glint { animation-duration: 1.4s; }
.dice.is-held .fxl-breathe, .dice.is-held .fxl-throb, .dice.is-held .fxl-beat { animation-duration: 0.7s; }
.dice.is-held .fxl-ping { animation-duration: 1.2s; }
.dice.is-held .dice__prompt { background: var(--cyan-hi); }
.dice__holdhint { font-size: var(--fs-xs); color: var(--text-dim); }
.dice.is-held .dice__holdhint { color: var(--cyan); }
@media (hover: none) { .dice__holdhint { display: none; } }
/* reduced motion: a press is a plain highlight, release reveals */
html[data-motion="reduced"] .dice.is-held .dice__throw { outline: 3px solid var(--cyan); background: var(--cyan-wash); }
html[data-motion="reduced"] .die::before { display: none; }
@media (prefers-reduced-motion: reduce) {
  .dice.is-held .dice__throw { outline: 3px solid var(--cyan); background: var(--cyan-wash); }
  .die::before { display: none; }
}

/* ===================================================================== hideout: stations that stand out (spec 18) */
/* usable stations: bright lines with a soft glow; the room shell recedes */
.bunker__room .ln-dim { stroke-opacity: 0.55; }
.station:not(.is-soon) .station__art { filter: drop-shadow(0 0 3px var(--cyan-glow)); }
.station:not(.is-soon) .station__art .ln { stroke: var(--cyan); stroke-width: 2.2; }
.station:not(.is-soon) .station__art .ln-dim { stroke: var(--cyan); stroke-opacity: 0.7; }
.station:not(.is-soon) .station__label rect { fill: var(--panel); stroke: var(--cyan); stroke-width: 1.8; }
.station:not(.is-soon) .station__label text { fill: var(--cyan-hi); }
/* hover, keyboard focus and a finger on it: the whole station lights, the label inverts */
.station:not(.is-soon):hover .station__hit, .station:not(.is-soon):focus-visible .station__hit, .station.is-lit .station__hit {
  fill: color-mix(in srgb, var(--cyan) 12%, transparent); stroke: var(--cyan); stroke-dasharray: none;
}
.station:not(.is-soon):hover .station__art, .station:not(.is-soon):focus-visible .station__art, .station.is-lit .station__art {
  filter: drop-shadow(0 0 6px var(--cyan)) drop-shadow(0 0 2px var(--cyan-hi));
}
.station:not(.is-soon):hover .station__art :is(.ln, .ln-dim), .station:not(.is-soon):focus-visible .station__art :is(.ln, .ln-dim), .station.is-lit .station__art :is(.ln, .ln-dim) { stroke: var(--cyan-hi); stroke-opacity: 1; }
.station:not(.is-soon):hover .station__label rect, .station:not(.is-soon):focus-visible .station__label rect, .station.is-lit .station__label rect { fill: var(--cyan); stroke: var(--cyan-hi); }
.station:not(.is-soon):hover .station__label text, .station:not(.is-soon):focus-visible .station__label text, .station.is-lit .station__label text { fill: var(--on-cyan); }
/* "soon": much dimmer, no glow */
.station.is-soon .station__art { opacity: 0.16; filter: grayscale(1); }
.station.is-soon .station__label, .station.is-soon .station__soon { opacity: 0.6; }

/* the station cards: an even grid, equal heights, usable first, "soon" in their own last row */
.stationcards { display: grid; gap: 0; }
.stations { grid-auto-rows: 1fr; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.stations > li { display: flex; min-width: 0; }
.station-row { height: 100%; min-height: 78px; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3); }
.station-row__icon { margin-top: 2px; }
.station-row__text { align-content: start; gap: 2px; }
.station-row__name { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; line-height: 1.3; }
.station-row__name .tag--soon { flex: none; font-size: var(--fs-xs); }
.station-row__blurb { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.station-row:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.station-row:not(.is-soon):hover .station-row__name { color: var(--cyan-hi); }
.stations--soon .station-row { background: transparent; opacity: 0.75; min-height: 70px; }
.stations__later { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }

/* ===================================================================== skins: screen themes and hideout skins */
.bunker { --cyan-glow: color-mix(in srgb, var(--cyan) 35%, transparent); }
.bunker[data-line="sketch"] .station__art .ln { stroke-dasharray: 14 2 6 2; }
.bunker[data-line="fine"] .ln { stroke-width: 1.4; }
.bunker[data-line="fine"] .station:not(.is-soon) .station__art .ln { stroke-width: 1.6; }
.bunker[data-line="double"] .station:not(.is-soon) .station__art .ln { stroke-width: 3; paint-order: stroke; }
.bunker[data-line="neon"] .station:not(.is-soon) .station__art { filter: drop-shadow(0 0 4px var(--cyan)) drop-shadow(0 0 10px var(--cyan-glow)); }
.dz-frost { fill: none; stroke: #e6f7ff; stroke-width: 2; stroke-linecap: round; opacity: 0.55; }
.dz-snow { fill: none; stroke: #f4fbff; stroke-width: 4; stroke-linecap: round; opacity: 0.7; }
.dz-wire { fill: none; stroke: var(--cyan-dim); stroke-width: 1.4; }
.dz-bulb { opacity: 0.9; animation: dz-twinkle 2.4s ease-in-out infinite; }
.dz-bulb--a { fill: #ff6a6a; } .dz-bulb--b { fill: #ffd166; animation-delay: -0.6s; } .dz-bulb--c { fill: #7fe7a0; animation-delay: -1.2s; } .dz-bulb--d { fill: #8ec5ff; animation-delay: -1.8s; }
@keyframes dz-twinkle { 0%, 100% { opacity: 0.95; } 50% { opacity: 0.35; } }
.dz-flame { fill: #ffcf7a; animation: dz-twinkle 1.3s ease-in-out infinite; }
.dz-strip { fill: color-mix(in srgb, var(--cyan-hi) 70%, transparent); }
.dz-board { fill: var(--cyan-hi); font-size: 22px; font-weight: 800; letter-spacing: 0.12em; }
.dz-neon { fill: none; stroke: var(--cyan-hi); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--cyan)); animation: dz-hum 5s steps(1, end) infinite; }
.dz-neon--b { stroke: #8ef6ff; }
.dz-neontext { fill: var(--cyan-hi); font-size: 30px; font-weight: 800; filter: drop-shadow(0 0 6px var(--cyan)); }
@keyframes dz-hum { 0%, 100% { opacity: 1; } 62% { opacity: 0.55; } 64% { opacity: 1; } 66% { opacity: 0.7; } 68% { opacity: 1; } }
.bunker__dress { pointer-events: none; }

.skins { display: grid; gap: var(--sp-4); }
.skins__group { display: grid; gap: var(--sp-3); }
.themegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 1fr; gap: var(--sp-2); }
.themegrid > li { display: flex; }
.themecard {
  display: grid; grid-template-rows: auto 1fr auto; gap: var(--sp-2); width: 100%; padding: var(--sp-2); text-align: left;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer;
}
.themecard:hover { border-color: var(--cyan-dim); }
.themecard:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.themecard.is-previewing, .themecard[aria-pressed="true"] { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.themecard.is-locked .themecard__swatch { opacity: 0.8; }
.themecard__name { font-weight: 700; color: var(--cyan); line-height: 1.3; }
.themecard__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.themecard__swatch { position: relative; display: block; height: 64px; background: var(--sw-bg, var(--bg)); border: 1px solid var(--sw-line, var(--line-2)); overflow: hidden; }
.themecard__panel { position: absolute; left: 8px; top: 8px; right: 34px; bottom: 8px; display: flex; align-items: baseline; gap: 6px; padding: 4px 8px; background: var(--sw-panel, var(--panel)); border: 1px solid var(--sw-line, var(--line-2)); }
.themecard__aa { color: var(--sw-text, var(--text)); font-weight: 800; }
.themecard__dim { color: var(--sw-dim, var(--text-dim)); font-size: var(--fs-xs); }
.themecard__accent { position: absolute; right: 8px; top: 8px; bottom: 8px; width: 18px; background: var(--sw-accent, var(--cyan)); box-shadow: 0 0 8px var(--sw-accent, var(--cyan)); }
.themecard__lines { position: absolute; inset: 8px 34px 8px 8px; background: repeating-linear-gradient(90deg, transparent 0 14px, var(--sw-line, var(--line-2)) 14px 15px), repeating-linear-gradient(0deg, transparent 0 14px, var(--sw-line, var(--line-2)) 14px 15px); opacity: 0.7; }
.tag--src-premium { border-color: var(--t-valuable); color: var(--t-valuable); }
.tag--src-prestige { border-color: var(--t-insane); color: var(--t-insane); }
.tag--src-earned { border-color: var(--t-medical); color: var(--t-medical); }
.skins__action { display: grid; gap: var(--sp-2); padding: var(--sp-3); border: 1px dashed var(--cyan-dim); justify-items: start; }
.skins__desc { margin: 0; }
.skins__bunker { margin: 0; }
.stats--appearance { margin-bottom: var(--sp-3); }

/* prestige theme: a slow scanline crosses the screen. premium theme: the aurora drifts. Motion off when reduced. */
html[data-theme-fx="scanline"] body::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 140px; z-index: 999; pointer-events: none;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--cyan) 7%, transparent) 60%, color-mix(in srgb, var(--cyan-hi) 12%, transparent) 62%, transparent);
  transform: translateY(-160px); animation: theme-scan 9s linear infinite;
}
@keyframes theme-scan { to { transform: translateY(110vh); } }
html[data-theme-fx="aurora"] body::before {
  content: ""; position: fixed; inset: -20% -20% auto -20%; height: 70vh; z-index: 0; pointer-events: none; opacity: 0.55;
  background:
    radial-gradient(ellipse 40% 50% at 30% 40%, color-mix(in srgb, #4dffb0 22%, transparent), transparent 70%),
    radial-gradient(ellipse 35% 45% at 70% 30%, color-mix(in srgb, #9a6bff 22%, transparent), transparent 70%),
    radial-gradient(ellipse 30% 40% at 50% 60%, color-mix(in srgb, #3ad7ff 16%, transparent), transparent 70%);
  animation: theme-aurora 26s ease-in-out infinite alternate;
}
html[data-theme-fx="aurora"] .app { position: relative; z-index: 1; }
@keyframes theme-aurora { 0% { transform: translateX(-6%) skewX(-4deg); opacity: 0.4; } 50% { transform: translateX(4%) skewX(3deg); opacity: 0.65; } 100% { transform: translateX(8%) skewX(-2deg); opacity: 0.45; } }
html[data-motion="reduced"][data-theme-fx="scanline"] body::before { display: none; }
@media (prefers-reduced-motion: reduce) { html[data-theme-fx="scanline"] body::before { display: none; } }
@media (max-width: 559px) { .stations { grid-auto-rows: auto; } .station-row { min-height: 64px; } }

/* ===================================================================== the figure, alive (idle and reactions) */
.figstage { position: relative; display: block; width: 100%; height: 100%; }
.figstage__anim, .figstage__react { position: relative; width: 100%; height: 100%; transform-origin: 50% 95%; }
.figstage .fig { width: 100%; height: 100%; }
.raid__fig .figstage { width: 130px; height: 216px; }
.outfitpreview__fig .figstage { width: 150px; height: 250px; }
.figstage__video, .figstage__sprite { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; pointer-events: none; }
.figstage__sprite { background-repeat: no-repeat; animation-name: fig-sprite; animation-iteration-count: infinite; }
@keyframes fig-sprite { from { background-position: 0% 0; } to { background-position: 100% 0; } }
.figstage.has-motion .fig__paint { display: none; }
.figstage__flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--red) 55%, transparent), transparent 70%); }
.figstage__shimmer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; mix-blend-mode: screen; }
.figstage__shimmer::before {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: -60%; width: 40%; opacity: 0;
  background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--cyan-hi) 45%, transparent), transparent);
}
/* idle: breathing from the feet, a slow weight shift, and a rim of light passing now and then */
.figstage--full .figstage__anim { animation: fig-breathe 4.6s ease-in-out infinite, fig-sway 9s ease-in-out infinite; }
.figstage--full:not(.has-motion) .figstage__shimmer::before { animation: fig-shimmer 11s ease-in-out infinite 2s; }
.figstage--gentle .figstage__anim { animation: fig-breathe 5.2s ease-in-out infinite; }
.figstage.has-motion .figstage__anim { animation: none; }
@keyframes fig-breathe { 0%, 100% { transform: scale(1, 1); } 45% { transform: scale(1.006, 1.016); } 55% { transform: scale(1.006, 1.016) translateY(-0.6px); } }
@keyframes fig-sway { 0%, 100% { rotate: 0deg; translate: 0 0; } 30% { rotate: -0.8deg; translate: -1px 0; } 62% { rotate: 0.6deg; translate: 1px -1px; } 80% { rotate: 0.2deg; translate: 0 -2px; } }
@keyframes fig-shimmer { 0%, 70% { transform: translateX(0) skewX(-12deg); opacity: 0; } 72% { opacity: 1; } 88% { transform: translateX(380%) skewX(-12deg); opacity: 0.9; } 90%, 100% { transform: translateX(380%) skewX(-12deg); opacity: 0; } }
/* reactions */
.figstage.is-hit .figstage__react { animation: fig-recoil 480ms ease-out; }
.figstage.is-hit .figstage__flash { animation: fig-flash 480ms ease-out; }
@keyframes fig-recoil { 0% { transform: translate(0, 0); } 15% { transform: translate(-5px, 1px) rotate(-3deg); } 30% { transform: translate(4px, -1px) rotate(2deg); } 50% { transform: translate(-2px, 0) rotate(-1deg); } 100% { transform: none; } }
@keyframes fig-flash { 0% { opacity: 0.9; } 100% { opacity: 0; } }
.figstage.is-shoot .figstage__react { animation: fig-kick 340ms ease-out; }
@keyframes fig-kick { 0% { transform: none; } 20% { transform: translateX(-4px) rotate(-2.5deg); } 100% { transform: none; } }
.figstage.is-lunge .figstage__react { animation: fig-lunge 400ms ease-out; }
@keyframes fig-lunge { 0% { transform: none; } 35% { transform: translate(5px, 2px) rotate(3deg); } 100% { transform: none; } }
.figstage.is-hurt .figstage__react { transform: rotate(2.5deg) translateX(2px); transition: transform 600ms; }
.figstage--full.is-hurt .figstage__anim { animation-duration: 2.4s, 6s; }
.figstage.is-hurt .fig__paint { filter: sepia(0.8) saturate(3) hue-rotate(-40deg) brightness(0.85); }
.figstage.is-sneak .figstage__react { transform: translateY(5%) scaleY(0.95); opacity: 0.72; transition: transform 500ms, opacity 500ms; }
.figstage.is-night { filter: brightness(0.62) saturate(0.7); }
.figstage.is-night.is-nv::after {
  content: ""; position: absolute; left: 41%; top: 14.5%; width: 18%; height: 3%; pointer-events: none; border-radius: 40%;
  background: radial-gradient(ellipse, #7dff9a 0 35%, color-mix(in srgb, #3dff6e 45%, transparent) 55%, transparent 75%);
  filter: drop-shadow(0 0 4px #3dff6e); animation: fig-nv 2.2s ease-in-out infinite;
}
@keyframes fig-nv { 50% { opacity: 0.6; } }
.figstage.is-urgent .figstage__flash { animation: fig-urgent 1.1s ease-in-out infinite; }
@keyframes fig-urgent { 0%, 100% { opacity: 0; } 50% { opacity: 0.45; } }
.figstage.is-out .figstage__react { transform: scale(1.02) translateY(-2px); transition: transform 700ms ease-out; }
.figstage.is-out .figstage__anim { animation: fig-breathe 4.6s ease-in-out infinite; }
.figstage.is-down .figstage__react { transform: translateY(8%) rotate(78deg); opacity: 0.12; transition: transform 1.2s cubic-bezier(.5, 0, .8, .4), opacity 1.6s ease-in 0.4s; }
.figstage.is-down .figstage__anim { animation: none; }
/* paused when the tab is hidden; still under reduced motion (the tints stay) */
html[data-hidden] .figstage *, html[data-hidden] .figstage::after { animation-play-state: paused !important; }
html[data-motion="reduced"] .figstage__shimmer { display: none; }
@media (prefers-reduced-motion: reduce) { .figstage__shimmer { display: none; } }

/* ===================================================================== raid clock, free rolls, ammo, gear (contracts 18) */
.hud__clock { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 2px var(--sp-2); }
.hud__clock .hud__v { font-variant-numeric: tabular-nums; }
.meter--clock .meter__fill { background: var(--cyan); }
.hud__clock.is-last10 .hud__v, .hud__clock.is-last10 .hud__k { color: var(--t-valuable); }
.hud__clock.is-last10 .meter--clock .meter__fill { background: var(--t-valuable); }
.hud__clock.is-last5 .hud__v, .hud__clock.is-last5 .hud__k { color: var(--red); }
.hud__clock.is-last5 .meter--clock .meter__fill { background: var(--red); }
.hud__clock.is-overtime { background: var(--red-wash); outline: 1px solid var(--red); }
.hud__sweep { color: var(--red); font-weight: 800; letter-spacing: 0.06em; animation: blink 1s steps(1) infinite; }
@media (max-width: 759px) {
  .screen.raid .hud__clock { grid-column: 1 / -1; grid-row: 3; grid-template-columns: auto auto 1fr; padding: 0 2px; }
  .screen.raid .hud__heading { grid-row: 4; }
}
.chip--time { border-style: dashed; color: var(--text-dim); }
.chip--time.is-free { color: var(--cyan); border-color: var(--cyan-dim); }
.chip--free { border-color: var(--t-valuable); color: var(--t-valuable); background: color-mix(in srgb, var(--t-valuable) 10%, transparent); }
.opt--free { border-color: var(--t-valuable); }
.opt--free .opt__label { color: var(--t-valuable); }
.opt--reroll { border-style: dashed; border-color: var(--t-valuable); }
.opt--reroll .opt__label::before { content: "\21BB  "; }
.opt.is-late { border-color: var(--red-dim); }
.opt__ammo { display: block; font-size: var(--fs-xs); color: var(--text-dim); margin-top: 2px; }
.opt__throw { color: var(--text); }
.freebanner { margin: 0 0 var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--t-valuable); background: color-mix(in srgb, var(--t-valuable) 8%, transparent); color: var(--text); }
.freebanner strong { color: var(--t-valuable); }
.freebanner__src { color: var(--text-dim); }
.tag--ammo { font-size: var(--fs-xs); padding: 0 5px; vertical-align: 1px; border-color: var(--ammo, var(--line-2)); color: var(--ammo, var(--text-dim)); }
.ammo-sp { --ammo: var(--t-general); } .ammo-tracer { --ammo: var(--t-industrial); } .ammo-hp { --ammo: var(--t-medical); }
.ammo-fmj { --ammo: var(--t-special); } .ammo-ap { --ammo: var(--t-valuable); } .ammo-iap { --ammo: var(--t-insane); }
.ammoladder { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; margin: var(--sp-2) 0 var(--sp-3); }
.ammoladder__step { display: grid; place-items: center; min-height: 30px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-dim); font-size: var(--fs-xs); font-weight: 700; }
.ammoladder__step.is-below { background: var(--panel-2); }
.ammoladder__step.is-on { border-color: var(--cyan); color: var(--on-cyan); background: var(--cyan); }
.ammoladder__role { grid-column: 1 / -1; margin: 4px 0 0; font-size: var(--fs-s); color: var(--text); }
.ammoblock, .gearblock { margin-top: var(--sp-3); display: grid; gap: var(--sp-2); }
.ammorow { display: grid; gap: 4px; padding: var(--sp-2); border: 1px solid var(--line); background: var(--bg-2); }
.ammorow__type { margin: 0; font-size: var(--fs-s); }
.ammorow__stats { color: var(--text-dim); }
.ammopick { display: flex; flex-wrap: wrap; gap: 6px; }
.ammopick .chip-btn { white-space: normal; text-align: left; }
.warnlist--soft { margin: 0; }
.warnlist--soft li { color: var(--text); font-size: var(--fs-s); }
.warnlist--soft li::before { border-color: var(--t-valuable); color: var(--t-valuable); }
.gearlist { display: grid; gap: 6px; }
.gearlist__row { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--sp-2); padding: 6px var(--sp-2); border: 1px solid var(--line); }
.gearlist__name { font-weight: 700; }
.gearlist__text { grid-column: 1 / -1; font-size: var(--fs-s); color: var(--text-dim); }
.gearlist__row.is-used { opacity: 0.6; }

/* ===================================================================== faces and portraits */
.enemy.has-face { grid-template-columns: auto 1fr auto; }
.enemy.has-face > .facepop { grid-row: 1 / span 2; grid-column: 1; }
.enemy.has-face > .enemy__head { grid-column: 2 / -1; }
.facepop { display: flex; align-items: flex-end; gap: 4px; }
.facepop.is-new .face { animation: face-pop 360ms cubic-bezier(.2, 1.4, .4, 1) both; }
.facepop.is-new .face:nth-child(2) { animation-delay: 60ms; } .facepop.is-new .face:nth-child(3) { animation-delay: 120ms; } .facepop.is-new .face:nth-child(4) { animation-delay: 180ms; }
@keyframes face-pop { from { transform: translateY(10px) scale(0.6); opacity: 0; } }
.face { display: grid; place-items: center; overflow: hidden; border: 2px solid var(--line-2); background: var(--bg-deep); flex: none; }
.face--m { width: 56px; height: 56px; }
.face--s { width: 34px; height: 34px; opacity: 0.75; }
.face.is-current { border-color: var(--red); }
.face__img, .face__svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.face__body { fill: var(--panel-3); stroke: #05080a; stroke-width: 3; }
.face__skin { fill: #c49a7a; stroke: #05080a; stroke-width: 3; }
.face__gear { fill: #3e4a40; stroke: #05080a; stroke-width: 3; stroke-linejoin: round; }
.face__gear2 { fill: #5a4a3a; stroke: #05080a; stroke-width: 3; stroke-linejoin: round; }
.face__strap { stroke: #05080a; stroke-width: 3; }
.face__eyes { fill: #3dff6e; stroke: #05080a; stroke-width: 2; }
.face__eye { fill: #05080a; }
.face__bandage { fill: #e8e2d6; stroke: #05080a; stroke-width: 2; }
.face--pmc .face__gear { fill: #2f3a46; }
.face--guards .face__gear { fill: #4a5240; }
.face--hunters .face__gear { fill: #22282c; }
.face--boss .face__body, .face--patch .face__body { fill: #4a2a26; }
.face--friendly { border-color: var(--cyan-dim); }
.face--shady .face__body { fill: #3a3326; }
.portrait { position: relative; display: grid; place-items: center; overflow: hidden; flex: none; border: 1px solid var(--line-2); background: var(--bg-deep); }
.portrait--s { width: 34px; height: 34px; }
.portrait--l { width: 96px; height: 96px; border-width: 2px; border-color: var(--cyan-dim); }
.portrait__img { width: 100%; height: 100%; object-fit: cover; }
.portrait.is-placeholder .face__svg { opacity: 0.55; }
.portrait__initial { position: absolute; right: 3px; bottom: 1px; font-weight: 800; font-size: var(--fs-xs); color: var(--cyan); }
.portrait--l .portrait__initial { font-size: var(--fs-l); right: 6px; bottom: 2px; }
.trader-pick { display: grid; grid-template-columns: auto 1fr; column-gap: var(--sp-2); align-items: center; }
.trader-pick > .portrait { grid-row: 1 / span 2; }
.trader-pick--all { grid-template-columns: 1fr; }
.trader-pick.is-locked .portrait { filter: grayscale(1); opacity: 0.6; }
.trader__hero { display: flex; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-3); }
.trader__hero .trader__greeting { margin: 0; flex: 1; }
.trader__hero .notice { margin: 0; }
.shop__ammo { color: var(--text-dim); }
@media (max-width: 559px) { .portrait--l { width: 72px; height: 72px; } }
@media (min-width: 560px) and (max-width: 959px) { .traderlist { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 559px) { .trader-pick > .portrait { display: none; } .trader-pick { grid-template-columns: 1fr; } }
.death--mia { border-color: color-mix(in srgb, var(--t-valuable) 50%, transparent); background: radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--t-valuable) 12%, transparent), transparent 70%), var(--panel); }
.death--mia .death__kia { color: var(--t-valuable); border-color: var(--t-valuable); }
.item__icon.has-art { display: grid; place-items: center; }
.item__img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
/* painted icons fill the box: the files are 128px with a small margin, so the box grows a little */
.item__icon.has-art { width: 44px; height: 44px; margin: -3px 0 -2px -3px; }
.item--mini .item__icon.has-art { width: 46px; height: 46px; margin: 0; }
.itemdetail__icon.has-art { padding: 2px; }
/* faces pop up beside the enemy panel at a readable size; trader cards keep a small portrait on phones */
.face--m { width: 72px; height: 72px; }
@media (min-width: 960px) { .face--m { width: 88px; height: 88px; } .trader-pick > .portrait--s { width: 44px; height: 44px; } }
@media (max-width: 559px) {
  /* name keeps the full width; the portrait sits beside the loyalty line */
  .trader-pick:not(.trader-pick--all) { grid-template-columns: auto 1fr; grid-template-areas: "name name" "pic meta"; column-gap: 4px; row-gap: 3px; }
  .trader-pick:not(.trader-pick--all) > .trader-pick__name { grid-area: name; }
  .trader-pick:not(.trader-pick--all) > .trader-pick__meta { grid-area: meta; min-width: 0; overflow-wrap: anywhere; }
  .trader-pick > .portrait { display: grid; grid-area: pic; grid-row: auto; width: 22px; height: 22px; }
  .portrait--l { width: 88px; height: 88px; }
}
.identity__titlehow { font-size: var(--fs-xs); }
.guides { display: grid; gap: var(--sp-3); }
.guidecard { padding: var(--sp-3); border: 1px solid var(--line); background: var(--panel); }
.guidecard__title { display: flex; align-items: center; gap: 6px; color: var(--cyan); font-size: var(--fs-m); margin-bottom: var(--sp-2); }
.guidecard__title .icon { width: 20px; height: 20px; }

/* ===================================================================== containers, cases, clearance (spec 19-20) */
.casepic { display: block; width: 100%; height: 100%; object-fit: contain; }
.container-hero { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-3); padding: var(--sp-3); background: radial-gradient(ellipse at 30% 50%, var(--cyan-wash), transparent 70%), var(--bg-2); border: 1px solid var(--line-2); }
.container-hero__pic { aspect-ratio: 4 / 3; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.container-hero__name { font-size: var(--fs-l); color: var(--cyan); margin-bottom: 2px; }
.container-hero__meta { margin: 0 0 var(--sp-1); color: var(--text); font-variant-numeric: tabular-nums; }
.casegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 44%), 1fr)); gap: var(--sp-2); list-style: none; margin: 0; padding: 0; }
.casetile { display: grid; grid-template-rows: auto auto auto; gap: 4px; width: 100%; padding: var(--sp-2); text-align: left; background: var(--panel); border: 1px solid var(--line-2); color: var(--text); font: inherit; cursor: pointer; }
.casetile:hover, .casetile:focus-visible { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 1px var(--cyan); }
.casetile__pic { aspect-ratio: 4 / 3; display: block; max-height: 150px; width: 100%; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45)); }
.casetile__name { font-weight: 700; color: var(--cyan); }
.casetile__count { font-size: var(--fs-s); font-variant-numeric: tabular-nums; color: var(--text-dim); }
.casetile__holds { font-size: var(--fs-xs); color: var(--text-faint); }
.casepanel { display: grid; gap: var(--sp-3); }
.casepanel__head { display: grid; grid-template-columns: 120px 1fr; gap: var(--sp-3); align-items: center; }
.casepanel__pic { aspect-ratio: 4 / 3; display: block; }
.casepanel__count { font-weight: 700; margin: 0; }
.casepanel__grid.is-drop { outline: 2px dashed var(--cyan); }
.casepanel__list { display: grid; gap: 4px; max-height: 40vh; overflow-y: auto; }
.casepanel__move { display: flex; align-items: center; gap: var(--sp-2); width: 100%; text-align: left; justify-content: flex-start; }
.casegallery { display: grid; gap: var(--sp-2); padding: var(--sp-3); background: var(--bg-2); border: 1px solid var(--line); }
.casegallery__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--sp-2); }
.casegallery__row--containers { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--line); }
.casegallery__row li { display: grid; gap: 2px; justify-items: center; text-align: center; }
.casegallery__pic { width: 100%; aspect-ratio: 4 / 3; display: block; }
.casegallery__name { font-size: var(--fs-xs); color: var(--text-dim); line-height: 1.2; }
.themecard__swatch--case { display: grid; place-items: center; padding: 4px; background: var(--bg-2); }
.themecard__swatch--case .casepic { height: 56px; }
.sealed { font-weight: 700; color: var(--cyan); margin-bottom: 4px; }
.clearance { display: grid; gap: 6px; }
.clearance__row { display: grid; grid-template-columns: 28px 1fr auto; gap: var(--sp-2); align-items: center; padding: 6px var(--sp-2); border: 1px solid var(--line); background: var(--panel); }
.clearance__box { display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--line-2); font-weight: 800; color: var(--on-cyan); }
.clearance__row.is-done .clearance__box { background: var(--cyan); border-color: var(--cyan); }
.clearance__row.is-done .clearance__label { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--cyan-dim); }
.clearance__detail { font-size: var(--fs-xs); color: var(--text-dim); text-align: right; }
@media (max-width: 559px) { .container-hero { grid-template-columns: 110px 1fr; } .clearance__row { grid-template-columns: 28px 1fr; } .clearance__detail { grid-column: 2; text-align: left; } }

/* ===================================================================== stash in lines of 10 (spec 21) */
.slotgrid--stash { --cols: 5; }
@media (min-width: 560px) { .slotgrid--stash { --cols: 5; } }
@media (min-width: 960px) { .slotgrid--stash { --cols: 10; grid-auto-rows: 78px; } }
.stashbar { flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; }
.stashghost { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: 40px; gap: 4px; padding: 4px; margin-top: 4px; border: 1px dashed var(--line-2); opacity: 0.55; }
@media (min-width: 960px) { .stashghost { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
.slotcell--ghost { border: 1px dashed var(--line-2); background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--line) 40%, transparent) 6px 7px); }
.stashghost__label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--text); text-shadow: 0 0 6px var(--bg); }

/* ===================================================================== the shop */
.moneyrule { margin: 0 0 var(--sp-4); padding: var(--sp-3); border: 1px solid var(--cyan-dim); border-left: 4px solid var(--cyan); background: var(--cyan-wash); font-weight: 700; color: var(--text); }
.shopgroup__label { color: var(--text-dim); font-size: var(--fs-s); margin-bottom: var(--sp-3); }
.shopgroup__count { font-weight: 400; color: var(--text-dim); font-size: var(--fs-s); }
.shopgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-auto-rows: 1fr; gap: var(--sp-2); }
.shopgrid > li { display: flex; }
.shopcard { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: 1fr auto; gap: var(--sp-2); width: 100%; padding: var(--sp-2); background: var(--panel); border: 1px solid var(--line); }
.shopcard.is-owned { border-color: var(--cyan-dim); }
.shopcard__art { grid-row: 1 / span 2; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); min-height: 64px; }
.shopcard__die .die__svg { width: 54px; height: 54px; }
.shopcard__fig .fig { width: 40px; height: 66px; }
.shopcard__case .casepic { width: 58px; height: 44px; }
.shopcard__icon .icon { width: 30px; height: 30px; color: var(--cyan); }
.shopcard__text { display: grid; gap: 2px; align-content: start; }
.shopcard__name { font-weight: 700; color: var(--cyan); }
.shopcard__sub, .shopcard__note { font-size: var(--fs-xs); color: var(--text-dim); }
.shopcard__price { font-weight: 800; color: var(--text-faint); }
.shopcard__actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.shopcard__owned { font-size: var(--fs-xs); color: var(--text); }
.bunker__price { fill: var(--cyan-hi); font-size: 14px; font-weight: 800; }
.skins__top { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: space-between; }
.skins__top .panel__note { margin: 0; flex: 1 1 260px; }
.shopgrid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.shopcard { grid-template-columns: 84px 1fr; }
.shopcard--wide { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
.shopcard--wide .shopcard__art { grid-row: auto; }
.shopcard__art--btn { padding: 0; cursor: pointer; font: inherit; color: inherit; }
.shopcard__art--btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.shopcard__art--btn:hover .die__svg, .shopcard__art--btn:focus-visible .die__svg { animation: die-wobble 2.6s ease-in-out infinite; }
.shopcard__art--btn.is-held .die__svg { animation: die-rattle 120ms linear infinite; }
@keyframes die-rattle { 0% { transform: rotate(-8deg) translate(-1px, 0); } 50% { transform: rotate(9deg) translate(1px, -1px); } 100% { transform: rotate(-8deg) translate(-1px, 0); } }
.shopcard__die .die__svg { width: 70px; height: 70px; }
.shopcard__fig .fig { width: 52px; height: 86px; }
.shopcard__set { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; padding: 6px; }
.shopcard__set .casepic { height: 70px; }
.shopcard__theme { display: block; width: 100%; }
.shopcard__theme .themecard__swatch { height: 70px; }
.shopcard__room { display: block; width: 100%; }
.shopcard__room .bunker { display: block; width: 100%; height: auto; }
.shopcard__season { font-size: var(--fs-xs); color: var(--text-dim); }
.shopcard__season.is-on { color: var(--t-medical); }
.shopcard--earned { border-style: dashed; }
.shopcard--earned .shopcard__price { display: none; }
.earnstrip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 260px); gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-2); scrollbar-width: thin; }
.earnstrip > li { display: flex; }
.filterbar__facet { align-items: center; }
.filterbar__facet[hidden] { display: none; }
.filterbar__facetlabel { flex: none; font-size: var(--fs-xs); color: var(--text-dim); margin-right: 4px; }
.shopcard__room .bunker--wide { display: block; }
/* phones: a landed die panel shrinks so the first choice fits on screen */
.dice.is-shown.is-compact { padding: 6px var(--sp-2); gap: 2px; margin: 4px 0 6px; }
.dice.is-compact .die, .dice.is-compact .dice__slots.is-multi .die { width: 46px; }
.dice.is-compact .dice__mods, .dice.is-compact .dice__mode, .dice.is-compact .dice__label { display: none; }
.dice.is-compact .dice__slots { flex-wrap: nowrap; gap: var(--sp-2) var(--sp-3); }
.dice.is-compact .dice__slot { grid-template-columns: auto auto; grid-auto-flow: column; align-items: center; gap: 2px 8px; }
.dice.is-compact .dice__totalnum { font-size: var(--fs-l); }
.dice.is-compact .dice__verdict { font-size: var(--fs-m); min-height: 0; }
.dice.is-compact .dice__slot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 8px; }
.dice.is-compact .dice__outcome { flex: 1 0 100%; margin-top: 0; font-size: var(--fs-s); text-align: center; }
.dice.is-compact .dice__slots.is-multi { flex-wrap: wrap; }
@media (max-width: 759px) {
  .sceneblock .hint { padding: 6px 10px; font-size: var(--fs-s); }
  .sceneblock .hint p { margin: 2px 0; }
}
.station__cell { fill: transparent; stroke: none; }
.station:not(.is-soon):hover .station__cell, .station:not(.is-soon):focus-visible .station__cell, .station.is-lit .station__cell { fill: color-mix(in srgb, var(--cyan) 6%, transparent); }
/* shop cards: picture on top, words, then actions (one even grid) */
.shopcard, .shopcard--wide { grid-template-columns: 1fr; grid-template-rows: 116px 1fr auto; align-content: start; }
.shopcard__art, .shopcard--wide .shopcard__art { grid-row: auto; height: 116px; min-height: 0; overflow: hidden; }
.shopcard__die .die__svg { width: 92px; height: 92px; }
.shopcard__fig .fig { width: 62px; height: 104px; }
.shopcard__room { height: 100%; display: grid; place-items: center; }
.shopcard__room .bunker { max-height: 112px; width: auto; max-width: 100%; }
.shopcard__theme { padding: 8px; }
.shopcard__theme .themecard__swatch { height: 96px; }
.shopcard__set .casepic { height: 96px; }
.shopcard__actions .btn { flex: 1 1 auto; }
.container-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.container-hero__pic { width: min(220px, 70%); }
@media (max-width: 559px) {
  .shopgrid { grid-auto-rows: auto; grid-template-columns: 1fr; }
  .shopcard, .shopcard--wide { grid-template-columns: 96px 1fr; grid-template-rows: auto auto; }
  .shopcard__art, .shopcard--wide .shopcard__art { grid-row: 1 / span 2; height: auto; min-height: 96px; }
  .shopcard__die .die__svg { width: 76px; height: 76px; }
  .shopcard__set { grid-template-columns: 1fr; }
  .shopcard__set .casepic { height: 44px; }
}

/* ===================================================================== shop v2 (Jake, 12 Nov): specials first, rail, product cards */
/* the CRT scanline and the theme scanline stay off the Shop: no banding across product art */
body:has(.view[data-screen="shop"])::after, body:has(.view[data-screen="shop"])::before { display: none; }
.shop2 { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr); }
.shop2__bar { display: flex; align-items: center; gap: 6px; }
.shop2__search { flex: 1 1 auto; min-width: 0; min-height: 44px; }
.shop2__clear { flex: none; min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; }
.shop2__rail { min-width: 0; }
.shop2__tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.shop2__tab {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--line); color: var(--text-dim); font: inherit; font-size: var(--fs-s); cursor: pointer;
}
.shop2__tab:hover { border-color: var(--cyan-dim); color: var(--text); }
.shop2__tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.shop2__tab.is-active { border-color: var(--cyan); color: var(--cyan-hi); background: var(--cyan-wash); font-weight: 700; box-shadow: inset 3px 0 0 var(--cyan); }
.shop2__tabicon .icon { width: 18px; height: 18px; }
.shop2__count { margin-left: auto; min-width: 22px; padding: 0 6px; text-align: center; font-size: var(--fs-xs); color: var(--text-dim); border: 1px solid var(--line-2); }
.shop2__main { display: grid; gap: var(--sp-3); align-content: start; min-width: 0; }
.shop2__title { font-size: var(--fs-xl); color: var(--cyan); }
.shop2__title:focus { outline: none; }
.shop2__lede { color: var(--text-dim); margin: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.shop2__tools { display: grid; gap: 6px; }
.shop2__toolrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; }
.shop2__chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-items: center; }
.shop2__chiplabel { flex: none; font-size: var(--fs-xs); color: var(--text-dim); min-width: 52px; }
.shop2__result { margin: 0; font-size: var(--fs-xs); color: var(--text-dim); }
.shop2__none { padding: var(--sp-4); border: 1px dashed var(--line-2); display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.shop2__more { justify-self: center; min-width: 220px; }
.shop2__trust { display: grid; gap: 4px; padding: var(--sp-3); border-top: 1px solid var(--line); color: var(--text-dim); font-size: var(--fs-s); }
.shop2__trust p { margin: 0; }
.shop2__trust strong { color: var(--text); }
.shop2__todo { text-decoration: underline dotted; color: var(--text-faint); }
@media (min-width: 960px) {
  .shop2 { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
  .shop2__bar, .shop2__trust { grid-column: 1 / -1; }
  .shop2__rail { position: sticky; top: 90px; }
  .shop2__tabs { flex-direction: column; overflow: visible; }
  .shop2__tab { width: 100%; }
}

/* product cards: one fixed picture area, name, one line, tags, price, one button */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--sp-2); }
.pcell { display: flex; min-width: 0; }
.pcard { display: grid; grid-template-rows: auto 1fr auto; width: 100%; background: var(--panel); border: 1px solid var(--line); transition: border-color var(--t-fast), transform var(--t-fast); }
.pcard:hover, .pcard:focus-within { border-color: var(--cyan-dim); }
.pcard.is-owned { border-color: color-mix(in srgb, var(--cyan) 35%, var(--line)); }
.pcard.has-offer { border-color: var(--t-valuable); }
.pcard.is-earned { border-style: dashed; }
.pcard__img {
  position: relative; display: grid; place-items: center; height: 150px; padding: 8px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, var(--cyan-wash), transparent 70%), var(--bg-2);
  border: 0; border-bottom: 1px solid var(--line); cursor: pointer; color: inherit; font: inherit;
}
.pcard__img:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.pcard__img > :not(.pcard__skel):not(.pcard__badge) { position: relative; z-index: 1; }
.pcard__skel { position: absolute; inset: 18% 25%; background: linear-gradient(100deg, var(--panel-2) 30%, var(--panel-3) 50%, var(--panel-2) 70%); background-size: 200% 100%; animation: skel 1.4s linear infinite; opacity: 0.6; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pcard__badge { position: absolute; top: 8px; left: 8px; z-index: 2; padding: 2px 8px; font-size: var(--fs-xs); font-weight: 800; }
.badge--discount, .badge--bundle { background: var(--t-valuable); color: #1a1405; }
.badge--one_off { background: var(--t-insane); color: #1a0510; }
.badge--new { background: var(--cyan); color: var(--on-cyan); }
.badge--seasonal { background: var(--t-medical); color: #04140a; }
.pcard__die .die__svg { width: 104px; height: 104px; }
.pcard__img:hover .pcard__die .die__svg, .pcard__img:focus-visible .pcard__die .die__svg { animation: die-wobble 2.6s ease-in-out infinite; }
.pcard__img:active .pcard__die .die__svg { animation: die-rattle 120ms linear infinite; }
.pcard__fig .fig { width: 76px; height: 128px; }
.pcard__set { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.pcard__set .casepic { height: 92px; }
.pcard__theme { width: 100%; }
.pcard__theme .themecard__swatch { height: 110px; }
.pcard__room { width: 100%; }
.pcard__room .bunker, .pdetail__room .bunker { display: block; width: 100%; height: auto; }
.pcard__icon .icon { width: 42px; height: 42px; color: var(--cyan); }
.stashicon { display: grid; gap: 4px; width: 110px; position: relative; }
.stashicon__line { height: 10px; border: 1px solid var(--cyan-dim); background: repeating-linear-gradient(90deg, transparent 0 10px, var(--cyan-dim) 10px 11px); }
.stashicon__plus { position: absolute; right: -12px; top: 50%; transform: translateY(-50%); padding: 2px 8px; background: var(--cyan); color: var(--on-cyan); font-weight: 800; }
.pcard__body { display: grid; gap: 4px; align-content: start; padding: var(--sp-2) var(--sp-3) 0; }
.pcard__name { font-size: var(--fs-m); margin: 0; }
.pcard__namebtn { all: unset; cursor: pointer; color: var(--cyan); font-weight: 700; }
.pcard__desc { margin: 0; font-size: var(--fs-s); color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.pcard__tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.tag--kind { color: var(--text); }
.tag--convenience { border-color: var(--t-special); color: var(--t-special); }
.tag--season { border-style: dashed; }
.tag--season.is-on { border-color: var(--t-medical); color: var(--t-medical); }
.pcard__foot { display: grid; gap: 6px; padding: var(--sp-2) var(--sp-3) var(--sp-3); }
.pcard__actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pcard__actions .btn { flex: 1 1 auto; }
.pcard__buy[disabled] { opacity: 0.75; cursor: not-allowed; }
.pcard__tick { display: inline-flex; align-items: center; gap: 4px; color: var(--cyan); font-weight: 700; font-size: var(--fs-s); }
.pcard__tick .icon { width: 16px; height: 16px; }
.pcard__owned, .pcard__how { font-size: var(--fs-xs); color: var(--text); flex-basis: 100%; }
.price { display: flex; align-items: baseline; gap: 8px; min-height: 1.6em; }
.price__old { color: var(--text-faint); text-decoration: line-through; }
.price__now { font-size: var(--fs-l); font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.price__off { padding: 0 6px; background: var(--t-valuable); color: #1a1405; font-weight: 800; font-size: var(--fs-xs); }

/* product detail panel */
.pdetail { display: grid; gap: var(--sp-4); }
.pdetail__stage { display: grid; place-items: center; min-height: 260px; padding: var(--sp-3); background: radial-gradient(ellipse at 50% 55%, var(--cyan-wash), transparent 70%), var(--bg-2); border: 1px solid var(--line); }
.pdetail__stage .figstage { width: 150px; height: 250px; }
.pdetail__stage .pcard__theme, .pdetail__theme { width: 100%; display: grid; gap: var(--sp-2); }
.pdetail__theme .themecard__swatch { height: 160px; }
.pdetail__dice { display: grid; gap: var(--sp-2); justify-items: center; width: 100%; }
.pdetail__dice .dice.is-shown { margin: 0; width: 100%; }
.pdetail__sets { display: grid; gap: var(--sp-3); width: 100%; }
.pdetail__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-2); }
.pdetail__row li { display: grid; gap: 2px; justify-items: center; text-align: center; font-size: var(--fs-xs); color: var(--text-dim); }
.pdetail__row .casepic { width: 100%; height: 70px; }
.pdetail__room { width: 100%; }
.pdetail__info { display: grid; gap: var(--sp-2); align-content: start; }
.pdetail__info p { margin: 0; }
.pdetail__tags { display: flex; gap: 4px; flex-wrap: wrap; }
.pdetail__desc { font-size: var(--fs-l); color: var(--text); }
.pdetail__limited { color: var(--t-insane); font-weight: 700; }
.pdetail__season { color: var(--t-medical); }
.pdetail__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pdetail__honest { font-size: var(--fs-s); color: var(--text-dim); border-top: 1px solid var(--line); padding-top: var(--sp-2); }
@media (min-width: 760px) { .pdetail { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }

/* specials */
.specials { display: grid; gap: var(--sp-4); }
.hero { display: grid; gap: var(--sp-3); padding: var(--sp-3); border: 1px solid var(--t-valuable); background: radial-gradient(ellipse at 20% 50%, color-mix(in srgb, var(--t-valuable) 12%, transparent), transparent 65%), var(--panel); }
.hero__art { display: grid; place-items: center; min-height: 200px; background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; color: inherit; font: inherit; padding: var(--sp-2); }
.hero__art .figstage { width: 130px; height: 216px; }
.hero__art .pcard__die .die__svg { width: 150px; height: 150px; }
.hero__art:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.hero__text { display: grid; gap: var(--sp-2); align-content: center; }
.hero__badge { justify-self: start; padding: 2px 10px; font-weight: 800; }
.hero__title { font-size: var(--fs-xxl); color: var(--text); line-height: 1.1; }
.hero__blurb { color: var(--text-dim); margin: 0; }
.hero__meta { margin: 0; color: var(--text); }
.countdown { display: inline-block; min-width: 15ch; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--t-valuable); }
@media (min-width: 760px) { .hero { grid-template-columns: minmax(220px, 1fr) 1.4fr; } }
.specrow { display: grid; gap: var(--sp-2); }
.specrow__title { font-size: var(--fs-l); color: var(--cyan); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.specrow__group { display: grid; gap: var(--sp-2); }
.specrow__head h3 { font-size: var(--fs-m); margin: 0; }
.specrow__blurb, .specrow__meta { margin: 0; font-size: var(--fs-s); color: var(--text-dim); }
.specrow__never { color: var(--t-insane); }
.specials-empty { display: grid; justify-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-6) var(--sp-4); border: 1px dashed var(--line-2); background: radial-gradient(ellipse at 50% 0, var(--cyan-wash), transparent 70%), var(--panel); }
.specials-empty__icon .icon { width: 44px; height: 44px; color: var(--t-valuable); }
.specials-empty__title { font-size: var(--fs-xl); color: var(--text); }
.specials-empty__text { color: var(--text-dim); margin: 0; }
.specials-empty__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; margin-top: var(--sp-2); }
.specials-empty__next { margin: var(--sp-2) 0 0; color: var(--t-medical); font-weight: 700; }

/* stash upgrades, side by side */
.upgrades { display: grid; gap: var(--sp-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.upgrade { display: grid; gap: 6px; align-content: start; padding: var(--sp-3); border: 1px solid var(--line-2); background: var(--bg-2); }
.upgrade p { margin: 0; }
.upgrade__kind { justify-self: start; padding: 1px 8px; font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.04em; }
.upgrade--roubles .upgrade__kind { background: var(--cyan); color: var(--on-cyan); }
.upgrade--paid { border-style: dashed; }
.upgrade--paid .upgrade__kind { background: var(--t-special); color: #040a14; }
.upgrade__name { font-size: var(--fs-m); color: var(--text); margin: 0; }
.upgrade__text, .upgrade__owned { font-size: var(--fs-s); }
.upgrade__reason { font-size: var(--fs-s); color: var(--t-valuable); }
html[data-motion="reduced"] .pcard__skel { animation: none; }
.pcard__img:has(> :not(.pcard__skel):not(.pcard__badge)) .pcard__skel { display: none; }
.pcard--skel .pcard__img .pcard__skel { display: block; }
.pcard--skel .skelline { display: block; height: 12px; margin: 6px 0; background: var(--panel-2); }
.pcard--skel .skelline--short { width: 60%; }
@media (min-width: 960px) {
  .shop2 { grid-template-columns: 270px minmax(0, 1fr); }
  .shop2__tab { white-space: normal; text-align: left; padding: 8px 10px; }
  .shop2__tab > span:nth-child(2) { flex: 1 1 auto; }
  .shop2__count { flex: none; }
}
.price__old { font-size: var(--fs-s); }

/* ===== 0.0.2: quest lines, standing orders, The Collection ===== */
.tag--mand { border-color: var(--t-valuable); color: var(--t-valuable); }
.qslots { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-3); margin: 0 0 var(--sp-3); font-size: var(--fs-s); }
.qslots__label { font-weight: 700; }
.qslots__pips { display: inline-flex; gap: 4px; }
.qslots__pip { width: 14px; height: 14px; border: var(--bw) solid var(--line-2); }
.qslots__pip.is-used { background: var(--cyan); border-color: var(--cyan); }
.qslots__note { flex-basis: 100%; color: var(--text-dim); font-size: var(--fs-xs); }
.qfilter { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.qfilter .seg--wrap { display: flex; flex-wrap: wrap; margin-bottom: 0; }
.qfilter .seg--wrap .seg__btn { flex: 1 1 30%; border-bottom: var(--bw) solid var(--line-2); margin-bottom: calc(-1 * var(--bw)); }
@media (min-width: 760px) { .qfilter .seg--wrap .seg__btn { flex-basis: 0; } }
.qsearch { width: 100%; }
.qlines { display: grid; gap: var(--sp-2); }
.qline { border: var(--bw) solid var(--line); background: var(--panel); }
.qline[hidden] { display: none; }
.qline__head {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "caret name count" "caret tags tags" ". meter meter";
  align-items: center; gap: 4px var(--sp-2); width: 100%; min-height: var(--tap); padding: var(--sp-2) var(--sp-3);
  background: transparent; border: 0; color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.qline__head:hover { background: var(--cyan-wash); }
.qline__caret { grid-area: caret; color: var(--cyan); font-weight: 800; transition: transform 150ms; align-self: start; }
.qline.is-open .qline__caret { transform: rotate(90deg); }
.qline__name { grid-area: name; font-weight: 800; color: var(--cyan); min-width: 0; }
.qline__who { display: block; font-weight: 400; font-size: var(--fs-xs); color: var(--text-dim); }
.qline__tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 4px; }
.qline__count { grid-area: count; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qline__meter { grid-area: meter; height: 6px; }
.qline__list { display: none; list-style: none; margin: 0; padding: 0 var(--sp-2) var(--sp-2); }
.qline.is-open .qline__list { display: grid; gap: 4px; }
.qrow { border-left: 3px solid var(--line-2); background: var(--bg-2); padding: var(--sp-2) var(--sp-3); }
.qrow[hidden] { display: none; }
.qrow.is-active { border-left-color: var(--cyan); }
.qrow.is-available { border-left-color: var(--t-medical); }
.qrow.is-done { opacity: 0.75; }
.qrow.is-locked .qrow__title { color: var(--text-dim); }
.qrow__head { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "status title" "status meta"; gap: 0 var(--sp-2); align-items: baseline; }
summary.qrow__head { cursor: pointer; list-style: none; }
summary.qrow__head::-webkit-details-marker { display: none; }
.qrow__status { grid-area: status; min-width: 5.5em; font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); }
.qrow__status.is-active { color: var(--cyan); }
.qrow__status.is-available { color: var(--t-medical); }
.qrow__status.is-done { color: var(--text-dim); }
.qrow__status.is-done::before { content: '✓ '; }
.qrow__title { grid-area: title; font-weight: 700; min-width: 0; }
.qrow__meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-2); color: var(--text-dim); font-size: var(--fs-xs); }
.qrow__gate { margin: 2px 0 0 calc(5.5em + var(--sp-2)); color: var(--text-dim); font-size: var(--fs-s); }
.qrow .quest__brief, .qrow .objectives, .qrow .quest__rewards { margin-left: 0; }
.qrow details[open] > summary { margin-bottom: var(--sp-2); }
.qrow__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); }
.qrow__actions .reason { margin: 0; }
@media (max-width: 559px) {
  .qrow__head { grid-template-columns: 1fr; grid-template-areas: "status" "title" "meta"; }
  .qrow__gate { margin-left: 0; }
}
.standing__active { border-left-color: var(--cyan); }
.standing__active .meter { margin: var(--sp-2) 0; }
.collection__count { display: grid; gap: var(--sp-1); font-weight: 800; margin: var(--sp-2) 0 var(--sp-3); }
.relics { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.relic { display: grid; grid-template-columns: 1.4em 48px 1fr; align-items: center; gap: var(--sp-2); padding: 6px var(--sp-2); background: var(--bg-2); border-left: 3px solid var(--line-2); }
.relic.is-found { border-left-color: var(--cyan); }
.relic__mark { color: var(--cyan); font-weight: 800; text-align: center; }
.relic.is-missing .relic__mark::before { content: '□'; color: var(--text-faint); }
.relic__icon { width: 48px; height: 48px; display: grid; place-items: center; border: var(--bw) solid var(--line); background: var(--bg); overflow: hidden; }
.relic__icon .icon { width: 26px; height: 26px; color: var(--text-faint); }
.relic__icon .item__img { width: 100%; height: 100%; object-fit: contain; }
.relic.is-missing .relic__icon { filter: grayscale(1) brightness(0.6); }
.relic__text { display: grid; min-width: 0; }
.relic__name { font-weight: 700; }
.relic.is-missing .relic__name { color: var(--text-dim); }
.relic__where { color: var(--text-dim); font-size: var(--fs-xs); }
.casepanel__holds { margin: 2px 0; font-weight: 700; color: var(--cyan); }
.casepanel__why { margin: 0; }
.casepanel__list li.is-no .casepanel__move { opacity: 0.55; }
.casepanel__itemname { display: grid; min-width: 0; }
.casepanel__no { font-size: var(--fs-xs); color: var(--text-dim); font-weight: 400; }

.casetile__pic .casepic { width: 100%; height: 100%; object-fit: contain; display: block; }
.casetile { align-content: start; min-width: 0; }
.casetile__name { overflow-wrap: anywhere; }
/* insurance on the Deploy screen */
.insure__row { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3); align-items: start; padding: var(--sp-3); border: var(--bw) solid var(--line-2); background: var(--bg-2); cursor: pointer; margin-bottom: var(--sp-3); }
.insure__row.is-on { border-color: var(--cyan); background: var(--cyan-wash); }
.insure__row.is-disabled { cursor: not-allowed; opacity: 0.7; }
.insure__row input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--cyan); }
.insure__text { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--sp-2); }
.insure__name { font-weight: 800; }
.insure__cost { font-weight: 800; color: var(--cyan); font-variant-numeric: tabular-nums; white-space: nowrap; }
.insure__what { grid-column: 1 / -1; color: var(--text-dim); font-size: var(--fs-s); }
.insure__reason { margin: var(--sp-2) 0 0; }
.gearlist__row.is-dark { opacity: 0.7; border-style: dashed; }
.notice--stack { display: block; }
.notice--stack > * + * { margin-top: var(--sp-2); }
.notice--stack p { margin: 0; }
.parcel__title { font-weight: 800; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--fs-xs); }
.parcel__list { margin: var(--sp-2) 0; padding-left: 1.2em; font-size: var(--fs-s); }
.result__claim strong { display: block; }
.enemy__twist { display: block; flex-basis: 100%; font-size: var(--fs-s); color: var(--text); font-style: italic; }
/* version and what's new */
.title__version { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-4); }
.version { font-size: var(--fs-xs); color: var(--text-dim); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.settings__version { font-weight: 700; }
.settings__version .version { font-size: inherit; color: var(--cyan); }
.whatsnew { display: grid; gap: var(--sp-3); }
.whatsnew__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.whatsnew__item { display: grid; gap: 2px; padding: var(--sp-2) var(--sp-3); border-left: 3px solid var(--cyan); background: var(--bg-2); }
.whatsnew__title { font-weight: 800; color: var(--cyan); }
.whatsnew__text { color: var(--text); font-size: var(--fs-s); }
/* item tiles at the new icon size (0.0.2): words break at syllables, not mid-letter; badges clear of the name;
   a wide tile (2+ slots) shows its picture big, beside the name */
.item__name { overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.item__uses { top: 4px; bottom: auto; right: 5px; font-weight: 700; }
.item.span-2, .item.span-3, .item.span-4,
.slotcell.span-2 > .item, .slotcell.span-3 > .item, .slotcell.span-4 > .item { flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--sp-2); }
.slotcell.span-2 > .item .item__icon.has-art, .slotcell.span-3 > .item .item__icon.has-art, .slotcell.span-4 > .item .item__icon.has-art { flex: none; width: auto; height: 100%; max-height: 74px; aspect-ratio: 1; margin: 0; }
.slotcell.span-2 > .item .item__icon:not(.has-art), .slotcell.span-3 > .item .item__icon:not(.has-art), .slotcell.span-4 > .item .item__icon:not(.has-art) { flex: none; width: 40px; height: 40px; }
.slotcell.span-2 > .item .item__name, .slotcell.span-3 > .item .item__name, .slotcell.span-4 > .item .item__name { margin-top: 0; flex: 1 1 auto; min-width: 0; font-size: var(--fs-s); }
.slotcell.span-2 > .item .item__durwrap, .slotcell.span-3 > .item .item__durwrap, .slotcell.span-4 > .item .item__durwrap { position: absolute; left: 6px; right: 6px; bottom: 4px; width: auto; margin: 0; }
@media (max-width: 559px) {
  .slotgrid .slotcell:not(.span-2):not(.span-3):not(.span-4) .item__name { font-size: 11px; line-height: 1.15; }
  .slotgrid .slotcell:not(.span-2):not(.span-3):not(.span-4) .item { padding: 4px; }
  .slotgrid .slotcell:not(.span-2):not(.span-3):not(.span-4) .item__icon.has-art { width: 42px; height: 42px; margin: -2px 0 -2px -2px; }
}
.slotcell.span-2 > .item .item__icon.has-art { max-height: 54px; }
.slotcell.span-2 > .item .item__name { font-size: var(--fs-xs); }
@media (min-width: 960px) { .slotgrid--stash { grid-auto-rows: 88px; } }
.itemdetail__effect { margin: var(--sp-2) 0; padding: var(--sp-2) var(--sp-3); border-left: 3px solid var(--cyan); background: var(--cyan-wash); font-size: var(--fs-s); }
.itemdetail__effect strong { color: var(--cyan); }
.itemdetail__sig { margin: var(--sp-2) 0; font-size: var(--fs-s); color: var(--t-valuable); font-weight: 700; }
.clearance__lines { list-style: none; margin: var(--sp-1) 0 var(--sp-3); padding: 0; display: grid; gap: 2px; font-size: var(--fs-s); }
.clearance__lines li { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 2px 0; border-bottom: 1px dashed var(--line); }
.clearance__n { color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* standard issue: a plain tag on the tile (worth 0), the hideout notice */
.item__issued {
  position: absolute; top: 4px; left: 4px; padding: 0 3px; font-size: 0.625rem; font-weight: 700; line-height: 1.3;
  color: var(--text); background: var(--bg); border: 1px solid var(--line-2); letter-spacing: 0.04em;
}
.item--mini .item__issued { display: none; }
.itemdetail__issued { margin: var(--sp-2) 0; }
.repair__early { margin-bottom: var(--sp-3); }
/* phone: a 2-slot tile is only ~120px wide, too narrow for a picture beside a name ("Sledgehamm-er");
   it stacks like a 1-slot tile, with the picture larger */
@media (max-width: 559px) {
  .slotcell.span-2 > .item { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; padding: 4px 6px; }
  .slotcell.span-2 > .item .item__icon.has-art { height: 48px; width: 48px; max-height: 48px; }
  .slotcell.span-2 > .item .item__name { flex: none; width: 100%; font-size: 11px; line-height: 1.15; }
}
@media (max-width: 559px) {
  .slotcell.span-3 > .item .item__icon.has-art, .slotcell.span-4 > .item .item__icon.has-art { max-height: 60px; }
  .slotcell.span-3 > .item .item__name, .slotcell.span-4 > .item .item__name { font-size: var(--fs-xs); }
}
/* phone: a boss plate carries a weapon line and his trick; the faces go on their own row above it so the words
   get the full width (and a third face is not squeezed) */
@media (max-width: 559px) {
  .enemy.has-face[data-boss] { grid-template-columns: 1fr auto; }
  .enemy.has-face[data-boss] > .facepop { grid-row: auto; grid-column: 1 / -1; }
  .enemy.has-face[data-boss] > .enemy__head { grid-column: 1 / -1; }
}
.facepop .face { flex-shrink: 0; }
