/* ============================================================
   CLIFF · Spark (SPK) — Game UI Design System
   Palette: Ink #111111 · Blue #3A3AF5 · Lime #D8FE5E · Blush #F9E0EB
   ============================================================ */

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

:root {
  --ink:    #111111;
  --blue:   #3A3AF5;
  --lime:   #D8FE5E;
  --blush:  #F9E0EB;
  --ink2:   #1a1a1a;
  --ink3:   #222222;
  --ink4:   #2e2e2e;
  --ink5:   #3a3a3a;
  --muted:  #666666;
  --muted2: #888888;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --mint:   #4ade80;
  --red:    #f87171;
  --amber:  #fbbf24;
  --nav-h:  56px;
  --r:      8px;
  --r-lg:   14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html, body {
  height: 100%;
  background: var(--ink);
  color: #e8e8e8;
  font-family: 'Syne', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ── SCREENS ─────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ── ONBOARDING ──────────────────────────────────────────── */
.onboard-bg {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden;
}
.onboard-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(58,58,245,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58,58,245,0.08) 1px, transparent 1px);
  background-size: 48px 48px;
}
.onboard-glow {
  position: absolute;
  top: -20%; left: 50%; transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse, rgba(58,58,245,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.onboard-inner {
  position: relative; z-index: 1;
  max-width: 860px; margin: 0 auto;
  padding: 60px 24px 80px;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
}

.onboard-logo {
  display: flex; align-items: center; gap: 10px;
}
.spark-sym {
  font-size: 28px; color: var(--lime);
  animation: spark-pulse 2.4s ease-in-out infinite;
}
@keyframes spark-pulse {
  0%,100% { opacity: 1; text-shadow: 0 0 12px var(--lime); }
  50% { opacity: 0.6; text-shadow: 0 0 4px var(--lime); }
}
.onboard-wordmark {
  font-size: 28px; font-weight: 800; letter-spacing: 0.12em;
  color: #fff;
}
.onboard-spk {
  font-family: 'DM Mono', monospace;
  font-size: 11px; color: var(--muted2);
  border: 1px solid var(--border2);
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: 0.1em;
}

.onboard-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700; text-align: center;
  line-height: 1.2; color: #fff;
}
.onboard-title em { color: var(--lime); font-style: normal; }

.onboard-sub {
  font-size: 16px; color: var(--muted2);
  text-align: center; max-width: 560px;
  line-height: 1.7;
}

/* Rules card */
.rules-card-onboard {
  width: 100%;
  background: var(--ink2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 24px 28px;
}
.rules-card-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 0.15em;
  color: var(--muted); margin-bottom: 16px;
}
.rules-card-grid { display: flex; flex-direction: column; gap: 10px; }
.rule-row {
  display: flex; gap: 16px; align-items: flex-start;
  font-size: 13px; color: #ccc; line-height: 1.5;
}
.rule-n {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--blue);
  min-width: 20px; padding-top: 2px;
  letter-spacing: 0.05em;
}

/* Setup form */
.setup-form {
  width: 100%;
  background: var(--ink2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 28px;
}
.setup-form-title {
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; color: var(--muted2);
  margin-bottom: 20px; text-transform: uppercase;
}
.setup-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 16px;
}
.setup-field { display: flex; flex-direction: column; gap: 6px; }
.setup-field label {
  font-size: 11px; color: var(--muted); letter-spacing: 0.08em;
  text-transform: uppercase;
}
.setup-field input, .setup-field select {
  background: var(--ink3); border: 1px solid var(--border2);
  color: #e8e8e8; border-radius: var(--r);
  padding: 10px 14px; font-family: 'Syne', sans-serif;
  font-size: 14px; outline: none;
  transition: border-color 0.2s;
}
.setup-field input:focus, .setup-field select:focus {
  border-color: var(--blue);
}
.setup-field select option { background: var(--ink3); }

.setup-jur-note {
  font-size: 12px; color: var(--muted);
  background: rgba(58,58,245,0.08);
  border: 1px solid rgba(58,58,245,0.2);
  border-radius: var(--r); padding: 10px 14px;
  margin-bottom: 20px; line-height: 1.5;
}

