/* Timing Suite TV Web — layout alinhado a TimingTV2View (1920×1080 virtual) */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --tv-bg: #05070d;
  --tv-panel: #0d1524;
  --tv-panel-alt: #111c30;
  --tv-border: #1a2438;
  --tv-text: #e8eef9;
  --tv-muted: #7b8ca8;
  --tv-accent: #ef0d0a;
  --tv-cyan: #22d3ee;
  --tv-green: #4ade80;
  --tv-purple: #a78bfa;
  --tv-pink: #f472b6;
  --tv-ref-w: 1920;
  --tv-ref-h: 1080;
  --tv-text-primary: #ffffff;
  --tv-text-secondary: rgba(255, 255, 255, 0.65);
  --tv-text-tertiary: rgba(255, 255, 255, 0.45);
  --tv-kart-text: #b8c4d8;
  --tv-glass-bg: rgba(8, 12, 20, 0.92);
  /* Flash de nova passagem (overlay temporário na linha). */
  --tv-lap-flash: rgba(34, 211, 238, 0.34);
  --tv-lap-flash-soft: rgba(34, 211, 238, 0.1);
  --tv-header-bg: #0a101c;
  --tv-map-bg: #050810;
  --tv-strip-bg: #060a12;
  --tv-strip-item: #0a0f18;
}

html[data-m-theme="light"] {
  --tv-bg: #e4ebf3;
  --tv-panel: #ffffff;
  --tv-panel-alt: #f4f7fb;
  --tv-border: #c5d0dc;
  --tv-text: #0b2545;
  --tv-muted: #5a6b80;
  --tv-text-primary: #0b2545;
  --tv-text-secondary: rgba(11, 37, 69, 0.7);
  --tv-text-tertiary: rgba(11, 37, 69, 0.45);
  --tv-kart-text: #3d5168;
  --tv-glass-bg: rgba(255, 255, 255, 0.9);
  --tv-header-bg: #0b2545;
  --tv-map-bg: #050810;
  --tv-strip-bg: #dce5ee;
  --tv-strip-item: #ffffff;
  --tv-lap-flash: rgba(0, 140, 200, 0.28);
  --tv-lap-flash-soft: rgba(0, 140, 200, 0.1);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--tv-bg);
  color: var(--tv-text);
  font-family: "Segoe UI", "Bahnschrift SemiBold", system-ui, sans-serif;
}

.tv-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--tv-bg);
}

.tv-stage {
  position: absolute;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  padding: 4px;
  display: flex;
  flex-direction: column;
  background: var(--tv-bg);
  overflow: hidden;
  /* containing block para .event-standby */
  isolation: isolate;
}

/* —— Header —— */
.tv-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--tv-header-bg);
  border-bottom: 1px solid var(--tv-border);
  flex-shrink: 0;
}

.tv-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.tv-header-race {
  font-size: 28px;
  font-weight: 600;
  color: var(--tv-text);
}

.tv-header-live {
  font-size: 28px;
  font-weight: 700;
  color: var(--tv-accent);
}

.tv-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tv-green);
  margin-left: 10px;
  flex-shrink: 0;
}

.tv-live-dot.hidden {
  display: none;
}

/* Estado real da transmissão (após RACE LIVE) */
.tv-live-state {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tv-live-state-on {
  color: var(--tv-green);
}

.tv-live-state-stale {
  color: #fbbf24;
}

.tv-live-state-reconnect,
.tv-live-state-connecting,
.tv-live-state-wait {
  color: #94a3b8;
}

.tv-live-state-off {
  color: var(--tv-muted);
}

.tv-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  font-size: 14px;
  color: var(--tv-text);
  letter-spacing: 0.02em;
}

