@font-face {
  font-family: "Chakra Petch";
  src: url("fonts/chakra-petch-regular.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("fonts/chakra-petch-semibold.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}
@font-face {
  font-family: Silkscreen;
  src: url("fonts/silkscreen.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #14191f;
  --panel: #20272f;
  --deep: #171d24;
  --line: #343e47;
  --paper: #eee7d8;
  --muted: #a8b5ba;
  --amber: #f6b761;
  --amber-dark: #df9148;
  --signal: #a6d6b2;
  --display: Silkscreen, "Courier New", monospace;
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 16px;
  color: var(--paper);
  background: var(--ink);
  scrollbar-color: #4a555b var(--ink);
  scrollbar-width: thin;
}

*, *::before, *::after { box-sizing: border-box; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #3d474f; border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: #56626a; }
::selection { color: var(--ink); background: var(--signal); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 48% 0%, #202c32, transparent 68%) no-repeat;
}
h1, h2, p, dl, dd { margin: 0; }
button {
  appearance: none;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 0;
}
button:disabled { cursor: not-allowed; }
button:focus-visible, .slider:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  z-index: 1;
}
svg { width: 20px; height: 20px; flex: none; }
[hidden], .symbols { display: none !important; }
.wrap { width: min(1320px, calc(100% - 48px)); margin-inline: auto; }
main.wrap { padding: 16px 0 24px; }

.mast { background: #171d23; border-bottom: 1px solid var(--line); }
.mast-inner {
  min-height: 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.brand, .brand-mark { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand-mark {
  width: 35px;
  height: 35px;
  justify-content: center;
  color: var(--amber);
  background: #2e2b29;
  border: 1px solid #604b37;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand strong { display: block; font: 400 18px/1 var(--display); white-space: nowrap; }
.modes { display: flex; align-self: stretch; gap: 5px; }
.modes button {
  min-width: 100px;
  padding: 0 14px;
  border: 0;
  border-block: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.modes button[aria-pressed="true"] {
  color: var(--amber);
  border-bottom-color: var(--amber);
  background: linear-gradient(0deg, #322c27, transparent 82%);
}
.modes button:hover:not([aria-pressed="true"]), .reset:hover, .ghost:hover:not(:disabled) { color: var(--paper); background: var(--line); }
.reset, .ghost {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  color: var(--muted);
  background: var(--deep);
  border: 1px solid var(--line);
  font-size: .86rem;
  font-weight: 600;
}
.reset { justify-self: end; }
.reset svg, .ghost svg { width: 16px; height: 16px; }
.ghost:disabled { opacity: .45; }

.station { position: relative; border: 1px solid var(--line); background: var(--panel); }
.screen {
  position: relative;
  isolation: isolate;
  aspect-ratio: 2 / 1;
  max-height: calc(100vh - 340px);
  min-height: 240px;
  width: 100%;
  background: #22273b;
  border-bottom: 1px solid #444951;
}
canvas#arena {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  cursor: none;
  touch-action: none;
}
.hud {
  position: absolute;
  z-index: 2;
  inset: 10px 10px auto;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-group {
  display: flex;
  align-items: stretch;
  background: rgb(20 25 31 / .86);
  border: 1px solid var(--line);
}
.site {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid var(--line);
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
}
.telemetry { display: flex; font-variant-numeric: tabular-nums; }
.telemetry > div { padding: 6px 12px; }
.telemetry > div + div { border-left: 1px solid var(--line); }
.telemetry dt { color: var(--muted); font-size: .7rem; }
.telemetry dd { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; font-weight: 600; }
.meter { width: 44px; height: 7px; background: #384047; position: relative; }
.meter > span { display: block; height: 100%; background: var(--signal); }
.meter > span[data-level="high"] { background: var(--amber); }
.meter > span[data-level="critical"] { background: #ff6a52; }
.meter::after {
  position: absolute;
  inset: 0 auto 0 9px;
  width: 2px;
  content: "";
  background: var(--ink);
  box-shadow: 11px 0 var(--ink), 22px 0 var(--ink), 33px 0 var(--ink);
}
.segment {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  background: var(--deep);
}
.view { background: rgb(20 25 31 / .86); }
.segment button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.segment button[aria-pressed="true"] { border-color: #4a555b; background: #354047; color: var(--paper); }
.speed button[aria-pressed="true"] { border-color: #8a6a45; background: #3a3129; color: var(--amber); }
.segment button:hover:not(:disabled):not([aria-pressed="true"]) { color: var(--paper); }
.segment button:disabled { opacity: .5; }
.view-legend, .result {
  position: absolute;
  background: var(--ink);
  border: 1px solid var(--line);
}
.view-legend {
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  font-size: .74rem;
  pointer-events: none;
}
.view-legend i { width: 29px; height: 5px; background: linear-gradient(to right, #4b758d 0 25%, #679c9a 25% 50%, #eca95e 50% 75%, #fd6650 75%); }
.result {
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: calc(100% - 20px);
  padding: 18px 22px;
  text-align: center;
}
.result p { font: 400 clamp(16px, 2.6vw, 26px)/1.3 var(--display); margin-bottom: 12px; }
.result .action { padding: 0 18px; }

.feedbar {
  min-height: 52px;
  padding: 6px 10px 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  background: var(--deep);
  border-bottom: 1px solid var(--line);
}
.feed { display: flex; align-items: baseline; gap: 10px; font-size: .84rem; min-width: 0; }
.feed i { align-self: center; width: 6px; height: 6px; flex: none; background: var(--signal); }
.feed[data-active] i { background: var(--amber); }
#phase { font-weight: 600; white-space: nowrap; }
#report { color: var(--muted); }
.playback { display: flex; align-items: center; gap: 10px; }
.control-label { display: block; color: var(--muted); font-size: .75rem; }

.controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(14px, 2.4vw, 30px);
  padding: 12px 14px 14px;
}
.flight { margin-top: 5px; }
.flight button { min-width: 64px; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.slider-value { color: var(--amber); font-size: .98rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.slider {
  --t: .5;
  position: relative;
  height: 36px;
  margin-top: 2px;
  cursor: ew-resize;
  touch-action: none;
  outline-offset: 2px;
}
.slider-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  height: 8px;
  background: #11161b;
  border: 1px solid var(--line);
}
.slider-fill { display: block; height: 100%; width: calc(var(--t) * 100%); background: var(--amber-dark); }
.slider-thumb {
  position: absolute;
  top: 6px;
  left: calc(8px + var(--t) * (100% - 16px));
  width: 14px;
  height: 24px;
  transform: translateX(-50%);
  background: var(--amber);
  border: 1px solid #ffd59a;
  border-bottom-color: #a96a34;
  box-shadow: 0 2px 4px rgb(0 0 0 / .45);
}
.slider-thumb::after {
  position: absolute;
  inset: 6px 4px;
  content: "";
  border-inline: 1px solid #a96a34;
}
.slider:hover .slider-thumb, .slider[data-dragging] .slider-thumb { background: #ffca86; }
.slider[aria-disabled="true"] { cursor: not-allowed; opacity: .5; }
.action {
  min-height: 44px;
  border: 1px solid #ffc981;
  border-bottom-color: #bd783f;
  background: var(--amber);
  color: #231e1a;
  font-weight: 700;
}
.action:hover:not(:disabled) { background: #ffca86; }
.action:active:not(:disabled) { background: var(--amber-dark); }
.action:disabled { color: #a8b0b1; background: #303941; border-color: #475058; }
.fire {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 150px;
  min-height: 56px;
  padding: 0 24px;
  font-size: 1.05rem;
  white-space: nowrap;
}
.fire svg { width: 18px; height: 18px; }

.armory { margin-top: 12px; border: 1px solid var(--line); background: var(--panel); padding: 10px 10px 2px; }
.round-list { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.round {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "profile" "text";
  align-items: center;
  gap: 6px 8px;
  min-height: 82px;
  padding: 9px 10px 8px;
  border: 1px solid #35404a;
  background: var(--deep);
  text-align: left;
}
.profile { grid-area: profile; display: block; width: 88px; height: 20px; image-rendering: pixelated; }
.round > span { grid-area: text; min-width: 0; }
.round strong { display: block; font-size: .98rem; font-weight: 600; line-height: 1.2; }
.round small { display: block; margin-top: 2px; color: var(--muted); font-size: .76rem; line-height: 1.25; }
.round[aria-pressed="true"] { background: #332d28; border-color: #a47946; }
.round:hover:not(:disabled):not([aria-pressed="true"]) { background: #29323b; border-color: #596771; }
.round:disabled:not([aria-pressed="true"]) { opacity: .62; }
.round-note { min-height: 44px; padding: 10px 4px; color: var(--muted); font-size: .85rem; line-height: 1.45; max-width: 90ch; }

.noscript { padding: 14px; margin-top: 14px; border: 1px solid #786044; background: #2e2822; }
@media (max-width: 1000px) {
  .mast-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding-top: 8px; }
  .modes { grid-column: 1 / -1; grid-row: 2; min-height: 46px; margin-top: 4px; }
  .modes button { flex: 1; min-width: 0; }
  .mast-side { grid-column: 2; grid-row: 1; }
}
@media (max-width: 1180px) {
  .round-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .trajectory { grid-column: 1 / -1; }
  .fire { grid-column: 1 / -1; }
  .telemetry > div { padding-inline: 9px; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 20px); }
  main.wrap { padding-top: 10px; }
  .screen { aspect-ratio: 4 / 3; max-height: none; }
  .hud { position: static; padding: 8px; flex-wrap: wrap; background: var(--deep); border-bottom: 1px solid var(--line); }
  .hud-group { flex-wrap: wrap; flex: 1 1 100%; background: transparent; }
  .site { width: 100%; min-height: 32px; border-right: 0; border-bottom: 1px solid var(--line); }
  .telemetry dd { font-size: .92rem; }
  .feedbar { padding-inline: 10px; }
  .playback { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .segment button { padding-inline: 8px; }
  .flight { display: flex; }
  .flight button { flex: 1; min-height: 42px; }
  .round-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (pointer: coarse) {
  .segment button, .reset, .ghost { min-height: 44px; }
  .slider { height: 44px; }
  .slider-track { top: 18px; }
  .slider-thumb { top: 9px; height: 28px; width: 18px; }
}

.mast-side { justify-self: end; display: flex; align-items: center; gap: 8px; }
.coins {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px 0 9px;
  border: 1px solid #5a4630;
  background: #2a241f;
  color: var(--amber);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.coins svg { width: 18px; height: 18px; image-rendering: pixelated; }
.reset[aria-pressed="false"] { color: #7d878d; }
.result-detail { margin: -4px 0 12px; color: var(--amber); font-weight: 600; }
.round-more { grid-template-areas: "text"; align-content: center; border-style: dashed; border-color: #5a4630; }
.round-more strong { color: var(--amber); }

.armory-view { padding-bottom: 8px; }
.armory-intro { margin: 6px 0 18px; }
.armory-intro h1 { font: 400 clamp(24px, 2.6vw, 34px)/1.1 var(--display); letter-spacing: -.03em; }
.armory-intro p { margin-top: 6px; color: var(--muted); max-width: 70ch; }
.armory-list { display: grid; gap: 12px; }
.family {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.family-head h2 { font: 400 18px/1.15 var(--display); }
.family-head p { margin-top: 5px; color: var(--muted); font-size: .86rem; }
.family-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shell-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "art status" "text text";
  gap: 8px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #35404a;
  background: var(--deep);
  text-align: left;
}
.shell-card canvas { grid-area: art; width: 104px; height: 24px; image-rendering: pixelated; }
.shell-card-text { grid-area: text; }
.shell-card strong { display: block; font-size: 1rem; font-weight: 600; }
.shell-card small { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; }
.shell-card-status { grid-area: status; align-self: start; font-size: .75rem; font-weight: 600; color: var(--amber); white-space: nowrap; }
.shell-card[data-state="owned"] .shell-card-status { color: var(--signal); }
.shell-card[data-state="locked"] .shell-card-status, .shell-card[data-state="short"] .shell-card-status { color: var(--muted); }
.shell-card[data-state="locked"] canvas { opacity: .45; }
.shell-card:hover { background: #29323b; border-color: #596771; }

.file-bar { display: flex; align-items: center; gap: 14px; margin: 2px 0 12px; }
.file-crumb { color: var(--muted); font-size: .86rem; }
.file-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 12px; align-items: start; }
.file-main, .file-side { border: 1px solid var(--line); background: var(--panel); }
.preview { position: relative; aspect-ratio: 16 / 10; max-height: calc(100vh - 330px); width: 100%; background: #10141f; border-bottom: 1px solid var(--line); }
.preview canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.preview-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  background: var(--amber);
  color: #231e1a;
  font-size: .76rem;
  font-weight: 700;
}
.preview-controls { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--deep); }
.preview-controls .action { display: flex; align-items: center; gap: 8px; padding: 0 18px; }
.preview-controls .action svg { width: 14px; height: 14px; }
.toggle {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}
.toggle:hover { color: var(--paper); background: var(--line); }
.toggle[aria-pressed="true"] { color: var(--amber); border-color: #8a6a45; background: #3a3129; }
.file-lower { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 10px; padding: 10px; }
.panel { padding: 10px 12px 12px; border: 1px solid var(--line); background: var(--deep); }
.panel h3 { font: 400 13px/1.2 var(--display); color: var(--paper); }
.panel-note { margin: 4px 0 8px; color: var(--muted); font-size: .76rem; }
.matchup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
.matchup {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  background: transparent;
  font-size: .82rem;
  text-align: left;
}
.matchup:hover { background: #222a32; }
.matchup[aria-pressed="true"] { border-color: #8a6a45; background: #2c2620; }
.bars { display: flex; gap: 2px; }
.bars i { width: 12px; height: 7px; background: #2c343c; }
.matchup[data-tone="good"] .bars i.on { background: var(--signal); }
.matchup[data-tone="fair"] .bars i.on { background: var(--amber); }
.matchup[data-tone="poor"] .bars i.on { background: #e0644a; }
.matchup[data-tone=""] .bars i { animation: measuring 1s steps(2) infinite; }
@keyframes measuring { 50% { background: #3a444d; } }
.swatch { display: inline-block; width: 10px; height: 10px; border: 1px solid rgb(0 0 0 / .4); }
.swatch-steel { background: #667f99; }
.swatch-angled { background: linear-gradient(135deg, #667f99 50%, #8ea3b6 50%); }
.swatch-spaced { background: linear-gradient(90deg, #667f99 35%, transparent 35% 65%, #667f99 65%); }
.swatch-concrete { background: #8b877c; }
.swatch-brick { background: #a77158; }
.swatch-wood { background: #927452; }
.chain { display: grid; gap: 4px; margin-top: 8px; }
.chain-step {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #35404a;
  background: var(--panel);
  text-align: left;
}
.chain-step strong { font-size: .88rem; font-weight: 600; }
.chain-step small { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.chain-step[data-state="owned"] small { color: var(--signal); }
.chain-step[aria-current="true"] { border-color: #a47946; background: #332d28; }
.chain-step:hover:not([aria-current="true"]) { background: #29323b; }

.file-side { padding: 16px 16px 14px; display: grid; gap: 14px; }
.file-family { color: var(--amber); font-size: .78rem; font-weight: 600; }
.file-title { margin-top: -8px; font: 400 clamp(22px, 2.4vw, 30px)/1.1 var(--display); letter-spacing: -.02em; }
.file-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.tag { padding: 4px 9px; border: 1px solid var(--line); background: var(--deep); font-size: .76rem; font-weight: 600; }
.tag#file-status[data-state="owned"] { color: var(--signal); border-color: #3f5a49; }
.tag#file-status[data-state="buy"], .tag#file-status[data-state="short"] { color: var(--amber); border-color: #5a4630; }
.stats { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.stat { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 10px; }
.stat dt { color: var(--muted); font-size: .78rem; }
.stat dd { display: flex; align-items: center; gap: 10px; }
.segments { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; flex: 1; }
.segments i { height: 9px; background: #2c343c; }
.stat-penetration i.on { background: var(--amber); }
.stat-blast i.on { background: #e0644a; }
.stat-velocity i.on { background: #6aa6d8; }
.stat-weight i.on { background: #b9c0c4; }
.stat[data-measuring] .segments i { animation: measuring 1s steps(2) infinite; }
.word { width: 64px; color: var(--muted); font-size: .74rem; text-align: right; }
.against { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); background: var(--deep); color: var(--paper); font-size: .78rem; }
.chip.muted { color: var(--muted); }
.cutaway-panel canvas { display: block; width: 100%; height: auto; margin-top: 8px; image-rendering: pixelated; background: #10141f; }
.file-note { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.file-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.buy { min-height: 52px; font-size: 1rem; }
.buy[data-state="owned"] { background: #2f4a3a; border-color: #4f7a5e; color: var(--signal); }
.buy[data-state="owned"]:disabled { color: var(--signal); background: #2f4a3a; border-color: #4f7a5e; }

@media (max-width: 1100px) {
  .file-grid { grid-template-columns: minmax(0, 1fr); }
  .family { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .family-cards { grid-template-columns: minmax(0, 1fr); }
  .file-lower { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .mast-side { gap: 6px; }
  .mast-side .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .coins { padding-inline: 8px; }
  .matchup-grid { grid-template-columns: minmax(0, 1fr); }
  .stat, .against { grid-template-columns: 96px minmax(0, 1fr); }
  .preview-controls { flex-wrap: wrap; }
  .preview-controls > * { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .matchup[data-tone=""] .bars i, .stat[data-measuring] .segments i { animation: none; }
}