.btn-found {
  width: 100%;
  background: var(--blue); color: #fff;
  border: none; border-radius: var(--r);
  padding: 14px 24px;
  font-family: 'Syne', sans-serif;
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.06em; cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-found:hover { background: #5050f8; }
.btn-found:active { transform: scale(0.98); }

/* ── GAME NAV ─────────────────────────────────────────────── */
.game-nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(17,17,17,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 16px;
}
.game-nav-left {
  display: flex; align-items: center; gap: 8px;
  min-width: 180px;
}
.nav-spark { font-size: 18px; }
.nav-cliff {
  font-size: 16px; font-weight: 800;
  letter-spacing: 0.1em; color: #fff;
}
.nav-company {
  font-size: 13px; color: var(--muted2);
  font-family: 'DM Mono', monospace;
  max-width: 140px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

.game-nav-center {
  flex: 1; display: flex; justify-content: center; gap: 4px;
}
.nav-tab {
  background: none; border: none;
  color: var(--muted2); cursor: pointer;
  padding: 6px 14px; border-radius: 6px;
  font-family: 'Syne', sans-serif;
  font-size: 13px; font-weight: 500;
  transition: all 0.15s;
}
.nav-tab:hover { color: #fff; background: var(--ink3); }
.nav-tab.active { color: #fff; background: var(--ink4); }

.game-nav-right {
  display: flex; align-items: center; gap: 12px;
  min-width: 220px; justify-content: flex-end;
}
.nav-spark-bal {
  display: flex; align-items: center; gap: 5px;
  font-family: 'DM Mono', monospace;
  font-size: 13px; color: var(--lime);
  font-weight: 500;
}
.spark-sym-sm { font-size: 14px; color: var(--lime); }
.nav-day {
  font-family: 'DM Mono', monospace;
  font-size: 12px; color: var(--muted2);
}

.btn-market-open {
  background: var(--blue); color: #fff;
  border: none; border-radius: 6px;
  padding: 7px 14px;
  font-family: 'Syne', sans-serif;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-market-open:hover { background: #5050f8; }
.btn-market-open.pulsing {
  animation: mo-pulse 1.5s ease-in-out infinite;
}
@keyframes mo-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(58,58,245,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(58,58,245,0); }
}

/* ── NOTIFICATION STRIP ──────────────────────────────────── */
.notif-strip {
  background: rgba(58,58,245,0.15);
  border-bottom: 1px solid rgba(58,58,245,0.3);
  padding: 8px 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: #ccc;
}
.notif-strip.warning { background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.3); }
.notif-strip.critical { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.3); }
.notif-strip button {
  background: none; border: none; color: var(--muted2);
  cursor: pointer; font-size: 16px; padding: 0 4px;
}

/* ── GAME MAIN ────────────────────────────────────────────── */
.game-main {
  max-width: 1400px; margin: 0 auto;
  padding: 20px 20px 60px;
}

/* ── PANELS ──────────────────────────────────────────────── */
.panel { display: none; }
.panel.active { display: block; }

/* ── DASHBOARD GRID ──────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  gap: 16px;
  align-items: start;
}
.dash-col-left, .dash-col-center, .dash-col-right {
  display: flex; flex-direction: column; gap: 12px;
}

/* ── DASH CARDS ──────────────────────────────────────────── */
.dash-card {
  background: var(--ink2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}
.dash-card-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 0.15em;
  color: var(--muted); margin-bottom: 14px;
  text-transform: uppercase;
}

/* Company card */
.company-name-big {
  font-size: 22px; font-weight: 800;
  color: #fff; margin-bottom: 6px;
  line-height: 1.2;
}
.company-meta {
  font-size: 12px; color: var(--muted2);
  display: flex; gap: 6px; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap;
}
.dot { color: var(--ink5); }
.company-valuation { margin-bottom: 14px; }
.val-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: 0.15em;
  color: var(--muted); margin-bottom: 4px;
}
.val-num {
  font-size: 20px; font-weight: 700;
  color: var(--lime); font-family: 'DM Mono', monospace;
}

/* Ownership bar */
.ownership-bar-wrap { margin-bottom: 10px; }
.ownership-bar-label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted2); margin-bottom: 6px;
}
.ownership-bar-track {
  height: 6px; background: var(--ink4);
  border-radius: 3px; position: relative;
  overflow: visible;
}
.ownership-bar-fill {
  height: 100%; background: var(--blue);
  border-radius: 3px; transition: width 0.4s ease;
}
.ownership-threshold-labels {
  position: relative; height: 16px; margin-top: 4px;
}
.ownership-threshold-labels span {
  position: absolute; transform: translateX(-50%);
  font-size: 9px; color: var(--muted);
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
}
.control-status {
  font-size: 12px; color: var(--muted2);
  display: flex; align-items: center; gap: 6px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block;
}
.status-dot.green { background: var(--mint); }
.status-dot.amber { background: var(--amber); }
.status-dot.red { background: var(--red); }

/* Three meters */
.meter-row { margin-bottom: 14px; }
.meter-row:last-child { margin-bottom: 0; }
.meter-info {
  display: flex; justify-content: space-between;
  margin-bottom: 5px;
}
.meter-name { font-size: 12px; color: #ccc; font-weight: 600; }
.meter-val {
  font-family: 'DM Mono', monospace;
  font-size: 12px; color: var(--lime);
}
.meter-track {
  height: 5px; background: var(--ink4);
  border-radius: 3px; overflow: hidden;
}
.meter-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.5s ease;
}
.runway-fill { background: var(--blue); }
.reliability-fill { background: var(--mint); }
.capacity-fill { background: var(--amber); }
.meter-hint {
  font-size: 10px; color: var(--muted);
  margin-top: 3px; font-family: 'DM Mono', monospace;
}

/* Week allocation */
.alloc-sliders { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.alloc-row { display: flex; align-items: center; gap: 10px; }
.alloc-label { font-size: 12px; color: #ccc; min-width: 60px; }
.alloc-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--ink4); border-radius: 2px;
  outline: none; cursor: pointer;
}
.alloc-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--blue); cursor: pointer;
  transition: background 0.2s;
}
.alloc-slider::-webkit-slider-thumb:hover { background: #5050f8; }
.alloc-pct {
  font-family: 'DM Mono', monospace;
  font-size: 12px; color: var(--lime);
  min-width: 36px; text-align: right;
}
.alloc-total {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--muted2);
  margin-left: 8px;
}
.alloc-total.over { color: var(--red); }