.tv-hdr-event {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  max-width: 42vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-hdr-group {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
  max-width: 28vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-hdr-section {
  font-size: 13px;
  font-weight: 600;
  color: var(--tv-cyan);
  text-transform: uppercase;
  max-width: 24vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hdr-sep.hidden {
  display: none;
}

.tv-sep {
  color: #334155;
  margin: 0 4px;
}

.tv-flag-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
}

.tv-flag-img {
  width: 32px;
  height: 22px;
  object-fit: contain;
}

.tv-flag-text.flag-green { color: var(--tv-green); }
.tv-flag-text.flag-yellow { color: #fbbf24; }
.tv-flag-text.flag-red { color: #ef4444; }
.tv-flag-text.flag-white { color: #e8eef9; }
.tv-flag-text.flag-checkered { color: var(--tv-purple); }

.tv-header-clock {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--tv-cyan);
}

.tv-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 120px;
}

.tv-company-logo {
  max-height: 44px;
  max-width: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: right center;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.45));
}

/* —— Body (WPF RootGrid row *: leaderboard | mapa | lateral) —— */
.tv-body {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 401px 1fr 280px;
  grid-template-rows: minmax(0, 1fr);
  gap: 0 10px;
  margin: 4px;
  align-items: stretch;
}

.tv-standing-col {
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.standing-panel {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.standing-panel-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  opacity: 0.35;
}

.standing-title {
  position: absolute;
  left: 10px;
  top: 14px;
  font-size: clamp(14px, 0.95rem, 18px);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--tv-text-primary);
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.standing-cards {
  position: absolute;
  left: 10px;
  top: 50px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  align-content: flex-start;
  --standing-row-gap: 2px;
  gap: var(--standing-row-gap);
  z-index: 1;
}

/* Broadcast Racing Premium — glass sobre SVG P1…P10 (como Pro WPF) */
.standing-card {
  position: relative;
  flex: 0 0 calc((100% - 9 * var(--standing-row-gap)) / 10);
  max-height: calc((100% - 9 * var(--standing-row-gap)) / 10);
  min-height: 0;
  border-radius: 5px;
  overflow: hidden;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Máscara de nova passagem — não altera layout; tipografia permanece legível. */
.standing-card.lap-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 6;
  background: linear-gradient(
    90deg,
    var(--tv-lap-flash-soft) 0%,
    var(--tv-lap-flash) 42%,
    rgba(94, 198, 198, 0.22) 100%
  );
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.35);
  animation: tv-lap-flash 700ms ease-out forwards;
}

@keyframes tv-lap-flash {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  48% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .standing-card.lap-flash::after {
    animation: tv-lap-flash-reduced 280ms ease-out forwards;
  }

  @keyframes tv-lap-flash-reduced {
    0% {
      opacity: 0.55;
    }
    100% {
      opacity: 0;
    }
  }
}

.standing-card-empty .standing-card-overlay {
  visibility: hidden;
}

.standing-card-glass {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 12, 20, 0.02) 0%, rgba(8, 12, 20, 0.16) 34%, rgba(8, 12, 20, 0.24) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.standing-card-accent {
  display: none;
}

.standing-card .pos {
  display: none;
}

.standing-card.leader .standing-card-glass {
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(90deg, rgba(8, 12, 20, 0.02) 0%, rgba(8, 12, 20, 0.13) 34%, rgba(8, 12, 20, 0.22) 100%);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.45),
    0 0 20px color-mix(in srgb, var(--pilot-color, #fff212) 18%, transparent);
}

.standing-card-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.standing-card .avatar {
  position: absolute;
  left: 18%;
  top: 50%;
  transform: translateY(-50%);
  height: 56%;
  width: auto;
  aspect-ratio: 1;
  max-height: clamp(40px, 5vh, 52px);
  max-width: clamp(40px, 5vh, 52px);
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--tv-header-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid var(--pilot-color, #5ec6c6);
  box-sizing: border-box;
  transition: border-width 0.2s ease, box-shadow 0.2s ease;
}

.standing-card.leader .avatar {
  border-width: 3px;
}

.standing-card .name-block {
  position: absolute;
  left: 32%;
  top: 0;
  width: 44%;
  height: 100%;
}

.standing-card .name-line {
  position: absolute;
  left: 0;
  top: 16%;
  width: 100%;
  display: flex;
  align-items: center;
  gap: clamp(3px, 0.3vw, 6px);
  min-width: 0;
}

.standing-card .kart-prefix,
.standing-card .kart-num {
  font-size: clamp(14px, 1rem, 17px);
  font-weight: 700;
  color: var(--tv-kart-text);
  flex-shrink: 0;
}

.standing-card .name {
  font-size: clamp(15px, 1.05rem, 18px);
  font-weight: 600;
  color: var(--tv-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* A origem dos snapshots pode alternar entre nome cadastrado e nome já formatado.
   A identidade visual da transmissão permanece sempre em caixa alta. */
.standing-card .name,
#txtLeaderName,
#txtFastestPilot,
.strip-label {
  text-transform: uppercase;
}

.standing-card .best-line {
  position: absolute;
  left: 0;
  top: 58%;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.standing-card .best-label {
  font-size: clamp(11px, 0.75rem, 13px);
  font-weight: 600;
  color: var(--tv-text-tertiary);
  flex-shrink: 0;
}

.standing-card .best-val {
  font-size: clamp(12px, 0.85rem, 14px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tv-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.standing-card .gap-col {
  position: absolute;
  right: 5%;
  top: 20%;
  width: 24%;
  text-align: right;
}

.standing-card .gap-label {
  font-size: clamp(10px, 0.7rem, 12px);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--tv-text-secondary);
}

.standing-card .gap-val {
  font-size: clamp(13px, 0.95rem, 16px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tv-text-primary);
  margin-top: 2px;
}

.standing-card.fastest .best-val {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 2px;
}

/* —— Mapa (TrackMapView — Stretch em toda a célula) —— */
.tv-map-col {
  position: relative;
  min-height: 0;
  min-width: 0;
  height: 100%;
  align-self: stretch;
  overflow: hidden;
  background: var(--tv-map-bg);
  display: flex;
  flex-direction: column;
}

.map-host {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  background: var(--tv-map-bg);
}

.track-map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.map-live-badge {
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(10, 16, 28, 0.8);
  border: 1px solid rgba(34, 211, 238, 0.27);
  border-radius: 6px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #f8fafc;
  pointer-events: none;
}

.map-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tv-cyan);
  flex-shrink: 0;
}

/* —— Lateral —— */
.tv-side-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.tv-side-col > .tv-widget,
.tv-side-col > .tv-panel,
.tv-side-col > .tv-track-record-host {
  flex-shrink: 0;
}

.tv-widget,
.tv-panel {
  background: var(--tv-panel-alt);
  border: 1px solid var(--tv-border);
  border-radius: 10px;
  padding: 14px 12px;
}

.tv-panel {
  background: var(--tv-panel);
}

.tv-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tv-muted);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.leader-focus {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
}

.leader-avatar {
  position: relative;
  width: 44px;
  height: 44px;
}

.leader-avatar-inner {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #0a101c center/cover no-repeat;
}

.leader-avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--tv-cyan);
}

.leader-pos {
  font-size: 28px;
  font-weight: 700;
}

.leader-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-kart-line .muted {
  font-size: 11px;
  color: var(--tv-muted);
}

.leader-kart {
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}

.leader-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.leader-best {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.08;
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.22);
}

/* —— Recordista do traçado —— */
.tv-track-record-host {
  min-height: 0;
}

.tv-track-record-host.hidden {
  display: none !important;
}

.tv-track-record-card {
  position: relative;
  overflow: hidden;
}

.tv-track-record-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.tv-track-record-icon {
  font-size: 14px;
  line-height: 1;
}

.tv-track-record-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.track-record-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #0a101c center/cover no-repeat;
  border: 2px solid rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.15);
  flex-shrink: 0;
}

