:root {
  --bg: #090d12;
  --surface: #10161d;
  --surface2: #151d26;
  --surface3: #1b2631;
  --ink: #edf2f6;
  --muted: #8f9eac;
  --faint: #627282;
  --line: #263441;
  --accent: #8bd3ff;
  --good: #8ee3a4;
  --warn: #e9bf69;
  --bad: #ee8585;
  --paper: #e9edf0;
  --paperInk: #17212a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  /* Two faces and three sizes for the whole board: anything that needs to
     stand out does it with weight, colour, or case, not another size. */
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  --fs-lg: 1.25rem;
  --fs-md: 0.85rem;
  --fs-sm: 0.68rem;
  --software: #7fb4d6;
  --vendor: #8eb69a;
  --ai: #a892d2;
  --action: #d2b36f;
  --upgrade: #a58fc2;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
html {
  background: var(--bg);
}
body {
  min-height: 100vh;
  background: transparent;
}
.hidden {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  background: var(--surface3);
  color: var(--ink);
  border: 0;
  padding: 0.6rem 0.78rem;
  cursor: pointer;
}
button:hover {
  background: #243443;
}
button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.button-link {
  background: var(--surface3);
  color: var(--ink);
  padding: 0.6rem 0.78rem;
  text-decoration: none;
}
.button-link:hover {
  background: #243443;
}
.shortcut-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  margin-right: 0.55em;
  padding: 0 0.3em;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: 1.5;
  vertical-align: 1px;
}
.primary {
  background: #1d5069;
}
.primary:hover {
  background: #266681;
}
.danger {
  background: #3a2225;
  color: #ffd9d9;
}
.quiet {
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.55rem;
}
.good {
  color: var(--good);
}
.action-pending [data-action] {
  pointer-events: none;
  opacity: 0.38;
}
.mono {
  font-family: var(--mono);
}
.sub {
  font-size: var(--fs-md);
  color: var(--muted);
}
.app {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 16px calc(var(--command-bar-h, 60px) + 24px);
}
.topbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(9, 13, 18, 0.94);
  backdrop-filter: blur(14px);
  padding: 13px 0 10px;
  border-bottom: 1px solid #18232d;
}
.brand,
.start-brand-name {
  font-family: var(--mono);
  font-weight: 900;
  letter-spacing: 0.2em;
  font-size: var(--fs-lg);
}
.top-actions {
  justify-self: end;
  display: flex;
  gap: 4px;
}
.hud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hud-button {
  cursor: pointer;
  border: 1px solid transparent;
  padding: 4px 10px;
  transition:
    0.14s background,
    0.14s border-color;
}
.hud-button:hover {
  background: #131c25;
  border-color: #2d4050;
}
.hud-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.metric {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}
.metric b {
  font-family: var(--mono);
  font-size: var(--fs-md);
}
.metric.work b {
  color: var(--good);
}
.metric.debt b {
  color: var(--bad);
}
.game-term {
  white-space: nowrap;
}
.game-icon {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  vertical-align: -0.12em;
  margin-right: 0.35em;
}
/* Icon sizes stay in em everywhere so a glyph scales with the type around it
   rather than staying pinned to a fixed pixel box as the view is zoomed. */