/* Spark card */
.spark-card { text-align: center; }
.spark-big {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-bottom: 16px;
}
.spark-sym-lg {
  font-size: 32px; color: var(--lime);
  animation: spark-pulse 2.4s ease-in-out infinite;
}
.spark-big span:last-child {
  font-size: 36px; font-weight: 800;
  font-family: 'DM Mono', monospace;
  color: var(--lime);
}
.spark-meta-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.spark-meta-item {
  background: var(--ink3); border-radius: var(--r);
  padding: 10px 12px; text-align: left;
}
.spark-meta-label {
  font-size: 9px; color: var(--muted);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 4px; font-family: 'DM Mono', monospace;
}
.spark-meta-val {
  font-family: 'DM Mono', monospace;
  font-size: 14px; font-weight: 500;
}
.spark-meta-val.mint { color: var(--mint); }
.spark-meta-val.burn { color: var(--red); }
.spark-meta-val.standing { color: var(--amber); }
.spark-meta-val.pmf { color: var(--blue); }

/* Market index card */
.index-display {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 12px;
}
.index-num {
  font-size: 32px; font-weight: 800;
  font-family: 'DM Mono', monospace; color: #fff;
}
.index-band { font-size: 12px; color: var(--muted2); line-height: 1.4; }
.index-bar-wrap { margin-bottom: 10px; }
.index-bar-track {
  height: 6px; background: var(--ink4);
  border-radius: 3px; position: relative;
  margin-bottom: 6px;
}
.index-bar-fill {
  position: absolute; top: 0;
  width: 10px; height: 100%;
  background: var(--lime); border-radius: 3px;
  transform: translateX(-50%);
  transition: left 0.5s ease;
  box-shadow: 0 0 8px var(--lime);
}
.index-bar-labels {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--muted);
  font-family: 'DM Mono', monospace;
}
.sector-multiple-row {
  display: flex; justify-content: space-between;
  align-items: center; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.sector-mult-label { font-size: 11px; color: var(--muted2); }
.sector-mult-val {
  font-family: 'DM Mono', monospace;
  font-size: 14px; color: var(--blue); font-weight: 600;
}

/* Season card */
.season-progress-wrap { margin-bottom: 14px; }
.season-progress-track {
  height: 6px; background: var(--ink4);
  border-radius: 3px; overflow: hidden; margin-bottom: 6px;
}
.season-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--lime));
  border-radius: 3px; transition: width 0.4s ease;
}
.season-progress-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--muted);
  font-family: 'DM Mono', monospace;
}
.season-actions {
  display: flex; flex-direction: column; gap: 6px;
}