.track-record-category {
  font-size: 13px;
  font-weight: 600;
  color: var(--tv-cyan);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-record-lap {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 28px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.1;
  margin: 4px 0 2px;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.25);
}

.track-record-name {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-record-date {
  font-size: 11px;
  margin-top: 2px;
}

.track-record-empty {
  text-align: center;
  font-size: 12px;
  margin: 8px 0 0;
}

.leader-last {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.08;
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.18);
}

.muted { color: var(--tv-muted); }
.tiny { font-size: 9px; display: block; }

.sector-info {
  font-size: 11px;
  color: var(--tv-muted);
  line-height: 1.4;
}

/* HUD inferior removido da Live TV (cards FASTEST LAP / EVENTO / DISPUTAS / BANDEIRAS). */
.tv-hud-host {
  display: none !important;
}

.tv-hud-bg {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.tv-hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Espaço de design TimingTvHudLayout 1910×120 */
}

/* —— Rótulos (PlaceHudTitle: TitleTop=8, font 21) —— */
.hud-title {
  position: absolute;
  top: calc(8 / 120 * 100%);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  margin: 0;
  padding: 0;
}

.hud-title-fastest {
  left: calc(85 / 1910 * 100%);
  color: var(--tv-pink);
}

.hud-title-event {
  left: calc(545 / 1910 * 100%);
  color: var(--tv-green);
}

.hud-title-disputes {
  left: calc(965 / 1910 * 100%);
  color: var(--tv-cyan);
}

.hud-title-alerts {
  left: calc(1290 / 1910 * 100%);
  color: #fbbf24;
}

/* —— Retrato / bandeira —— */
.hud-portrait {
  position: absolute;
  left: calc(102 / 1910 * 100%);
  top: 50%;
  transform: translateY(-50%);
  width: calc(95 / 1910 * 100%);
  height: calc(58 / 120 * 100%);
  max-width: 95px;
  max-height: 58px;
  object-fit: contain;
}

.hud-flag-img {
  position: absolute;
  left: calc(1228 / 1910 * 100%);
  top: calc(50% + 5 / 120 * 100%);
  transform: translateY(-50%);
  width: calc(100 / 1910 * 100%);
  max-width: 100px;
  max-height: 90%;
  object-fit: contain;
}

/* —— Conteúdo (PlaceHudContentCentered: Content*X, vertical center) —— */
.hud-zone {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
}

.hud-fastest {
  left: calc(224 / 1910 * 100%);
  max-width: calc((545 - 224) / 1910 * 100%);
}

.hud-event {
  left: calc(618 / 1910 * 100%);
  max-width: calc((965 - 618) / 1910 * 100%);
}

.hud-disputes {
  left: calc((1016 + 13) / 1910 * 100%);
  top: calc(50% + 3 / 120 * 100%);
  transform: translateY(-50%);
  max-width: calc((1290 - 1029) / 1910 * 100%);
  text-align: center;
}

.hud-alerts {
  left: calc(1342 / 1910 * 100%);
  max-width: calc((1550 - 1342) / 1910 * 100%);
}

.hud-pilot {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-kart { font-size: 13px; margin-top: 2px; }
.hud-time-fastest {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--tv-pink);
  margin-top: 4px;
}

.hud-event-body {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  max-height: 72px;
  overflow: hidden;
}

.hud-dispute-body,
.hud-disputes-text {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.hud-dispute-body.pulse,
.hud-disputes-text.pulse,
.hud-title-disputes.pulse {
  animation: dispute-pulse 0.65s ease-in-out infinite alternate;
}

.hud-dispute-body.hud-glow,
.hud-disputes-text.hud-glow,
.hud-title-disputes.hud-glow {
  text-shadow: 0 0 10px var(--glow-color, var(--tv-cyan));
}

.hud-dispute-body.hud-glow.hud-disputes-text,
.hud-disputes-text.hud-glow {
  text-shadow: 0 0 14px var(--glow-color, var(--tv-cyan));
}

@keyframes dispute-pulse {
  from { opacity: 1; }
  to { opacity: 0.82; }
}


.hud-alert-title { font-size: 12px; font-weight: 600; }
.hud-alert-detail { font-size: 11px; margin-top: 4px; }

/* —— Pilot strip —— */
.tv-pilot-strip {
  height: 44px;
  flex-shrink: 0;
  background: var(--tv-strip-bg);
  border-top: 1px solid var(--tv-border);
  margin: 2px 4px 4px;
  overflow: hidden;
}

.pilot-strip-scroll {
  display: block;
  height: 100%;
  overflow: hidden;
}

.pilot-strip-track {
  display: flex;
  flex-direction: row;
  height: 100%;
  width: max-content;
  will-change: transform;
  animation: strip-marquee var(--strip-duration, 24s) linear infinite;
}

.pilot-strip-track.is-static {
  animation: none;
  transform: none;
}

@keyframes strip-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(var(--strip-shift, -50%)); }
}

