/* style.css — Cap Table Commander */

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #FAFAF8;
  --bg-secondary: #F2F2F0;
  --bg-panel: #FFFFFF;
  --bg-hover: #F0F0EE;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-muted: #999999;
  --border-color: #E5E5E3;
  --border-light: #F0F0EE;
  --accent-blue: #3B82F6;
  --accent-amber: #F59E0B;
  --accent-green: #10B981;
  --accent-purple: #8B5CF6;
  --accent-red: #EF4444;
  --accent-gray: #6B7280;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg-primary: #111111;
  --bg-secondary: #1A1A1A;
  --bg-panel: #222222;
  --bg-hover: #2A2A2A;
  --text-primary: #F0F0F0;
  --text-secondary: #A0A0A0;
  --text-muted: #666666;
  --border-color: #333333;
  --border-light: #2A2A2A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #111111;
    --bg-secondary: #1A1A1A;
    --bg-panel: #222222;
    --bg-hover: #2A2A2A;
    --text-primary: #F0F0F0;
    --text-secondary: #A0A0A0;
    --text-muted: #666666;
    --border-color: #333333;
    --border-light: #2A2A2A;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
    color-scheme: dark;
  }
}

html {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: manipulation;
}

#app {
  min-height: 100vh;
  padding: 16px;
}

/* ─── Typography ─── */
.game-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* ─── Buttons ─── */
button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
  transition: all 0.15s ease;
}

button:active { transform: scale(0.97); }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.back-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ─── Dashboard Layout ─── */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
}

.header-right {
  display: flex;
  gap: 12px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  min-width: 80px;
}

.metric-card.small {
  padding: 6px 10px;
}

.metric-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.metric-value.danger { color: var(--danger); }
.metric-value.warning { color: var(--warning); }
.metric-value.success { color: var(--success); }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
}

.dash-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.dash-panel:hover {
  box-shadow: var(--shadow-md);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.panel-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ─── Cap Table Visual ─── */
.cap-table-visual {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 16px;
}

.donut-chart {
  width: 100%;
  height: 100%;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.donut-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cap-table-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-label {
  flex: 1;
  color: var(--text-secondary);
}

.legend-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Metrics Panel ─── */
.metrics-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-row-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 120px;
}

.metric-row-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease, background 0.3s ease;
}

.metric-bar-fill.success { background: var(--success); }
.metric-bar-fill.warning { background: var(--warning); }
.metric-bar-fill.danger { background: var(--danger); }

.metric-row-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}

.control-thresholds {
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.threshold-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.threshold-item.active {
  color: var(--success);
  font-weight: 500;
}

.threshold-status {
  font-size: 1rem;
}

/* ─── Milestones ─── */
.milestones-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.milestone-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.milestone-item.hit {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.milestone-item.locked {
  opacity: 0.5;
}

.milestone-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-panel);
  border: 1.5px solid var(--border-color);
  flex-shrink: 0;
}

.milestone-item.hit .milestone-icon {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.milestone-info {
  flex: 1;
  min-width: 0;
}

.milestone-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.milestone-desc {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.milestone-btn {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent-blue);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.milestone-btn:hover { background: #2563EB; }

.milestone-locked {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Actions Panel ─── */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-panel);
  transition: all 0.15s ease;
  text-align: left;
}

.action-btn:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.action-btn.primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

.action-btn.primary:hover {
  background: #2563EB;
}

.action-btn.secondary {
  background: var(--bg-secondary);
}

.action-btn-icon {
  font-size: 1.3rem;
}

.action-btn-text {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
}

.action-btn-sub {
  display: block;
  font-size: 0.7rem;
  opacity: 0.7;
}

.event-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.event-banner.good {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.event-banner.bad {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.event-icon { font-size: 1rem; }
.event-text { flex: 1; }
.event-delta { font-family: var(--font-mono); font-weight: 600; }

.urgency-banner {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger);
}

/* ─── Funding Screen ─── */
.funding-screen {
  max-width: 1200px;
  margin: 0 auto;
}

.funding-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.funding-header h1 {
  font-size: 1.2rem;
}

.stage-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.funding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.funding-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.funding-panel h2 {
  margin-bottom: 16px;
  font-size: 0.95rem;
}

/* ─── Instrument Selection ─── */
.instrument-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.instrument-card {
  padding: 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--bg-secondary);
}

.instrument-card:hover {
  border-color: var(--text-muted);
  background: var(--bg-hover);
}

.instrument-card.selected {
  border-width: 2px;
  background: var(--bg-panel);
  box-shadow: var(--shadow-md);
}

.instrument-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.instrument-label {
  font-size: 0.9rem;
  font-weight: 700;
}

.board-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--accent-purple);
  color: #fff;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.instrument-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.instrument-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ─── Terms Form ─── */
.terms-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.term-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.amount-input {
  display: flex;
  align-items: center;
  gap: 12px;
}

.amount-input input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  outline: none;
}

