/* Stock Rush Pro — styles
   Inherits the clean white-paper aesthetic from Stock Rush,
   adds event-phase overlay, choice tracker, event type badges.  */

:root {
  --bg:     #ffffff;
  --paper:  #fafaf7;
  --ink:    #111111;
  --muted:  #6b6b6b;
  --faint:  #ebe8e1;
  --line:   #111111;
  --up:     #1f7a4d;
  --down:   #c24a3a;
  --accent: #d97757;

  /* F1 / Silverstone racing skin — accent palette for classroom vibe */
  --racing-green: #004225;   /* British racing green */
  --racing-red:   #dc0000;   /* Ferrari red */
  --racing-silv:  #c0c0c0;   /* Mercedes silver */
  --racing-gold:  #e6b800;   /* Podium gold */
  --racing-bronze:#c47b3a;
  --racing-black: #0a0a0a;
}

/* ============================================================
   F1 SKIN — checker strips, podium labels, LAP chip, lights
   ============================================================ */

/* Chequered flag strip — 8-cell alternating black/white 8px band */
.sr-checker {
  display: block;
  height: 10px;
  background-image:
    linear-gradient(45deg, #000 25%, transparent 25%),
    linear-gradient(-45deg, #000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000 75%),
    linear-gradient(-45deg, transparent 75%, #000 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  background-color: #fff;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
}
.sr-checker.thin { height: 6px; background-size: 6px 6px; background-position: 0 0, 0 3px, 3px -3px, -3px 0px; }

/* Lap chip — mono, red-accented, sits next to the round badge.
   Sized to match the ROUND badge (28-30px font) so it reads as a peer
   racing indicator, not an afterthought. */
.sr-lap-chip {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 22px; font-weight: 800; letter-spacing: 0.14em;
  padding: 6px 14px;
  background: linear-gradient(180deg, #1a1a1a, #0a0a0a);
  color: #fff;
  border-radius: 6px;
  border: 1.5px solid #000;
  text-transform: uppercase;
  line-height: 1.05;
  box-shadow: 0 2px 0 #000;
}
.sr-lap-chip::before {
  content: '';
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--racing-red);
  box-shadow: 0 0 10px rgba(220,0,0,0.85), inset 0 1px 2px rgba(255,255,255,0.25);
  animation: sr-lap-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes sr-lap-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.85); } }

/* Podium chips — replace 🥇🥈🥉 on end-screen leaderboard */
.sr-podium {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 22px;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 12px; font-weight: 800; letter-spacing: 0.06em;
  border-radius: 3px;
  border: 1.5px solid var(--racing-black);
  box-shadow: 0 2px 0 var(--racing-black);
  color: var(--racing-black);
}
.sr-podium.p1 { background: linear-gradient(180deg, #ffe067, var(--racing-gold)); }
.sr-podium.p2 { background: linear-gradient(180deg, #e8e8e8, var(--racing-silv)); }
.sr-podium.p3 { background: linear-gradient(180deg, #e8a666, var(--racing-bronze)); }

/* Bigger podium chip for the hero-leaderboard rank column during play */
.sr-podium.sr-podium-lg {
  width: 46px;
  height: 32px;
  font-size: 16px;
  letter-spacing: 0.08em;
  border-radius: 5px;
  box-shadow: 0 3px 0 var(--racing-black), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ============================================================
   F1 SKIN — LOBBY & FLOW REDESIGN
   Full Silverstone / Mercedes pit-wall aesthetic on the lobby
   overlay. Dark carbon backgrounds, racing typography, red
   race-plate for the room code, "pit wall" + "starting grid"
   framing without ditching classroom-friendly clarity.
   ============================================================ */

/* Top chequered strip on the host header — thin racing flag */
.sr-checker.sr-checker-header {
  height: 8px;
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
  border-top: none;
}

/* Racing overlay — replaces the default cream overlay-card look on lobby */
.overlay-card.sr-racing {
  background: linear-gradient(180deg, #14171b 0%, #0d0f12 100%);
  border: 1.5px solid #000;
  color: #f5f7fa;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 0 0 4px rgba(220,0,0,0.06);
  border-radius: 14px;
  overflow: hidden;
}
.sr-racing * { color: inherit; }

/* Top brand strip inside racing overlay */
.sr-race-topstrip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: linear-gradient(90deg, #0a0c0f 0%, #14171b 60%, #0a0c0f 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sr-race-topstrip .sr-race-tag {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--racing-red);
  font-weight: 800;
}
.sr-race-topstrip .sr-race-title {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
}

/* Big racing number-plate for the room code */
.sr-race-plate {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: #fff;
  border: 3px solid #000;
  border-radius: 10px;
  box-shadow: 0 3px 0 #000, inset 0 0 0 1.5px #000;
  font-family: 'Geist Mono', ui-monospace;
  font-weight: 900;
}
.sr-race-plate .plate-eyebrow {
  font-size: 9px;
  letter-spacing: 0.24em;
  color: #666;
  padding: 2px 6px;
  border: 1px solid #333;
  border-radius: 3px;
}
.sr-race-plate .plate-code {
  font-size: 32px;
  letter-spacing: 0.18em;
  color: #000;
  line-height: 1;
}

/* Panel containers inside the lobby (Pit Wall + Starting Grid) */
.sr-race-panel {
  background: #1a1d21;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 380px;
}
.sr-race-panel .sr-panel-label {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
}
.sr-race-panel .sr-panel-label::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--racing-red);
  box-shadow: 0 0 6px rgba(220,0,0,0.7);
}
.sr-race-panel .sr-panel-title {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.1;
  text-transform: uppercase;
}
.sr-race-panel .sr-panel-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
}

/* Driver-bib chip — one per joined student */
.sr-driver-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  transition: background 0.15s;
}
.sr-driver-chip:hover { background: rgba(255,255,255,0.08); }
.sr-driver-chip .bib {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 12px; font-weight: 800;
  background: #fff; color: #000;
  border: 1.5px solid #000;
  border-radius: 4px;
  box-shadow: 0 2px 0 #000;
  flex-shrink: 0;
}
.sr-driver-chip .name {
  flex: 1;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sr-driver-chip .kick-x {
  background: transparent; color: rgba(255,255,255,0.35);
  border: none; padding: 4px 8px; cursor: pointer; font-size: 14px;
  border-radius: 4px;
}
.sr-driver-chip .kick-x:hover { color: var(--racing-red); background: rgba(220,0,0,0.08); }

/* Empty-grid state */
.sr-grid-empty {
  padding: 28px 16px;
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 8px;
}

/* Big racing start button — LIGHTS OUT & AWAY WE GO */
.sr-lights-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(180deg, var(--racing-red) 0%, #b30000 100%);
  color: #fff;
  border: 2px solid #000;
  border-radius: 10px;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 0 #000, 0 8px 20px rgba(220,0,0,0.4);
  transition: transform 0.08s, box-shadow 0.08s;
}
.sr-lights-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #000, 0 10px 24px rgba(220,0,0,0.5); }
.sr-lights-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #000, 0 4px 10px rgba(220,0,0,0.35); }
.sr-lights-btn.subtle {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  border-color: rgba(255,255,255,0.12);
  box-shadow: none;
}
.sr-lights-btn.subtle:hover { transform: none; box-shadow: none; }

/* QR framed like a pit board */
.sr-pit-board {
  padding: 10px;
  background: #fff;
  border: 3px solid #000;
  border-radius: 10px;
  box-shadow: 0 4px 0 #000, 0 12px 30px rgba(0,0,0,0.5);
  display: inline-block;
  line-height: 0;
}
.sr-pit-board-tag {
  display: inline-flex; gap: 6px; align-items: center;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.55);
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 4px;
  margin-top: 8px;
}

/* Stats strip footer */
.sr-race-stats {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 12px 20px;
  background: #0a0c0f;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5);
}
.sr-race-stats b { color: #fff; font-weight: 800; }

/* ============================================================
   F1 SKIN — HOST IN-GAME DARK MODE (sr-race-mode)
   Applied to .host-shell to invert the whole projector view
   into a pit-wall telemetry dashboard: carbon background,
   luminous accents, mono type dominant.
   ============================================================ */

.host-shell.sr-race-mode {
  background: linear-gradient(180deg, #0d0f12 0%, #14171b 100%);
  color: #f5f7fa;
  min-height: 100vh;
}
.sr-race-mode .host-header {
  background: linear-gradient(90deg, #0a0c0f 0%, #14171b 60%, #0a0c0f 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sr-race-mode .brand-title,
.sr-race-mode .brand-sub,
.sr-race-mode .round-label { color: #fff; }
.sr-race-mode .brand-sub { color: rgba(255,255,255,0.55); }
.sr-race-mode .brand-mark {
  background: #fff; color: #000; border-color: #000;
}
.sr-race-mode .connected-pill,
.sr-race-mode .sound-toggle,
.sr-race-mode .new-game-btn {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
  border-color: rgba(255,255,255,0.12);
}
.sr-race-mode .connected-pill { border-color: rgba(74,222,128,0.35); color: #4ade80; }

/* Hero leaderboard container */
.sr-race-mode .hero-leaderboard,
.sr-race-mode .side-panel,
.sr-race-mode .live-feed,
.sr-race-mode .compact-ticker {
  background: #14171b;
  border-color: rgba(255,255,255,0.08);
  color: #f5f7fa;
}
.sr-race-mode .hero-title,
.sr-race-mode .side-panel-title { color: rgba(255,255,255,0.55); }

/* Rows — carbon strips with racing tension */
.sr-race-mode .hero-row {
  background: transparent;
  border-bottom-color: rgba(255,255,255,0.06);
  color: #fff;
}
.sr-race-mode .hero-row:hover { background: rgba(255,255,255,0.03); }
.sr-race-mode .hero-row.is-bot { opacity: 0.85; }
/* Keep the fire, glow ring, and podium stripe at full brightness on bot rows
   so the P1/2/3 dazzle still POPS even when the leaderboard is bots-only. */
.sr-race-mode .hero-row.is-bot.rank-1::after,
.sr-race-mode .hero-row.is-bot.rank-2::after,
.sr-race-mode .hero-row.is-bot.rank-3::after { opacity: 1; }
.sr-race-mode .hero-row .hr-name,
.sr-race-mode .hero-row .hr-worth,
.sr-race-mode .hero-row .hr-cash,
.sr-race-mode .hero-row .hr-num { color: #fff; }
.sr-race-mode .hero-row .hr-cash { color: rgba(255,255,255,0.6); }
.sr-race-mode .hero-row .hr-num { color: rgba(255,255,255,0.35); }
.sr-race-mode .hero-row .pill.cash { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8); }
.sr-race-mode .hero-row .pill.invested { background: rgba(74,222,128,0.14); color: #4ade80; }
.sr-race-mode .hero-row.rank-1 {
  background: linear-gradient(90deg, rgba(230,184,0,0.20), rgba(230,184,0,0.05) 60%, transparent) !important;
  border-left: 4px solid var(--racing-gold);
}
/* Kill leftover light backgrounds from the base leaderboard styling */
.sr-race-mode .hero-row.rank-2 {
  background: linear-gradient(90deg, rgba(192,192,192,0.15), rgba(192,192,192,0.03) 60%, transparent) !important;
  border-left: 4px solid var(--racing-silv);
}
.sr-race-mode .hero-row.rank-3 {
  background: linear-gradient(90deg, rgba(196,123,58,0.15), rgba(196,123,58,0.03) 60%, transparent) !important;
  border-left: 4px solid var(--racing-bronze);
}
.sr-race-mode .hero-row:not(.rank-1):not(.rank-2):not(.rank-3) {
  background: transparent !important;
}
/* Timer + round badge legibility on dark */
.sr-race-mode .round-year-pill,
.sr-race-mode div[style*="rgba(15,58,36,0.10)"] {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.2) !important;
}
/* Sound / New game buttons in header */
.sr-race-mode button[title*="sound" i],
.sr-race-mode .new-game-btn,
.sr-race-mode .pause-btn {
  background: rgba(255,255,255,0.06) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.15) !important;
}
/* Live feed items */
.sr-race-mode .live-feed [style*="background: rgb(240"] {
  background: rgba(255,255,255,0.04) !important;
  color: #fff !important;
}
/* Ticker rows in the right rail market list */
.sr-race-mode .stock-line { color: #fff !important; }
.sr-race-mode [class*="ticker"] .name,
.sr-race-mode [class*="ticker"] .price { color: #fff !important; }
/* Ensure any 'muted' text stays legible */
.sr-race-mode .muted { color: rgba(255,255,255,0.5) !important; }
.sr-race-mode .small { color: rgba(255,255,255,0.6); }

/* ── ROOT FIX: base .panel is white — override for race mode ── */
.sr-race-mode .panel {
  background: #14171b !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #f5f7fa;
}
.sr-race-mode .panel-head {
  background: #0f1114 !important;
  color: rgba(255,255,255,0.65) !important;
  border-bottom-color: rgba(255,255,255,0.06) !important;
}
.sr-race-mode .hero-lb-list { background: transparent !important; }
.sr-race-mode .activity-list,
.sr-race-mode .activity-panel { background: transparent !important; color: #f5f7fa; }
.sr-race-mode .activity-panel .activity-item {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}
.sr-race-mode .activity-panel * { color: inherit; }
.sr-race-mode .compact-ticker {
  background: #14171b !important;
  border-color: rgba(255,255,255,0.08) !important;
}
.sr-race-mode .compact-ticker .ticker-row {
  background: transparent !important;
  border-bottom-color: rgba(255,255,255,0.06) !important;
  color: #fff !important;
}
.sr-race-mode .compact-ticker .ticker-row * { color: inherit !important; }
/* News/headlines panel */
.sr-race-mode .news-panel,
.sr-race-mode .headline-row {
  background: transparent !important;
  color: #fff !important;
}
/* Deliberately NOT using [style*="background: white"] etc. — those selectors
   were bleeding into popups and modals, corrupting their intended styling. */

/* Hero leaderboard panel — the big one that broke last time */
.sr-race-mode .hero-lb,
.sr-race-mode .panel.hero-lb {
  background: #14171b !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #f5f7fa;
}
.sr-race-mode .hero-lb-list { background: transparent !important; color: #fff; }
.sr-race-mode .hero-lb-list * { color: inherit; }

/* Explicit rank-row tinting overrides — the base CSS uses --rank-bg CSS var
   set inline via style, which we can't easily strip. Layer a gradient on top. */
/* PODIUM ROWS — dazzled up. Rank-1 gets an animated gold glow, sparkles,
   and a fire emoji marker. Rank-2 silver, rank-3 bronze — both brighter
   than the muted originals. */
.sr-race-mode .hero-row.rank-1 {
  background:
    radial-gradient(ellipse at 8% 50%, rgba(230,184,0,0.42) 0%, transparent 60%),
    linear-gradient(90deg, rgba(230,184,0,0.36) 0%, rgba(230,184,0,0.13) 45%, rgba(230,184,0,0.03) 80%, transparent) !important;
  border-left: 6px solid var(--racing-gold) !important;
  box-shadow: inset 0 0 0 1px rgba(230,184,0,0.36), 0 0 24px -8px rgba(230,184,0,0.45);
  position: relative;
}
.sr-race-mode .hero-row.rank-1::after {
  content: '🔥';
  position: absolute;
  top: 50%; right: 14px;
  transform: translateY(-50%);
  font-size: 60px;
  pointer-events: none;
  animation: sr-fire-flicker 0.9s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(255,140,0,0.85));
}
@keyframes sr-fire-flicker {
  0%,100% { transform: translateY(-50%) rotate(-6deg) scale(1);    opacity: 1; }
  25%     { transform: translateY(-56%) rotate(5deg)  scale(1.22); opacity: 0.9; }
  50%     { transform: translateY(-44%) rotate(-4deg) scale(0.9);  opacity: 1; }
  75%     { transform: translateY(-54%) rotate(6deg)  scale(1.18); opacity: 0.92; }
}
.sr-race-mode .hero-row.rank-2 {
  background:
    radial-gradient(ellipse at 8% 50%, rgba(220,220,240,0.33) 0%, transparent 60%),
    linear-gradient(90deg, rgba(220,220,240,0.26) 0%, rgba(220,220,240,0.07) 55%, transparent) !important;
  border-left: 6px solid var(--racing-silv) !important;
  box-shadow: inset 0 0 0 1px rgba(220,220,240,0.20);
}
.sr-race-mode .hero-row.rank-3 {
  background:
    radial-gradient(ellipse at 8% 50%, rgba(230,140,70,0.31) 0%, transparent 60%),
    linear-gradient(90deg, rgba(230,140,70,0.23) 0%, rgba(230,140,70,0.07) 55%, transparent) !important;
  border-left: 6px solid var(--racing-bronze) !important;
  box-shadow: inset 0 0 0 1px rgba(230,140,70,0.24);
}
.sr-race-mode .hero-row:not(.rank-1):not(.rank-2):not(.rank-3) {
  background: rgba(255,255,255,0.06) !important;
  border-left: 3px solid transparent !important;
}
.sr-race-mode .hero-row { color: #fff !important; }
.sr-race-mode .hero-row .hr-num { color: rgba(255,255,255,0.5) !important; font-weight: 800; font-size: 26px !important; }

/* Bigger, brighter names on podium rows */
.sr-race-mode .hero-row .hr-name {
  font-size: 26px !important;
  font-weight: 800 !important;
  color: #fff !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sr-race-mode .hero-row.rank-1 .hr-name {
  font-size: 36px !important;
  color: #fff5b7 !important;
  text-shadow: 0 0 22px rgba(255,224,120,0.55), 0 2px 4px rgba(0,0,0,0.35);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sr-race-mode .hero-row.rank-2 .hr-name {
  font-size: 31px !important;
  color: #f4f4ff !important;
  text-shadow: 0 0 14px rgba(220,220,240,0.35);
  text-transform: uppercase;
}
.sr-race-mode .hero-row.rank-3 .hr-name {
  font-size: 29px !important;
  color: #ffe6cf !important;
  text-shadow: 0 0 14px rgba(230,140,70,0.35);
  text-transform: uppercase;
}

/* Glow the avatar circle on top-3 */
.sr-race-mode .hero-row.rank-1 .avatar-circle,
.sr-race-mode .hero-row.rank-1 [class*="Avatar"] > div {
  box-shadow: 0 0 0 3px var(--racing-gold), 0 0 22px rgba(255,215,0,0.55) !important;
}
.sr-race-mode .hero-row.rank-2 .avatar-circle,
.sr-race-mode .hero-row.rank-2 [class*="Avatar"] > div {
  box-shadow: 0 0 0 3px var(--racing-silv), 0 0 18px rgba(220,220,240,0.5) !important;
}
.sr-race-mode .hero-row.rank-3 .avatar-circle,
.sr-race-mode .hero-row.rank-3 [class*="Avatar"] > div {
  box-shadow: 0 0 0 3px var(--racing-bronze), 0 0 18px rgba(230,140,70,0.5) !important;
}

/* Bigger worth values on podium */
.sr-race-mode .hero-row.rank-1 .hr-worth {
  font-size: 28px !important;
  color: var(--racing-gold) !important;
  text-shadow: 0 0 18px rgba(255,215,0,0.4);
}
.sr-race-mode .hero-row.rank-2 .hr-worth {
  font-size: 24px !important;
  color: var(--racing-silv) !important;
}
.sr-race-mode .hero-row.rank-3 .hr-worth {
  font-size: 22px !important;
  color: var(--racing-bronze) !important;
}

/* Reserve room on right side so the 🔥 emoji doesn't overlap content */
.sr-race-mode .hero-row.rank-1 { padding-right: 96px !important; }

/* Make chip pills readable and vibrant on the dark theme */
.sr-race-mode .hero-row .hr-chip {
  background: rgba(255,255,255,0.10) !important;
  border-color: rgba(255,255,255,0.18) !important;
  color: #fff !important;
}
.sr-race-mode .hero-row .hr-chip.chip-up { background: rgba(74,222,128,0.22) !important; border-color: rgba(74,222,128,0.4) !important; }
.sr-race-mode .hero-row .hr-chip.chip-down { background: rgba(248,113,113,0.22) !important; border-color: rgba(248,113,113,0.4) !important; }

/* ============================================================
   F1 · ENDED OVERLAY — Final Results makeover
   Dark carbon dashboard vibe (per Organik Truck reference PDF)
   with racing-red + gold accents. Big italic display headline,
   full-bleed panels, bold typography, no cream anywhere.
   ============================================================ */

.overlay.sr-ended-overlay { background: rgba(0,0,0,0.94); align-items: flex-start; padding: 0; }

.overlay-card.sr-ended-card {
  background: linear-gradient(180deg, #0d0f12 0%, #14171b 60%, #0a0c0f 100%) !important;
  border: 2px solid rgba(217,119,87,0.4) !important;
  color: #f5f7fa !important;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 0 4px rgba(0,0,0,0.5), 0 0 60px rgba(217,119,87,0.15) !important;
}
.sr-ended-card * { color: inherit; }

/* Ambient glow ring behind the whole card for drama */
.sr-ended-card {
  position: relative;
}
.sr-ended-card > .sr-checker { flex-shrink: 0; }

/* Header strip — big italic display headline */
.sr-ended-card > div > div:first-child {
  padding-bottom: 24px !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 24px !important;
}
.sr-ended-card [style*="font-size: 26px"][style*="font-weight: 700"],
.sr-ended-card [style*="fontSize: 26"][style*="fontWeight: 700"] {
  font-size: 56px !important;
  font-weight: 800 !important;
  font-family: 'Geist', 'Lora', ui-serif, Georgia, serif !important;
  font-style: italic !important;
  letter-spacing: -0.03em !important;
  line-height: 1 !important;
  color: #fff !important;
  text-shadow: 0 0 40px rgba(217,119,87,0.25);
  background: linear-gradient(135deg, #fff 30%, #ffd28a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sr-ended-card .overlay-eyebrow,
.sr-ended-card [style*="letterSpacing: '0.16em'"],
.sr-ended-card [style*="letter-spacing: 0.16em"] {
  color: var(--racing-red) !important;
  font-size: 13px !important;
  letter-spacing: 0.22em !important;
  font-weight: 800 !important;
}

/* MAR 2026 REVEAL pill */
.sr-ended-card [style*="MAR 2026"],
.sr-ended-card [style*="rgba(217,119,6"] {
  background: linear-gradient(135deg, rgba(217,119,6,0.18), rgba(252,211,77,0.10)) !important;
  border: 1px solid rgba(217,119,6,0.42) !important;
  color: #ffd28a !important;
  font-size: 13px !important;
  padding: 6px 14px !important;
}

/* Headline stat blocks (Top return, Class avg, Beat the bots) */
.sr-ended-card [style*="textAlign: 'right'"],
.sr-ended-card [style*="text-align: right"] {
  min-width: 100px;
}
.sr-ended-card [style*="fontSize: 18"][style*="fontWeight: 700"][style*="Geist Mono"] {
  font-size: 34px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
}

/* Counterfactual "What if you slept" card */
.sr-ended-card [style*="gridTemplateColumns: 'auto 1fr auto'"] {
  background: linear-gradient(135deg, #1a1206 0%, #0f0a04 100%) !important;
  border: 1.5px solid rgba(245,158,11,0.4) !important;
  border-left: 5px solid var(--racing-gold) !important;
  padding: 18px 24px !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 32px rgba(245,158,11,0.15);
}
.sr-ended-card [style*="gridTemplateColumns: 'auto 1fr auto'"] * { color: #fff !important; }
.sr-ended-card [style*="gridTemplateColumns: 'auto 1fr auto'"] [style*="fontSize: 14"] { color: rgba(255,255,255,0.85) !important; font-size: 16px !important; }
.sr-ended-card [style*="gridTemplateColumns: 'auto 1fr auto'"] [style*="fontSize: 11"] {
  color: #ffd28a !important;
  font-size: 12px !important;
  letter-spacing: 0.16em !important;
}
.sr-ended-card [style*="gridTemplateColumns: 'auto 1fr auto'"] [style*="fontSize: 32"] { font-size: 50px !important; }
.sr-ended-card [style*="fontSize: 22"][style*="fontWeight: 700"][style*="#92400e"] {
  font-size: 34px !important;
  color: var(--racing-gold) !important;
  background: rgba(255,255,255,0.05) !important;
  border-color: var(--racing-gold) !important;
  text-shadow: 0 0 20px rgba(245,158,11,0.4);
}

/* Story-of-the-game strip — big round cards */
.sr-ended-card [style*="STORY OF THE GAME"],
.sr-ended-card [style*="Story of the game"] {
  color: var(--racing-red) !important;
  font-size: 14px !important;
  letter-spacing: 0.2em !important;
  margin-bottom: 18px !important;
}
.sr-ended-card [style*="gridTemplateColumns: 'repeat(4'"],
.sr-ended-card [style*="repeat(4"] { gap: 14px !important; }

/* Story strip individual round cards */
.sr-ended-card [style*="border: '1px solid var(--line)"][style*="borderRadius: 8"] {
  background: linear-gradient(180deg, #16191d 0%, #0d0f12 100%) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-top: 3px solid var(--racing-red) !important;
  padding: 16px 16px !important;
  border-radius: 10px !important;
}
.sr-ended-card [style*="fontSize: 12"][style*="fontWeight: 700"] {
  font-size: 16px !important;
  color: #fff !important;
  line-height: 1.35 !important;
}
.sr-ended-card [style*="Round"][style*="fontFamily"] {
  color: var(--racing-gold) !important;
}

/* Stock Movers panel — dark carbon with racing accents */
.sr-ended-card [style*="STOCK MOVERS"] {
  color: var(--racing-red) !important;
  font-size: 14px !important;
  letter-spacing: 0.2em !important;
}
.sr-ended-card [style*="Ranked by total return"] {
  color: rgba(255,255,255,0.5) !important;
  font-size: 13px !important;
}

/* Movers table rows */
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"] {
  background: rgba(255,255,255,0.02) !important;
  border-color: rgba(255,255,255,0.06) !important;
  padding: 12px 10px !important;
  font-size: 15px !important;
}
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"][style*="rgba(22,163,74,0.06)"] {
  background: linear-gradient(90deg, rgba(74,222,128,0.15), rgba(74,222,128,0.03) 60%) !important;
  border: 1px solid rgba(74,222,128,0.35) !important;
}
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"][style*="rgba(220,38,38,0.06)"] {
  background: linear-gradient(90deg, rgba(248,113,113,0.15), rgba(248,113,113,0.03) 60%) !important;
  border: 1px solid rgba(248,113,113,0.35) !important;
}
.sr-ended-card [style*="fontSize: 13"][style*="fontWeight: 700"] { font-size: 17px !important; color: #fff !important; }
.sr-ended-card [style*="fontSize: 10"][style*="color: 'var(--muted)"] { color: rgba(255,255,255,0.55) !important; font-size: 12px !important; }

/* Leaderboard + per-student panels */
.sr-ended-card [style*="Leaderboard"],
.sr-ended-card [style*="How each student played"] {
  color: var(--racing-red) !important;
  font-size: 14px !important;
  letter-spacing: 0.2em !important;
}
.sr-ended-card [style*="background: 'var(--surface)"][style*="border: '1.5px solid var(--line)"] {
  background: linear-gradient(180deg, #14171b 0%, #0d0f12 100%) !important;
  border: 1.5px solid rgba(255,255,255,0.1) !important;
}

/* Play again button - full racing bar */
.sr-ended-card .big-btn {
  background: linear-gradient(90deg, #b04a1e 0%, #d97757 45%, #d97757 55%, #b04a1e 100%) !important;
  color: #fff !important;
  border: none !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  padding: 20px 32px !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(217,119,87,0.4), inset 0 1px 0 rgba(255,255,255,0.15) !important;
  text-transform: uppercase;
}
.sr-ended-card .big-btn:hover { filter: brightness(1.1); }

/* Muted → light text everywhere */
.sr-ended-card [style*="color: 'var(--muted)"],
.sr-ended-card .muted {
  color: rgba(255,255,255,0.5) !important;
}

/* Blanket-override text colors — inline styles have color rgb() from React,
   attribute-substring selectors miss them. Force everything readable. */
.sr-ended-card,
.sr-ended-card div,
.sr-ended-card span,
.sr-ended-card p {
  color: #fff !important;
}
/* Bold text universally = gold highlight (racing theme). Winner-numbers,
   share counts, %s — all pop with the racing-gold accent. */
.sr-ended-card b,
.sr-ended-card strong {
  color: var(--racing-gold) !important;
  font-weight: 800 !important;
}
.sr-ended-card .muted,
.sr-ended-card [class*="muted"] { color: rgba(255,255,255,0.55) !important; }

/* The ×26.4 sleep-multiplier pill — target it via its unique cream
   background `#fef3c7` (rgb(254, 243, 199)). Nothing else in the recap
   has that exact background so this is safe. */
.sr-ended-card [style*="rgb(254, 243, 199)"],
.sr-ended-card [style*="#fef3c7"] {
  background: linear-gradient(135deg, #ffe067 0%, #d97706 100%) !important;
  color: #1a0a02 !important;
  border: 2px solid #f5b301 !important;
  font-size: 34px !important;
  font-weight: 900 !important;
  padding: 8px 18px !important;
  border-radius: 12px !important;
  box-shadow: 0 0 24px rgba(245,158,11,0.4), 0 4px 14px rgba(0,0,0,0.35);
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  white-space: nowrap;
}
.sr-ended-card [style*="rgb(254, 243, 199)"] *,
.sr-ended-card [style*="#fef3c7"] * { color: #1a0a02 !important; }

/* Green / red delta pills need to stay coloured — override the blanket */
.sr-ended-card [style*="rgba(74,222,128"],
.sr-ended-card [style*="rgb(74, 222, 128"],
.sr-ended-card [style*="rgba(22,163,74"],
.sr-ended-card [style*="rgb(22, 163, 74"] { color: #4ade80 !important; }
.sr-ended-card [style*="rgba(248,113,113"],
.sr-ended-card [style*="rgb(248, 113, 113"],
.sr-ended-card [style*="rgba(220,38,38"],
.sr-ended-card [style*="rgb(220, 38, 38"] { color: #f87171 !important; }

/* Podium chips keep dark text on their metallic gradients */
.sr-ended-card .sr-podium,
.sr-ended-card .sr-podium * { color: var(--racing-black) !important; }

/* Top-return / Class-average / Beat-the-bots headline stats — big colour */
.sr-ended-card [style*="color: rgb(21, 128, 61)"],
.sr-ended-card [style*="color: rgb(74, 222, 128)"] { color: #4ade80 !important; }
.sr-ended-card [style*="color: rgb(185, 28, 28)"],
.sr-ended-card [style*="color: rgb(248, 113, 113)"] { color: #f87171 !important; }

/* ============================================================
   STEP 1 · Classroom-projector text bumps for the Final Results
   All numbers picked so a teacher standing 8m from the screen
   can read every value without squinting.
   ============================================================ */

/* "GAME OVER · N STUDENTS · N ROUNDS" — jump from tiny 13px to big-headline size */
.sr-ended-card [style*="font-size: 10px"][style*="letter-spacing: 0.16em"],
.sr-ended-card [style*="fontSize: 10"][style*="letterSpacing: '0.16em"] {
  font-size: 22px !important;
  letter-spacing: 0.2em !important;
}

/* "MAR 2026 REVEAL" pill */
.sr-ended-card [style*="MAR 2026"] { font-size: 18px !important; padding: 8px 18px !important; }

/* Top-return / Class-avg / Beat-bots big values — pop them */
.sr-ended-card [style*="font-size: 18px"][style*="font-weight: 700"][style*="Geist Mono"],
.sr-ended-card [style*="fontSize: 18"][style*="fontWeight: 700"][style*="Geist Mono"] {
  font-size: 48px !important;
  letter-spacing: -0.02em !important;
}
.sr-ended-card [style*="fontSize: 9"][style*="letterSpacing: '0.12em"] {
  font-size: 16px !important;
}

/* Counterfactual body ("Buying N shares of X at the start would...") */
.sr-ended-card [style*="font-size: 14px"][style*="line-height: 1.45"],
.sr-ended-card [style*="fontSize: 14"][style*="lineHeight: 1.45"] {
  font-size: 22px !important;
  line-height: 1.5 !important;
}
.sr-ended-card [style*="fontSize: 14"][style*="marginTop: 4"] {
  font-size: 22px !important;
}
/* Bold gold values inside counterfactual and elsewhere — bump */
.sr-ended-card b { font-size: 1.15em !important; }

/* Counterfactual small italic disclaimer */
.sr-ended-card [style*="fontStyle: 'italic"][style*="fontSize: 11"] {
  font-size: 14px !important;
}

/* "STORY OF THE GAME · 10 YEARS IN 5 ROUNDS" section header */
.sr-ended-card [style*="Story of the game"],
.sr-ended-card [style*="STORY OF THE GAME"] {
  font-size: 20px !important;
  letter-spacing: 0.22em !important;
  padding-bottom: 14px !important;
}

/* Story cards inside the strip */
.sr-ended-card [style*="Round"][style*="fontFamily"][style*="fontSize: 10"] {
  font-size: 16px !important;
  letter-spacing: 0.14em !important;
}
.sr-ended-card [style*="linear-gradient(180deg, rgba(15,23,42"] [style*="fontSize: 12"][style*="fontWeight: 700"] {
  font-size: 20px !important;
  line-height: 1.4 !important;
}

/* Story-strip stock chips (DIXON +47%) */
.sr-ended-card [style*="fontSize: 11"][style*="Geist Mono"][style*="fontWeight: 700"] {
  font-size: 17px !important;
  padding: 6px 12px !important;
}

/* "STOCK MOVERS · 2016 → MAR 2026" section header */
.sr-ended-card [style*="STOCK MOVERS"] {
  font-size: 20px !important;
  letter-spacing: 0.22em !important;
}
.sr-ended-card [style*="Ranked by total return"] {
  font-size: 15px !important;
}

/* Stock movers table rows — bump everything for classroom readability */
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"] > div:nth-child(1),
.sr-ended-card [style*="grid-template-columns: 22px 30px 130px 84px 84px 100px 1fr 78px"] > div:nth-child(1) {
  font-size: 20px !important;
}
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"] > div:nth-child(2),
.sr-ended-card [style*="grid-template-columns: 22px 30px 130px 84px 84px 100px 1fr 78px"] > div:nth-child(2) {
  font-size: 30px !important;
}
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"] > div:nth-child(3) [style*="fontWeight: 700"],
.sr-ended-card [style*="grid-template-columns: 22px 30px 130px 84px 84px 100px 1fr 78px"] > div:nth-child(3) [style*="fontWeight: 700"] {
  font-size: 24px !important;
}
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"] > div:nth-child(3) [style*="var(--muted)"],
.sr-ended-card [style*="grid-template-columns: 22px 30px 130px 84px 84px 100px 1fr 78px"] > div:nth-child(3) [style*="var(--muted)"],
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"] > div:nth-child(3) [style*="rgb(255, 255, 255"],
.sr-ended-card [style*="grid-template-columns: 22px 30px 130px 84px 84px 100px 1fr 78px"] > div:nth-child(3) [style*="rgb(255, 255, 255"] {
  font-size: 16px !important;
}
/* Movers row prices ₹160 → ₹4,223 (children 4 + 5) */
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"] > div:nth-child(4),
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"] > div:nth-child(5),
.sr-ended-card [style*="grid-template-columns: 22px 30px 130px 84px 84px 100px 1fr 78px"] > div:nth-child(4),
.sr-ended-card [style*="grid-template-columns: 22px 30px 130px 84px 84px 100px 1fr 78px"] > div:nth-child(5) {
  font-size: 20px !important;
}
/* Movers row % delta (child 6) */
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"] > div:nth-child(6),
.sr-ended-card [style*="grid-template-columns: 22px 30px 130px 84px 84px 100px 1fr 78px"] > div:nth-child(6) {
  font-size: 20px !important;
  padding: 8px 12px !important;
}
/* Movers row "0/0 held" (child 8, last) */
.sr-ended-card [style*="gridTemplateColumns: '22px 30px 130px 84px 84px 100px 1fr 78px'"] > div:nth-child(8),
.sr-ended-card [style*="grid-template-columns: 22px 30px 130px 84px 84px 100px 1fr 78px"] > div:nth-child(8) {
  font-size: 15px !important;
}

/* Legend at bottom of movers table (🏆 = ..., 🐌 = ..., 💥 = ...) */
.sr-ended-card [style*="marginTop: 8"][style*="gap: 12"][style*="fontSize: 11"] {
  font-size: 15px !important;
  gap: 20px !important;
}

/* Leaderboard + How each student played panel labels */
.sr-ended-card [style*="Leaderboard"][style*="fontFamily"][style*="letterSpacing"],
.sr-ended-card [style*="How each student played"][style*="fontFamily"] {
  font-size: 20px !important;
  letter-spacing: 0.22em !important;
}

/* Story strip stock chips (DIXON +47%) - larger + brighter */
.sr-ended-card [style*="rgba(22,163,74,0.12)"][style*="Geist Mono"],
.sr-ended-card [style*="rgba(220,38,38,0.12)"][style*="Geist Mono"] {
  padding: 6px 12px !important;
  font-size: 14px !important;
}
.sr-ended-card [style*="rgba(22,163,74,0.12)"] { background: rgba(74,222,128,0.20) !important; color: #4ade80 !important; }
.sr-ended-card [style*="rgba(220,38,38,0.12)"] { background: rgba(248,113,113,0.20) !important; color: #f87171 !important; }

/* News/headline panel + card + big-btn overrides that use white bg */
.sr-race-mode .news-panel,
.sr-race-mode .news-panel .panel,
.sr-race-mode .headline-row,
.sr-race-mode .big-btn,
.sr-race-mode .how-card,
.sr-race-mode .side-panel {
  background: #14171b !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #f5f7fa !important;
}
.sr-race-mode .news-panel * { color: inherit !important; }

/* Round transition overlays (news popup content) — leave them alone; those
   render as their own overlays and already work in the light theme. */
.sr-race-mode .overlay-card:not(.sr-racing) { color: #0f172a; }

/* Chequered flag inside the shell (between header + ticker) */
.host-shell.sr-race-mode > .sr-checker {
  height: 6px;
  background-size: 6px 6px;
  background-position: 0 0, 0 3px, 3px -3px, -3px 0;
  border-top: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ============================================================
   F1 TIMING TOWER — hero-row extras
   Adds a GAP column between portfolio and worth so every row
   reads like an F1 timing screen: LEADER at top, gaps below,
   position-change arrow next to the P&L.
   ============================================================ */

/* Gap column — F1 timing-tower centrepiece */
.sr-gap-col {
  display: flex; flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 0 12px;
  min-width: 110px;
  border-left: 1px dashed rgba(255,255,255,0.08);
  border-right: 1px dashed rgba(255,255,255,0.08);
}
.sr-gap-col .sr-gap-label {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.35);
  font-weight: 700;
}
.sr-gap-col .sr-gap-value {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.sr-gap-col .sr-gap-value.leader {
  color: var(--racing-gold);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-shadow: 0 0 12px rgba(230,184,0,0.5);
}
.sr-gap-col .sr-gap-value.behind {
  color: #ff4d6d;   /* F1 red for "losing to leader" */
}
.sr-gap-col .sr-gap-value.even {
  color: rgba(255,255,255,0.55);
}

/* Position-change arrow — small chip under P&L */
.sr-pos-change {
  display: inline-block;
  margin-top: 3px;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 3px;
}
.sr-pos-change.up {
  background: rgba(74,222,128,0.16);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.3);
}
.sr-pos-change.down {
  background: rgba(255,77,109,0.16);
  color: #ff4d6d;
  border: 1px solid rgba(255,77,109,0.3);
}
.sr-pos-change.new {
  background: rgba(160,80,255,0.18);
  color: #c084fc;
  border: 1px solid rgba(160,80,255,0.4);
}

/* Team livery stripe — thicker left border for driver color. No transitions
   on background/border-color: they compound with the 550ms FLIP translate
   creating a visible cross-fade wobble during rank swaps. Snap them. */
.sr-race-mode .hero-row {
  border-left-width: 5px !important;
  transition: none;
}
.sr-race-mode .hero-row.rank-1 { border-left-color: var(--racing-gold) !important; }
.sr-race-mode .hero-row.rank-2 { border-left-color: var(--racing-silv) !important; }
.sr-race-mode .hero-row.rank-3 { border-left-color: var(--racing-bronze) !important; }

/* ============================================================
   Stock ticker marquee — moved out of the component's inline
   <style> so it doesn't re-parse on every render, and every
   item has a stable-width delta slot so price flips at round
   transitions don't reflow the track mid-scroll.
   ============================================================ */
.sr-ticker-wrap {
  background: linear-gradient(180deg, #071a10 0%, #0f3a24 100%);
  border-top: 2px solid #15803d;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
@keyframes sr-ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.sr-ticker-track {
  display: flex;
  width: max-content;
  animation: sr-ticker-scroll 75s linear infinite;
  will-change: transform;
}
.sr-ticker-track:hover { animation-play-state: paused; }

.sr-ticker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  border-right: 1px solid rgba(255,255,255,0.10);
  color: #fff; white-space: nowrap; flex-shrink: 0;
}
.sr-ticker-emoji { font-size: 24px; line-height: 1; }
.sr-ticker-id {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 18px; font-weight: 800;
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.04em;
}
.sr-ticker-price {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 20px; font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
/* Fixed-width delta pill — keeps its slot even when flat, so appear/
   disappear on price transitions doesn't reflow the row. */
.sr-ticker-delta {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 15px; font-weight: 700;
  padding: 3px 10px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
  min-width: 82px; text-align: center;
  display: inline-block;
}
.sr-ticker-delta.up   { color: #4ade80; background: rgba(74,222,128,0.18); }
.sr-ticker-delta.down { color: #f87171; background: rgba(248,113,113,0.18); }
.sr-ticker-delta.flat { background: transparent; color: transparent; }

/* Round-transition popup animation keyframes — moved out of the component's
   inline <style> tag so React doesn't re-parse them on every render (which
   used to cause a subtle flash when the popup re-mounted between rounds). */
@keyframes rtp-fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes rtp-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes rtp-rise    {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes rtp-drop    {
  from { opacity: 1; transform: translateY(0)     scale(1);    }
  to   { opacity: 0; transform: translateY(-16px) scale(0.98); }
}
@keyframes rtp-glow    {
  0%, 100% { box-shadow: 0 0 60px rgba(217,119,87,0.45), 0 0 0 2px rgba(217,119,87,0.55), 0 30px 80px rgba(0,0,0,0.5); }
  50%      { box-shadow: 0 0 90px rgba(217,119,87,0.70), 0 0 0 2px rgba(217,119,87,0.85), 0 30px 80px rgba(0,0,0,0.5); }
}

/* Chip stack (holdings) */
.sr-race-mode .hr-chip { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: #fff; }
.sr-race-mode .hr-chip-qty { color: rgba(255,255,255,0.6); }
.sr-race-mode .hr-lock { color: #4ade80; }

/* Ticker */
.sr-race-mode .compact-ticker .ticker-row {
  background: transparent;
  border-color: rgba(255,255,255,0.06);
  color: #fff;
}
.sr-race-mode .compact-ticker .ticker-row .price { color: #fff; }
.sr-race-mode .compact-ticker .ticker-row .name { color: rgba(255,255,255,0.55); }

/* Marquee ticker at top of screen */
.sr-race-mode .sr-marquee,
.sr-race-mode .stock-ticker-marquee {
  background: #0a0c0f;
  border-color: rgba(255,255,255,0.08);
  color: #fff;
}

/* Round year pill / round transition popup */
.sr-race-mode .round-year-pill {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.16) !important;
}

/* Lock-strip and student count chip */
.sr-race-mode .lock-strip,
.sr-race-mode .live-feed .feed-item {
  color: rgba(255,255,255,0.75);
}
.sr-race-mode .side-panel-count { color: #4ade80; }
.sr-race-mode .live-feed .feed-item {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

/* Compact market list on right rail */
.sr-race-mode .side-panel .stock-row {
  background: transparent;
  border-color: rgba(255,255,255,0.06);
  color: #fff;
}
.sr-race-mode .side-panel .stock-row .ticker { color: #fff; }
.sr-race-mode .side-panel .stock-row .name { color: rgba(255,255,255,0.5); }
.sr-race-mode .side-panel .stock-row .price { color: #fff; }

/* Headlines strip */
.sr-race-mode .headlines,
.sr-race-mode .headlines-title { color: rgba(255,255,255,0.65); }

/* Starting-lights row — 5 red lights that fade in one at a time, then all
   go out. Used on the last briefing slide "Let's play →" moment. Purely
   decorative — the click still starts the game. */
.sr-lights {
  display: inline-flex; gap: 6px; padding: 6px 10px;
  background: #0a0a0a; border-radius: 8px;
  border: 1.5px solid #000;
}
.sr-lights .lgt {
  width: 14px; height: 14px; border-radius: 50%;
  background: #2a0000; border: 1px solid #000;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.15);
}
.sr-lights.armed .lgt { animation: sr-light-on 1s ease-out forwards; }
.sr-lights.armed .lgt:nth-child(1) { animation-delay: 0.0s; }
.sr-lights.armed .lgt:nth-child(2) { animation-delay: 0.25s; }
.sr-lights.armed .lgt:nth-child(3) { animation-delay: 0.5s; }
.sr-lights.armed .lgt:nth-child(4) { animation-delay: 0.75s; }
.sr-lights.armed .lgt:nth-child(5) { animation-delay: 1.0s; }
@keyframes sr-light-on {
  to { background: var(--racing-red); box-shadow: 0 0 10px rgba(220,0,0,0.9), inset 0 1px 2px rgba(255,255,255,0.2); }
}

* { box-sizing: border-box; }

html, body, #root {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input  { font-family: inherit; }

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ============================================================
   LANDING
   ============================================================ */
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: radial-gradient(circle at 20% 10%, #fff 0%, #fafaf7 60%, #f3f0e8 100%);
}
.landing-card {
  max-width: 720px;
  width: 100%;
  border: 1.5px solid var(--line);
  background: white;
  padding: 48px 48px 40px;
}
.landing-mark {
  width: 56px; height: 56px;
  border: 1.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Geist Mono', ui-monospace;
  font-weight: 700; font-size: 20px;
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}
.landing-title {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0 0 8px;
}
.landing-sub {
  font-size: 17px;
  color: var(--muted);
  max-width: 540px;
  line-height: 1.55;
  margin-bottom: 36px;
}
.role-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.role-card {
  text-align: left;
  border: 1.5px solid var(--line);
  background: white;
  padding: 24px;
  transition: transform .15s, background .15s;
}
.role-card:hover { background: var(--paper); transform: translateY(-2px); }
.role-eyebrow {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.role-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 6px 0 8px;
}
.role-desc { color: var(--muted); font-size: 14px; line-height: 1.5; }
.role-cta {
  margin-top: 24px;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.landing-foot {
  border-top: 1px solid var(--faint);
  padding-top: 24px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.landing-foot b { color: var(--ink); }

/* ============================================================
   HOST SHELL
   ============================================================ */
.host-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

/* ── Header ── */
.host-header {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1.5px solid var(--line);
  background: white;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px;
  border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Geist Mono', ui-monospace;
  font-weight: 700; font-size: 13px;
  letter-spacing: 0;
}
.brand-title  { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub    { font-size: 11px; color: var(--muted); font-family: 'Geist Mono', ui-monospace; }

.header-center { text-align: center; }
.round-label {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.round-era-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.phase-events-tag {
  background: #d4953a;
  color: white;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  font-weight: 700;
}

.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.join-pill {
  border: 1.5px solid var(--line);
  padding: 8px 14px;
  text-align: right;
}
.join-label  { font-family: 'Geist Mono', ui-monospace; font-size: 10px; letter-spacing: 0.14em; color: var(--muted); }
.join-url    { font-size: 12px; font-weight: 600; }
.join-code   { font-family: 'Geist Mono', ui-monospace; font-size: 22px; font-weight: 700; letter-spacing: 0.16em; margin-top: 1px; }

/* ── Body layout ── */
.host-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 14px;
  padding: 14px;
  min-height: 0;
  align-items: start;
}
.host-main    { display: flex; flex-direction: column; gap: 14px; }
.host-sidebar { display: flex; flex-direction: column; gap: 14px; }

/* ── Panel ── */
.panel {
  border: 1.5px solid var(--line);
  background: white;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1.5px solid var(--line);
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Lock strip ── */
.lock-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin: 6px 0 3px;
}
.lock-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid var(--line);
  padding: 2px 7px 2px 3px;
  font-size: 12px;
  font-family: 'Geist Mono', ui-monospace;
  transition: background .2s;
}
.lock-chip.locked   { background: var(--up);  color: white; border-color: var(--up); }
.lock-chip.unlocked { background: white; color: var(--muted); }
.lock-icon          { font-size: 11px; }
.lock-icon.pending  { opacity: 0.5; }
.lock-count {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Next round button ── */
.next-round-btn {
  border: 2px solid var(--ink);
  padding: 12px 22px;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform .12s, background .15s, box-shadow .15s;
  white-space: nowrap;
  border-radius: 10px;
  cursor: pointer;
  background: var(--ink);
  color: white;
  box-shadow: 0 4px 14px rgba(7, 26, 16, 0.28), 0 0 0 4px rgba(7, 26, 16, 0.06);
  animation: nrb-glow 2.4s ease-in-out infinite;
}
.next-round-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(7, 26, 16, 0.38), 0 0 0 6px rgba(7, 26, 16, 0.08);
}
/* All-locked = dark ink. Force = warm amber so the teacher knows it's a "push it through" action. */
.next-round-btn.ready {
  background: var(--ink); color: white;
  border-color: var(--ink);
}
.next-round-btn.force {
  background: #d97706; color: white;
  border-color: #b45309;
  box-shadow: 0 4px 14px rgba(217,119,6,0.28), 0 0 0 4px rgba(217,119,6,0.08);
}
.next-round-btn.force:hover {
  background: #b45309;
  box-shadow: 0 6px 18px rgba(217,119,6,0.42), 0 0 0 6px rgba(217,119,6,0.12);
}

@keyframes nrb-glow {
  0%, 100% { box-shadow: 0 4px 14px rgba(7, 26, 16, 0.28), 0 0 0 4px rgba(7, 26, 16, 0.06); }
  50%      { box-shadow: 0 4px 18px rgba(7, 26, 16, 0.40), 0 0 0 8px rgba(7, 26, 16, 0.10); }
}

/* ============================================================
   HERO LEADERBOARD
   ============================================================ */
.hero-lb      { flex: 1; }
.hero-lb-list { display: flex; flex-direction: column; }

.hero-row {
  display: grid;
  grid-template-columns: 56px 260px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  position: relative;
  transition: background .15s;
}
/* #1 gets a bit more room and a dramatic gold underline */
.hero-row.rank-1 { padding: 14px 18px; }
.hero-row:last-child { border-bottom: none; }
.hero-row:hover      { background: rgba(0,0,0,0.015); }
.hero-row.is-bot     { opacity: 0.55; }
/* Podium row colours — gold / silver / bronze, vivid */
.hero-row.rank-1 {
  background: linear-gradient(90deg, #ffe066 0%, #fff3b0 35%, #fffbe8 70%, transparent 100%);
  border-bottom: 1.5px solid #f5d142;
}
.hero-row.rank-1::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px; width: 6px;
  background: linear-gradient(180deg, #f5d142, #f5a142);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(245, 161, 66, 0.6);
}

.hero-row.rank-2 {
  background: linear-gradient(90deg, #cdd6e2 0%, #e0e4ec 40%, #f2f3f6 75%, transparent 100%);
  border-bottom: 1.5px solid #94a3b8;
}
.hero-row.rank-2::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px;
  background: linear-gradient(180deg, #cbd5e1, #94a3b8);
  border-radius: 0 4px 4px 0;
}

.hero-row.rank-3 {
  background: linear-gradient(90deg, #fbbf77 0%, #fcd5a5 40%, #fdebd5 70%, transparent 100%);
  border-bottom: 1.5px solid #d97706;
}
.hero-row.rank-3::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px;
  background: linear-gradient(180deg, #f59e0b, #b45309);
  border-radius: 0 4px 4px 0;
}

/* Mid-pack rows (4-6) get a subtle slate left stripe for legibility */
.hero-row.rank-mid {
  background: linear-gradient(90deg, rgba(148,163,184,0.06), transparent 60%);
}
.hero-row.rank-mid::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: #94a3b8;
  border-radius: 0 3px 3px 0;
  opacity: 0.55;
}

/* Bottom rows get a very faint pink tint to signal "needs help" */
.hero-row.rank-bottom {
  background: linear-gradient(90deg, rgba(220,38,38,0.04), transparent 60%);
}
.hero-row.rank-bottom::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: #fca5a5;
  border-radius: 0 3px 3px 0;
  opacity: 0.6;
}

.hr-rank    { display: flex; align-items: center; justify-content: center; }
.hr-medal   { font-size: 34px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15)); }
.hr-num     { font-family: 'Geist Mono', ui-monospace; font-size: 24px; font-weight: 700; color: #94a3b8; }

.hr-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hr-identity > div:last-child { min-width: 0; flex: 1; }
.hr-name     { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: #0f172a; }
.hero-row.rank-1 .hr-name { font-size: 22px; }
.hr-lock     { font-size: 14px; }

/* Cash + Invested as small colour-coded pills so they never get cropped */
.hr-cash {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 12.5px;
  margin-top: 4px;
  display: flex; gap: 5px; flex-wrap: wrap;
}
.hr-cash .pill {
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.hr-cash .pill.cash     { background: #f1f5f9; color: #475569; }
.hr-cash .pill.invested { background: #ecfdf5; color: #047857; border: 1px solid rgba(4,120,87,0.18); }

.hr-portfolio { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-width: 0; }
.hr-no-holds  { font-size: 12px; }
.hr-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  border-radius: 6px;
  transition: transform .12s;
}
.hr-chip:hover     { transform: translateY(-1px); }
.hr-chip.chip-up   { border-color: #16a34a; background: #ecfdf5; color: #15803d; }
.hr-chip.chip-down { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }
.hr-chip-emoji  { font-size: 17px; }
.hr-chip-ticker { font-weight: 700; letter-spacing: 0.04em; }
.hr-chip-qty    { opacity: 0.7; font-size: 11.5px; font-weight: 600; }

.hr-worth-block { text-align: right; flex-shrink: 0; min-width: 130px; }
.hr-worth {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 22px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.hero-worth {
  font-size: 34px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #334155 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hr-pnl {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 12px; font-weight: 700;
  margin-top: 4px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
}
.hr-pnl.up   { color: #15803d; background: rgba(22,163,74,0.10); }
.hr-pnl.down { color: #b91c1c; background: rgba(220,38,38,0.10); }
.hr-pnl-abs  { opacity: 0.75; font-weight: 600; }

.bot-tag {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  background: var(--faint);
  padding: 2px 4px;
  color: var(--muted);
  text-transform: uppercase;
}

/* ============================================================
   COMPACT STOCK TICKER
   ============================================================ */
.compact-ticker { flex-shrink: 0; }
.ticker-list    { display: flex; flex-direction: column; }
.ticker-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-bottom: 1px dashed var(--faint);
}
.ticker-row:last-child { border-bottom: none; }
.ticker-emoji  { font-size: 17px; flex-shrink: 0; }
.ticker-ident  { flex: 1; min-width: 0; }
.ticker-id     { font-family: 'Geist Mono', ui-monospace; font-weight: 700; font-size: 12px; letter-spacing: 0.04em; display: block; }
.ticker-name   { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ticker-right  { text-align: right; flex-shrink: 0; }
.ticker-price  { font-family: 'Geist Mono', ui-monospace; font-size: 13px; font-weight: 700; display: block; font-variant-numeric: tabular-nums; }
.ticker-delta  { font-family: 'Geist Mono', ui-monospace; font-size: 11px; font-weight: 600; display: block; }
.ticker-delta.up   { color: var(--up); }
.ticker-delta.down { color: var(--down); }

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reaction-strip {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 1px dashed var(--faint);
  min-height: 40px;
  align-items: center;
}
.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  border: 1px solid var(--faint);
  padding: 3px 6px 3px 4px;
  animation: pop 0.4s ease;
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.reaction-emoji { font-size: 13px; }
.reaction-name  { color: var(--muted); font-size: 11px; }
.activity-list  { overflow-y: auto; padding: 6px 0; flex: 1; }
.activity-item  { padding: 5px 14px; font-size: 12px; font-family: 'Geist Mono', ui-monospace; color: var(--muted); border-bottom: 1px dashed var(--faint); }
.activity-item:last-child { border: none; }

/* ============================================================
   EVENT TYPE BADGES
   ============================================================ */
.event-type-badge {
  display: inline-block;
  padding: 4px 12px;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 2px;
}
.event-type-badge-sm {
  padding: 2px 7px;
  font-size: 9px;
  letter-spacing: 0.12em;
  display: inline-block;
  margin-bottom: 4px;
  border-radius: 2px;
}
.evt-dividend { background: #1f7a4d; color: white; }
.evt-split    { background: #3b82c4; color: white; }
.evt-ipo      { background: #d4953a; color: white; }
.evt-bonus    { background: #7c5cc9; color: white; }
.evt-buyback  { background: #e85d4b; color: white; }
.evt-rights   { background: #2f9e6f; color: white; }

/* ============================================================
   EVENT PHASE OVERLAY (full-screen during events phase)
   ============================================================ */
.event-phase-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 90;
  animation: fade-in 0.3s ease;
}
.event-phase-backdrop.rtp-closing {
  animation: rtp-fade-out 0.3s ease forwards;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.event-phase-card {
  color: white;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  animation: pop-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop-up {
  from { transform: scale(0.96) translateY(10px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.event-type-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.event-stock-tag {
  font-size: 18px;
  font-weight: 600;
  opacity: 0.9;
}

.event-waiting-tag {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 13px;
  opacity: 0.6;
  margin-left: auto;
}

.event-phase-headline {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 18px;
}

.event-phase-body {
  font-size: 16px;
  line-height: 1.7;
  opacity: 0.78;
  max-width: 720px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Quick numbers row */
.event-quick-numbers {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.eqn-cell {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 12px 20px;
  border-radius: 2px;
}
.eqn-label {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 4px;
}
.eqn-val {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.eqn-val.eqn-up { color: #4ade80; }
.eqn-arrow {
  font-size: 22px;
  opacity: 0.35;
  font-weight: 300;
}

/* ── Choice tracker ── */
.event-choice-tracker { margin-top: 8px; }
.ect-label {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.45;
  margin-bottom: 14px;
}
.ect-players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.ect-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1.5px solid rgba(255,255,255,0.15);
  font-size: 13px;
  transition: border-color .3s, background .3s;
  border-radius: 2px;
}
.ect-chip.responded {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(31, 122, 77, 0.18);
}
.ect-chip.pending { opacity: 0.65; }
.ect-name  { font-weight: 600; }
.ect-choice {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  margin-left: 2px;
}
.ect-dot { opacity: 0.5; }

.ect-progress {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}
.ect-progress-fill {
  height: 100%;
  background: #4ade80;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.ect-count {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 12px;
  opacity: 0.55;
}

/* ============================================================
   OVERLAYS (lobby, ended)
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
.overlay-card {
  background: white;
  border: 1.5px solid var(--line);
  padding: 40px 44px;
  max-width: 540px;
  text-align: center;
}
.overlay-card.wide { max-width: 820px; }
.overlay-eyebrow {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.overlay-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 12px;
}
.overlay-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 24px;
}

/* Lobby grid */
.lobby-overlay { max-width: 860px; padding: 32px 36px; }
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0 20px;
  text-align: left;
}
.how-card {
  border: 1.5px solid var(--line);
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.how-card.demo { background: var(--ink); color: white; }
.how-card.demo .muted, .how-card.demo .how-foot { color: rgba(255,255,255,0.6); }
.how-tag  { font-family: 'Geist Mono', ui-monospace; font-size: 10px; letter-spacing: 0.14em; opacity: 0.65; }
.how-body { font-size: 13px; line-height: 1.5; opacity: 0.9; flex: 1; }
.how-card.real .how-body { color: var(--ink); opacity: 1; }
.how-foot { font-size: 12px; }
.fake-qr  { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px dashed var(--line); margin-top: 4px; }

.join-url-big  { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.join-code-big { font-family: 'Geist Mono', ui-monospace; font-size: 22px; font-weight: 700; letter-spacing: 0.16em; }

.lobby-divider {
  border-top: 1px dashed var(--faint);
  padding-top: 16px;
  margin-bottom: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.lobby-players { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.lobby-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  padding: 4px 10px 4px 4px;
  font-size: 13px;
}

/* Buttons */
.big-btn {
  background: var(--ink);
  color: white;
  border: 1.5px solid var(--line);
  padding: 13px 26px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  width: 100%;
  transition: transform .12s;
}
.big-btn:hover   { transform: translateY(-1px); }
.big-btn.subtle  { background: white; color: var(--ink); }

/* Primary button on the dark host lobby card — invert so it stands out */
.how-card.demo .big-btn.primary {
  background: #4ade80;
  color: #071a10;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(74, 222, 128, 0.28);
}
.how-card.demo .big-btn.primary:hover {
  background: #22c55e;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.42);
}
.how-card.demo .big-btn.primary.subtle {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: none;
}
.ghost-btn {
  background: white;
  color: var(--ink);
  border: 1.5px solid var(--line);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
}
.ghost-btn:hover { background: var(--paper); }

/* Podium */
.podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin: 22px 0 28px;
}
.podium-step {
  border: 1.5px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.podium-step.step-1 { background: var(--ink); color: white; }
.podium-step.step-1 .podium-place { color: rgba(255,255,255,0.6); }
.podium-place { font-family: 'Geist Mono', ui-monospace; font-size: 11px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; margin-top: 6px; }
.podium-name  { font-size: 17px; font-weight: 600; }
.podium-worth { font-family: 'Geist Mono', ui-monospace; font-size: 20px; font-weight: 700; }

/* ============================================================
   PLAYER SHELL
   ============================================================ */
.player-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: white;
  border-left: 1.5px solid var(--line);
  border-right: 1.5px solid var(--line);
  display: flex;
  flex-direction: column;
}
@media (max-width: 520px) { .player-shell { border-left: none; border-right: none; } }

/* Onboard */
.onboard { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--paper); }
.onboard-card {
  width: 100%;
  max-width: 380px;
  background: white;
  border: 1.5px solid var(--line);
  padding: 32px 28px;
}
.onboard-mark {
  width: 44px; height: 44px;
  border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Geist Mono', ui-monospace;
  font-weight: 700; font-size: 13px;
  margin-bottom: 20px;
}
.onboard-title { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 4px; }
.onboard-sub   { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.field         { display: block; margin-bottom: 14px; }
.field-label   { font-family: 'Geist Mono', ui-monospace; font-size: 11px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.input         { width: 100%; border: 1.5px solid var(--line); background: white; padding: 12px 14px; font-size: 16px; outline: none; font-family: inherit; }
.input:focus   { background: var(--paper); }
.code-input    { font-family: 'Geist Mono', ui-monospace; font-size: 22px; letter-spacing: 0.2em; text-align: center; font-weight: 700; }
.color-row     { display: flex; align-items: center; gap: 12px; }
.onboard-foot  { margin-top: 14px; text-align: center; }

/* Player header */
.player-header { border-bottom: 1.5px solid var(--line); background: var(--paper); }
.ph-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.ph-me  { display: flex; align-items: center; gap: 9px; }
.ph-name { font-weight: 600; font-size: 15px; }
.ph-rank { font-size: 12px; color: var(--muted); font-family: 'Geist Mono', ui-monospace; }
.ph-worth { text-align: right; }
.ph-worth-label { font-family: 'Geist Mono', ui-monospace; font-size: 10px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.ph-worth-val   { font-family: 'Geist Mono', ui-monospace; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Progress dots */
.ph-progress { display: flex; align-items: center; gap: 5px; padding: 8px 16px 11px; }
.progress-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: white;
  flex-shrink: 0;
  transition: background .3s;
}
.progress-dot.done   { background: var(--up);  border-color: var(--up); }
.progress-dot.active { background: var(--ink); border-color: var(--ink); }
.ph-round-label { font-family: 'Geist Mono', ui-monospace; font-size: 11px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; margin-left: 5px; }

/* Player body */
.player-body { flex: 1; display: flex; flex-direction: column; }
.lobby-msg { padding: 40px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lobby-msg-icon  { font-size: 38px; margin-bottom: 8px; }
.lobby-msg-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.lobby-msg-sub   { color: var(--muted); margin-bottom: 16px; }

/* Summary strip */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1.5px solid var(--line);
  background: var(--paper);
}
.summary-cell { padding: 9px 10px; border-right: 1px dashed var(--faint); text-align: center; }
.summary-cell:last-child { border-right: none; }
.summary-label { font-family: 'Geist Mono', ui-monospace; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.summary-val   { font-family: 'Geist Mono', ui-monospace; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-val.up   { color: var(--up); }
.summary-val.down { color: var(--down); }

/* Worth chart */
.worth-chart-wrap {
  padding: 12px 14px 8px;
  background: var(--paper);
  border-bottom: 1.5px solid var(--line);
}
.worth-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.worth-chart-title  { font-family: 'Geist Mono', ui-monospace; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.worth-chart-badge  { font-family: 'Geist Mono', ui-monospace; font-size: 14px; font-weight: 700; }
.worth-chart-badge.up   { color: var(--up); }
.worth-chart-badge.down { color: var(--down); }
.worth-chart-badge-abs  { font-size: 11px; font-weight: 500; opacity: 0.75; }

/* Lock zone */
.lock-zone {
  padding: 12px 16px 9px;
  border-bottom: 1.5px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.lock-btn {
  background: var(--ink);
  color: white;
  border: 1.5px solid var(--line);
  padding: 15px 30px;
  font-size: 17px;
  font-weight: 700;
  width: 100%;
  letter-spacing: -0.01em;
  transition: transform .12s;
}
.lock-btn:hover  { transform: translateY(-1px); }
.locked-badge    { width: 100%; text-align: center; background: var(--up); color: white; border: 1.5px solid var(--up); padding: 13px 18px; font-size: 14px; font-weight: 600; }
.lock-hint       { font-size: 12px; text-align: center; }

/* Tabs */
.tab-row { display: flex; border-bottom: 1.5px solid var(--line); }
.tab {
  flex: 1;
  padding: 13px 0;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--ink); border-bottom-color: var(--ink); background: var(--paper); }
.badge {
  display: inline-block;
  background: var(--ink);
  color: white;
  font-size: 10px;
  padding: 1px 5px;
  margin-left: 4px;
  font-family: 'Geist Mono', ui-monospace;
}

/* ============================================================
   EVENT CARDS (player view)
   ============================================================ */
.event-card-wrap {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.event-card {
  border: 1.5px solid var(--line);
  background: var(--ink);
  color: white;
  padding: 20px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.event-card.auto { background: white; color: var(--ink); border: 1.5px solid var(--line); }
.event-card-type { /* uses .event-type-badge */ }
.event-card-headline { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
.event-card-body {
  font-size: 14px;
  line-height: 1.65;
  opacity: 0.82;
  flex: 1;
}
.event-card.auto .event-card-body { opacity: 1; color: var(--muted); }
.event-auto-banner {
  background: #f0faf5;
  border: 1.5px solid #1f7a4d;
  padding: 10px 14px;
  color: #1f7a4d;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}
.event-card-math {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 10px 14px;
  border-radius: 2px;
  flex-wrap: wrap;
}
.event-card.auto .event-card-math { background: var(--paper); border-color: var(--faint); }
.ecm-item { display: flex; flex-direction: column; gap: 2px; }
.ecm-label {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
}
.ecm-val {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ecm-val.highlight { color: #4ade80; }
.event-card.auto .ecm-val.highlight { color: var(--up); }
.ecm-sep { opacity: 0.3; font-size: 18px; }

/* Choice buttons */
.event-choice-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.choice-btn {
  flex: 1;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: transparent;
  color: white;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background .15s, transform .12s;
}
.choice-btn.accept { background: #1f7a4d; border-color: #1f7a4d; }
.choice-btn.reject { background: rgba(255,255,255,0.08); }
.choice-btn:hover  { filter: brightness(1.15); transform: translateY(-1px); }

/* IPO amount buttons */
.ipo-amounts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.ipo-amount-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border: 1.5px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
  color: white;
  font-size: 15px;
  font-weight: 600;
  transition: background .15s, transform .12s;
}
.ipo-amount-btn:hover { background: rgba(255,255,255,0.12); transform: translateY(-1px); }
.ipo-amount-btn .ipo-shares {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 12px;
  opacity: 0.6;
}
.ipo-reject-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  padding: 10px;
  font-size: 13px;
  width: 100%;
  margin-top: 4px;
  transition: color .15s;
}
.ipo-reject-btn:hover { color: white; }

.event-waiting { text-align: center; padding: 14px; font-size: 14px; opacity: 0.6; font-style: italic; }

/* ============================================================
   TRADE CARDS (player)
   ============================================================ */
.trade-list        { display: flex; flex-direction: column; }
.trade-group-label {
  padding: 9px 16px 5px;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper);
  border-bottom: 1px solid var(--faint);
}

.trade-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--faint);
  background: white;
  transition: background .12s;
  cursor: pointer;
}
.trade-card:active { background: rgba(15,23,42,0.02); }
.trade-card.holding {
  border-left: 3px solid var(--up);
  padding-left: 13px;
}

.tc-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.tc-emoji { font-size: 28px; flex-shrink: 0; line-height: 1; }
.tc-info  { flex: 1; min-width: 0; }
.tc-id    {
  font-family: 'Geist Mono', ui-monospace;
  font-weight: 700; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tc-name  { font-size: 12px; color: var(--muted); font-family: 'Geist', ui-sans-serif; font-weight: 400; }
.tc-price-row { display: flex; align-items: baseline; gap: 5px; margin-top: 2px; flex-wrap: wrap; }
.tc-price { font-family: 'Geist Mono', ui-monospace; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tc-delta { font-family: 'Geist Mono', ui-monospace; font-size: 11px; font-weight: 700; }
.tc-delta.up   { color: var(--up); }
.tc-delta.down { color: var(--down); }
.tc-holding {
  display: flex; align-items: center; gap: 4px;
  margin-top: 3px;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px;
  color: var(--muted);
}
.tc-holding.profit { color: var(--up); }
.tc-holding.loss   { color: var(--down); }
.tc-held-pnl { font-size: 11px; }

.tc-btns { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.tc-buy-btn, .tc-sell-btn {
  padding: 9px 16px;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  border: 1.5px solid; border-radius: 6px;
  min-width: 64px; text-align: center;
  transition: transform .1s, filter .1s;
}
.tc-buy-btn       { background: var(--up);   color: white; border-color: var(--up); }
.tc-buy-btn.cant  { background: var(--faint); color: var(--muted); border-color: var(--faint); cursor: not-allowed; }
.tc-buy-btn:not(.cant):active { transform: scale(0.95); }
.tc-sell-btn      { background: white; color: var(--down); border-color: var(--down); }
.tc-sell-btn:active { background: var(--down); color: white; transform: scale(0.95); }

/* ============================================================
   TRADE SHEET (bottom drawer)
   ============================================================ */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.52);
  z-index: 200;
  display: flex; align-items: flex-end;
  animation: fade-in 0.2s ease;
}
.trade-sheet {
  width: 100%;
  max-height: 94vh;
  background: white;
  border-radius: 18px 18px 0 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom, 10px);
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.sheet-handle-bar {
  width: 36px; height: 4px;
  background: #d8d5ce; border-radius: 2px;
  margin: 7px auto 2px;
}

.sheet-header {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px 8px;
  border-bottom: 1px solid var(--faint);
}
.sheet-emoji      { font-size: 26px; flex-shrink: 0; line-height: 1; }
.sheet-stock-info { flex: 1; min-width: 0; }
.sheet-ticker {
  font-family: 'Geist Mono', ui-monospace;
  font-weight: 700; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-sname  { font-size: 12px; color: var(--muted); font-family: 'Geist', ui-sans-serif; font-weight: 400; }
.sheet-price-row { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.sheet-price  { font-family: 'Geist Mono', ui-monospace; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet-delta  { font-family: 'Geist Mono', ui-monospace; font-size: 12px; font-weight: 700; }
.sheet-delta.up   { color: var(--up); }
.sheet-delta.down { color: var(--down); }
.sheet-close-btn {
  font-size: 15px; color: var(--muted);
  padding: 6px; flex-shrink: 0;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--faint);
}
.sheet-close-btn:hover { color: var(--ink); background: var(--paper); }

.sheet-balance {
  padding: 5px 16px;
  font-size: 12px; color: var(--muted);
  background: var(--paper);
  border-bottom: 1px solid var(--faint);
}
.sheet-balance b          { color: var(--ink); font-weight: 700; }
.sheet-balance-held       { color: var(--muted); }

.sheet-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1.5px solid var(--faint);
}
.sheet-tab {
  padding: 9px 0;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 12px; font-weight: 700; letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.sheet-tab.buy.active   { color: var(--up);   border-bottom-color: var(--up); }
.sheet-tab.sell.active  { color: var(--down); border-bottom-color: var(--down); }
.sheet-tab.dimmed       { opacity: 0.35; cursor: not-allowed; }

/* Quantity picker */
.sheet-qty-row {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; padding: 10px 18px 4px;
}
.sheet-nudge {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--paper);
  font-size: 22px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .1s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.sheet-nudge:active { transform: scale(0.88); background: var(--faint); }
.sheet-qty-num {
  font-family: 'Geist Mono', ui-monospace;
  font-size: 46px; font-weight: 700; letter-spacing: -0.04em;
  min-width: 100px; text-align: center;
  font-variant-numeric: tabular-nums; line-height: 1;
}

/* Quick-add preset row */
.sheet-presets {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 3px 16px 6px;
  justify-content: center;
}
.sheet-preset {
  height: 30px; padding: 0 11px;
  border: 1.5px solid var(--line); background: var(--paper);
  font-family: 'Geist Mono', ui-monospace;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em;
  border-radius: 6px; flex-shrink: 0;
  transition: background .1s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.sheet-preset:active       { transform: scale(0.92); }
.sheet-preset.max          { background: var(--ink); color: white; border-color: var(--ink); }
.sheet-preset.max:active   { filter: brightness(1.25); }
.sheet-preset.clear        { background: var(--faint); color: var(--muted); border-color: var(--faint); }

.sheet-hint {
  text-align: center;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 10.5px; color: var(--muted);
  padding: 0 16px 5px; letter-spacing: 0.04em;
}

/* Summary box */
.sheet-summary {
  margin: 2px 16px 6px;
  background: var(--paper); border: 1px solid var(--faint);
  border-radius: 9px; padding: 7px 13px;
  display: flex; flex-direction: column; gap: 4px;
}
.sheet-sum-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
.sheet-sum-row span { color: var(--muted); }
.sheet-sum-row b    { font-family: 'Geist Mono', ui-monospace; font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet-sum-row b.warn { color: var(--down); }

/* Confirm button */
.sheet-confirm {
  display: block;
  width: calc(100% - 32px);
  margin: 3px 16px 12px;
  padding: 12px 14px;
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 700; letter-spacing: -0.01em;
  text-align: center;
  transition: transform .1s, filter .1s;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.sheet-confirm.buy      { background: var(--up);   color: white; }
.sheet-confirm.sell     { background: var(--down); color: white; }
.sheet-confirm.disabled { background: var(--faint); color: var(--muted); cursor: not-allowed; }
.sheet-confirm:not(.disabled):active { transform: scale(0.97); }

/* ============================================================
   TRADE TOAST (success flash)
   ============================================================ */
.trade-toast {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 28px;
  border-radius: 0 0 18px 18px;
  min-width: 260px; max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  animation: toast-drop 0.35s cubic-bezier(0.32, 0.72, 0, 1),
             toast-fade-out 0.4s ease 2.4s forwards;
}
@keyframes toast-drop {
  from { transform: translateX(-50%) translateY(-110%); }
  to   { transform: translateX(-50%) translateY(0); }
}
@keyframes toast-fade-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
.trade-toast.toast-buy  { background: var(--up);   color: white; }
.trade-toast.toast-sell { background: var(--down); color: white; }
.tt-icon     { font-size: 30px; flex-shrink: 0; }
.tt-headline { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.tt-sub      { font-family: 'Geist Mono', ui-monospace; font-size: 12px; opacity: 0.85; margin-top: 2px; }

/* ============================================================
   PORTFOLIO (player)
   ============================================================ */
.portfolio-list { display: flex; flex-direction: column; }
.portfolio-row  { display: flex; flex-direction: column; gap: 7px; padding: 12px 16px; border-bottom: 1px dashed var(--faint); }
.pf-top { display: flex; align-items: center; gap: 11px; }
.pf-qty { font-family: 'Geist Mono', ui-monospace; font-size: 11px; color: var(--muted); margin-top: 2px; }
.pf-total { text-align: right; }
.pf-total-val { font-family: 'Geist Mono', ui-monospace; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-pnl       { font-family: 'Geist Mono', ui-monospace; font-size: 12px; font-weight: 600; }
.pf-pnl.up    { color: var(--up); }
.pf-pnl.down  { color: var(--down); }

.pf-prices {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--paper);
  border: 1px solid var(--faint);
  padding: 7px 10px;
  border-radius: 2px;
}
.pf-price-cell  { display: flex; flex-direction: column; gap: 2px; }
.pf-price-label { font-family: 'Geist Mono', ui-monospace; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pf-price-val   { font-family: 'Geist Mono', ui-monospace; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pf-price-val.up   { color: var(--up); }
.pf-price-val.down { color: var(--down); }
.pf-price-arrow { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.pf-pct-badge {
  margin-left: auto;
  font-family: 'Geist Mono', ui-monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 2px;
  flex-shrink: 0;
}
.pf-pct-badge.up   { background: #e8f5ee; color: var(--up); }
.pf-pct-badge.down { background: #fdf0ef; color: var(--down); }

.portfolio-footer {
  padding: 12px 16px;
  border-top: 1.5px solid var(--line);
  background: var(--paper);
  font-family: 'Geist Mono', ui-monospace;
  font-size: 12px;
  color: var(--up);
}

.empty { padding: 50px 22px; text-align: center; color: var(--muted); font-size: 14px; }

/* ============================================================
   PLAYER NEWS (events tab)
   ============================================================ */
.player-news { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.player-news-item { border: 1.5px solid var(--line); padding: 14px; }
.pn-round    { font-family: 'Geist Mono', ui-monospace; font-size: 10px; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 6px; }
.pn-headline { font-size: 15px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.pn-body     { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ============================================================
   ENDED (player)
   ============================================================ */
.ended-body  { align-items: center; justify-content: center; padding: 32px 20px; }
.ended-card  { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.ended-eyebrow  { font-family: 'Geist Mono', ui-monospace; font-size: 11px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.ended-rank     { font-family: 'Geist Mono', ui-monospace; font-size: 40px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 14px; }
.ended-name     { font-size: 17px; font-weight: 600; margin-top: 4px; }
.ended-grade    { font-family: 'Geist Mono', ui-monospace; font-size: 64px; font-weight: 700; letter-spacing: -0.04em; }
.ended-worth    { font-family: 'Geist Mono', ui-monospace; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.ended-profit   { font-family: 'Geist Mono', ui-monospace; font-weight: 600; }
.ended-profit.up   { color: var(--up); }
.ended-profit.down { color: var(--down); }
.ended-divs     { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .host-body   { grid-template-columns: 1fr 260px; }
  .hero-row    { grid-template-columns: 44px 160px 1fr auto; gap: 10px; }
  .hr-worth    { font-size: 14px; }
  .hero-worth  { font-size: 18px; }
}
@media (max-width: 860px) {
  .host-body       { grid-template-columns: 1fr; }
  .host-header     { grid-template-columns: 1fr; gap: 10px; text-align: center; }
  .header-right    { align-items: center; }
  .hero-row        { grid-template-columns: 40px 1fr auto; }
  .hr-portfolio    { display: none; }
  .event-phase-headline { font-size: 26px; }
  .event-phase-body     { font-size: 14px; }
  .eqn-val              { font-size: 20px; }
}
@media (max-width: 600px) {
  .role-row        { grid-template-columns: 1fr; }
  .landing-card    { padding: 28px 22px; }
  .landing-title   { font-size: 36px; }
  .how-grid        { grid-template-columns: 1fr; }
  .lobby-overlay   { padding: 22px 16px; }
}