.strip-item {
  flex: 0 0 148px;
  height: 44px;
  margin-right: 1px;
  background: var(--tv-strip-item);
  display: flex;
  align-items: center;
  position: relative;
  opacity: 0.92;
}

.strip-item.leader { background: var(--tv-panel); opacity: 1; }
.strip-item.fastest { background: var(--tv-panel-alt); }

.strip-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--pilot-color, var(--tv-cyan));
  opacity: 0.85;
}

.strip-item.fastest:not(.leader) .strip-bar {
  background: var(--tv-purple);
}

.strip-inner {
  display: flex;
  align-items: center;
  margin-left: 7px;
  margin-right: 5px;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.strip-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tv-map-bg);
  border: 1.5px solid var(--pilot-color, var(--tv-cyan));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.strip-item.leader .strip-avatar {
  border-width: 2.5px;
}

.strip-pos {
  color: var(--tv-text-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  font-family: "Bahnschrift SemiBold", "Segoe UI", sans-serif;
  text-align: center;
}

.strip-pos.is-wide {
  font-size: 12px;
}

.strip-text {
  min-width: 0;
  max-width: 100px;
  flex: 1;
}

.strip-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tv-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.strip-gap {
  font-size: 10px;
  font-weight: 600;
  color: var(--tv-cyan);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* —— Overlays / misc —— */
.hidden { display: none !important; }

.debug-panel:not(.hidden) {
  display: block;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Bootstrap inicial — canto superior, sem tela preta */
.tv-bootstrap {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 480;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(10, 16, 28, 0.88);
  border: 1px solid #334155;
  border-radius: 8px;
  pointer-events: none;
}

.tv-bootstrap .spinner {
  width: 22px;
  height: 22px;
  border-width: 2px;
}

.tv-bootstrap p {
  font-size: 12px;
  font-weight: 600;
  color: var(--tv-muted);
  margin: 0;
}

.tv-stale {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 480;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(10, 16, 28, 0.9);
  border: 1px solid rgba(251, 191, 36, 0.45);
  pointer-events: none;
}

body.tv-clean .tv-stale,
body.tv-obs .tv-stale {
  top: 8px;
  left: 8px;
  font-size: 10px;
  padding: 4px 10px;
}

.overlay.blocked {
  background: rgba(5, 7, 13, 0.97);
}

.overlay.blocked h1 {
  font-size: 36px;
}

.overlay.blocked p {
  color: var(--tv-muted);
  max-width: 520px;
  text-align: center;
}

/* —— TimingTvStandbyView (Modelo 2) — canvas 1920×1080 no desktop; fluido no mobile —— */
.event-standby {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  display: block;
  background: transparent;
}

.standby-canvas {
  position: absolute;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  overflow: hidden;
  background: var(--tv-bg);
  background-image: radial-gradient(ellipse 85% 90% at 68% 28%, #173052 0%, #081426 38%, var(--tv-bg) 100%);
}

.standby-deco-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.standby-deco {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.standby-event-panel {
  position: absolute;
  left: 86px;
  top: 58px;
  right: 86px;
  bottom: 168px;
  z-index: 1;
  display: grid;
  grid-template-columns: 330px 1fr 330px;
  align-items: center;
}

.event-standby.no-company-logo .standby-event-panel {
  grid-template-columns: 250px 1fr 330px;
}

.standby-company-slot {
  grid-column: 1;
  grid-row: 1;
  width: 285px;
  max-height: 150px;
  justify-self: center;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mantém coluna esquerda no grid (como WPF CompanyColumn) */
.event-standby .standby-company-slot.hidden {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

.standby-company-logo,
.standby-ts-logo {
  display: block;
  width: 285px;
  max-height: 150px;
  object-fit: contain;
}

.standby-ts-logo {
  grid-column: 3;
  grid-row: 1;
  justify-self: center;
  align-self: center;
}

.standby-message {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  text-align: center;
  align-self: center;
  overflow: visible;
}

.standby-kicker,
.standby-message h1,
.standby-next {
  font-family: "Bahnschrift Condensed", Bahnschrift, "Arial Narrow", "Segoe UI", sans-serif;
  font-stretch: condensed;
  font-style: italic;
  line-height: 0.95;
  text-align: center;
}

.standby-kicker {
  color: #f8fafc;
  font-size: 78px;
  font-weight: 800;
  white-space: nowrap;
}

.standby-message h1 {
  margin: 16px 12px;
  max-height: 230px;
  overflow: hidden;
  color: #f1263c;
  font-size: 94px;
  font-weight: 900;
  line-height: 0.95;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.standby-rule {
  position: relative;
  height: 8px;
  margin: 26px 85px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.standby-rule::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e5253c 25%, #4478ad 50%, #e5253c 75%, transparent);
}

.standby-rule span {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f8fafc;
}

.standby-next {
  color: #f8fafc;
  font-size: 43px;
  font-weight: 700;
}

.standby-subtitle {
  margin-top: 26px;
  color: #9aabbf;
  font-size: 28px;
  font-weight: 500;
  text-align: center;
}

.standby-sponsors {
  margin-top: 22px;
  margin-left: 12px;
  margin-right: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 24px;
  row-gap: 18px;
  width: calc(100% - 24px);
  box-sizing: border-box;
}

.standby-sponsors.hidden {
  display: none !important;
}

.standby-sponsor-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 calc((100% - 96px) / 5);
  width: calc((100% - 96px) / 5);
  max-width: calc((100% - 96px) / 5);
}

.standby-sponsor-item img {
  display: block;
  height: max(160px, var(--sponsor-logo-size, 160px));
  width: auto;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
}

.standby-sponsor-item img.hidden {
  display: none !important;
}

.standby-sponsor-item span {
  margin-top: 8px;
  color: #f6f8fc;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standby-sponsor-item.has-logo span {
  display: none;
}

.standby-statusbar {
  position: absolute;
  left: 230px;
  right: 230px;
  bottom: 0;
  z-index: 1;
  height: 92px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  align-items: stretch;
  border: 1px solid #467fb8;
  border-radius: 14px;
  background: rgba(4, 16, 32, 0.847);
  box-sizing: border-box;
}

.standby-status-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #526b86;
  font-family: "Bahnschrift Condensed", Bahnschrift, "Arial Narrow", sans-serif;
  font-stretch: condensed;
  font-size: 22px;
  font-weight: 700;
  color: #f6f8fc;
  text-align: center;
  white-space: nowrap;
}

.standby-status-cell-last {
  border-right: 0;
}

body.tv-clean .event-standby,
body.tv-obs .event-standby {
  background-color: transparent;
}

body.tv-clean .standby-canvas,
body.tv-obs .standby-canvas {
  background-color: var(--tv-bg);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--tv-border);
  border-top-color: var(--tv-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.debug-panel {
  display: none;
  position: fixed;
  bottom: 8px;
  left: 8px;
  z-index: 400;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  font-family: Consolas, monospace;
  line-height: 1.45;
  color: #94a3b8;
  max-width: min(420px, 90vw);
  pointer-events: none;
}

.debug-panel .debug-title {
  color: var(--tv-cyan);
  font-weight: 700;
  margin-bottom: 4px;
}

.debug-hint {
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.6;
}

.btn-fs {
  display: none !important;
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 350;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: opacity 0.2s ease;
}

.btn-fs.hidden {
  display: none !important;
}

.btn-fs:hover {
  background: #334155;
}

body.tv-clean .btn-fs,
body.tv-clean .debug-panel {
  display: none !important;
}

body.tv-obs .btn-fs,
body.tv-obs .debug-panel {
  display: none !important;
}

.view-switch-btn {
  display: none !important;
}

.tv-chrome {
  display: none;
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 360;
  align-items: center;
  gap: 8px;
}

html.tv-can-switch-view:not(.tv-view-mobile) .tv-chrome:not(.hidden) {
  display: flex;
}

.tv-chrome.hidden {
  display: none !important;
}

.tv-chrome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

html[data-m-theme="light"] .tv-chrome-btn {
  background: rgba(11, 37, 69, 0.94);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f8fafc;
}

.tv-chrome-btn:hover,
.tv-chrome-btn:focus-visible {
  background: rgba(30, 41, 59, 0.96);
}

.tv-dock {
  --tv-nav-bg: #07111c;
  --tv-nav-text: #cbd5e1;
  --tv-nav-active: #e10600;
  --tv-nav-border: rgba(56, 189, 248, 0.22);
  --tv-dock-handle-h: 32px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: none;
  pointer-events: none;
}

html[data-m-theme="light"] .tv-dock {
  --tv-nav-bg: #ffffff;
  --tv-nav-text: #475569;
  --tv-nav-active: #e10600;
  --tv-nav-border: #cbd5e1;
}

html.tv-can-switch-view:not(.tv-view-mobile) .tv-dock:not(.hidden) {
  display: block;
}

.tv-dock.hidden {
  display: none !important;
}

.tv-dock-sheet {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(calc(100% - var(--tv-dock-handle-h)));
  transition: transform 280ms ease;
}

.tv-dock.is-open .tv-dock-sheet {
  transform: translateY(0);
}

.tv-dock-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 108px;
  height: var(--tv-dock-handle-h);
  padding: 0 16px;
  border: 1px solid var(--tv-nav-border);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--tv-nav-bg);
  color: var(--tv-nav-text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.28);
}

.tv-dock-handle:focus-visible {
  outline: 2px solid var(--tv-nav-active);
  outline-offset: 2px;
}

.tv-dock-handle-ico {
  display: inline-flex;
}

.tv-display-nav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 20px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--tv-nav-bg);
  border-top: 1px solid var(--tv-nav-border);
  color: var(--tv-nav-text);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
}

.tv-dock-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex: 1 1 auto;
  min-width: 0;
}

.tv-display-nav .m-nav-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--tv-nav-text);
  padding: 10px 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  min-height: 48px;
  border-radius: 8px;
}

