/* ==========================================================================
   HELLDIVER // LOADOUT TERMINAL
   Pure CSS. No external fonts, frameworks, trackers, or network requests.
   ========================================================================== */

:root {
  --bg: #090b07;
  --bg-raised: #11150d;
  --panel: rgba(18, 22, 14, 0.88);
  --panel-solid: #12160e;
  --panel-light: #1a1f14;
  --line: rgba(231, 218, 180, 0.14);
  --line-strong: rgba(231, 218, 180, 0.26);
  --text: #f0ecdf;
  --text-soft: #cbc7b8;
  --muted: #8f907f;
  --muted-dark: #676b5d;
  --gold: #f0c64b;
  --gold-bright: #ffda72;
  --gold-dim: #9d8231;
  --bone: #d8d1bc;
  --bone-light: #e7e1cf;
  --ink: #171a12;
  --green: #83b86b;
  --red: #df5a41;
  --red-rgb: 223, 90, 65;
  --blue: #5aa8d4;
  --blue-rgb: 90, 168, 212;
  --orange: #dd8b47;
  --font-display: "Bahnschrift Condensed", "Bahnschrift", "Arial Narrow", "Franklin Gothic Medium", "Microsoft YaHei UI", sans-serif;
  --font-body: "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", "Liberation Mono", monospace;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --max-w: 1560px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-rolling {
  cursor: progress;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--gold);
  color: var(--ink);
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ol,
dl,
dd {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0d1009;
}

::-webkit-scrollbar-thumb {
  background: #34392a;
  border: 2px solid #0d1009;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dim);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.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;
}

/* --------------------------------------------------------------------------
   Background world
   -------------------------------------------------------------------------- */

.world {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 52% -8%, rgba(160, 148, 84, 0.12), transparent 42%),
    linear-gradient(180deg, #0c0f09 0%, #090b07 42%, #080a06 100%);
}

.world-stars {
  position: absolute;
  inset: -12%;
  opacity: 0.55;
  background-image:
    radial-gradient(circle, rgba(244, 237, 211, 0.8) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(244, 237, 211, 0.46) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(240, 198, 75, 0.38) 0 1px, transparent 1.5px);
  background-size: 167px 193px, 241px 271px, 397px 353px;
  background-position: 23px 41px, 121px 87px, 54px 161px;
  animation: starDrift 160s linear infinite;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 78%);
}

.world-grid {
  position: absolute;
  inset: 0;
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(207, 193, 137, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(207, 193, 137, 0.045) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 82%);
}

.world-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(207, 193, 137, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(207, 193, 137, 0.09) 1px, transparent 1px);
  background-size: 420px 420px;
}

.world-glow {
  position: absolute;
  top: -18%;
  right: 2%;
  width: 58vw;
  height: 58vw;
  min-width: 600px;
  min-height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231, 191, 66, 0.11) 0%, rgba(130, 118, 61, 0.05) 38%, transparent 69%);
  filter: blur(4px);
}

.world-planet {
  position: absolute;
  top: -47vw;
  right: -27vw;
  width: 84vw;
  height: 84vw;
  min-width: 740px;
  min-height: 740px;
  border: 1px solid rgba(220, 206, 153, 0.14);
  border-radius: 50%;
  background:
    radial-gradient(circle at 31% 78%, rgba(137, 133, 84, 0.16), transparent 34%),
    radial-gradient(circle at 39% 63%, rgba(92, 94, 56, 0.22), transparent 48%),
    radial-gradient(circle at 72% 36%, rgba(17, 20, 13, 0.2) 0 52%, rgba(4, 5, 3, 0.72) 76%);
  box-shadow:
    inset -60px -90px 160px rgba(0, 0, 0, 0.55),
    0 0 120px rgba(221, 195, 106, 0.06);
}

.world-planet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 63px, rgba(225, 210, 151, 0.13) 63px 64px),
    repeating-linear-gradient(90deg, transparent 0 63px, rgba(225, 210, 151, 0.1) 63px 64px);
  mask-image: radial-gradient(circle at 38% 66%, #000 0 44%, transparent 68%);
}

.world-noise {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.8'/%3E%3C/svg%3E");
}

.world-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 5, 3, 0.55), transparent 18%, transparent 82%, rgba(4, 5, 3, 0.5)),
    radial-gradient(ellipse at 50% 43%, transparent 25%, rgba(3, 4, 2, 0.68) 100%);
}

.world-scan {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(0, 0, 0, 0.3) 3px 4px);
  animation: scanDrift 14s linear infinite;
  transition: opacity 0.3s ease;
}

body.is-rolling .world-scan {
  opacity: 0.3;
}

@keyframes starDrift {
  to {
    transform: translate3d(-60px, -110px, 0);
  }
}

@keyframes scanDrift {
  to {
    background-position: 0 100px;
  }
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 28px 16px;
  border-bottom: 1px solid var(--line);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent 24%, transparent 76%, rgba(240, 198, 75, 0.3));
  opacity: 0.55;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 14px rgba(240, 198, 75, 0.18));
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.brand-shield {
  fill: rgba(240, 198, 75, 0.06);
  stroke: var(--gold);
  stroke-width: 1.4;
}

.brand-star {
  fill: var(--gold);
}

.brand-chevron {
  fill: none;
  stroke: var(--bone);
  stroke-width: 1.4;
  opacity: 0.65;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.brand-kicker {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  white-space: nowrap;
}

.brand-title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1;
  white-space: nowrap;
}

.brand-title i {
  color: var(--gold);
  font-style: normal;
  padding: 0 2px;
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 24px;
}

.link-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 22px;
  border-right: 1px solid var(--line);
}