.amount-input input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-blue);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.3);
}

.amount-input input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-blue);
  cursor: pointer;
  border: none;
}

.amount-display {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 70px;
  text-align: right;
}

.quick-amounts {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.quick-amounts button {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.quick-amounts button:hover {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.term-hint {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Term Sheet Preview ─── */
.term-sheet {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.term-sheet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.8rem;
}

.ts-label {
  color: var(--text-secondary);
}

.ts-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.ts-value.danger { color: var(--danger); }

.term-sheet-row.highlight {
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border-color);
  font-weight: 700;
}

.term-sheet-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}

.down-round-warning {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--danger);
  font-weight: 500;
}

.deal-impact {
  margin-bottom: 16px;
}

.deal-impact h3 {
  margin-bottom: 10px;
}

.impact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.8rem;
}

.impact-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.impact-row.warning {
  color: var(--accent-purple);
  font-weight: 600;
}

.execute-btn {
  width: 100%;
  padding: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent-blue);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}

.execute-btn:hover {
  background: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ─── Results Screen ─── */
.results-screen {
  max-width: 1200px;
  margin: 0 auto;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.results-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.results-panel h2 {
  margin-bottom: 16px;
}

.deal-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-stat {
  text-align: center;
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.summary-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.down-round-alert {
  margin-top: 16px;
  padding: 14px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
}

.down-round-alert h3 {
  color: var(--danger);
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.down-round-alert p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.market-event {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
}

.market-event.good {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.market-event.bad {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.event-icon-large {
  font-size: 2rem;
}

.event-description {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.event-impact {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.market-event.good .event-impact { color: var(--success); }
.market-event.bad .event-impact { color: var(--danger); }

/* ─── History Table ─── */
.history-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.history-header {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr 0.8fr 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.history-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr 0.8fr 1fr;
  gap: 8px;
  padding: 8px 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-light);
}

.history-row:last-child { border-bottom: none; }

.history-row span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ─── Results Actions ─── */
.results-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* ─── Game Over Screen ─── */
.gameover-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 32px);
}

.gameover-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.gameover-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.gameover-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.gameover-reason {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.gameover-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.gameover-cap-table {
  margin-bottom: 24px;
}

.restart-btn {
  padding: 14px 32px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent-blue);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.restart-btn:hover {
  background: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  
  .funding-grid {
    grid-template-columns: 1fr;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .dash-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .metric-card {
    flex: 1;
  }
  
  .gameover-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  #app {
    padding: 8px;
  }
  
  .dash-header {
    padding: 12px 14px;
  }
  
  .game-title {
    font-size: 1.2rem;
  }
  
  .dash-panel {
    padding: 14px;
  }
  
  .funding-panel {
    padding: 14px;
  }
  
  .gameover-card {
    padding: 24px;
  }
  
  .gameover-stats {
    grid-template-columns: 1fr;
  }
  
  .history-header,
  .history-row {
    grid-template-columns: 1fr 1fr 0.8fr;
  }
  
  .history-header span:nth-child(4),
  .history-header span:nth-child(5),
  .history-row span:nth-child(4),
  .history-row span:nth-child(5) {
    display: none;
  }
}

/* ─── Animations ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-panel, .funding-panel, .results-panel, .gameover-card {
  animation: fadeIn 0.3s ease;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Focus states ─── */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* ─── Error state ─── */
.error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  font-size: 1rem;
  color: var(--danger);
  text-align: center;
  padding: 20px;
}