.tv-display-nav .m-nav-btn:hover,
.tv-dock-fs:hover {
  background: rgba(148, 163, 184, 0.12);
}

.tv-display-nav .m-nav-btn.is-active {
  color: var(--tv-nav-active);
}

.tv-dock-sep {
  flex: 0 0 1px;
  width: 1px;
  margin: 10px 8px;
  background: var(--tv-nav-border);
}

.tv-dock-fs {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--tv-nav-text);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  min-height: 48px;
  border-radius: 8px;
  white-space: nowrap;
}

.tv-dock-fs:focus-visible,
.tv-display-nav .m-nav-btn:focus-visible {
  outline: 2px solid var(--tv-nav-active);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .tv-display-nav .m-nav-btn,
  .tv-dock-fs {
    font-size: 10px;
    gap: 5px;
    padding-left: 6px;
    padding-right: 6px;
  }
}

.standby-statusbar {
  display: none !important;
}

body.tv-clean .tv-chrome,
body.tv-obs .tv-chrome,
body.tv-clean .tv-dock,
body.tv-obs .tv-dock {
  display: none !important;
}

body.tv-clean .view-switch-btn,
body.tv-obs .view-switch-btn {
  display: none !important;
}

.rotate-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 340;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 24px;
  background: rgba(2, 6, 13, 0.94);
  color: #f8fafc;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.rotate-hint-icon {
  font-size: 52px;
  line-height: 1;
  animation: rotate-phone 1.6s ease-in-out infinite;
}

