:root {
  --bg-dark: #090b1a;
  --glass: rgba(11, 16, 33, 0.78);
  --glass-border: rgba(255, 255, 255, 0.14);
  --f1-red: #e10600;
  --f1-red-hover: #ff1e17;
  --gold: #facc15;
  --cyan: #22d3ee;
  --pink: #ec4899;
  --text: #f8fafc;
  --muted: #94a3b8;
  --font-display: 'Chakra Petch', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text);
  font-family: var(--font-body);
  touch-action: none;
}

#gameCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

/* === PAPARAZZI FLASH === */
.flash-overlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 60;
}

/* === PORTRAIT ROTATE OVERLAY === */
.rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(9, 11, 26, 0.96);
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.rotate-overlay.dismissed {
  display: none !important;
}
@media (orientation: portrait) and (max-width: 900px) {
  .rotate-overlay {
    display: flex;
  }
}
.rotate-card {
  max-width: 320px;
  background: #111827;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 28px 22px;
}
.rotate-icon {
  font-size: 46px;
  margin-bottom: 12px;
  display: inline-block;
  animation: tiltPhone 1.8s ease-in-out infinite;
}
@keyframes tiltPhone {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg); }
}
.rotate-card h2 {
  font-family: var(--font-display);
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.rotate-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 18px;
}

/* === MAIN MENU / PADDOCK === */
.menu-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: linear-gradient(90deg, rgba(9, 11, 26, 0.84) 0%, rgba(9, 11, 26, 0.18) 46%, rgba(9, 11, 26, 0.86) 100%);
  pointer-events: none;
}
.menu-screen > * {
  pointer-events: auto;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-badge {
  background: var(--f1-red);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
}
.brand h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(22px, 3.2vw, 34px);
  letter-spacing: 1.5px;
  line-height: 1;
}
.brand h1 span {
  color: var(--gold);
}

.menu-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.music-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--glass);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.music-pill:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
}
.music-pill:active {
  transform: scale(0.97);
}
.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 5px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.toggle-pill input {
  accent-color: #22c55e;
  width: 14px;
  height: 14px;
}
.btn-icon {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: #fff;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
}

.menu-body {
  display: grid;
  grid-template-columns: minmax(220px, 310px) 1fr minmax(240px, 340px);
  align-items: center;
  gap: 12px;
  flex: 1;
  min-height: 0;
  pointer-events: none;
}
.driver-spotlight,
.race-setup {
  pointer-events: auto;
}
.driver-spotlight {
  grid-column: 1;
}
.race-setup {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spotlight-card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 14px;
}
.driver-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.spot-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
  background: #1e293b;
}
.driver-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  min-width: 38px;
}
.driver-header-row h2 {
  font-family: var(--font-display);
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.1;
}
.driver-team {
  font-size: 11px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}
.boss-tag {
  margin-left: auto;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #09090b;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 4px;
}
.driver-quote {
  font-size: 12px;
  font-style: italic;
  color: #e2e8f0;
  margin-bottom: 8px;
  line-height: 1.3;
}

.stat-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-row {
  display: grid;
  grid-template-columns: 62px 1fr 26px;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.stat-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
}
.stat-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #38bdf8, #facc15);
  transition: width 0.25s ease;
}

.panel-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-bottom: 4px;
}