/* Headcount card */
.headcount-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.headcount-num {
  font-size: 28px; font-weight: 800;
  font-family: 'DM Mono', monospace; color: #fff;
}
.headcount-label { font-size: 12px; color: var(--muted2); }
.headcount-note { font-size: 10px; color: var(--muted); font-family: 'DM Mono', monospace; }

/* Feed card */
.feed-card { max-height: 280px; overflow: hidden; display: flex; flex-direction: column; }
.feed-list {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  scrollbar-width: thin; scrollbar-color: var(--ink4) transparent;
}
.feed-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 6px 8px; border-radius: 6px;
  background: var(--ink3); font-size: 11px;
}
.feed-item.feed-mint { border-left: 2px solid var(--mint); }
.feed-item.feed-burn { border-left: 2px solid var(--red); }
.feed-item.feed-index { border-left: 2px solid var(--blue); }
.feed-item.feed-warning { border-left: 2px solid var(--amber); }
.feed-item.feed-critical { border-left: 2px solid var(--red); background: rgba(248,113,113,0.08); }
.feed-item.feed-system { border-left: 2px solid var(--ink5); }
.feed-code {
  font-family: 'DM Mono', monospace;
  font-size: 9px; color: var(--muted);
  min-width: 80px; padding-top: 1px;
  letter-spacing: 0.05em;
}
.feed-detail { color: #bbb; line-height: 1.4; }

/* Customers card */
.customers-card { max-height: 200px; overflow: hidden; display: flex; flex-direction: column; }
.customers-list {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin; scrollbar-color: var(--ink4) transparent;
}
.customer-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 5px 8px;
  background: var(--ink3); border-radius: 5px;
  font-size: 11px;
}
.cust-name { color: #ccc; }
.cust-arpc { font-family: 'DM Mono', monospace; color: var(--mint); font-size: 10px; }
.cust-count {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--muted2);
  margin-left: 6px;
}