.rotate-hint-sub {
  max-width: 280px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
}

.rotate-hint p {
  margin: 0;
}

@keyframes rotate-phone {
  0%, 20% { transform: rotate(0deg); }
  45%, 70% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

@media (orientation: portrait) {
  html.tv-prefer-landscape.tv-can-switch-view:not(.tv-standby) .rotate-hint {
    display: flex;
  }
}

html.tv-standby .rotate-hint,
html.tv-view-mobile .rotate-hint,
body.tv-clean .rotate-hint,
body.tv-obs .rotate-hint {
  display: none !important;
}

.standing-extra,
.standing-extra.hidden {
  display: none !important;
}

.standing-cards-more,
.standing-cards-pit {
  position: relative;
  left: auto;
  top: auto;
  right: auto;
  bottom: auto;
  display: block;
  overflow: hidden;
}
.standing-title-more,
.standing-title-pit {
  font-size: 13px;
  margin: 8px 0 4px;
  opacity: 0.85;
}
.standing-mini {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  padding: 2px 6px;
  color: #e8eef7;
}
.standing-mini.pit { color: #fbbf24; }

/* Patrocinador da corrida — sem fundo próprio, colado na base da coluna */
.tv-sponsor-race {
  flex: 0 0 auto;
  margin-top: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease-in-out;
}

.tv-sponsor-race.is-visible {
  opacity: 1;
}

.tv-sponsor-race img {
  display: block;
  width: auto;
  height: max(140px, var(--sponsor-logo-size, 160px));
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  margin: 0;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.35));
}

.tv-sponsor-race img.hidden {
  display: none !important;
}

.tv-sponsor-race [data-sponsor-name] {
  color: #f6f8fc;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-sponsor-race.has-logo [data-sponsor-name] {
  display: none;
}

/* Placeholder de melhor volta — centrado no mapa, 10px acima da faixa inferior */
.best-lap-placeholder {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 900px;
  height: 80px;
  z-index: 40;
  pointer-events: none;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
}

.best-lap-placeholder.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity 3s ease, transform 3s ease;
}

.best-lap-placeholder.is-leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(0);
  transition: opacity 2s ease;
}

.best-lap-placeholder-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.best-lap-placeholder-overlay {
  position: absolute;
  inset: 0;
}

.best-lap-label {
  position: absolute;
  left: 26px;
  top: 21px;
  color: #e8eef9;
  font-weight: 700;
  font-size: 30px;
  font-family: "Bahnschrift SemiBold", "Segoe UI", sans-serif;
}

.best-lap-pilot {
  position: absolute;
  left: 370px;
  top: 23px;
  width: 360px;
  color: #e8eef9;
  font-size: 29px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.best-lap-kart {
  position: absolute;
  left: 370px;
  top: 55px;
  width: 160px;
  color: #7b8ca8;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.best-lap-time {
  position: absolute;
  left: 700px;
  top: 12px;
  width: 170px;
  color: #e8eef9;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 42px;
  font-weight: 700;
  text-align: center;
}

/* Disputa quente — mesmas dimensões e posição do card de melhor volta */
.hot-dispute {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 900px;
  height: 80px;
  z-index: 41;
  pointer-events: none;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
}

.hot-dispute.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.hot-dispute.is-leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.45s ease;
}

.hot-dispute.is-visible.pulse {
  animation: hot-dispute-pulse 0.65s ease-in-out infinite alternate;
}

.hot-dispute-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.hot-dispute-overlay {
  position: absolute;
  inset: 0;
}