.link-state > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.link-state b {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.link-state small {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.signal {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
}

.signal i {
  display: block;
  width: 3px;
  background: var(--green);
  box-shadow: 0 0 6px rgba(131, 184, 107, 0.5);
}

.signal i:nth-child(1) {
  height: 5px;
}

.signal i:nth-child(2) {
  height: 9px;
}

.signal i:nth-child(3) {
  height: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(16, 20, 12, 0.64);
  color: var(--text-soft);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.icon-button:hover {
  border-color: rgba(240, 198, 75, 0.55);
  background: rgba(240, 198, 75, 0.08);
  color: var(--gold);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  background: #11150d;
  color: var(--text-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: 0.16s ease;
}

.icon-button[data-tip]:hover::after,
.icon-button[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.sound-on {
  display: none;
}

body.audio-on .sound-on {
  display: block;
}

body.audio-on .sound-off {
  display: none;
}

body.audio-on #soundButton {
  color: var(--gold);
  border-color: rgba(240, 198, 75, 0.36);
}

/* --------------------------------------------------------------------------
   Page frame
   -------------------------------------------------------------------------- */

.page {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px 22px;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 42px;
  padding: 35px 0 25px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.23em;
}

.eyebrow-rule {
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}

.eyebrow-code {
  color: var(--muted-dark);
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.hero h1 {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(42px, 4.7vw, 68px);
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 0.94;
}

.hero h1 span {
  position: relative;
}

.hero h1 span::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 3px;
  bottom: -5px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(240, 198, 75, 0.08));
}

.hero h1 em {
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 1.2px rgba(240, 198, 75, 0.88);
  text-stroke: 1.2px rgba(240, 198, 75, 0.88);
}

@supports not ((-webkit-text-stroke: 1px #000) or (text-stroke: 1px #000)) {
  .hero h1 em {
    color: var(--gold);
  }
}

.hero-lede {
  max-width: 900px;
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 14px;
  letter-spacing: 0.02em;
  line-height: 1.9;
}

.hero-lede::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 8px 2px 0;
  background: var(--gold);
  transform: rotate(45deg);
}

.telemetry {
  display: grid;
  grid-template-columns: 0.85fr 0.95fr 1.25fr;
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 23, 15, 0.55), rgba(9, 11, 7, 0.1));
}

.telemetry-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 108px;
  padding: 13px 18px 12px;
}

.telemetry-cell + .telemetry-cell {
  border-left: 1px solid var(--line);
}

.telemetry-cell--wide {
  min-width: 150px;
}

.telemetry-label {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.18em;
}

.telemetry-cell strong {
  margin-top: 4px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 1;
  white-space: nowrap;
}

.telemetry-cell--wide strong {
  font-size: 23px;
  letter-spacing: 0.03em;
}

.telemetry-unit {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

/* --------------------------------------------------------------------------
   Console / loadout panel
   -------------------------------------------------------------------------- */

.console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 15px;
  align-items: stretch;
}

.loadout-panel {
  position: relative;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(240, 198, 75, 0.025), transparent 24%),
    linear-gradient(180deg, rgba(21, 26, 16, 0.92), rgba(12, 15, 9, 0.94));
  box-shadow: var(--shadow);
}

.loadout-panel::before,
.loadout-panel::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
  z-index: 2;
}

.loadout-panel::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
}

.loadout-panel::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid var(--gold-dim);
  border-bottom: 2px solid var(--gold-dim);
}

.egg-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(240, 198, 75, 0.5);
  background:
    linear-gradient(100deg, rgba(240, 198, 75, 0.12), transparent 45%),
    repeating-linear-gradient(135deg, rgba(240, 198, 75, 0.08) 0 8px, transparent 8px 16px),
    rgba(18, 19, 10, 0.9);
  animation: eggIn 0.45s ease both;
}

.egg-banner[hidden] {
  display: none;
}

.egg-kicker {
  grid-row: 1 / span 2;
  padding-right: 11px;
  border-right: 1px solid rgba(240, 198, 75, 0.25);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  line-height: 1.5;
  white-space: nowrap;
}

.egg-banner strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.egg-banner #eggDescription {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

@keyframes eggIn {
  from {
    transform: translateY(-4px);
  }
  to {
    transform: translateY(0);
  }
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 2px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.section-index {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-width: 33px;
  padding-right: 11px;
  border-right: 1px solid var(--line-strong);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.panel-heading h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.panel-heading p {
  margin-top: 2px;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
}

.panel-head-side {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.valid-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.valid-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(131, 184, 107, 0.75);
  animation: pulseDot 2.4s ease-in-out infinite;
}

.head-divider {
  width: 1px;
  height: 16px;
  background: var(--line);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  transition: color 0.18s ease;
}

.text-button:hover {
  color: var(--gold);
}

.text-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-button--muted {
  color: var(--muted-dark);
}

@keyframes pulseDot {
  50% {
    opacity: 0.4;
  }
}

.loadout-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
}

.loadout-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.loadout-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.loadout-foot-note {
  margin-left: auto;
}

.loadout-foot-note svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.legend-dot {
  width: 5px;
  height: 5px;
  background: var(--gold);
}

.legend-dot--strat {
  background: var(--red);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.slot-card {
  --permit: var(--gold);
  --permit-rgb: 240, 198, 75;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1a1f14, #0d100a 82%);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: cardIn 0.45s both;
  animation-delay: calc(var(--card-index, 0) * 55ms);
}

.slot-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 38px;
  height: 2px;
  background: var(--permit);
  box-shadow: 0 0 12px rgba(var(--permit-rgb), 0.38);
}

.slot-card[data-permit="offensive"] {
  --permit: #df5a41;
  --permit-rgb: 223, 90, 65;
}

.slot-card[data-permit="supply"] {
  --permit: #5aa8d4;
  --permit-rgb: 90, 168, 212;
}

.slot-card[data-permit="defensive"] {
  --permit: #83b86b;
  --permit-rgb: 131, 184, 107;
}

.slot-card:hover {
  border-color: rgba(240, 198, 75, 0.38);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.slot-card.is-locked {
  border-color: rgba(240, 198, 75, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(240, 198, 75, 0.09),
    0 0 24px rgba(240, 198, 75, 0.055);
}

.slot-card.is-locked::before {
  width: 100%;
  background: var(--gold);
}

.slot-card.is-rolling {
  border-color: rgba(240, 198, 75, 0.46);
}

.slot-card.is-rolling .card-visual img {
  animation: iconFlicker 0.1s steps(2, end) infinite;
}

.slot-card.is-rolling .card-name {
  animation: textFlicker 0.14s steps(2, end) infinite;
}

.slot-card.is-settled {
  animation: settleIn 0.38s ease both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

@keyframes iconFlicker {
  50% {
    opacity: 0.42;
    transform: translateY(1px) scale(0.985);
  }
}

@keyframes textFlicker {
  50% {
    color: var(--gold);
    opacity: 0.62;
  }
}

@keyframes settleIn {
  0% {
    box-shadow: inset 0 0 0 1px rgba(240, 198, 75, 0.8), 0 0 28px rgba(240, 198, 75, 0.24);
  }
  100% {
    box-shadow: inset 0 0 0 1px rgba(240, 198, 75, 0), 0 0 0 rgba(240, 198, 75, 0);
  }
}

.card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 7px 0 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 3, 0.24);
}

.is-locked .card-head {
  background: rgba(240, 198, 75, 0.055);
}

.slot-number {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.slot-type {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.is-locked .slot-type {
  color: var(--gold);
}

.is-locked .slot-type::after {
  content: " · 已锁定";
  color: var(--gold-dim);
}

.lock-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-dark);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.lock-button:hover {
  color: var(--gold);
  border-color: rgba(240, 198, 75, 0.3);
}

.lock-button[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--gold);
  background: var(--gold);
}

.lock-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.lock-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lock-button .icon-closed {
  display: none;
}

.lock-button[aria-pressed="true"] .icon-open {
  display: none;
}

.lock-button[aria-pressed="true"] .icon-closed {
  display: block;
}

.card-visual {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(128px, 12vw, 170px);
  overflow: hidden;
}

.card-visual--weapon {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.44), transparent 67%),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(30, 31, 22, 0.075) 22px 23px),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(30, 31, 22, 0.075) 22px 23px),
    linear-gradient(145deg, var(--bone-light), var(--bone) 56%, #c3bba4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.42);
}

