/* === Round Table Sportsbook · Centerpiece === */
:root {
  --bg-base: #08070b;
  --bg-deep: #050407;
  --bg-surface: #0e1019;
  --bg-elevated: #161927;
  --line: rgba(240, 198, 116, 0.14);
  --line-soft: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(240, 198, 116, 0.32);
  --text: #ece7da;
  --text-mute: #8a8378;
  --text-faint: #4d473d;
  --gold: #f0c674;
  --gold-soft: #d4a93f;
  --gold-dim: #8a6c2a;
  --home: #5fc6a0;
  --away: #ec7777;
  --draw: #b3b8c3;
  --success: #34d399;
  --danger: #f87171;
  --info: #60a5fa;
  --tier-a: #f0c674;
  --tier-b: #5fc6a0;
  --tier-c: #60a5fa;
  --tier-d: #b3b8c3;
  --tier-e: #c084fc;
  --tier-f: #ec7777;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  background: radial-gradient(ellipse at 50% 65%, #14131a 0%, #08070b 55%, #04030a 100%);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.serif { font-family: 'Cormorant Garamond', serif; }
button { font-family: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* === App fills viewport, table is the centerpiece === */
.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* === Slim topbar (translucent, no longer a full panel) === */
.topbar {
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 7, 11, 0.5);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  font-size: 12px;
  pointer-events: auto;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark {
  width: 14px; height: 14px;
  border: 1px solid var(--gold);
  position: relative;
  transform: rotate(45deg);
  flex-shrink: 0;
}
.brand-mark::after {
  content: ''; position: absolute; inset: 2px; background: var(--gold);
}
.brand-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600; font-size: 15px;
}
.brand-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.topbar-sep { width: 1px; height: 18px; background: var(--line); }
.topbar-team {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.topbar-vs {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-mute);
}
.topbar-spacer { flex: 1; }
.topbar-odds {
  display: flex; gap: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-mute);
}
.topbar-odds-cell {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.topbar-odds-cell strong { color: var(--gold); font-weight: 500; }

.live-pulse {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--success);
}
.live-pulse::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  50% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

.scenarios {
  display: flex;
  gap: 4px;
}
.scenario-pill {
  padding: 4px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text-mute);
  background: transparent;
}
.scenario-pill.active { color: var(--gold); border-color: var(--gold); }

/* === Hero strip below topbar (compact, always visible) === */
.hero-strip {
  position: absolute;
  top: 218px; left: 50%;     /* sit below the live pipeline progress bar */
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  pointer-events: none;
}
.hero-strip-cell {
  background: rgba(8, 7, 11, 0.85);
  backdrop-filter: blur(14px);
  padding: 8px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 110px;
}
.hero-strip-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero-strip-tag--home { color: var(--home); }
.hero-strip-tag--draw { color: var(--draw); }
.hero-strip-tag--away { color: var(--away); }
.hero-strip-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.hero-strip-num span { font-size: 12px; color: var(--text-mute); }
.hero-strip-delta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text-faint);
}
.hero-strip-delta.up { color: var(--success); }
.hero-strip-delta.down { color: var(--danger); }