/* piloto 1 | GAP (retângulo lilás) | piloto 2 — caixa lilás do SVG em 54.9%–77.3% */
.hot-dispute-pilot {
  position: absolute;
  top: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.hot-dispute-ahead {
  left: 33.8%;
  width: 20.6%;
}

.hot-dispute-chaser {
  left: 78%;
  width: 19%;
}

.hot-dispute-pilot-name {
  width: 100%;
  color: inherit;
  font-size: 26px;
  font-weight: 700;
  font-family: "Bahnschrift SemiBold", "Segoe UI", sans-serif;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hot-dispute-pilot-num {
  margin-top: 2px;
  color: inherit;
  opacity: 0.88;
  font-size: 16px;
  font-weight: 600;
  font-family: "Bahnschrift SemiBold", "Segoe UI", sans-serif;
  line-height: 1;
  text-align: center;
}

.hot-dispute-gap {
  position: absolute;
  left: 54.9%;
  top: 6px;
  bottom: 6px;
  width: 22.4%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hot-dispute-gap-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hot-dispute-gap-value {
  color: #e8eef9;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.hot-dispute-gap-label {
  margin-top: 1px;
  color: #e8eef9;
  opacity: 0.8;
  font-size: 11px;
  font-weight: 700;
  font-family: "Bahnschrift SemiBold", "Segoe UI", sans-serif;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

@keyframes hot-dispute-pulse {
  from { filter: drop-shadow(0 0 0 rgba(147, 49, 246, 0)); }
  to { filter: drop-shadow(0 0 14px rgba(147, 49, 246, 0.55)); }
}

body.tv-result .tv-live-state-on::after {
  content: " RESULTADO";
  font-size: 0.75em;
}
@media (max-width: 1100px) {
  .tv-viewport { transform-origin: top center; }
}

/* Tela de espera fluida — não altera o stage 1920×1080 da corrida ao vivo */
@media (max-width: 1024px) {
  .event-standby {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--tv-bg);
    background-image: radial-gradient(ellipse 85% 90% at 68% 28%, #173052 0%, #081426 38%, var(--tv-bg) 100%);
  }

  .event-standby .standby-canvas {
    position: relative;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    transform: none !important;
    display: flex;
    flex-direction: column;
    overflow: visible;
    background: transparent;
  }

  .event-standby .standby-deco-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
  }

  .event-standby .standby-event-panel {
    position: relative;
    left: auto;
    top: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto;
    justify-items: center;
    align-items: center;
    gap: 10px 16px;
    padding: clamp(12px, 3.5vh, 28px) clamp(12px, 4vw, 24px) 12px;
    box-sizing: border-box;
  }

  .event-standby.no-company-logo .standby-event-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .event-standby .standby-message {
    display: contents;
  }

  .event-standby .standby-kicker {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    max-width: 100%;
    font-size: clamp(1.15rem, 5.6vw, 1.85rem);
    line-height: 1.1;
    white-space: normal;
  }

  .event-standby .standby-message h1 {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    margin: 4px 0 0;
    max-height: none;
    overflow: visible;
    font-size: clamp(1.45rem, 6.6vw, 2.55rem);
    line-height: 1.05;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: manual;
  }

  .event-standby .standby-rule {
    grid-column: 1 / -1;
    grid-row: 3;
    width: min(100%, 420px);
    margin: 8px 0 4px;
  }

  .event-standby .standby-next {
    grid-column: 1 / -1;
    grid-row: 4;
    width: 100%;
    max-width: 100%;
    font-size: clamp(0.95rem, 3.8vw, 1.35rem);
    line-height: 1.15;
    white-space: normal;
  }

  .event-standby .standby-subtitle {
    grid-column: 1 / -1;
    grid-row: 5;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
    font-size: clamp(0.78rem, 3.2vw, 1rem);
    line-height: 1.3;
  }

  .event-standby .standby-company-slot,
  .event-standby .standby-ts-logo,
  .event-standby .standby-company-logo {
    width: min(42vw, 168px);
    max-width: 100%;
    height: auto;
    max-height: 72px;
    object-fit: contain;
    justify-self: center;
    align-self: center;
  }

  .event-standby .standby-company-slot {
    grid-column: 1;
    grid-row: 6;
    display: flex;
    visibility: visible;
  }

  .event-standby .standby-company-slot.hidden {
    display: none !important;
  }

  .event-standby .standby-ts-logo {
    grid-column: 2;
    grid-row: 6;
  }

  .event-standby.no-company-logo .standby-ts-logo,
  .event-standby .standby-company-slot.hidden ~ .standby-ts-logo {
    grid-column: 1 / -1;
  }

  .event-standby .standby-sponsors {
    grid-column: 1 / -1;
    grid-row: 7;
    width: 100%;
    max-width: 100%;
    margin: 10px 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    justify-items: center;
    align-items: stretch;
  }

  .event-standby .standby-sponsors[data-count="1"] {
    grid-template-columns: minmax(0, 240px);
    justify-content: center;
  }

  .event-standby .standby-sponsor-item {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box;
  }

  .event-standby .standby-sponsor-item img {
    height: auto;
    width: auto;
    max-width: 100%;
    max-height: 52px;
    object-fit: contain;
    filter: none;
  }

  .event-standby .standby-sponsor-item span {
    max-width: 100%;
    font-size: 12px;
    color: #0f172a;
  }

  .event-standby .standby-statusbar {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    width: calc(100% - 24px);
    max-width: 100%;
    height: auto;
    min-height: 0;
    margin: 8px 12px max(12px, env(safe-area-inset-bottom, 0px));
    padding: 6px;
    padding-left: max(6px, env(safe-area-inset-left, 0px));
    padding-right: max(6px, env(safe-area-inset-right, 0px));
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    flex: 0 0 auto;
    box-sizing: border-box;
  }

  .event-standby .standby-status-cell {
    white-space: normal;
    font-size: clamp(0.68rem, 2.8vw, 0.92rem);
    line-height: 1.2;
    padding: 8px 6px;
    border-right: 1px solid #526b86;
    border-bottom: 1px solid #526b86;
  }

  .event-standby .standby-status-cell:nth-child(2n) {
    border-right: 0;
  }

  .event-standby .standby-status-cell:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .event-standby .standby-status-cell-last {
    border-right: 0;
  }
}

@media (max-width: 768px) {
  .event-standby .standby-sponsors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .event-standby .standby-sponsors {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .event-standby .standby-sponsor-item img {
    max-height: 64px;
  }

  .event-standby .standby-company-slot,
  .event-standby .standby-ts-logo,
  .event-standby .standby-company-logo {
    max-height: 88px;
    width: min(28vw, 200px);
  }
}

@media (max-width: 480px) {
  .event-standby .standby-event-panel {
    gap: 8px 12px;
    padding: 12px 12px 8px;
  }

  .event-standby .standby-sponsor-item {
    padding: 6px 8px;
  }

  .event-standby .standby-sponsor-item img {
    max-height: 44px;
  }
}

@media (max-width: 359px) {
  .event-standby .standby-sponsors {
    grid-template-columns: minmax(0, 1fr);
  }

  .event-standby .standby-statusbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .event-standby .standby-status-cell {
    border-right: 0;
    border-bottom: 1px solid #526b86;
  }

  .event-standby .standby-status-cell:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 1024px) and (orientation: landscape) and (max-height: 540px) {
  .event-standby .standby-canvas {
    min-height: 100%;
    min-height: 100dvh;
  }

  .event-standby .standby-event-panel {
    grid-template-columns: minmax(0, 1.5fr) minmax(72px, 18vw) minmax(72px, 18vw);
    gap: 6px 12px;
    padding: 8px 12px 6px;
    align-items: center;
  }

  .event-standby .standby-kicker {
    grid-column: 1;
    grid-row: 1;
    font-size: clamp(0.95rem, 3.4vh, 1.3rem);
    text-align: left;
  }

  .event-standby .standby-message h1 {
    grid-column: 1;
    grid-row: 2;
    font-size: clamp(1.05rem, 4.6vh, 1.7rem);
    text-align: left;
    margin: 0;
  }

  .event-standby .standby-rule {
    grid-column: 1;
    grid-row: 3;
    margin: 4px 0;
    justify-self: stretch;
    width: 100%;
  }

  .event-standby .standby-next {
    grid-column: 1;
    grid-row: 4;
    font-size: clamp(0.78rem, 3.2vh, 1.05rem);
    text-align: left;
  }

  .event-standby .standby-subtitle {
    grid-column: 1;
    grid-row: 5;
    margin-top: 0;
    font-size: clamp(0.7rem, 2.8vh, 0.9rem);
    text-align: left;
  }

  .event-standby .standby-company-slot {
    grid-column: 2;
    grid-row: 1 / 6;
    width: min(18vw, 120px);
    max-height: 64px;
  }

  .event-standby .standby-ts-logo {
    grid-column: 3;
    grid-row: 1 / 6;
    width: min(18vw, 120px);
    max-height: 64px;
  }

  .event-standby.no-company-logo .standby-ts-logo,
  .event-standby .standby-company-slot.hidden ~ .standby-ts-logo {
    grid-column: 2 / 4;
    grid-row: 1 / 6;
  }

  .event-standby .standby-sponsors {
    grid-column: 1 / -1;
    grid-row: 6;
    margin-top: 4px;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 6px 8px;
  }

  .event-standby .standby-sponsor-item {
    padding: 4px 6px;
  }

  .event-standby .standby-sponsor-item img {
    max-height: 36px;
  }

  .event-standby .standby-statusbar {
    margin: 4px 10px 8px;
    width: calc(100% - 20px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .event-standby .standby-status-cell {
    border-bottom: 0;
    border-right: 1px solid #526b86;
    padding: 6px 4px;
    font-size: clamp(0.58rem, 1.6vw, 0.78rem);
  }

  .event-standby .standby-status-cell:nth-child(2n) {
    border-right: 1px solid #526b86;
  }

  .event-standby .standby-status-cell-last,
  .event-standby .standby-status-cell:last-child {
    border-right: 0;
  }
}

/* Escala virtual 1920×1080 da corrida ao vivo — sem media queries que alterem proporções WPF */

html[data-m-theme="light"] .standing-title {
  text-shadow: none;
}

html[data-m-theme="light"] .standing-card-glass {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.55) 40%, rgba(232, 238, 245, 0.82) 100%);
  border-color: rgba(11, 37, 69, 0.12);
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.08);
}

html[data-m-theme="light"] .standing-card.leader .standing-card-glass {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.62) 40%, rgba(226, 232, 240, 0.9) 100%);
  border-color: rgba(11, 37, 69, 0.18);
}

html[data-m-theme="light"] .standing-card.fastest .best-val {
  text-decoration-color: rgba(11, 37, 69, 0.35);
}

html[data-m-theme="light"] .tv-hud-overlay,
html[data-m-theme="light"] .hud-title,
html[data-m-theme="light"] .hud-kart,
html[data-m-theme="light"] .hud-time-fastest,
html[data-m-theme="light"] .hud-event-body,
html[data-m-theme="light"] .hud-dispute-body,
html[data-m-theme="light"] .hud-disputes-text,
html[data-m-theme="light"] .hud-alert-title,
html[data-m-theme="light"] .hud-alert-detail {
  color: var(--tv-text-primary);
}

html[data-m-theme="light"] .standby-canvas {
  background: var(--tv-bg);
  background-image: radial-gradient(ellipse 85% 90% at 68% 28%, #c5d7ec 0%, #dbe6f2 42%, var(--tv-bg) 100%);
}

html[data-m-theme="light"] .standby-kicker,
html[data-m-theme="light"] .standby-message h1,
html[data-m-theme="light"] .standby-next,
html[data-m-theme="light"] .standby-subtitle {
  color: var(--tv-text-primary);
}

html[data-m-theme="light"] .tv-header,
html[data-m-theme="light"] .tv-header-center,
html[data-m-theme="light"] .tv-hdr-event,
html[data-m-theme="light"] .tv-hdr-group,
html[data-m-theme="light"] .tv-hdr-section,
html[data-m-theme="light"] .tv-header-clock,
html[data-m-theme="light"] .tv-live-state {
  color: #f8fafc;
}

html[data-m-theme="light"] .tv-map-col,
html[data-m-theme="light"] .map-host {
  outline: 1px solid var(--tv-border);
}