.card-visual--weapon::before {
  content: "TOP VIEW // FIELD ISSUE";
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 1;
  color: rgba(23, 26, 18, 0.44);
  font-family: var(--font-mono);
  font-size: 5.5px;
  letter-spacing: 0.16em;
}

.card-visual--weapon::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: 8px;
  width: 24px;
  height: 24px;
  border-right: 1px solid rgba(23, 26, 18, 0.28);
  border-bottom: 1px solid rgba(23, 26, 18, 0.28);
}

.card-visual--weapon img {
  position: relative;
  z-index: 1;
  width: 92%;
  height: 86%;
  object-fit: contain;
  filter:
    drop-shadow(0 9px 8px rgba(23, 26, 18, 0.26))
    drop-shadow(0 0 1px rgba(20, 23, 15, 0.9));
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card-visual img.is-missing {
  opacity: 0;
}

.slot-card:hover .card-visual--weapon img {
  transform: scale(1.035);
}

.card-visual--strat {
  background:
    radial-gradient(circle at 50% 50%, rgba(var(--permit-rgb), 0.16), transparent 65%),
    linear-gradient(180deg, rgba(8, 11, 6, 0.5), rgba(8, 10, 6, 0.95));
}

.card-visual--strat::before {
  content: "";
  position: absolute;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.014);
}

.card-visual--strat::after {
  content: "";
  position: absolute;
  width: 1px;
  height: 22px;
  top: 0;
  background: linear-gradient(180deg, rgba(var(--permit-rgb), 0.7), transparent);
}

.card-visual--strat img {
  position: relative;
  z-index: 1;
  width: min(74%, 146px);
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.52));
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.3s ease;
}

.slot-card:hover .card-visual--strat img {
  transform: scale(1.045);
  filter: drop-shadow(0 8px 22px rgba(var(--permit-rgb), 0.18));
}

.card-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-height: 100px;
  padding: 8px 10px 9px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.card-category {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-ap {
  flex: 0 0 auto;
  padding: 1px 5px 0;
  border: 1px solid rgba(240, 198, 75, 0.27);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.03em;
  line-height: 1.45;
}

.card-name {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.35em;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  min-height: 12px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 17px;
  overflow: hidden;
}

.tag-mini {
  --tag-color: var(--gold);
  --tag-rgb: 240, 198, 75;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding: 3px 6px 2px;
  border: 1px solid rgba(var(--tag-rgb), 0.26);
  background: rgba(var(--tag-rgb), 0.055);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.01em;
  line-height: 1.35;
  white-space: nowrap;
}

.tag-mini::before {
  content: "";
  width: 3px;
  height: 3px;
  background: var(--tag-color);
}

.tag-mini small {
  color: var(--muted-dark);
  font-size: 6.5px;
  letter-spacing: 0;
}

.tag--range {
  --tag-color: var(--gold);
  --tag-rgb: 240, 198, 75;
}

.tag--role {
  --tag-color: var(--red);
  --tag-rgb: 223, 90, 65;
}

.tag--utility {
  --tag-color: var(--blue);
  --tag-rgb: 90, 168, 212;
}

.tag-more {
  display: inline-flex;
  align-items: center;
  padding: 3px 4px 2px;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.35;
}

.card-code-wrap {
  min-width: 0;
  overflow: hidden;
}

.code {
  display: flex;
  align-items: center;
  gap: 1px;
  min-width: 0;
}

.code img {
  width: 11px;
  height: 11px;
  opacity: 0.84;
}

.code--long img {
  width: 8.5px;
  height: 8.5px;
}

.card-cooldown {
  margin-left: auto;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

.wiki-link {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--muted-dark);
  transition: color 0.16s ease;
}

.wiki-link:hover {
  color: var(--gold);
}

.wiki-link svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   Intel tile
   -------------------------------------------------------------------------- */

.intel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 100%;
  padding: 10px 11px 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(240, 198, 75, 0.055), transparent 42%),
    repeating-linear-gradient(180deg, transparent 0 3px, rgba(255, 255, 255, 0.012) 3px 4px),
    #0e120b;
  animation: cardIn 0.45s 0.22s both;
}

.intel-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 2px;
  background: var(--gold);
}

.intel-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.intel-head span {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.18em;
}