/* === The room (full-viewport table stage) === */
.room {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.room canvas { display: block; width: 100% !important; height: 100% !important; }
.zoom-controls { display: none; }
.agent-bubble-3d {
  position: absolute;
  transform: translate(-50%, -100%);
  background: #f5ecd6;
  color: #1a1208;
  padding: 4px 8px;
  border-radius: 3px 3px 3px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  animation: bubble-life-3d 4s ease-out forwards;
}
@keyframes bubble-life-3d {
  0% { opacity: 0; transform: translate(-50%, -90%); }
  10%, 80% { opacity: 1; transform: translate(-50%, -110%); }
  100% { opacity: 0; transform: translate(-50%, -130%); }
}
.agent-nameplate {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: rgba(245, 236, 214, 0.78);
  background: rgba(8, 6, 12, 0.78);
  border: 1px solid rgba(240, 198, 116, 0.18);
  border-radius: 1px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  text-transform: uppercase;
}
.agent-nameplate .np-id { color: rgba(240, 198, 116, 0.55); font-size: 8.5px; }
.agent-nameplate.tier-A { border-color: rgba(240, 198, 116, 0.55); color: #f0c674; }
.agent-nameplate.tier-B { border-color: rgba(95, 198, 160, 0.4); color: #b8e8d2; }
.agent-nameplate.tier-C { border-color: rgba(96, 165, 250, 0.4); color: #c8dcfa; }
.agent-nameplate.tier-D { border-color: rgba(179, 184, 195, 0.25); color: #c8c8d0; }
.agent-nameplate.tier-E { border-color: rgba(192, 132, 252, 0.45); color: #e0c8fa; }
.agent-nameplate.tier-F { border-color: rgba(236, 119, 119, 0.4); color: #f5b8b8; }
.agent-nameplate.working {
  background: rgba(240, 198, 116, 0.18);
  border-color: #f0c674;
  color: #fff8e8;
  box-shadow: 0 0 14px rgba(240, 198, 116, 0.45);
  z-index: 6;
  animation: np-pulse 1.6s ease-in-out infinite;
}
@keyframes np-pulse {
  0%, 100% { box-shadow: 0 0 14px rgba(240, 198, 116, 0.45); }
  50%      { box-shadow: 0 0 26px rgba(240, 198, 116, 0.85); }
}
.agent-nameplate { transition: opacity .35s ease, transform .35s ease; cursor: pointer; pointer-events: auto; }
.agent-nameplate:hover { transform: translate(-50%, -55%) scale(1.06); border-color: #f0c674; color: #fff8e8; }

/* World Cup 2026 ambient branding overlay */
.wc26-watermark {
  position: absolute; left: 50%; top: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  font-family: 'Cormorant Garamond', serif;
  color: rgba(240, 198, 116, 0.55);
  letter-spacing: 0.32em;
  font-size: 11px;
  text-transform: uppercase;
  pointer-events: none; z-index: 3;
}
.wc26-watermark .num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 500; letter-spacing: 0;
  color: #f0c674;
  border-top: 1px solid rgba(240, 198, 116, 0.4);
  border-bottom: 1px solid rgba(240, 198, 116, 0.4);
  padding: 2px 12px;
}
.wc26-watermark .hosts {
  display: flex; gap: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  color: rgba(255,255,255,0.5);
}
.wc26-watermark .hosts span { padding: 0 6px; border-left: 1px solid rgba(240,198,116,0.2); }
.wc26-watermark .hosts span:first-child { border-left: none; }

/* corner trophy mark */
.wc26-trophy {
  position: absolute; left: 22px; bottom: 22px;
  width: 92px; opacity: 0.42;
  pointer-events: none; z-index: 3;
}
.wc26-trophy svg { display: block; width: 100%; }

/* click ripple emitter (mounted at click coords) */
.click-ripple {
  position: absolute; pointer-events: none;
  width: 12px; height: 12px;
  border: 1px solid rgba(240, 198, 116, 0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ripple-out 700ms ease-out forwards;
  z-index: 8;
}
@keyframes ripple-out {
  0%   { width: 12px; height: 12px; opacity: 1; border-width: 2px; }
  100% { width: 240px; height: 240px; opacity: 0; border-width: 1px; }
}
/* Floor + walls vibe */
.room::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 78%, rgba(240, 198, 116, 0.08), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(95, 198, 160, 0.025), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
/* Stars */
.room::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 14%, rgba(240,198,116,0.6), transparent),
    radial-gradient(1px 1px at 78% 22%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 35% 8%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 62% 12%, rgba(240,198,116,0.4), transparent),
    radial-gradient(1px 1px at 12% 32%, rgba(255,255,255,0.3), transparent);
  pointer-events: none;
  opacity: 0.6;
}

/* Zoom/pan transform layer */
.zoom {
  position: absolute;
  top: 50%; left: 50%;
  transform-origin: 50% 50%;
  width: 0; height: 0;
  transition: transform 0.5s var(--ease);
  z-index: 1;
}
.zoom.dragging { transition: none; }

/* === The round table (3D tilted disc) === */
.table-stage {
  position: absolute;
  top: 50%; left: 50%;
  width: 1200px; height: 1200px;
  margin-left: -600px;
  margin-top: -600px;
  perspective: 2400px;
  transform-style: preserve-3d;
}
.table-tilt {
  position: relative;
  width: 100%; height: 100%;
  transform: rotateX(58deg);
  transform-style: preserve-3d;
  transition: transform 1.2s var(--ease);
}

/* Concentric ring guides */
.ring {
  position: absolute;
  top: 50%; left: 50%;
  border: 1px solid rgba(240, 198, 116, 0.08);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.ring.major { border-color: rgba(240, 198, 116, 0.18); border-style: dashed; }

/* The wooden disc */
.table-disc {
  position: absolute;
  top: 50%; left: 50%;
  width: 720px; height: 720px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 50% 40%, rgba(60, 42, 22, 0.95), rgba(28, 18, 10, 0.98) 65%, rgba(12, 8, 5, 1) 100%);
  border: 1px solid var(--gold-dim);
  box-shadow:
    inset 0 0 0 2px rgba(240, 198, 116, 0.05),
    inset 0 0 0 14px rgba(240, 198, 116, 0.03),
    inset 0 0 120px rgba(0, 0, 0, 0.7),
    0 40px 120px rgba(0, 0, 0, 0.7);
}
.table-disc-ring {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px dashed rgba(240, 198, 116, 0.18);
}
.table-disc-ring2 {
  position: absolute;
  inset: 60px;
  border-radius: 50%;
  border: 1px solid rgba(240, 198, 116, 0.06);
}
/* Gold center seal */
.table-seal {
  position: absolute;
  top: 50%; left: 50%;
  width: 380px; height: 380px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, rgba(240, 198, 116, 0.18), rgba(60, 42, 22, 0.4) 70%, transparent);
  border: 1px solid rgba(240, 198, 116, 0.28);
  box-shadow: inset 0 0 60px rgba(240, 198, 116, 0.12);
}

/* === Football pitch in the center (top-down view, sits on table) === */
.pitch {
  position: absolute;
  top: 50%; left: 50%;
  width: 320px; height: 200px;
  transform: translate(-50%, -50%);
  background:
    repeating-linear-gradient(90deg,
      rgba(34, 96, 64, 0.95) 0px,
      rgba(34, 96, 64, 0.95) 32px,
      rgba(28, 84, 56, 0.95) 32px,
      rgba(28, 84, 56, 0.95) 64px);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 3px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.pitch-line { position: absolute; background: rgba(255, 255, 255, 0.85); }
.pitch-mid { left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-1px); }
.pitch-circle {
  position: absolute;
  top: 50%; left: 50%;
  width: 56px; height: 56px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
}
.pitch-spot {
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  transform: translate(-50%, -50%);
}
.pitch-box {
  position: absolute;
  top: 50%;
  width: 50px; height: 100px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  transform: translateY(-50%);
}
.pitch-box.left { left: 0; border-left: none; }
.pitch-box.right { right: 0; border-right: none; }
.pitch-box-small {
  position: absolute;
  top: 50%;
  width: 22px; height: 56px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  transform: translateY(-50%);
}
.pitch-box-small.left { left: 0; border-left: none; }
.pitch-box-small.right { right: 0; border-right: none; }

/* Ball + dots */
.ball {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(255,255,255,0.8);
  transform: translate(-50%, -50%);
  animation: ball-roam 7s ease-in-out infinite;
}
@keyframes ball-roam {
  0% { left: 50%; top: 50%; }
  20% { left: 70%; top: 35%; }
  35% { left: 82%; top: 50%; }
  50% { left: 60%; top: 65%; }
  70% { left: 30%; top: 60%; }
  85% { left: 18%; top: 40%; }
  100% { left: 50%; top: 50%; }
}
.player-dot {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(0,0,0,0.3);
}
.player-dot.home { background: #ffd23b; }
.player-dot.away { background: #76e1ff; }

/* Pitch overlay HUD inside pitch */
.pitch-score {
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  letter-spacing: 0.2em;
}

/* === Humanoid agent figures around the table === */
.agent {
  position: absolute;
  top: 50%; left: 50%;
  cursor: pointer;
  transition: opacity 0.5s var(--ease), filter 0.4s var(--ease);
  opacity: 0.32;
}
.agent.lit { opacity: 1; }
.agent.working { z-index: 5; }
.agent:not(.lit) { filter: grayscale(0.85) brightness(0.7); }
.agent-figure {
  position: relative;
  /* counter-rotate the table tilt so figures stand up */
  transform: rotateX(-58deg);
  transform-origin: center bottom;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.agent-figure svg {
  display: block;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}
.agent.working .agent-figure svg {
  animation: figure-bob 1.4s ease-in-out infinite;
}
@keyframes figure-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Tier ring on the floor under each agent (a chair/zone marker) */
.agent-base {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.3;
  pointer-events: none;
}
.agent[data-tier="A"] .agent-base { color: var(--tier-a); }
.agent[data-tier="B"] .agent-base { color: var(--tier-b); }
.agent[data-tier="C"] .agent-base { color: var(--tier-c); }
.agent[data-tier="D"] .agent-base { color: var(--tier-d); }
.agent[data-tier="E"] .agent-base { color: var(--tier-e); }
.agent[data-tier="F"] .agent-base { color: var(--tier-f); }

/* Label + role underneath figure */
.agent-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) rotateX(-58deg);
  transform-origin: center top;
  margin-top: 2px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
.agent-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text);
  letter-spacing: 0.04em;
  font-weight: 500;
  background: rgba(8, 7, 11, 0.7);
  padding: 1px 5px;
  border-radius: 2px;
  border: 1px solid var(--line);
}
.agent-role {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: var(--text-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 1px;
}
.agent:not(.lit) .agent-name,
.agent:not(.lit) .agent-role { display: none; }

/* Bubble (speech) over agent's head */
.agent-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -10px) rotateX(-58deg);
  transform-origin: center bottom;
  background: #f5ecd6;
  color: #1a1208;
  padding: 4px 8px;
  border-radius: 3px 3px 3px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  animation: bubble-life 4s ease-out forwards;
}
@keyframes bubble-life {
  0% { opacity: 0; transform: translate(-50%, 0) rotateX(-58deg); }
  10%, 80% { opacity: 1; transform: translate(-50%, -10px) rotateX(-58deg); }
  100% { opacity: 0; transform: translate(-50%, -20px) rotateX(-58deg); }
}

/* Real/mock dot (bottom-right of figure) */
.agent-real-dot {
  position: absolute;
  bottom: -2px; right: -4px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}
.agent[data-real="true"] .agent-real-dot {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* Working halo (when agent is currently working) */
.agent-halo {
  position: absolute;
  top: 0; left: 50%;
  width: 40px; height: 40px;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotateX(-58deg);
  pointer-events: none;
  background: radial-gradient(circle, rgba(240, 198, 116, 0.5), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.agent.working .agent-halo { opacity: 1; animation: halo-pulse 1.4s ease-in-out infinite; }
@keyframes halo-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) rotateX(-58deg) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) rotateX(-58deg) scale(1.4); }
}

/* === Chips at center === */
.chip {
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}
.chip.attack { background: #ec7777; }
.chip.defense { background: #60a5fa; }
.chip.hfa { background: #f0c674; }
.chip.goals { background: #c084fc; }
.chip.draw { background: #5fc6a0; }

/* === Team flags (left/right of pitch) === */
.team-banner {
  position: absolute;
  top: 50%;
  width: 100px; height: 70px;
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  background: rgba(8, 7, 11, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: 'Cormorant Garamond', serif;
  z-index: 5;
  transform: translateY(-50%);
}
.team-banner-name { font-size: 17px; font-weight: 600; }
.team-banner-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--text-mute);
  text-transform: uppercase;
}
.team-banner.home {
  left: -210px;
  border-color: var(--home);
  color: var(--home);
}
.team-banner.away {
  right: -210px;
  border-color: var(--away);
  color: var(--away);
}

/* === Center HUD overlay (always faces camera) === */
.center-hud {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% + 130px));
  z-index: 8;
  text-align: center;
  pointer-events: none;
}
.center-hud-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.center-hud-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-top: 2px;
}

/* === Empty state center call === */
.table-cta {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  text-align: center;
  background: rgba(8, 7, 11, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 22px 30px;
  pointer-events: auto;
}
.table-cta-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}
.table-cta-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.table-cta-btn {
  background: linear-gradient(180deg, #1f1810, #100c08);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 10px 22px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.table-cta-btn:hover {
  background: linear-gradient(180deg, #2c2316, #19140d);
  box-shadow: 0 0 24px rgba(240, 198, 116, 0.3);
}

/* === Zoom controls (deprecated, OrbitControls handles it) === */
.zoom-controls {
  display: none !important;
  position: absolute;
  bottom: 24px; left: 24px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(8, 7, 11, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px;
}
.zoom-btn {
  width: 30px; height: 30px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.zoom-btn:hover { border-color: var(--gold); color: var(--gold); }
.zoom-readout {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text-faint);
  text-align: center;
  letter-spacing: 0.12em;
  padding: 2px 0;
}

/* === Drawer system (collapsible side panels) === */
.drawer-tab {
  position: absolute;
  z-index: 30;
  background: rgba(8, 7, 11, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  color: var(--text-mute);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.drawer-tab:hover { color: var(--gold); border-color: var(--gold-dim); }
.drawer-tab.active { color: var(--gold); border-color: var(--gold); background: rgba(240, 198, 116, 0.08); }

.drawer-tab.right {
  top: 50%;
  right: 0;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  border-right: none;
  border-radius: 4px 0 0 4px;
  padding: 16px 6px;
  letter-spacing: 0.2em;
}
.drawer-tab.right .drawer-tab-glyph { transform: rotate(90deg); }

.drawer-tabs-bottom {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 6px;
}

.drawer {
  position: absolute;
  z-index: 36;
  background: rgba(8, 7, 11, 0.92);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform 0.4s var(--ease);
  overflow: hidden;
}
.drawer.right {
  top: 14px; right: 14px; bottom: 14px;
  width: 420px;
  border-radius: 6px;
  transform: translateX(440px);
}
.drawer.right.open { transform: translateX(0); }

.drawer.bottom {
  left: 14px; right: 14px; bottom: 14px;
  height: 64vh;
  border-radius: 6px;
  transform: translateY(110%);
}
.drawer.bottom.open { transform: translateY(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.drawer-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
}
.drawer-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.drawer-close {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-mute);
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 18px;
}

/* Drawer tabs (when one drawer hosts multiple sections) */
.drawer-tabs {
  display: flex;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line-soft);
}
.drawer-tab-btn {
  flex: 1;
  background: rgba(8, 7, 11, 0.6);
  border: none;
  color: var(--text-mute);
  padding: 10px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.drawer-tab-btn.active {
  color: var(--gold);
  background: rgba(240, 198, 116, 0.06);
}

/* === Section bits used inside drawers === */
.section { margin-bottom: 28px; }
.section-head {
  display: flex; align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
}
.section-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Stats rail (compact, inside intel drawer) */
.stats-rail {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-bottom: 16px;
}
.stat-cell {
  padding: 10px 12px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.stat-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-value.gold { color: var(--gold); }
.stat-value.alive { color: var(--success); }

/* Pipeline (compact stack inside drawer) */
.pipeline {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pipe-step {
  position: relative;
  padding: 8px 10px 8px 36px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-surface);
  transition: all 0.4s var(--ease);
}
.pipe-step .pipe-roman { position: absolute; left: 10px; top: 10px; }
.pipe-step .pipe-num { position: absolute; right: 28px; top: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.pipe-step.active .pipe-num { color: var(--gold); }
.pipe-step.active {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(240, 198, 116, 0.08), var(--bg-surface));
}
.pipe-step.done { border-color: rgba(95, 198, 160, 0.3); }
.pipe-step.done::after {
  content: '✓';
  color: var(--success);
  font-size: 11px;
}
.pipe-roman {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-faint);
}
.pipe-step.active .pipe-roman { color: var(--gold); }
.pipe-label { font-size: 12px; font-weight: 500; }
.pipe-en {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Event row */
.event-row {
  display: grid;
  grid-template-columns: 30px 80px 1fr;
  align-items: baseline;
  gap: 6px;
  padding: 6px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  border-bottom: 1px solid var(--line-soft);
  animation: row-in 0.4s var(--ease);
}
@keyframes row-in {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}
.event-tier { font-weight: 500; }
.event-tier[data-t="A"] { color: var(--tier-a); }
.event-tier[data-t="B"] { color: var(--tier-b); }
.event-tier[data-t="C"] { color: var(--tier-c); }
.event-tier[data-t="D"] { color: var(--tier-d); }
.event-tier[data-t="E"] { color: var(--tier-e); }
.event-tier[data-t="F"] { color: var(--tier-f); }
.event-agent {
  color: var(--text);
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-text { color: var(--text-mute); font-size: 9.5px; }
.event-row.kind-modifier .event-text { color: var(--gold); }
.event-row.kind-predict .event-text { color: var(--success); }

/* Network log */
.netlog-row {
  display: grid;
  grid-template-columns: 38px 28px 1fr 36px;
  gap: 6px;
  align-items: baseline;
  padding: 5px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  border-bottom: 1px solid var(--line-soft);
}
.netlog-time { color: var(--text-faint); }
.netlog-method { color: var(--gold); font-weight: 500; }
.netlog-url {
  color: var(--text);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.netlog-status { text-align: right; font-weight: 500; }
.netlog-status[data-s="200"] { color: var(--success); }
.netlog-status[data-s="429"] { color: var(--danger); }

/* Factor cards (compact in drawer) */
.factor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.factor-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  background: var(--bg-surface);
  display: flex; flex-direction: column; gap: 4px;
}
.factor-card-head { display: flex; justify-content: space-between; align-items: baseline; }
.factor-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-weight: 600;
}
.factor-card-side {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.factor-card-delta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
}
.factor-card-delta.up { color: var(--success); }
.factor-card-delta.down { color: var(--danger); }
.factor-card-delta.flat { color: var(--text-mute); }
.factor-card-body {
  font-size: 10.5px;
  color: var(--text-mute);
  line-height: 1.5;
}
.factor-card-sources {
  margin-top: auto;
  display: flex; flex-wrap: wrap; gap: 3px;
}
.factor-source-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}

/* Monte Carlo */
.mc { padding: 8px 0; }
.mc-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.mc-stat { border-left: 1px solid var(--line); padding-left: 8px; }
.mc-stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.mc-stat-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.mc-stat-num.gold { color: var(--gold); }
.mc-canvas { width: 100%; height: 80px; display: block; }
.mc-axis {
  display: flex; justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: var(--text-faint);
  margin-top: 4px;
  letter-spacing: 0.12em;
}
.mc-scores {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.mc-score { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mc-score-bar {
  width: 100%; background: var(--line-soft); height: 3px; border-radius: 2px; overflow: hidden;
}
.mc-score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
}
.mc-score-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
}
.mc-score-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: var(--text-mute);
}

/* Longform */
.longform {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
}
.longform p { margin: 0 0 12px; }
.longform strong { color: var(--gold); font-weight: 500; }

/* === Modal v2 (agent detail) === */
.modal.v2 {
  background: linear-gradient(180deg, #0d0a14 0%, #07060c 100%);
  border: 1px solid rgba(240, 198, 116, 0.32);
  box-shadow: 0 60px 120px rgba(0,0,0,0.7), 0 0 0 1px rgba(240, 198, 116, 0.08), inset 0 1px 0 rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 0;
  max-width: 920px;
  overflow: hidden;
}
.modal-hero {
  display: flex;
  gap: 22px;
  padding: 28px 32px 22px 32px;
  background:
    radial-gradient(ellipse at top right, rgba(240, 198, 116, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(96, 165, 250, 0.06), transparent 60%);
  border-bottom: 1px solid rgba(240, 198, 116, 0.12);
}
.modal-hero-portrait {
  flex: 0 0 120px;
  width: 120px; height: 140px;
  border: 1px solid rgba(240, 198, 116, 0.24);
  background: #06070b;
  border-radius: 4px;
  overflow: hidden;
}
.modal-hero-info { flex: 1; min-width: 0; padding-top: 4px; }
.modal-hero-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: rgba(240, 198, 116, 0.72);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.modal-hero-eyebrow .dot { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: rgba(240, 198, 116, 0.5); vertical-align: middle; margin: 0 8px; }
.modal-hero-title {
  font-family: 'Cormorant Garamond', 'Source Han Serif SC', serif;
  font-size: 38px;
  line-height: 1;
  font-weight: 500;
  color: #f5ecd6;
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}
.modal-hero-role {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: rgba(220, 220, 230, 0.62);
  margin-bottom: 14px;
}
.modal-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: rgba(220, 220, 230, 0.7);
  border-radius: 2px;
}
.modal-tag.live { color: #5fc6a0; border-color: rgba(95, 198, 160, 0.45); }
.modal-tag.live .tag-dot { width: 6px; height: 6px; border-radius: 50%; background: #5fc6a0; box-shadow: 0 0 8px #5fc6a0; }
.modal-tag.mock { color: #ec7777; border-color: rgba(236, 119, 119, 0.4); }
.modal-tag.mock .tag-dot { width: 6px; height: 6px; border-radius: 50%; background: #ec7777; }
.modal-tag.mono { color: rgba(180,180,200,0.55); }

.modal-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  padding: 1px;
  background: rgba(240, 198, 116, 0.08);
  border-bottom: 1px solid rgba(240, 198, 116, 0.12);
}
.modal-stat {
  background: #0a0810;
  padding: 14px 14px 12px 14px;
}
.ms-label { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: 0.16em; color: rgba(180,180,200,0.5); text-transform: uppercase; margin-bottom: 6px; }
.ms-value { font-family: 'Cormorant Garamond', serif; font-size: 26px; line-height: 1; color: #f5ecd6; margin-bottom: 6px; font-weight: 500; }
.ms-value span { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: rgba(180,180,200,0.5); margin-left: 2px; }
.ms-value.gold { color: #f0c674; }
.ms-value.mint { color: #5fc6a0; }
.ms-value.stakes-A { color: #ec7777; font-size: 18px; }
.ms-value.stakes-B { color: #f0c674; font-size: 18px; }
.ms-value.stakes-C { color: #60a5fa; font-size: 18px; }
.ms-value.stakes-D, .ms-value.stakes-E, .ms-value.stakes-F { color: rgba(180,180,200,0.6); font-size: 18px; }
.ms-bar { height: 2px; background: rgba(255,255,255,0.05); }
.ms-bar > div { height: 100%; }
.ms-sub { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; color: rgba(180,180,200,0.4); margin-top: 4px; }

.modal.v2 .modal-layer { margin: 16px 32px 0; }
.modal.v2 .modal-layer:last-child { margin-bottom: 24px; }
.modal-layer-head { display: flex; align-items: center; gap: 10px; padding: 0 14px 6px; }
.modal-layer-num { font-family: 'Cormorant Garamond', serif; font-size: 18px; color: rgba(240, 198, 116, 0.75); font-style: italic; }
.modal-layer-meta { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: rgba(180,180,200,0.4); }

/* === Modal (legacy, kept for fallback) === */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(5, 4, 7, 0.8);
  backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  animation: fade-in 0.2s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(820px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--bg-surface);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 28px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 80px rgba(240, 198, 116, 0.12);
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-mute);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.modal-head { margin-bottom: 18px; }
.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  display: flex; align-items: center; gap: 12px;
}
.modal-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}
.modal-badge.real { color: var(--success); border: 1px solid var(--success); }
.modal-badge.mock { color: var(--text-faint); border: 1px solid var(--text-faint); }
.modal-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  margin-top: 6px;
}
.modal-layer {
  border-left: 2px solid;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 4px 4px 0;
}
.modal-layer.raw { border-color: var(--success); }
.modal-layer.belief { border-color: var(--gold); }
.modal-layer.modifier { border-color: var(--away); }
.modal-layer-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.modal-layer-body {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}

/* Tier legend (small, lower-right) */
.tier-legend {
  position: absolute;
  bottom: 24px; right: 24px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(8, 7, 11, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 10px;
}
.tier-legend-row {
  display: flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tier-dot { width: 8px; height: 8px; border-radius: 50%; }

/* === Embedded football simulation iframe ===
   The iframe runs at all times so the match keeps streaming, but it is
   visually invisible by default — the user sees only the round-table 3D
   scene with live player dots driven by data forwarded from the iframe.
   When the user expands (double-click pitch / press Z) the iframe fades
   in and covers the viewport with the full simulator (3D camera modes,
   commentary, replay, highlights — everything the standalone /ui has). */
.rt-pitch-frame {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #07101a;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92);
  transform-origin: 50% 50%;
  transition: opacity 0.45s var(--ease), transform 0.55s var(--ease);
}
.rt-pitch-frame iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
  background: #07101a;
}
.rt-pitch-frame.fullscreen {
  pointer-events: auto;
  opacity: 1;
  transform: scale(1);
}
.rt-pitch-frame.fullscreen::after { display: none; }
.rt-pitch-exit {
  position: absolute;
  top: 84px; right: 18px;     /* sit below the v2 topbar */
  z-index: 5;
  background: rgba(8, 7, 11, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
}
.rt-pitch-exit:hover {
  background: rgba(240, 198, 116, 0.18);
  box-shadow: 0 0 20px rgba(240, 198, 116, 0.4);
}

/* When the pitch is expanded, bump the top bar above the iframe (which sits
   at z-index 200) so the user can still reach Players / 2D Lite / Replay /
   Highlights / Stop. */
body:has(.rt-pitch-frame.fullscreen) .topbar {
  z-index: 250 !important;
}

/* === Live pipeline progress bar (real prediction events) === */
.rt-pipe-bar {
  position: absolute;
  top: 78px; left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(820px, 70vw);
  background: rgba(8, 7, 11, 0.85);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px 14px 12px;
  pointer-events: none;
  animation: rt-pipe-fade-in 0.4s var(--ease);
}
@keyframes rt-pipe-fade-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.rt-pipe-bar-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.rt-pipe-bar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.rt-pipe-bar-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
}
.rt-pipe-bar-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.rt-pipe-step {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 8px 6px 10px;
  background: rgba(255,255,255,0.02);
  display: flex; flex-direction: column; gap: 1px;
  transition: all 0.4s var(--ease);
}
.rt-pipe-step.pending { opacity: 0.4; }
.rt-pipe-step.active {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(240, 198, 116, 0.18), rgba(240, 198, 116, 0.04));
  box-shadow: 0 0 14px rgba(240, 198, 116, 0.25);
  animation: rt-pipe-step-pulse 1.6s ease-in-out infinite;
}
@keyframes rt-pipe-step-pulse {
  0%, 100% { box-shadow: 0 0 14px rgba(240, 198, 116, 0.25); }
  50%      { box-shadow: 0 0 22px rgba(240, 198, 116, 0.55); }
}
.rt-pipe-step.done {
  border-color: rgba(95, 198, 160, 0.4);
  opacity: 0.85;
}
.rt-pipe-step.done::after {
  content: '✓';
  position: absolute; top: 4px; right: 8px;
  color: var(--success);
  font-size: 11px;
}
.rt-pipe-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: 0.16em;
}
.rt-pipe-step.active .rt-pipe-num { color: var(--gold); }
.rt-pipe-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.rt-pipe-en {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8.5px;
  color: var(--text-faint);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.rt-pipe-bar-counters {
  display: flex; gap: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  color: var(--text-faint);
  letter-spacing: 0.12em;
}
.rt-pipe-bar-counters strong {
  color: var(--gold);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.rt-pipe-bar-counters .ok { color: var(--success); }