.metric .game-icon {
  width: 0.9em;
  height: 0.9em;
  margin-right: 0;
}
.status {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  flex-wrap: wrap;
  margin-top: 9px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-weight: 800;
  letter-spacing: 0.13em;
  font-size: var(--fs-md);
  text-transform: uppercase;
}
.status .dot {
  width: 9px;
  height: 9px;
  background: currentColor;
  flex: none;
}
.status .who {
  color: var(--ink);
  font-weight: 800;
}
.status .note {
  letter-spacing: 0.06em;
  font-weight: 600;
  opacity: 0.72;
  text-transform: none;
  font-size: var(--fs-md);
}
.status .pips {
  display: flex;
  gap: 4px;
}
.status .pip {
  width: 18px;
  height: 5px;
  background: currentColor;
  opacity: 0.22;
}
.status .pip.on {
  opacity: 1;
}
.status.mine {
  background: linear-gradient(90deg, rgba(142, 227, 164, 0.15), rgba(142, 227, 164, 0.04));
  color: var(--good);
  box-shadow: inset 0 0 0 1px rgba(142, 227, 164, 0.34);
}
.status.theirs {
  background: rgba(233, 191, 105, 0.08);
  color: var(--warn);
  box-shadow: inset 0 0 0 1px rgba(233, 191, 105, 0.26);
}
.status.theirs .dot {
  animation: tick 1.5s ease-in-out infinite;
}
@keyframes tick {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}
@media (max-width: 720px) {
  .status {
    margin-top: 7px;
    padding: 8px 10px;
    gap: 8px;
    font-size: var(--fs-sm);
    letter-spacing: 0.08em;
  }
  .status .note {
    display: none;
  }
}
.qcard {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 150px;
  z-index: 70;
  width: min(520px, calc(100vw - 24px));
  background: #16212c;
  padding: 14px 16px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid #2c3f50;
  cursor: pointer;
  animation: qin 0.22s ease-out;
}
.qcard.hidden {
  display: none;
}
body {
  font-size: var(--fs-md);
}
h1,
h2,
h3,
h4 {
  font-size: var(--fs-lg);
}
.qcard h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--fs-lg);
  letter-spacing: 0.16em;
  color: var(--accent);
}
.qcard .qsub {
  font-size: var(--fs-sm);
  color: var(--faint);
  margin-top: 2px;
}
.qcard ul {
  margin: 11px 0 0;
  padding-left: 17px;
  line-height: 1.5;
  font-size: var(--fs-md);
  color: #d3dde6;
}
.qcard li {
  margin: 2px 0;
}
.qcard li.bad {
  color: var(--bad);
}
.qcard li.world {
  color: var(--warn);
}
@keyframes qin {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@media (max-width: 720px) {
  .qcard {
    top: 132px;
    padding: 12px 13px;
  }
  .qcard ul {
    font-size: var(--fs-md);
  }
}
.board {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(480px, 1.75fr) minmax(220px, 0.72fr);
  gap: 12px;
  margin-top: 14px;
  min-height: 470px;
}
.surface {
  background: var(--surface);
  padding: 14px;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
}
.section-head h2 {
  font-size: var(--fs-md);
  margin: 0;
  font-weight: 750;
}
.section-note {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--faint);
}
.requirements-panel {
  display: flex;
  flex-direction: column;
}
.req-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.req-slot {
  padding: 0;
}
.slot-label {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--faint);
  letter-spacing: 0.14em;
  margin: 0 0 4px 4px;
}
.req {
  position: relative;
  background: var(--surface2);
  padding: 10px 10px 9px;
  cursor: pointer;
  transition:
    0.14s transform,
    0.14s background;
}
.req:hover {
  background: #1a2530;
}
.req.selected {
  outline: 2px solid var(--accent);
}
.req.legal-target {
  outline: 2px dotted var(--accent);
  animation: legal-target-pulse 1.2s ease-in-out infinite;
}
.req.now {
  border-left: 3px solid var(--bad);
}
.req.next {
  border-left: 3px solid var(--warn);
}
.req.later {
  border-left: 3px solid #506170;
}
.req-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}
.req-name {
  font-size: var(--fs-md);
  font-weight: 760;
  line-height: 1.15;
}
.req-kind {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.06em;
}
.req-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 7px;
}
.req-penalty {
  color: var(--bad);
}
.progress {
  height: 5px;
  background: #080c10;
  overflow: hidden;
  margin-top: 7px;
}
.progress > i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.architecture-panel {
  position: relative;
  overflow: hidden;
  background: var(--surface2);
}
.arch {
  min-height: 395px;
  padding: 8px 2px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.arch-node {
  width: min(420px, 85%);
  background: rgba(25, 36, 46, 0.92);
  padding: 10px 12px;
  cursor: pointer;
  position: relative;
  transition:
    0.14s transform,
    0.14s background;
}
.arch-node:hover {
  background: #1d2b37;
}
.arch-node.selected {
  outline: 2px solid var(--accent);
}
.arch-node.legal-target {
  outline: 2px dotted var(--accent);
  animation: legal-target-pulse 1.2s ease-in-out infinite;
}
.arch-node:before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: #334757;
}
.arch-node.root:before {
  display: none;
}
.arch-node + .arch-node {
  margin-top: 8px;
}
.arch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.arch-name {
  font-weight: 780;
  font-size: var(--fs-md);
}
.arch-stats {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.arch-meta {
  margin-top: 5px;
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--faint);
}
.type-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  background: var(--software);
}
.type-dot.vendor {
  background: var(--vendor);
}
.type-dot.ai {
  background: var(--ai);
}
.debt-mark {
  color: var(--bad);
  font-family: var(--mono);
}
.upgrade-mark {
  color: #b8a4d4;
}
.empty-state {
  margin: auto;
  color: var(--faint);
  font-size: var(--fs-md);
  text-align: center;
  max-width: 280px;
  line-height: 1.5;
}
.arch-node.dormant {
  filter: grayscale(0.85);
  opacity: 0.58;
  transform: rotate(-1.4deg);
  border: 1px dashed #65717c;
}
.dormant-mark {
  color: var(--warn);
  font-family: var(--mono);
}
.progress-pips {
  letter-spacing: 0.12em;
  color: var(--faint);
}
.progress-pips .on {
  color: var(--ai);
}
.ai-winter {
  color: var(--bad);
  font-weight: 800;
}
.prereq {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.prereq .met {
  color: var(--good);
}
.prereq .unmet {
  color: var(--warn);
}
.right-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.world-card,
.opponent-card,
.race-card {
  background: var(--surface);
  padding: 13px;
}
.world-card {
  cursor: pointer;
}
.race-card-button {
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    0.14s background,
    0.14s border-color;
}
.race-card-button:hover {
  background: #131c25;
  border-color: #2d4050;
}
.race-card-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.race-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.race-details-hint {
  color: var(--faint);
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
}
.eyebrow {
  font-family: var(--mono);
  color: var(--accent);
  font-size: var(--fs-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.world-name {
  font-weight: 780;
  font-size: var(--fs-md);
  margin-top: 4px;
}
.world-text {
  font-size: var(--fs-md);
  color: #b3bfca;
  line-height: 1.4;
  margin-top: 6px;
}
.world-flavor {
  font-style: italic;
  color: #748697;
  font-size: var(--fs-sm);
  line-height: 1.35;
  margin-top: 8px;
}
.opponents {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opponent-card {
  cursor: pointer;
  background: var(--surface);
}
.opponent-card:hover {
  background: #131c25;
}
.opponent-card.legal-target {
  outline: 2px dotted var(--accent);
  animation: legal-target-pulse 1.2s ease-in-out infinite;
}
@keyframes legal-target-pulse {
  0%,
  100% {
    outline-color: var(--accent);
  }
  50% {
    outline-color: rgba(139, 211, 255, 0.3);
  }
}
@media (prefers-reduced-motion: reduce) {
  .req.legal-target,
  .arch-node.legal-target,
  .opponent-card.legal-target {
    animation: none;
  }
}
.op-name {
  font-weight: 760;
}
.op-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.op-metric {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.op-metric b {
  color: var(--ink);
  font-weight: 600;
}
.op-arch {
  margin-top: 8px;
  color: var(--faint);
  font-size: var(--fs-sm);
  line-height: 1.35;
}
.race-row {
  margin-top: 9px;
}
.race-row-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.race-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 5px;
}
.race-step {
  height: 6px;
  background: #24303b;
}
.race-step.on {
  background: var(--ai);
}
.race-label {
  font-family: var(--mono);
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: 7px;
}
.ai-race-modal-card {
  width: min(720px, 100%);
}
.waffle-modal-card {
  width: min(580px, 100%);
}
.waffle-chart {
  margin-top: 12px;
  overflow-x: auto;
}
.waffle-chart svg {
  display: block;
  margin: 0 auto;
}
.waffle-player + .waffle-player {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.waffle-player-label {
  margin-bottom: 2px;
}
.waffle-baseline {
  stroke: var(--line);
  stroke-width: 1;
}
.waffle-col {
  outline: none;
}
.waffle-hit {
  fill: transparent;
}
.waffle-col:hover .waffle-hit {
  fill: rgba(255, 255, 255, 0.05);
}
.waffle-col:focus-visible .waffle-hit {
  stroke: var(--accent);
  stroke-width: 2;
}
.waffle-value {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 9px;
  fill: var(--ink);
}
.waffle-label {
  font-size: 6.2px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  fill: var(--muted);
}
.ai-race-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-race-detail {
  padding: 12px 13px;
  border: 1px solid var(--line);
  background: #0d141b;
}
.ai-race-detail .race-row {
  margin-top: 0;
}
.ai-race-detail .prereq {
  margin-top: 11px;
}
.funding-bar {
  height: 6px;
  background: #24303b;
  overflow: hidden;
  margin-top: 9px;
}
.funding-bar i {
  display: block;
  height: 100%;
  background: var(--good);
}
.market-clock {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--warn);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.hand-shell {
  margin-top: 12px;
  background: var(--surface);
  padding: 13px 14px 10px;
}
.hand {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 9px;
  scroll-snap-type: x proximity;
}
.card {
  min-width: 154px;
  width: 154px;
  height: 188px;
  background: var(--paper);
  color: var(--paperInk);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.18);
  transition:
    0.14s transform,
    0.14s box-shadow;
}
.card:hover {
  transform: translateY(-2px);
}
.card.selected {
  box-shadow:
    0 0 0 3px var(--accent),
    0 12px 25px rgba(0, 0, 0, 0.28);
}
.card-art {
  height: 72px;
  background: linear-gradient(145deg, #526779, #1b2731);
  position: relative;
  overflow: hidden;
}
.card-art:after {
  content: '';
  position: absolute;
  inset: 18% -20% -25% 24%;
  transform: rotate(-12deg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 0 0 14px rgba(255, 255, 255, 0.025),
    0 0 0 28px rgba(255, 255, 255, 0.018);
}
.art-vendor {
  background: linear-gradient(145deg, #668574, #1b2923);
}
.art-action {
  background: linear-gradient(145deg, #8a7041, #282015);
}
.art-upgrade {
  background: linear-gradient(145deg, #716482, #251f2e);
}
.art-ai {
  background: linear-gradient(145deg, #725f91, #1c1928);
}
.art-danger {
  background: linear-gradient(145deg, #794c4c, #28191b);
}
.card-body {
  padding: 8px 9px;
}
.card-title {
  font-size: var(--fs-md);
  font-weight: 830;
  line-height: 1.08;
  min-height: 34px;
}
.card-sub {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.05em;
  color: #5f6f7d;
  text-transform: uppercase;
  margin-top: 3px;
}
.card-costs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: #42515e;
  font-weight: 800;
}
.hand-empty {
  padding: 24px;
  color: var(--faint);
}
.art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.world-art {
  position: relative;
  height: 62px;
  overflow: hidden;
  margin: 9px 0 2px;
  background: #1b2731;
}
.inspect-art {
  position: relative;
  height: 108px;
  overflow: hidden;
  margin: 12px 0 2px;
  background: #1b2731;
}
.ai-claim-modal-card {
  width: min(560px, 100%);
  border: 1px solid rgba(199, 160, 255, 0.5);
  box-shadow:
    0 0 0 1px rgba(199, 160, 255, 0.1),
    0 30px 80px rgba(0, 0, 0, 0.7);
}
.ai-claim-kicker {
  font-family: var(--mono);
  color: var(--ai);
  font-size: var(--fs-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.ai-claim-costs {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ai-claim-costs li {
  background: #1b222a;
  border-left: 3px solid var(--ai);
  padding: 10px;
  font-size: var(--fs-md);
}
.ai-claim-modal-card .start-actions {
  justify-content: flex-end;
}
.funding-modal-card {
  width: min(560px, 100%);
  border: 1px solid rgba(142, 227, 164, 0.5);
  box-shadow:
    0 0 0 1px rgba(142, 227, 164, 0.1),
    0 30px 80px rgba(0, 0, 0, 0.7);
}
.funding-kicker {
  font-family: var(--mono);
  color: var(--good);
  font-size: var(--fs-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.funding-modal-card .start-actions {
  justify-content: flex-end;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.section-title h2 {
  margin: 0;
}
.modal.full {
  padding: 0;
  place-items: stretch;
}
.modal.full .modal-card {
  width: 100%;
  max-width: none;
  height: 100vh;
  max-height: 100vh;
  padding: 20px 24px;
}
.cardsheet {
  width: min(1180px, 100%);
}
.cards-search {
  flex: 1;
  max-width: 320px;
  margin: 0 auto;
}
.cardsheet .section-title {
  position: sticky;
  top: -21px;
  background: #121a22;
  padding: 14px 0 10px;
  z-index: 2;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 6px;
}
.cg-card {
  background: var(--paper);
  color: var(--paperInk);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  transition:
    0.14s transform,
    0.14s box-shadow;
}
.cg-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
}
.cg-art {
  position: relative;
  height: 78px;
  background: #1b2731;
  overflow: hidden;
}
.cg-body {
  padding: 8px 9px 10px;
}
.cg-title {
  font-size: var(--fs-md);
  font-weight: 830;
  line-height: 1.12;
  min-height: 31px;
}
.cg-sub {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.05em;
  color: #5f6f7d;
  text-transform: uppercase;
  margin-top: 3px;
}
.cg-group {
  grid-column: 1/-1;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 14px 0 -4px;
  padding-top: 8px;
  border-top: 1px solid #24313d;
}
.cg-group:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}
.zoomcard {
  width: min(880px, 100%);
}
.zoom-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  padding: 10px 14px;
  z-index: 1;
}
.zoom-prev {
  left: 12px;
}
.zoom-next {
  right: 12px;
}
.zoom-nav.hidden {
  display: none;
}
.zoom-art {
  position: relative;
  height: min(46vh, 300px);
  overflow: hidden;
  background: #1b2731;
}
.zoom-body {
  margin-top: 15px;
}
.zoom-body h2 {
  margin: 0 0 2px;
  font-size: var(--fs-lg);
  line-height: 1.1;
}
.zoom-body .inspect-tags {
  margin-top: 14px;
}
@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 620px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
.command-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(1568px, calc(100% - 32px));
  z-index: 55;
  background: rgba(12, 18, 24, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid #1c2830;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  padding: 8px 10px;
  transition: box-shadow 0.15s ease;
}
.command-bar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.command-hint {
  font-size: var(--fs-md);
  color: var(--muted);
  flex: 1;
}
.command-bar-peek {
  display: none;
  flex: 1;
  font-family: var(--mono);
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.command-bar.collapsed .command-hint {
  display: none;
}
.command-bar.collapsed .command-bar-peek {
  display: block;
}
.command-bar.collapsed.mine .command-bar-peek {
  color: var(--good);
}
.command-bar.collapsed.theirs .command-bar-peek {
  color: var(--warn);
}
.command-bar-head:hover .command-hint,
.command-bar-head:hover .command-bar-peek {
  color: var(--ink);
}
.command-bar-body {
  margin-top: 8px;
}
.command-bar.collapsed .command-bar-body {
  display: none;
}
.command-bar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.undo-btn {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  padding: 0.5rem 0.65rem;
  margin-right: auto;
}
.undo-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.quick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.quick-actions button {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  padding: 0.5rem 0.65rem;
}
/* Pass is the only irreversible move: outlined and set apart, never filled.
   A filled button reads as "the thing to click", which is exactly wrong here. */
.quick-actions button.pass-btn {
  color: var(--warn);
  box-shadow: inset 0 0 0 1px rgba(233, 191, 105, 0.4);
  margin-left: 6px;
}
.quick-actions button.end-turn-btn {
  font-weight: 700;
}
.command-note {
  align-self: center;
  margin-right: 4px;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.support-step-hint {
  margin: 6px 10px 0;
  text-align: right;
  color: var(--accent);
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.inspector {
  position: fixed;
  right: 16px;
  top: 78px;
  bottom: calc(var(--command-bar-h, 60px) + 16px);
  width: min(390px, calc(100vw - 32px));
  z-index: 60;
  background: #131b24;
  box-shadow: var(--shadow);
  overflow: auto;
  padding: 16px;
}
.inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.inspect-title {
  font-size: var(--fs-lg);
  font-weight: 820;
  line-height: 1.1;
}
.inspect-kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: var(--fs-sm);
  color: var(--accent);
  margin-bottom: 5px;
}
.inspect-stats {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.stat-pill {
  background: #1c2731;
  padding: 5px 8px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
}
.inspect-rule {
  font-size: var(--fs-md);
  line-height: 1.5;
  color: #d7e0e8;
  margin: 13px 0;
}
.inspect-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.inspect-tag {
  font-family: var(--mono);
  background: #202c37;
  color: #aab8c4;
  padding: 3px 6px;
  font-size: var(--fs-sm);
}
.flavor {
  border-top: 1px solid #263441;
  margin-top: 16px;
  padding-top: 13px;
  color: #9aa9b7;
  font-style: italic;
  line-height: 1.45;
  font-size: var(--fs-md);
}
.inspect-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
}
.inspect-actions button {
  text-align: left;
}
.inspect-section {
  margin-top: 18px;
}
.inspect-section h4 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
}
.mini-list {
  font-size: var(--fs-md);
  color: #b6c2cc;
  line-height: 1.5;
}
.evo-path {
  display: grid;
  gap: 10px;
}
.evo-step {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  align-items: start;
}
.evo-level {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 2px;
}
.evo-text b {
  color: #dbe5ee;
}
.evo-note {
  margin-top: 8px;
  color: var(--muted);
}
@media (max-width: 620px) {
  .evo-step {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
.modal,
.handoff {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 9, 0.88);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}
#start {
  background: rgba(3, 6, 9, 0.5);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 16px 18px;
}
.start-topbar {
  width: min(1600px, 100%);
  margin: 0 auto;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: none;
  background: rgba(9, 13, 18, 0.94);
  backdrop-filter: blur(14px);
  padding: 10px 0;
  border-bottom: 1px solid #18232d;
}
.start-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.start-brand h1 {
  margin: 0;
}
.start-brand .sub {
  font-family: var(--mono);
  font-weight: 700;
}
.start-nav {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}
.start-topbar .button-link {
  display: inline-flex;
  align-items: center;
}
.start-content {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 18px 0;
}
.start-card {
  width: min(680px, 100%);
  max-height: 100%;
}
.start-card > .rules:first-child {
  margin-top: 0;
}
.advanced-settings {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.advanced-settings summary {
  padding: 12px 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.advanced-settings summary:hover {
  color: var(--ink);
}
.advanced-settings-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 0 14px;
}
.advanced-settings-fields label {
  font-size: var(--fs-md);
  color: var(--muted);
}
.modal-card {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #121a22;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}
.modal-card h1,
.modal-card h2 {
  margin-top: 0;
}
.debt-choice-card {
  width: min(620px, 100%);
}
.debt-choice-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.debt-choice {
  display: flex;
  gap: 10px;
  align-items: start;
  text-align: left;
}
.debt-choice span {
  display: grid;
  gap: 3px;
}
.debt-choice small {
  color: var(--muted);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-row label {
  font-size: var(--fs-md);
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  background: #0b1117;
  color: var(--ink);
  border: 1px solid #31465a;
  padding: 0.65rem;
}
.start-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.rules {
  line-height: 1.55;
  color: #dce5ee;
}
.rules h3 {
  font-family: var(--mono);
}
.rules li {
  margin: 0.35rem 0;
}
.shortcuts-help-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.shortcuts-help-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #1e2b37;
}
.shortcuts-help-list li:last-child {
  border-bottom: none;
}
.shortcuts-help-list kbd {
  flex: 0 0 auto;
  min-width: 64px;
  text-align: center;
  font-family: var(--mono);
  font-size: var(--fs-md);
  background: #0b1117;
  border: 1px solid #31465a;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--ink);
}
.log {
  max-height: 320px;
  overflow: auto;
  background: #080c10;
  padding: 8px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: #a8b8c8;
}
.log div {
  padding: 3px 0;
  border-bottom: 1px dotted #202c38;
}
.log .q {
  color: #7f91a4;
}
.dev-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.small {
  font-size: var(--fs-sm);
}
.toast {
  position: fixed;
  right: 12px;
  bottom: 12px;
  background: #1d2a36;
  padding: 10px 12px;
  z-index: 120;
  max-width: 360px;
  box-shadow: var(--shadow);
}
.incident-card {
  width: min(760px, 100%);
  border: 1px solid rgba(239, 111, 108, 0.55);
  box-shadow:
    0 0 0 1px rgba(239, 111, 108, 0.12),
    0 30px 80px rgba(0, 0, 0, 0.7);
}
.incident-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}
.incident-art {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background: linear-gradient(145deg, #794c4c, #28191b);
}
.incident-art .art-img {
  display: block;
}
.incident-kicker {
  font-family: var(--mono);
  color: var(--bad);
  font-size: var(--fs-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.incident-title {
  font-size: var(--fs-lg);
  line-height: 1.05;
  margin: 5px 0 7px;
}
.incident-target {
  color: var(--warn);
  font-family: var(--mono);
  font-size: var(--fs-md);
}
.incident-effect {
  font-size: var(--fs-md);
  line-height: 1.5;
  margin: 16px 0;
}
.incident-quip {
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--muted);
  margin: 0 0 13px;
}
.incident-results {
  list-style: none;
  padding: 0;
  margin: 13px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.incident-results li {
  background: #1b222a;
  border-left: 3px solid var(--bad);
  padding: 8px 10px;
  font-size: var(--fs-md);
}
.incident-results .game-icon {
  width: 1.05em;
  height: 1.05em;
}
.incident-card .start-actions {
  justify-content: flex-end;
}
@media (max-width: 1320px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .hud {
    grid-column: 1/-1;
    grid-row: 2;
    justify-content: center;
    padding-bottom: 2px;
  }
  .top-actions {
    grid-column: 2;
    grid-row: 1;
    white-space: nowrap;
  }
}
@media (max-width: 1050px) {
  .board {
    grid-template-columns: minmax(210px, 0.7fr) minmax(420px, 1.4fr);
  }
  .right-rail {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .app {
    padding: 0 9px calc(var(--command-bar-h, 56px) + 16px);
  }
  .topbar {
    position: sticky;
    padding: 10px 2px 8px;
    grid-template-columns: 1fr auto;
  }
  #start {
    padding: 0 9px 9px;
  }
  .start-topbar {
    min-height: 54px;
    padding: 8px 2px;
  }
  .start-nav button,
  .start-nav .button-link {
    font-size: var(--fs-sm);
    padding: 0.45rem 0.5rem;
  }
  .start-brand {
    gap: 5px;
  }
  .start-brand .sub {
    font-size: var(--fs-sm);
  }
  .brand,
  .start-brand-name {
    font-size: var(--fs-md);
  }
  .top-actions button {
    font-size: var(--fs-sm);
    padding: 0.45rem 0.55rem;
  }
  .hud {
    gap: 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: safe center;
  }
  .metric b {
    font-size: var(--fs-md);
  }
  .board {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .architecture-panel {
    order: 1;
  }
  .requirements-panel {
    order: 2;
  }
  .right-rail {
    order: 3;
    grid-column: auto;
    display: grid;
    grid-template-columns: 1fr;
  }
  .arch {
    min-height: 300px;
  }
  .arch-node {
    width: 92%;
  }
  .hand-shell {
    padding: 11px 10px 8px;
  }
  .card {
    min-width: 132px;
    width: 132px;
    height: 168px;
  }
  .card-art {
    height: 62px;
  }
  .card-title {
    font-size: var(--fs-md);
    min-height: 31px;
  }
  .command-bar {
    left: 7px;
    right: 7px;
    bottom: 7px;
    width: auto;
    transform: none;
  }
  .command-bar-actions {
    justify-content: flex-start;
  }
  .quick-actions {
    justify-content: flex-start;
  }
  .command-hint {
    display: none;
  }
  .inspector {
    left: 7px;
    right: 7px;
    top: auto;
    bottom: calc(var(--command-bar-h, 56px) + 14px);
    width: auto;
    max-height: 68vh;
    padding: 15px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .advanced-settings-fields {
    grid-template-columns: 1fr;
  }
  .world-flavor {
    display: none;
  }
  .incident-layout {
    grid-template-columns: 1fr;
  }
  .incident-art {
    min-height: 150px;
  }
  .incident-title {
    font-size: var(--fs-lg);
  }
}

.invite-box {
  margin-top: 14px;
}

.handoff-card {
  text-align: center;
}

.competition-heading {
  margin: 0 3px 7px;
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 0.15em;
  font-weight: 700;
}
.delta.up {
  color: var(--good);
}
.delta.down {
  color: var(--bad);
}