.intel-head b {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 6px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.intel-title {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
}

.intel-title small {
  display: block;
  margin-top: 3px;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 5.5px;
  font-weight: 400;
  letter-spacing: 0.13em;
}

.intel-data {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 9px 0;
}

.intel-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 3px;
  border-bottom: 1px dashed rgba(231, 218, 180, 0.1);
  color: var(--muted-dark);
  font-size: 7px;
  letter-spacing: 0.04em;
}

.intel-row b {
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intel-row b.ok {
  color: var(--green);
}

.intel-quote {
  position: relative;
  z-index: 2;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: 0.05em;
  line-height: 1.35;
}

.intel-quote::before {
  content: "“";
  color: var(--gold);
}

.intel-barcode {
  position: relative;
  z-index: 2;
  width: 72%;
  height: 11px;
  margin-top: 6px;
  opacity: 0.4;
  background: repeating-linear-gradient(90deg, var(--bone) 0 1px, transparent 1px 3px, var(--bone) 3px 4px, transparent 4px 7px, var(--bone) 7px 10px, transparent 10px 12px);
}

.intel-radar {
  position: absolute;
  right: -38px;
  bottom: -42px;
  width: 134px;
  height: 134px;
  border: 1px solid rgba(240, 198, 75, 0.2);
  border-radius: 50%;
  opacity: 0.65;
  background:
    radial-gradient(circle, transparent 0 26%, rgba(240, 198, 75, 0.09) 26.5% 27%, transparent 27.5% 53%, rgba(240, 198, 75, 0.07) 53.5% 54%, transparent 54.5%),
    conic-gradient(from 0deg, rgba(240, 198, 75, 0.22), transparent 19%, transparent 100%);
  mask-image: linear-gradient(140deg, #000, transparent 82%);
  animation: radarSpin 9s linear infinite;
}

.intel-radar::before,
.intel-radar::after {
  content: "";
  position: absolute;
  background: rgba(240, 198, 75, 0.13);
}

.intel-radar::before {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
}

.intel-radar::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

@keyframes radarSpin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Command panel
   -------------------------------------------------------------------------- */

.command-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(240, 198, 75, 0.22);
  background:
    linear-gradient(155deg, rgba(240, 198, 75, 0.065), transparent 35%),
    linear-gradient(180deg, #171c11, #0e120b);
  box-shadow: var(--shadow);
}

.hazard {
  flex: 0 0 auto;
  height: 6px;
  opacity: 0.82;
  background: repeating-linear-gradient(135deg, var(--gold) 0 6px, #161a10 6px 13px);
}

.command-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 17px 17px 14px;
}

.command-panel::after {
  content: "SE";
  position: absolute;
  right: -12px;
  bottom: 72px;
  z-index: 0;
  color: rgba(240, 198, 75, 0.025);
  font-family: var(--font-display);
  font-size: 178px;
  font-weight: 700;
  line-height: 0.7;
  letter-spacing: -0.08em;
  pointer-events: none;
  user-select: none;
}

.kicker {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.15em;
}

.kicker span {
  color: var(--muted-dark);
  padding: 0 2px;
}

.command-head h2 {
  margin-top: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0.035em;
  line-height: 0.98;
}

.command-head h2 em {
  color: var(--gold);
  font-style: normal;
}

.command-desc {
  min-height: 42px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.01em;
  line-height: 1.7;
}

.scope-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
  border: 1px solid var(--line);
  background: rgba(5, 7, 3, 0.3);
}

.scope-switch button {
  position: relative;
  height: 38px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  transition: color 0.16s ease, background 0.16s ease;
}

.scope-switch button:last-child {
  border-right: 0;
}

.scope-switch button:hover {
  color: var(--text);
}

.scope-switch button[aria-pressed="true"] {
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
}

.scope-switch button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.roll-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 86px;
  margin: 10px 0;
  padding: 12px 15px;
  overflow: hidden;
  border: 0;
  background: var(--gold);
  color: var(--ink);
  text-align: left;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%);
  transition: background 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

.roll-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.11) 0 1px, transparent 1px 11px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 43%);
  opacity: 0.55;
  pointer-events: none;
}

.roll-button::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 7px;
  width: 9px;
  height: 9px;
  border-right: 1px solid rgba(23, 26, 18, 0.6);
  border-bottom: 1px solid rgba(23, 26, 18, 0.6);
}

.roll-button:hover {
  background: var(--gold-bright);
  transform: translateY(-2px);
  filter: drop-shadow(0 8px 18px rgba(240, 198, 75, 0.15));
}

.roll-button:active {
  transform: translateY(0);
}

.roll-button[disabled] {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.confirm-button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  margin: 0 0 9px;
  padding: 6px 11px;
  border: 1px solid rgba(240, 198, 75, 0.34);
  background: rgba(240, 198, 75, 0.045);
  color: var(--gold);
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.confirm-button svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.confirm-copy small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
}

.confirm-copy strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.confirm-state {
  margin-left: auto;
  padding: 3px 6px;
  border: 1px solid rgba(240, 198, 75, 0.24);
  color: var(--gold-dim);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.confirm-button:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(240, 198, 75, 0.12);
}

.confirm-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.confirm-button.is-confirmed {
  border-color: rgba(131, 184, 107, 0.5);
  background: rgba(131, 184, 107, 0.08);
  color: var(--green);
}

.confirm-button.is-confirmed .confirm-copy small {
  color: var(--green);
  opacity: 0.7;
}

.confirm-button.is-confirmed .confirm-state {
  border-color: rgba(131, 184, 107, 0.36);
  color: var(--green);
}

.confirm-button.is-confirmed:disabled {
  cursor: default;
  opacity: 1;
}

.valid-state.is-draft {
  color: var(--gold);
}

.valid-state.is-draft i {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(240, 198, 75, 0.7);
}

.valid-state.is-confirmed {
  color: var(--green);
}

.roll-reticle {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(23, 26, 18, 0.45);
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(23, 26, 18, 0.06);
  transition: transform 0.45s ease;
}

.roll-reticle::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(23, 26, 18, 0.38);
  border-radius: 50%;
}

.roll-reticle svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.roll-button:hover .roll-reticle {
  transform: rotate(18deg);
}

.is-rolling .roll-reticle {
  animation: reticleSpin 1.2s linear infinite;
}

@keyframes reticleSpin {
  to {
    transform: rotate(360deg);
  }
}