/* Equity card */
.equity-list { display: flex; flex-direction: column; gap: 4px; }
.equity-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 5px 8px;
  background: var(--ink3); border-radius: 5px;
  font-size: 11px;
}
.equity-row.equity-founder { border-left: 2px solid var(--lime); }
.eq-name { color: #ccc; }
.eq-pct {
  font-family: 'DM Mono', monospace;
  color: var(--lime); font-size: 11px;
}

/* ── SMALL BUTTONS ───────────────────────────────────────── */
.btn-sm {
  background: var(--ink3); border: 1px solid var(--border2);
  color: #ccc; border-radius: 6px;
  padding: 6px 12px; font-family: 'Syne', sans-serif;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.btn-sm:hover { background: var(--ink4); color: #fff; border-color: var(--border2); }
.btn-grant { border-color: rgba(74,222,128,0.3); color: var(--mint); }
.btn-grant:hover { background: rgba(74,222,128,0.1); }
.btn-flip { border-color: rgba(251,191,36,0.3); color: var(--amber); }
.btn-flip:hover { background: rgba(251,191,36,0.1); }
.btn-exit-vol { border-color: rgba(248,113,113,0.3); color: var(--red); }
.btn-exit-vol:hover { background: rgba(248,113,113,0.1); }
.btn-hire { border-color: rgba(58,58,245,0.3); color: #a0a0ff; }
.btn-hire:hover { background: rgba(58,58,245,0.1); }
.btn-alloc { border-color: rgba(216,254,94,0.3); color: var(--lime); }
.btn-alloc:hover { background: rgba(216,254,94,0.08); }

.empty-state {
  font-size: 11px; color: var(--muted);
  font-family: 'DM Mono', monospace;
  padding: 12px 0; text-align: center;
}

/* ── WORKBENCH ───────────────────────────────────────────── */
.workbench-layout {
  display: grid; grid-template-columns: 1fr 340px; gap: 20px;
}
.panel-title {
  font-size: 22px; font-weight: 800; color: #fff;
  margin-bottom: 6px;
}
.panel-sub {
  font-size: 13px; color: var(--muted2);
  margin-bottom: 20px; line-height: 1.6;
}
.panel-title-sm {
  font-size: 13px; font-weight: 700; color: #ccc;
  margin-bottom: 10px; letter-spacing: 0.04em;
}

.components-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.component-card {
  background: var(--ink2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px 16px;
  cursor: pointer; transition: all 0.15s;
}
.component-card:hover { border-color: var(--blue); background: var(--ink3); }
.component-card.built { border-color: var(--mint); opacity: 0.6; cursor: default; }
.comp-name { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.comp-cost {
  font-family: 'DM Mono', monospace;
  font-size: 11px; color: var(--red); margin-bottom: 2px;
}
.comp-quality {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--muted2);
}
.comp-built-badge {
  display: inline-block; margin-top: 6px;
  font-size: 9px; color: var(--mint);
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: 4px; padding: 2px 6px;
  font-family: 'DM Mono', monospace;
}

.built-components-panel {
  background: var(--ink2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px;
  margin-bottom: 14px;
}
.built-list { display: flex; flex-direction: column; gap: 4px; }
.built-item {
  display: flex; justify-content: space-between;
  align-items: center; padding: 5px 8px;
  background: var(--ink3); border-radius: 5px;
  font-size: 11px;
}
.built-item-name { color: #ccc; }
.built-item-cost { font-family: 'DM Mono', monospace; color: var(--red); font-size: 10px; }

.ship-panel {
  background: var(--ink2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.ship-note { font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace; }
.ship-panel input[type="text"],
.ship-panel textarea {
  background: var(--ink3); border: 1px solid var(--border2);
  color: #e8e8e8; border-radius: var(--r);
  padding: 9px 12px; font-family: 'Syne', sans-serif;
  font-size: 13px; outline: none; resize: none;
  transition: border-color 0.2s; width: 100%;
}
.ship-panel input:focus, .ship-panel textarea:focus { border-color: var(--blue); }
.price-row {
  display: flex; align-items: center; gap: 8px;
}
.price-row label { font-size: 11px; color: var(--muted2); white-space: nowrap; }
.price-row input {
  background: var(--ink3); border: 1px solid var(--border2);
  color: var(--lime); border-radius: var(--r);
  padding: 7px 10px; font-family: 'DM Mono', monospace;
  font-size: 13px; outline: none; width: 90px;
}
.price-unit { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted2); }
.btn-ship {
  background: var(--blue); color: #fff;
  border: none; border-radius: var(--r);
  padding: 10px 16px; font-family: 'Syne', sans-serif;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background 0.2s;
}
.btn-ship:hover { background: #5050f8; }
.ship-warning {
  font-size: 11px; color: var(--amber);
  font-family: 'DM Mono', monospace;
  padding: 6px 10px; background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2); border-radius: 5px;
}

/* ── THE FLOOR ───────────────────────────────────────────── */
.floor-layout { display: flex; flex-direction: column; gap: 16px; }
.floor-header { margin-bottom: 4px; }
.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.floor-card {
  background: var(--ink2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 20px;
  transition: border-color 0.15s;
}
.floor-card:hover { border-color: var(--border2); }
.floor-card-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 8px;
}
.floor-product-name { font-size: 15px; font-weight: 700; color: #fff; }
.floor-company { font-size: 11px; color: var(--muted2); margin-bottom: 6px; }
.floor-desc { font-size: 12px; color: #bbb; margin-bottom: 12px; line-height: 1.5; }
.floor-components {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px;
}
.floor-comp-tag {
  font-size: 9px; color: var(--muted2);
  background: var(--ink3); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px;
  font-family: 'DM Mono', monospace;
}
.floor-price-row {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 12px;
}
.floor-price {
  font-family: 'DM Mono', monospace;
  font-size: 14px; color: var(--lime); font-weight: 600;
}
.floor-price-label { font-size: 10px; color: var(--muted); }
.floor-actions { display: flex; gap: 8px; }
.btn-adopt {
  flex: 1; background: var(--blue); color: #fff;
  border: none; border-radius: 6px;
  padding: 8px 12px; font-family: 'Syne', sans-serif;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background 0.2s;
}
.btn-adopt:hover { background: #5050f8; }
.btn-adopt.adopted {
  background: rgba(74,222,128,0.15);
  color: var(--mint); border: 1px solid rgba(74,222,128,0.3);
  cursor: default;
}
.btn-vouch {
  background: var(--ink3); border: 1px solid var(--border2);
  color: var(--muted2); border-radius: 6px;
  padding: 8px 12px; font-family: 'Syne', sans-serif;
  font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.btn-vouch:hover { color: var(--amber); border-color: rgba(251,191,36,0.3); }
.btn-vouch.vouched { color: var(--amber); border-color: rgba(251,191,36,0.4); cursor: default; }
.floor-vouches {
  font-size: 10px; color: var(--muted);
  font-family: 'DM Mono', monospace;
}
.floor-empty {
  grid-column: 1/-1; text-align: center;
  padding: 60px 20px; color: var(--muted);
  font-family: 'DM Mono', monospace; font-size: 13px;
}

/* ── RAISE ───────────────────────────────────────────────── */
.raise-layout { display: flex; flex-direction: column; gap: 16px; }
.raise-grid {
  display: grid; grid-template-columns: 280px 1fr 260px; gap: 16px;
}
.col-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 0.15em;
  color: var(--muted); margin-bottom: 12px;
  text-transform: uppercase;
}
.investor-cards { display: flex; flex-direction: column; gap: 8px; }
.investor-card {
  background: var(--ink2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px 16px;
  cursor: pointer; transition: all 0.15s;
}
.investor-card:hover { border-color: var(--blue); }
.investor-card.active { border-color: var(--blue); background: rgba(58,58,245,0.08); }
.inv-name { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.inv-thesis { font-size: 11px; color: var(--muted2); margin-bottom: 6px; line-height: 1.4; }
.inv-range {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--lime);
}
.inv-blind {
  font-size: 10px; color: var(--amber);
  margin-top: 4px; line-height: 1.4;
  font-style: italic;
}

.negotiation-empty {
  background: var(--ink2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 32px 24px;
  font-size: 13px; color: var(--muted2);
  text-align: center; line-height: 1.6;
}
.negotiation-active { display: flex; flex-direction: column; gap: 12px; }
.term-sheet-card {
  background: var(--ink2); border: 1px solid var(--border2);
  border-radius: var(--r-lg); padding: 20px;
}
.ts-investor { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.ts-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.ts-row:last-child { border-bottom: none; }
.ts-label { color: var(--muted2); }
.ts-val { font-family: 'DM Mono', monospace; color: #fff; font-weight: 500; }
.ts-val.good { color: var(--mint); }
.ts-val.bad { color: var(--red); }
.ts-val.warn { color: var(--amber); }
.ts-terms {
  margin-top: 10px; padding: 10px 12px;
  background: var(--ink3); border-radius: 6px;
  font-size: 11px; color: var(--muted2);
  font-family: 'DM Mono', monospace; line-height: 1.5;
}
.ts-declined {
  padding: 16px; background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: var(--r); font-size: 12px; color: var(--red);
}

.neg-actions { display: flex; gap: 10px; }
.btn-accept {
  flex: 1; background: var(--mint); color: var(--ink);
  border: none; border-radius: 6px;
  padding: 10px 16px; font-family: 'Syne', sans-serif;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: opacity 0.2s;
}
.btn-accept:hover { opacity: 0.85; }
.btn-decline {
  flex: 1; background: var(--ink3); border: 1px solid var(--border2);
  color: #ccc; border-radius: 6px;
  padding: 10px 16px; font-family: 'Syne', sans-serif;
  font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.btn-decline:hover { background: var(--ink4); }
.neg-rounds-left {
  font-size: 11px; color: var(--muted2);
  font-family: 'DM Mono', monospace; text-align: center;
}

/* Flip panel */
.flip-panel {
  background: var(--ink2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px;
}
.flip-current { font-size: 12px; color: var(--muted2); margin-bottom: 10px; }
.flip-current strong { color: #fff; }
.flip-warning {
  font-size: 11px; color: var(--amber);
  background: rgba(251,191,36,0.06);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 6px; padding: 10px 12px;
  margin-bottom: 12px; line-height: 1.5;
  font-family: 'DM Mono', monospace;
}
.flip-options { display: flex; flex-direction: column; gap: 6px; }
.flip-option-btn {
  background: var(--ink3); border: 1px solid var(--border2);
  color: #ccc; border-radius: 6px;
  padding: 8px 12px; font-family: 'Syne', sans-serif;
  font-size: 12px; cursor: pointer; text-align: left;
  transition: all 0.15s;
}
.flip-option-btn:hover { border-color: var(--amber); color: var(--amber); }

/* ── LEDGER ──────────────────────────────────────────────── */
.ledger-layout { display: flex; flex-direction: column; gap: 16px; }
.ledger-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.ledger-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted2); cursor: pointer;
  padding: 8px 16px; font-family: 'Syne', sans-serif;
  font-size: 13px; font-weight: 500;
  transition: all 0.15s; margin-bottom: -1px;
}
.ledger-tab:hover { color: #fff; }
.ledger-tab.active { color: #fff; border-bottom-color: var(--blue); }
.ledger-content { padding-top: 16px; }
.ltab-content { display: none; }
.ltab-content.active { display: block; }

.ledger-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.ledger-table th {
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: 0.12em;
  color: var(--muted); text-align: left;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}
.ledger-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  color: #bbb; vertical-align: top;
}
.ledger-table tr:hover td { background: var(--ink2); }
.ledger-table .code-cell {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 0.05em;
}
.code-mint { color: var(--mint); }
.code-burn { color: var(--red); }
.code-xfer { color: var(--blue); }
.amount-mint { color: var(--mint); font-family: 'DM Mono', monospace; }
.amount-burn { color: var(--red); font-family: 'DM Mono', monospace; }
.balance-cell { font-family: 'DM Mono', monospace; color: var(--lime); }

.obs-list { display: flex; flex-direction: column; gap: 8px; }
.obs-item {
  background: var(--ink2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 14px;
  display: flex; gap: 12px;
}
.obs-day {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--muted);
  min-width: 40px;
}
.obs-type {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--blue);
  min-width: 80px; letter-spacing: 0.05em;
}
.obs-detail { font-size: 12px; color: #bbb; line-height: 1.5; }

.supply-assertion-panel {
  background: var(--ink2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px;
}
.supply-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.supply-row:last-child { border-bottom: none; }
.supply-label { color: var(--muted2); }
.supply-val { font-family: 'DM Mono', monospace; color: var(--lime); }
.supply-status {
  margin-top: 16px; padding: 12px 16px;
  border-radius: var(--r); font-size: 12px;
  font-family: 'DM Mono', monospace;
}
.supply-status.valid {
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.3);
  color: var(--mint);
}
.supply-status.invalid {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--red);
}

/* ── MODALS ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--ink2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow);
  animation: modal-in 0.2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title {
  font-size: 20px; font-weight: 800; color: #fff;
  margin-bottom: 20px;
}

/* Market Open modal */
.market-open-modal { max-width: 520px; }
.mo-header { margin-bottom: 20px; }
.mo-title {
  font-size: 20px; font-weight: 800; color: #fff;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.mo-subtitle { font-size: 12px; color: var(--muted2); font-family: 'DM Mono', monospace; }
.mo-events {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 20px;
}
.mo-event {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 12px; border-radius: 6px;
  background: var(--ink3); font-size: 12px;
  animation: event-in 0.3s ease both;
}
@keyframes event-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.mo-event-icon { font-size: 14px; min-width: 20px; }
.mo-event-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px; color: var(--muted);
  letter-spacing: 0.1em; min-width: 90px;
  padding-top: 2px;
}
.mo-event-detail { color: #bbb; line-height: 1.4; }
.mo-event.ev-burn { border-left: 2px solid var(--red); }
.mo-event.ev-mint { border-left: 2px solid var(--mint); }
.mo-event.ev-index { border-left: 2px solid var(--blue); }
.mo-event.ev-price { border-left: 2px solid var(--muted); }
.mo-event.ev-warning { border-left: 2px solid var(--amber); }
.mo-event.ev-critical { border-left: 2px solid var(--red); background: rgba(248,113,113,0.08); }
.mo-event.ev-season { border-left: 2px solid var(--lime); }

.mo-summary {
  background: var(--ink3); border-radius: var(--r);
  padding: 14px 16px; margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.mo-sum-row {
  display: flex; justify-content: space-between;
  font-size: 13px;
}
.mo-sum-row span:first-child { color: var(--muted2); }
.mo-sum-row span:last-child {
  font-family: 'DM Mono', monospace; color: var(--lime);
}
.btn-mo-close {
  width: 100%; background: var(--blue); color: #fff;
  border: none; border-radius: var(--r);
  padding: 12px; font-family: 'Syne', sans-serif;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background 0.2s;
}
.btn-mo-close:hover { background: #5050f8; }

/* Flip modal */
.flip-modal { max-width: 500px; }
.flip-scenario-box {
  background: rgba(251,191,36,0.06);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: var(--r); padding: 14px 16px;
  margin-bottom: 16px;
}
.flip-scenario-title { font-size: 14px; color: var(--amber); font-weight: 600; margin-bottom: 6px; }
.flip-scenario-sub { font-size: 12px; color: var(--muted2); line-height: 1.5; }
.flip-cost-breakdown {
  background: var(--ink3); border-radius: var(--r);
  padding: 14px 16px; margin-bottom: 16px;
  font-size: 12px;
}
.flip-cost-row {
  display: flex; justify-content: space-between;
  padding: 5px 0; border-bottom: 1px solid var(--border);
}
.flip-cost-row:last-child { border-bottom: none; }
.flip-cost-label { color: var(--muted2); }
.flip-cost-val { font-family: 'DM Mono', monospace; color: var(--red); }
.flip-modal-options { display: flex; flex-direction: column; gap: 8px; }
.flip-path-btn {
  background: var(--ink3); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 14px 16px;
  cursor: pointer; text-align: left; transition: all 0.15s;
}
.flip-path-btn:hover { border-color: var(--blue); }
.flip-path-label { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.flip-path-desc { font-size: 11px; color: var(--muted2); line-height: 1.4; }
.btn-cancel-flip { margin-top: 12px; }

/* Exit modal */
.exit-modal { max-width: 480px; }
.exit-modal-body { margin-bottom: 20px; }
.exit-val-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.exit-val-row:last-child { border-bottom: none; }
.exit-val-label { color: var(--muted2); }
.exit-val-val { font-family: 'DM Mono', monospace; color: var(--lime); }
.exit-liq-warning {
  margin-top: 12px; padding: 12px 14px;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: var(--r); font-size: 11px;
  color: var(--red); line-height: 1.5;
  font-family: 'DM Mono', monospace;
}
.exit-modal-actions { display: flex; gap: 10px; }

/* ── ENDED SCREEN ────────────────────────────────────────── */
#screen-ended {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 30%, rgba(58,58,245,0.12) 0%, transparent 60%);
}
.ended-inner {
  max-width: 600px; width: 100%;
  padding: 60px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}
.ended-logo {
  font-size: 20px; font-weight: 800;
  color: var(--lime); letter-spacing: 0.1em;
}
.ended-title {
  font-size: 36px; font-weight: 800; color: #fff;
  line-height: 1.2;
}
.ended-record {
  width: 100%; background: var(--ink2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg); padding: 24px;
  text-align: left;
}
.ended-record-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.ended-record-row:last-child { border-bottom: none; }
.ended-record-label { color: var(--muted2); }
.ended-record-val { font-family: 'DM Mono', monospace; color: var(--lime); }
.ended-observations {
  width: 100%; background: var(--ink2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px;
  text-align: left;
}
.ended-obs-title {
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase;
  font-family: 'DM Mono', monospace; margin-bottom: 12px;
}
.ended-obs-item {
  font-size: 12px; color: #bbb;
  padding: 5px 0; border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
.ended-obs-item:last-child { border-bottom: none; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 260px 1fr; }
  .dash-col-right { grid-column: 1/-1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
  .raise-grid { grid-template-columns: 240px 1fr; }
  .flip-col { display: none; }
}
@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dash-col-right { grid-template-columns: 1fr; }
  .workbench-layout { grid-template-columns: 1fr; }
  .raise-grid { grid-template-columns: 1fr; }
  .setup-row { grid-template-columns: 1fr; }
  .game-nav-center { display: none; }
  .spark-big span:last-child { font-size: 28px; }
}