.track-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.track-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass);
  border: 2px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px 11px;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
  text-align: left;
  color: var(--text);
}
.track-card:hover {
  border-color: rgba(255, 255, 255, 0.4);
}
.track-card.selected {
  border-color: var(--gold);
  background: rgba(250, 204, 21, 0.14);
}
.track-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
}
.track-card small {
  font-size: 11px;
  color: var(--muted);
}
.track-pill {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.btn-start {
  background: linear-gradient(135deg, var(--f1-red), #b91c1c);
  border: none;
  color: #fff;
  border-radius: 12px;
  padding: 11px 16px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(225, 6, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.12s, filter 0.12s;
}
.btn-start small {
  font-family: var(--font-body);
  font-size: 10px;
  opacity: 0.88;
  font-weight: 600;
}
.btn-start:active {
  transform: scale(0.97);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
}

.controls-hint {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: var(--muted);
  background: rgba(9, 11, 26, 0.65);
  padding: 6px 8px;
  border-radius: 8px;
}

/* === BOTTOM 12-RACER SCROLL STRIP === */
.roster-bar {
  width: 100%;
}
.racer-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  touch-action: pan-x;
}
.racer-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--glass);
  border: 2px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.racer-chip.selected {
  border-color: var(--gold);
  background: rgba(250, 204, 21, 0.16);
  transform: translateY(-2px);
}
.racer-chip.boss {
  border-color: rgba(245, 158, 11, 0.55);
}
.chip-swatch {
  width: 12px;
  height: 26px;
  border-radius: 4px;
  flex-shrink: 0;
}
.chip-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
  background: #1e293b;
}
.res-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
  background: #1e293b;
}
.chip-info strong {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  white-space: nowrap;
}
.chip-info small {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

/* === F1 5-RED-LIGHTS COUNTDOWN === */
.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 12vh;
  pointer-events: none;
}
.f1-lights-box {
  display: flex;
  gap: 12px;
  background: #09090b;
  border: 3px solid #3f3f46;
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}
.f1-light {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #27272a;
  border: 2px solid #52525b;
  transition: background 0.1s, box-shadow 0.1s;
}
.f1-light.lit {
  background: #ef4444;
  box-shadow: 0 0 22px #ef4444;
}
.f1-light.go {
  background: #22c55e;
  box-shadow: 0 0 24px #22c55e;
}
.countdown-text {
  margin-top: 10px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 700;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.8);
}