.roll-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.roll-copy small {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  opacity: 0.62;
}

.roll-copy strong {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
}

.roll-key {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 1;
  padding: 1px 4px;
  border: 1px solid rgba(23, 26, 18, 0.35);
  font-family: var(--font-mono);
  font-size: 5.5px;
  letter-spacing: 0.08em;
  opacity: 0.5;
}

.command-actions {
  display: grid;
  grid-template-columns: 1fr 1.22fr;
  gap: 7px;
}

.utility-button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: rgba(7, 9, 5, 0.34);
  color: var(--text-soft);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.utility-button:hover {
  border-color: rgba(240, 198, 75, 0.48);
  background: rgba(240, 198, 75, 0.055);
  color: var(--gold);
}

.utility-button svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.utility-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-count {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 16px;
  height: 15px;
  margin-left: auto;
  padding: 0 3px;
  background: rgba(240, 198, 75, 0.1);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 400;
}

.filter-count.is-zero {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted-dark);
}

.filter-count[hidden] {
  display: none;
}

.command-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 7px 10px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 27px;
  height: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 7, 3, 0.5);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch-track i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  background: var(--muted-dark);
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch-row input:checked + .switch-track {
  border-color: var(--gold);
  background: rgba(240, 198, 75, 0.13);
}

.switch-row input:checked + .switch-track i {
  background: var(--gold);
  transform: translateX(13px);
}

.switch-row input:focus-visible + .switch-track {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

.pool-summary {
  margin-left: auto;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.history-block {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.history-head h3 {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.history-head h3 span {
  margin-left: 4px;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 6px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 47px;
}

.readiness-block {
  position: relative;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.readiness-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.13em;
}

.readiness-head b {
  color: var(--gold-dim);
  font-weight: 400;
}

.readiness-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(231, 218, 180, 0.08);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.readiness-line strong {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.readiness-line strong.ok {
  color: var(--green);
}

.readiness-stamp {
  display: block;
  width: max-content;
  margin: 5px 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(240, 198, 75, 0.23);
  color: rgba(240, 198, 75, 0.3);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  transform: rotate(-5deg);
  pointer-events: none;
}

.readiness-stamp.is-confirmed {
  border-color: rgba(131, 184, 107, 0.3);
  color: rgba(131, 184, 107, 0.45);
}

.history-empty {
  padding: 9px 0 6px;
  color: var(--muted-dark);
  font-size: 10px;
  line-height: 1.65;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(231, 218, 180, 0.07);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-time {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  width: 35px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.2;
}

.history-time small {
  color: var(--muted-dark);
  font-size: 6.5px;
}

.history-icons {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.history-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  overflow: hidden;
}

.history-icon--weapon {
  background: var(--bone);
}

.history-icon--weapon img {
  width: 23px;
  height: 19px;
  object-fit: contain;
  filter: drop-shadow(0 0 1px rgba(20, 23, 15, 0.85));
}

.history-icon--strat img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.history-restore {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-dark);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.history-restore:hover {
  border-color: var(--line-strong);
  color: var(--gold);
}

.history-restore svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.key-hint {
  margin-top: auto;
  padding-top: 9px;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

.key-hint kbd,
.help-shortcuts kbd {
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 7, 3, 0.4);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 6px;
  line-height: 1.3;
}

.key-hint span {
  padding: 0 2px;
  color: var(--line-strong);
}

/* --------------------------------------------------------------------------
   Loadout tag profile
   -------------------------------------------------------------------------- */

.tag-summary {
  position: relative;
  margin-top: 15px;
  padding: 14px 15px 15px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(240, 198, 75, 0.035), transparent 30%),
    rgba(16, 20, 12, 0.72);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.tag-summary::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
}

.tag-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.tag-summary-head .panel-heading h2 {
  font-size: 21px;
}

.tag-summary-head .panel-heading p {
  letter-spacing: 0.1em;
}

.tag-summary-head .section-index {
  min-width: 33px;
}

.tag-summary-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.tag-summary-meta #tagTotal {
  color: var(--gold);
  font-size: 10px;
}

.tag-summary-meta .head-divider {
  height: 13px;
}

.tag-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 11px;
}

.tag-group {
  --tag-color: var(--gold);
  --tag-rgb: 240, 198, 75;
  min-width: 0;
  padding: 8px 9px 9px;
  border: 1px solid rgba(231, 218, 180, 0.1);
  background: rgba(6, 8, 4, 0.25);
}

.tag-group[data-group="range"] {
  --tag-color: var(--gold);
  --tag-rgb: 240, 198, 75;
}

.tag-group[data-group="role"] {
  --tag-color: var(--red);
  --tag-rgb: 223, 90, 65;
}

.tag-group[data-group="utility"] {
  --tag-color: var(--blue);
  --tag-rgb: 90, 168, 212;
}

.tag-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.tag-group-head span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.tag-group-head b {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.tag-group-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 28px;
}

.tag-chip {
  --tag-color: var(--gold);
  --tag-rgb: 240, 198, 75;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px 3px;
  border: 1px solid rgba(var(--tag-rgb), 0.3);
  background: rgba(var(--tag-rgb), 0.07);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  line-height: 1.35;
  white-space: nowrap;
  cursor: default;
}

.tag-chip::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--tag-color);
}

.tag-chip small {
  color: var(--muted);
  font-size: 9px;
}

.tag-chip:hover {
  border-color: rgba(var(--tag-rgb), 0.62);
  background: rgba(var(--tag-rgb), 0.13);
}

.tag-group .tag--range {
  --tag-color: var(--gold);
  --tag-rgb: 240, 198, 75;
}

.tag-group .tag--role {
  --tag-color: var(--red);
  --tag-rgb: 223, 90, 65;
}

.tag-group .tag--utility {
  --tag-color: var(--blue);
  --tag-rgb: 90, 168, 212;
}

.tag-empty {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Intel strip
   -------------------------------------------------------------------------- */

.intel-strip {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-top: 15px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(14, 17, 10, 0.46);
}

.intel-strip-cell {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  padding: 9px 18px 8px;
  border-right: 1px solid var(--line);
}

.intel-strip-cell span {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.14em;
}

.intel-strip-cell strong {
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.intel-strip-cell strong.ok {
  color: var(--green);
}

.intel-strip-barcode {
  flex: 1;
  min-width: 60px;
  margin: 9px 16px;
  opacity: 0.24;
  background: repeating-linear-gradient(90deg, var(--bone) 0 1px, transparent 1px 4px, var(--bone) 4px 5px, transparent 5px 9px, var(--bone) 9px 12px, transparent 12px 15px);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 25px 28px 38px;
  border-top: 1px solid var(--line);
}

.footer-main {
  max-width: 760px;
}

.footer-mark {
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.footer-mark span {
  color: var(--gold);
}

.footer-disclaimer {
  margin-top: 8px;
  color: var(--muted-dark);
  font-size: 10.5px;
  line-height: 1.8;
}

.footer-disclaimer a {
  color: var(--muted);
  border-bottom: 1px dotted var(--muted-dark);
}

.footer-disclaimer a:hover {
  color: var(--gold);
}

.footer-side {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.footer-side nav {
  display: flex;
  align-items: center;
  gap: 13px;
}

.footer-side nav a,
.footer-side nav button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  transition: color 0.16s ease;
}

.footer-side nav a:hover,
.footer-side nav button:hover {
  color: var(--gold);
}

.footer-side nav svg {
  width: 8px;
  height: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-side > p {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.09em;
}

.footer-side > p span {
  padding: 0 4px;
  color: var(--line-strong);
}

/* --------------------------------------------------------------------------
   Dialogs
   -------------------------------------------------------------------------- */

.modal {
  width: calc(100% - 32px);
  max-width: 780px;
  max-height: 90vh;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(3, 5, 2, 0.82);
  backdrop-filter: blur(7px);
}

.modal[open] {
  animation: modalIn 0.22s ease both;
}

.armory-modal {
  max-width: 1080px;
}

.help-modal {
  max-width: 610px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
}

.modal-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid rgba(240, 198, 75, 0.3);
  background:
    linear-gradient(135deg, rgba(240, 198, 75, 0.035), transparent 28%),
    #11150d;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.68);
}

.modal-frame::before {
  content: "";
  flex: 0 0 auto;
  height: 5px;
  background: repeating-linear-gradient(135deg, var(--gold) 0 5px, #161a10 5px 11px);
  opacity: 0.8;
}

.modal-frame::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 13px;
  height: 13px;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  pointer-events: none;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-kicker {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.15em;
}

.modal-head h2 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
}

.modal-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: color 0.16s ease, border-color 0.16s ease;
}

.modal-close:hover {
  border-color: rgba(240, 198, 75, 0.6);
  color: var(--gold);
}

.modal-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.modal-body {
  flex: 1;
  padding: 16px 20px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-intro {
  max-width: 720px;
  margin-bottom: 19px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: rgba(7, 9, 5, 0.36);
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button-ghost,
.button-solid {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-soft);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  transition: 0.16s ease;
}

.button-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.button-solid {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
}

.button-solid:hover {
  background: var(--gold-bright);
}

.button-solid:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  background: transparent;
  color: var(--muted);
  border-color: var(--line-strong);
}

/* Filter */

.filter-section {
  margin-bottom: 17px;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.filter-section-head h3 {
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.filter-section-head h3 span {
  margin-left: 4px;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.filter-section-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-section-tools button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.filter-section-tools button:hover {
  color: var(--gold);
}

.filter-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(137px, 1fr));
  gap: 6px;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: rgba(7, 9, 5, 0.28);
  color: var(--muted);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.filter-chip[aria-pressed="true"] {
  border-color: rgba(240, 198, 75, 0.46);
  background: rgba(240, 198, 75, 0.065);
  color: var(--text);
}

.filter-chip .chip-dot {
  flex: 0 0 auto;
  width: 4px;
  height: 4px;
  background: var(--muted-dark);
}

.filter-chip[data-kind="orbital"] .chip-dot,
.filter-chip[data-kind="eagle"] .chip-dot {
  background: var(--red);
}

.filter-chip[data-kind="support"] .chip-dot,
.filter-chip[data-kind="backpack"] .chip-dot,
.filter-chip[data-kind="vehicle"] .chip-dot {
  background: var(--blue);
}

.filter-chip[data-kind="sentry"] .chip-dot,
.filter-chip[data-kind="emplacement"] .chip-dot {
  background: var(--green);
}

.filter-chip[aria-pressed="true"] .chip-dot {
  background: var(--gold);
}

.chip-label {
  overflow: hidden;
  font-size: 12px;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-count {
  margin-left: auto;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 9px;
}

.filter-readout {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.filter-readout.is-warning {
  color: var(--red);
}

/* Armory */

.armory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
}

.armory-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}

.armory-tabs button {
  height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  transition: 0.15s ease;
}

.armory-tabs button:hover {
  color: var(--text);
}

.armory-tabs button[aria-selected="true"] {
  border-color: var(--line-strong);
  background: rgba(240, 198, 75, 0.065);
  color: var(--gold);
}

.armory-tabs button span {
  margin-left: 4px;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 6px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 210px;
}

.search-field input {
  width: 100%;
  height: 38px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(4, 6, 3, 0.36);
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.03em;
  outline: none;
}

.search-field input::placeholder {
  color: var(--muted-dark);
}

.search-field input:focus {
  border-color: rgba(240, 198, 75, 0.45);
}

.search-field svg {
  position: absolute;
  right: 8px;
  width: 11px;
  height: 11px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  pointer-events: none;
}

.armory-body {
  padding-top: 12px;
}

.armory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.armory-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 84px;
  padding: 7px 9px;
  background: #12160e;
  transition: background 0.15s ease;
}

.armory-item:hover {
  background: #171c11;
}

.armory-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 66px;
  height: 48px;
  overflow: hidden;
}

.armory-icon--weapon {
  background: var(--bone);
}

.armory-icon--weapon img {
  width: 64px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 1px rgba(20, 23, 15, 0.8));
}

.armory-icon--strat img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.armory-item-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.armory-item-name {
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.armory-item-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.armory-item-meta b {
  color: var(--muted);
  font-weight: 400;
}

.armory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  overflow: hidden;
}

.armory-tags .tag-mini {
  padding: 2px 5px 1px;
  font-size: 9px;
  line-height: 1.4;
}

.armory-tags .tag-more {
  padding: 2px 3px 1px;
  font-size: 8.5px;
  line-height: 1.4;
}

.armory-item-meta .mini-code {
  display: flex;
  gap: 1px;
}

.armory-item-meta .mini-code img {
  width: 6px;
  height: 6px;
  opacity: 0.6;
}

.armory-wiki {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-left: auto;
  color: var(--muted-dark);
}

.armory-wiki:hover {
  color: var(--gold);
}

.armory-wiki svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.armory-empty {
  padding: 48px 20px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.armory-foot a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
}

.armory-foot a:hover {
  color: var(--gold);
}

.armory-foot svg {
  width: 8px;
  height: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* Help */

.help-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.help-step {
  display: flex;
  gap: 13px;
}

.help-step > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(240, 198, 75, 0.3);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8px;
}

.help-step h3,
.help-shortcuts h3,
.help-note h3 {
  margin-bottom: 5px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.help-step p,
.help-note p {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.8;
}

.help-shortcuts,
.help-note {
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.help-shortcuts dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
}

.help-shortcuts dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(231, 218, 180, 0.08);
}

.help-shortcuts dd {
  color: var(--muted);
  font-size: 8.5px;
}

.help-note a {
  color: var(--gold);
  border-bottom: 1px dotted var(--gold-dim);
}

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  max-width: min(90vw, 440px);
  padding: 9px 15px;
  border: 1px solid rgba(240, 198, 75, 0.5);
  background: rgba(16, 20, 12, 0.97);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
  color: var(--text-soft);
  font-size: 9px;
  letter-spacing: 0.03em;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 9px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast::before {
  content: "///";
  margin-right: 7px;
  color: var(--gold);
  font-family: var(--font-mono);
}

/* Hover/focus stat panel shared by the terminal and the tag workshop. */
.stat-tooltip {
  position: fixed;
  z-index: 120;
  width: 320px;
  max-width: calc(100vw - 20px);
  padding: 12px 13px 11px;
  border: 1px solid rgba(240, 198, 75, 0.4);
  background:
    linear-gradient(145deg, rgba(240, 198, 75, 0.06), transparent 38%),
    rgba(12, 15, 8, 0.97);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
}

.stat-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.stat-tooltip::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 34px;
  height: 2px;
  background: var(--gold);
}

.stat-tooltip-head {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.stat-tooltip-kind {
  display: block;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.stat-tooltip-head strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.stat-tooltip-head small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-tooltip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 9px;
  border: 1px solid var(--line);
  background: var(--line);
}

.stat-tooltip-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 7px 6px;
  background: rgba(17, 21, 13, 0.94);
}

.stat-tooltip-cell span {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.05em;
}

.stat-tooltip-cell b {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.stat-tooltip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 9px;
}

.stat-tooltip-tags .tag-mini {
  font-size: 8.5px;
  padding: 2px 5px 1px;
}

.stat-tooltip-no-tags {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8px;
}

.stat-tooltip-note {
  margin-top: 8px;
  color: var(--muted-dark);
  font-size: 8px;
  line-height: 1.55;
}

.noscript {
  padding: 20px;
  background: var(--red);
  color: #fff;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1320px) {
  .console {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .command-inner {
    padding: 15px 14px 12px;
  }

  .command-head h2 {
    font-size: 30px;
  }

  .card-visual {
    height: clamp(120px, 11.5vw, 155px);
  }

  .card-name {
    font-size: clamp(13.5px, 1.05vw, 16px);
  }

  .hero h1 {
    font-size: clamp(42px, 4.4vw, 60px);
  }
}

@media (max-width: 1120px) {
  .console {
    grid-template-columns: 1fr;
  }

  .command-panel {
    order: -1;
  }

  .readiness-block {
    display: none;
  }

  .command-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
    column-gap: 24px;
    align-items: start;
  }

  .command-head {
    grid-column: 1;
    grid-row: 1 / 5;
  }

  .command-head h2 {
    font-size: 31px;
  }

  .scope-switch {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }

  .roll-button {
    grid-column: 2;
    grid-row: 2;
  }

  .confirm-button {
    grid-column: 2;
    grid-row: 3;
  }

  .command-actions {
    grid-column: 2;
    grid-row: 4;
  }

  .command-meta {
    grid-column: 1;
    grid-row: 5;
    margin-top: 10px;
  }

  .history-block {
    grid-column: 1 / -1;
    grid-row: 6;
  }

  .key-hint {
    grid-column: 1 / -1;
    grid-row: 7;
  }

  .history-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 18px;
  }

  .history-item {
    flex: 1 1 260px;
    border-bottom: 0;
  }

  .history-empty {
    flex-basis: 100%;
  }

  .loadout-grid {
    gap: 10px;
  }

  .card-visual {
    height: clamp(124px, 16vw, 180px);
  }

  .card-name {
    font-size: clamp(12px, 1.5vw, 16px);
  }

  .intel-card {
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 14px 20px;
  }

  .page {
    padding: 0 20px 20px;
  }

  .tag-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tag-summary-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .site-footer {
    padding: 22px 20px 32px;
  }

  .link-state {
    display: none;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    padding: 28px 0 22px;
  }

  .hero-lede {
    max-width: 620px;
  }

  .telemetry {
    width: 100%;
  }

  .telemetry-cell {
    flex: 1;
  }

  .command-inner {
    grid-template-columns: 1fr;
  }

  .command-head,
  .scope-switch,
  .roll-button,
  .confirm-button,
  .command-actions,
  .command-meta,
  .history-block,
  .key-hint {
    grid-column: 1;
    grid-row: auto;
  }

  .command-head h2 br {
    display: none;
  }

  .command-head h2 em {
    margin-left: 6px;
  }

  .command-desc {
    min-height: 0;
  }

  .scope-switch {
    margin-top: 13px;
  }

  .history-list {
    flex-direction: column;
    gap: 2px;
  }

  .history-item {
    flex-basis: auto;
    border-bottom: 1px dashed rgba(231, 218, 180, 0.07);
  }

  .intel-strip-cell {
    min-width: 0;
    flex: 1;
    padding: 8px 12px;
  }

  .intel-strip-cell:nth-child(2) {
    display: none;
  }

  .intel-strip-barcode {
    display: none;
  }

  .site-footer {
    flex-direction: column;
    gap: 18px;
  }

  .footer-side {
    align-items: flex-start;
  }

  .armory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .loadout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .editor-link {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-kicker {
    font-size: 6.5px;
  }

  .brand-title {
    font-size: 17px;
  }

  .topbar-side {
    gap: 8px;
  }

  .icon-button {
    width: 32px;
    height: 32px;
  }

  .hero h1 {
    display: block;
    font-size: clamp(38px, 10vw, 50px);
  }

  .hero h1 em {
    display: block;
    margin-top: 4px;
  }

  .hero h1 span::after {
    display: none;
  }

  .telemetry-cell {
    min-width: 0;
    padding: 10px 10px 9px;
  }

  .telemetry-cell strong {
    font-size: 20px;
  }

  .telemetry-cell--wide strong {
    font-size: 15px;
  }

  .telemetry-label {
    font-size: 5.5px;
  }

  .telemetry-unit {
    font-size: 7px;
  }

  .loadout-panel {
    padding: 11px;
  }

  .panel-head {
    align-items: flex-start;
    gap: 8px;
  }

  .panel-heading h2 {
    font-size: 20px;
  }

  .panel-head-side {
    gap: 7px;
  }

  .valid-state {
    display: none;
  }

  .head-divider {
    display: none;
  }

  .loadout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-visual {
    height: clamp(120px, 25vw, 160px);
  }

  .card-name {
    font-size: 15px;
  }

  .intel-card {
    min-height: 150px;
  }

  .loadout-foot {
    flex-wrap: wrap;
    gap: 7px 13px;
  }

  .loadout-foot-note {
    flex-basis: 100%;
    margin-left: 0;
  }

  .command-inner {
    padding: 14px;
  }

  .command-head h2 {
    font-size: 32px;
  }

  .armory-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 9px 14px;
  }

  .search-field {
    flex-basis: auto;
    width: 100%;
  }

  .modal-head {
    padding: 14px;
  }

  .modal-body {
    padding: 14px;
  }

  .modal-foot {
    padding: 11px 14px;
  }

  .filter-chips {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .armory-grid {
    grid-template-columns: 1fr;
  }

  .help-shortcuts dl {
    grid-template-columns: 1fr;
  }

  .footer-side nav {
    flex-wrap: wrap;
    gap: 9px 13px;
  }
}

@media (max-width: 460px) {
  .tag-groups {
    grid-template-columns: 1fr;
  }

  .tag-summary {
    padding: 11px;
  }

  .topbar {
    padding: 12px 14px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .brand-title {
    font-size: 14px;
    letter-spacing: 0.03em;
  }

  .brand-kicker {
    display: none;
  }

  .topbar-actions {
    gap: 3px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .icon-button svg {
    width: 17px;
    height: 17px;
  }

  .page {
    padding: 0 12px 16px;
  }

  .hero {
    padding-top: 23px;
  }

  .eyebrow {
    font-size: 6.5px;
    letter-spacing: 0.15em;
  }

  .eyebrow-code {
    display: none;
  }

  .hero-lede {
    font-size: 10.5px;
    line-height: 1.8;
  }

  .telemetry-cell {
    padding: 8px 7px;
  }

  .telemetry-cell strong {
    font-size: 17px;
  }

  .telemetry-cell--wide strong {
    font-size: 12px;
  }

  .telemetry-label {
    font-size: 4.8px;
    letter-spacing: 0.12em;
  }

  .telemetry-unit {
    font-size: 6px;
  }

  .panel-heading {
    gap: 8px;
  }

  .section-index {
    min-width: 25px;
    padding-right: 8px;
    font-size: 8px;
  }

  .panel-heading p {
    display: none;
  }

  .loadout-grid {
    gap: 7px;
  }

  .card-head {
    padding: 0 4px 0 7px;
    gap: 4px;
  }

  .slot-type {
    font-size: 7.5px;
    letter-spacing: 0.06em;
  }

  .lock-button {
    width: 32px;
    height: 30px;
  }

  .card-visual {
    height: 112px;
  }

  .card-visual--weapon::before {
    font-size: 5.5px;
  }

  .card-visual--strat::before {
    width: 96px;
    height: 96px;
  }

  .card-info {
    min-height: 92px;
    padding: 7px 8px 8px;
  }

  .card-category {
    font-size: 7.5px;
  }

  .card-name {
    min-height: 2.3em;
    font-size: 14px;
    line-height: 1.17;
  }

  .intel-card {
    min-height: 129px;
    padding: 8px;
  }

  .intel-title {
    font-size: 16px;
  }

  .intel-data {
    margin: 6px 0;
  }

  .intel-row {
    font-size: 6px;
  }

  .intel-row b {
    font-size: 6.5px;
  }

  .intel-quote {
    display: none;
  }

  .command-inner {
    padding: 12px;
  }

  .command-head h2 {
    font-size: 30px;
  }

  .roll-button {
    min-height: 80px;
  }

  .roll-copy strong {
    font-size: 26px;
  }

  .roll-reticle {
    width: 48px;
    height: 48px;
  }

  .command-actions {
    grid-template-columns: 1fr;
  }

  .utility-button {
    height: 42px;
  }

  .command-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .intel-strip {
    display: none;
  }

  .footer-main {
    max-width: none;
  }

  .footer-side > p {
    line-height: 1.7;
  }

  .filter-chips {
    grid-template-columns: 1fr 1fr;
  }

  .filter-chip {
    padding: 6px;
  }

  .modal-actions {
    width: 100%;
  }

  .button-ghost,
  .button-solid {
    flex: 1;
  }

  .armory-tabs button {
    padding: 0 6px;
    font-size: 7px;
  }

  .armory-icon {
    width: 48px;
    height: 38px;
  }

  .armory-icon--weapon img {
    width: 46px;
    height: 34px;
  }

  .toast {
    bottom: 16px;
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