/* === IN-RACE HUD === */
.race-hud {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.hud-top-left {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pos-lap-bar {
  display: flex;
  gap: 6px;
}
.pos-box, .lap-box, .time-box {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 4px 9px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
}
.pos-box strong {
  font-size: 22px;
  color: var(--gold);
}
.lap-box strong, .time-box strong {
  font-size: 16px;
}
.lbl {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}

.timing-tower {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 148px;
}
.tower-row {
  display: grid;
  grid-template-columns: 20px 6px 40px 1fr;
  align-items: center;
  gap: 5px;
  background: rgba(9, 11, 26, 0.72);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 11px;
}
.tower-row.player {
  background: rgba(14, 116, 144, 0.88);
  border: 1px solid #38bdf8;
}
.tower-row.player .tower-gap {
  color: #e0f2fe;
}
.tower-row.boss {
  border-left: 2px solid #f59e0b;
}
.tower-color {
  width: 4px;
  height: 11px;
  border-radius: 2px;
}
.tower-gap {
  text-align: right;
  font-size: 10px;
  color: var(--muted);
}

.hud-top-center {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  max-width: 46vw;
}
.event-banner {
  background: rgba(9, 11, 26, 0.9);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--font-display);
  font-size: clamp(11px, 1.8vw, 15px);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.hud-top-right {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: auto;
}
.hud-util-btns {
  display: flex;
  gap: 5px;
}
.hud-mini-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: #fff;
  border-radius: 8px;
  padding: 5px 9px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.minimap-wrap {
  background: rgba(9, 11, 26, 0.65);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 4px;
}

/* === F1 TELEMETRY POD === */
.hud-bottom-center {
  position: absolute;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
}
.telemetry-pod {
  background: rgba(9, 11, 26, 0.82);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 6px 14px 8px;
  min-width: 210px;
  backdrop-filter: blur(8px);
}
.rpm-bar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  margin-bottom: 5px;
}
.rpm-bar span {
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}
.rpm-bar span.g { background: #22c55e; }
.rpm-bar span.r { background: #ef4444; }
.rpm-bar span.b { background: #38bdf8; }

.tel-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gear-pill {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}
.speed-readout {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
}
.speed-readout strong {
  font-size: 28px;
  line-height: 1;
}
.speed-readout span {
  font-size: 10px;
  color: var(--muted);
}
.status-pills {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.badge-drs, .badge-slip {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  opacity: 0.25;
  background: #1e293b;
}
.badge-drs.ready {
  opacity: 1;
  background: #0284c7;
  color: #fff;
}
.badge-drs.active {
  opacity: 1;
  background: #22c55e;
  color: #052e16;
  box-shadow: 0 0 10px #22c55e;
}
.badge-slip.active {
  opacity: 1;
  background: #facc15;
  color: #1c1917;
}

/* === MOBILE / TABLET LANDSCAPE TOUCH CONTROLS === */
.touch-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.touch-left {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  display: flex;
  gap: 10px;
  pointer-events: auto;
}
.touch-right {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  right: max(14px, env(safe-area-inset-right));
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
}
.touch-right-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pedal-row {
  display: flex;
  gap: 8px;
}
.touch-btn {
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 16px;
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: pointer;
}
.touch-btn.pressed {
  transform: scale(0.93);
  background: rgba(56, 189, 248, 0.45);
  border-color: #38bdf8;
}
.steer-btn {
  width: 68px;
  height: 68px;
  font-size: 26px;
}
.item-btn {
  width: 68px;
  height: 68px;
  border-color: rgba(250, 204, 21, 0.6);
  background: rgba(250, 204, 21, 0.18);
}
.item-btn span {
  font-size: 24px;
  line-height: 1;
}
.item-btn small {
  font-size: 10px;
  margin-top: 2px;
}
.item-btn.has-item {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.35);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.45);
}
.drift-btn {
  width: 118px;
  height: 46px;
  font-size: 15px;
  border-color: rgba(236, 72, 153, 0.65);
  background: rgba(236, 72, 153, 0.22);
}
.pedal-btn {
  width: 55px;
  height: 44px;
  font-size: 12px;
}
.brake-btn {
  border-color: rgba(239, 68, 68, 0.6);
}
.gas-btn {
  border-color: rgba(34, 197, 94, 0.6);
}

/* === MODALS (PAUSE & RESULTS) === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(9, 11, 26, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card, .results-card {
  background: #0f172a;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.modal-card h2 {
  font-family: var(--font-display);
  margin-bottom: 16px;
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.results-card {
  max-width: 580px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 12px;
}
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.results-header h2 {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.5vw, 22px);
  margin-top: 4px;
}
.results-pos-badge {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 30px;
  font-weight: 700;
  background: var(--gold);
  color: #09090b;
  padding: 6px 14px;
  border-radius: 10px;
}
.results-table {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 46vh;
  padding-right: 4px;
}
.res-row {
  display: grid;
  grid-template-columns: 32px 26px 1fr 90px 72px;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.res-row.player {
  background: rgba(56, 189, 248, 0.25);
  border: 1px solid #38bdf8;
}
.res-pos {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
}
.res-team {
  font-size: 11px;
  color: var(--muted);
}
.res-time {
  font-family: var(--font-display);
  text-align: right;
}
.results-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.results-actions > button {
  flex: 1;
}

/* === LIVE TV BROADCAST SIMULATION MODE === */
.btn-broadcast {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  color: #e0f2fe;
  border-radius: 12px;
  padding: 9px 14px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.9px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.btn-broadcast:hover {
  border-color: #38bdf8;
  background: linear-gradient(135deg, #172554, #0f172a);
}
.btn-broadcast small {
  font-family: var(--font-body);
  font-size: 9.5px;
  color: #93c5fd;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.btn-broadcast:active {
  transform: scale(0.97);
}

.broadcast-live-bug {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(9, 11, 26, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 3px solid var(--f1-red);
  border-radius: 7px;
  padding: 5px 10px;
  font-family: var(--font-display);
  font-size: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.live-dot-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--f1-red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.8px;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
  animation: livePulse 1.1s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.78); }
}
.tv-brand {
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.9px;
  color: #f8fafc;
}
.tv-lap-readout {
  color: var(--muted);
  font-size: 11px;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}
.tv-lap-readout strong {
  color: var(--gold);
  font-size: 14px;
}
.tv-clock {
  color: #cbd5e1;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Expanded interactive 12-driver F1 TV Timing Tower in Broadcast Mode */
.race-hud.broadcast-mode .timing-tower {
  width: 214px;
  gap: 2px;
  pointer-events: auto;
}
.race-hud.broadcast-mode .tower-row {
  grid-template-columns: 20px 5px 20px 38px 1fr auto;
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
  background: rgba(9, 11, 26, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
}
.race-hud.broadcast-mode .tower-row:hover {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(255, 255, 255, 0.28);
}
.race-hud.broadcast-mode .tower-row.focused {
  background: linear-gradient(90deg, rgba(225, 6, 0, 0.36), rgba(15, 23, 42, 0.92));
  border-color: #f87171;
  transform: translateX(3px);
}
.tower-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.tower-drs {
  font-size: 9px;
  font-weight: 800;
  color: #22d3ee;
  padding: 0 3px;
}
.tower-hint {
  font-size: 10px;
  color: rgba(226, 232, 240, 0.9);
  font-family: var(--font-body);
  background: rgba(9, 11, 26, 0.72);
  padding: 2px 7px;
  border-radius: 4px;
  width: fit-content;
}

.hud-mini-btn.active {
  background: rgba(225, 6, 0, 0.82);
  border-color: #fca5a5;
  color: #fff;
}

/* Broadcast Lower-Third Driver Graphic next to Telemetry Pod */
.race-hud.broadcast-mode .hud-bottom-center {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.broadcast-lower-third {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(9, 11, 26, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid var(--gold);
  border-radius: 11px;
  padding: 8px 14px 8px 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  min-width: 248px;
}
.bc-pos-pill {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  font-weight: 800;
  color: var(--gold);
  min-width: 34px;
  text-align: center;
}
.bc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--gold);
  flex-shrink: 0;
  background: #1e293b;
}
.bc-driver-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bc-driver-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.bc-driver-top strong {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.bc-num {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}
.bc-driver-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
}
.bc-cam-tag {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  font-family: var(--font-display);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.race-hud.broadcast-mode .touch-controls {
  display: none !important;
}

/* === F1 TV TEAM RADIO CHATTER GRAPHIC === */
.team-radio-box {
  width: 248px;
  background: rgba(9, 11, 26, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-right: 4px solid var(--gold);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.58);
  pointer-events: none;
  animation: radioSlideIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes radioSlideIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.radio-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.radio-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
  background: #1e293b;
}
.radio-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.radio-tag {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: #38bdf8;
  text-transform: uppercase;
}
.radio-meta strong {
  font-family: var(--font-display);
  font-size: 12.5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.radio-eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  padding-bottom: 1px;
}
.radio-eq span {
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: var(--gold);
  animation: radioEqBounce 0.55s ease-in-out infinite alternate;
}
.radio-eq span:nth-child(2) { animation-delay: 0.1s; animation-duration: 0.42s; }
.radio-eq span:nth-child(3) { animation-delay: 0.22s; animation-duration: 0.62s; }
.radio-eq span:nth-child(4) { animation-delay: 0.06s; animation-duration: 0.38s; }
.radio-eq span:nth-child(5) { animation-delay: 0.18s; animation-duration: 0.5s; }
.radio-eq span:nth-child(6) { animation-delay: 0.28s; animation-duration: 0.45s; }
@keyframes radioEqBounce {
  0% { height: 4px; opacity: 0.55; }
  100% { height: 17px; opacity: 1; }
}
.radio-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 11.5px;
  line-height: 1.35;
  color: #e2e8f0;
  font-style: italic;
}

/* Compact phone landscape tuning */
@media (max-height: 480px) {
  .spotlight-card { padding: 8px 10px; }
  .driver-quote { display: none; }
  .controls-hint { display: none; }
  .track-card { padding: 5px 9px; }
  .btn-start { padding: 8px 12px; font-size: 14px; }
  .btn-broadcast { padding: 6px 10px; font-size: 12px; }
  .timing-tower { display: none; }
  .minimap-wrap canvas { width: 96px; height: 76px; }
  .team-radio-box { width: 204px; padding: 6px 8px; }
  .radio-text { font-size: 10px; }
  .telemetry-pod { min-width: 176px; padding: 4px 10px 6px; }
  .speed-readout strong { font-size: 22px; }
  .steer-btn, .item-btn { width: 58px; height: 58px; }
  .drift-btn { width: 102px; height: 40px; font-size: 13px; }
  .pedal-btn { width: 47px; height: 38px; }
}
