/* ==========================================================================
   VIEW 2: FULLSCREEN LIVE CAMERA & SCOREBOARD OVERLAY
   ========================================================================== */
.video-fullscreen-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000000;
  overflow: hidden;
}

.fullscreen-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* HUD Top Bar */
.video-hud-top {
  position: absolute;
  top: 24px;
  left: 32px;
  right: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  pointer-events: none;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(7, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  pointer-events: auto;
}

.hud-table-badge {
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-green);
  letter-spacing: 0.5px;
}

.hud-live-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-red);
}

.hud-club-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.hud-club-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #ffffff;
}

.hud-brand-watermark {
  position: absolute;
  right: 24px;
  bottom: 20px;
  padding: 6px 16px;
  background: rgba(7, 10, 15, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 20;
  display: flex;
  align-items: center;
}

.hud-brand-watermark img {
  height: 22px;
  width: auto;
  object-fit: contain;
}

.hud-right {
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.hud-btn {
  height: 42px;
  padding: 0 16px;
  background: rgba(7, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease-in-out;
}

.hud-btn:hover, .hud-btn:focus, .hud-btn.focused {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-green);
  transform: translateY(-2px);
}

.hud-exit {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ff9999;
}

.hud-exit:hover, .hud-exit:focus, .hud-exit.focused {
  background: rgba(239, 68, 68, 0.5);
  border-color: var(--accent-red);
}

/* Digital Scoreboard Bottom Overlay */
.scoreboard-overlay {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 1100px);
  background: rgba(7, 10, 15, 0.90);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
  z-index: 20;
}

.scoreboard-overlay.hidden {
  display: none;
}

.player-hud {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
}

.player-right {
  justify-content: flex-end;
}

.player-avatar-box {
  position: relative;
  width: 68px;
  height: 68px;
}

.player-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.turn-indicator {
  display: none;
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-green);
  color: #070A0F;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.player-hud.active-turn .turn-indicator {
  display: block;
}

.player-hud.active-turn .player-avatar {
  border-color: var(--accent-green);
  box-shadow: 0 0 14px var(--accent-glow);
}

.player-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
}

.player-score {
  font-size: 64px;
  font-weight: 900;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  text-align: center;
}

.player-left .player-score {
  color: var(--accent-green);
  text-shadow: 0 0 20px var(--accent-glow);
}

.player-right .player-score {
  color: var(--accent-blue);
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

/* Center Match Meta */
.match-center-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 24px;
  border-left: 1px solid var(--border-glass);
  border-right: 1px solid var(--border-glass);
}

.tournament-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.match-race {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main);
}

.match-discipline {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
}

.match-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Standby Idle Banner */
.table-idle-banner {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 14px 28px;
  z-index: 20;
}

.table-idle-banner.hidden {
  display: none;
}

.idle-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.idle-icon {
  font-size: 28px;
}

.idle-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.idle-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}


/* ==========================================================================
   VIEW 4: MOBILE COMPANION VIEW
   ========================================================================== */
.companion-view {
  background: var(--bg-main);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.companion-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.companion-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.companion-header h1 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.companion-header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.companion-header strong {
  color: var(--accent-green);
  font-size: 18px;
  letter-spacing: 2px;
}

.companion-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.companion-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.companion-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  margin-top: 8px;
}

.companion-table-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.comp-table-btn {
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.comp-table-btn:active {
  background: var(--accent-green);
  color: #070A0F;
}

.companion-footer {
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   VIEW 3B: SABO DE (DE8 & DE16) PANORAMIC 3-BRANCH CANVAS ENGINE
   ========================================================================== */
.sabo-de-canvas-wrapper {
  position: relative;
  overflow: auto;
  width: 100%;
  height: 100%;
  padding: 12px 20px 24px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sabo-de-canvas {
  position: relative;
  min-width: max-content;
}

.sabo-de-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Section Floating Headers */
.sde-section-header {
  position: absolute;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  z-index: 5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.sde-section-header.wb-header {
  background: rgba(16, 185, 129, 0.16);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.sde-section-header.lb-header {
  background: rgba(245, 158, 11, 0.16);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.sde-section-header.rescue-header {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.55);
}

.sde-section-header.finals-header {
  background: rgba(168, 85, 247, 0.18);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

/* Match Card in SABO DE Canvas */
.sabo-de-card {
  position: absolute;
  height: 74px;
  background: linear-gradient(135deg, rgba(18, 24, 38, 0.94) 0%, rgba(10, 14, 24, 0.98) 100%);
  border: 1.2px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 6;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.sabo-de-card:focus,
.sabo-de-card.focused {
  outline: none;
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 0 24px var(--accent-glow);
}

/* Color Accents by Branch */
.sabo-de-card.wb-card {
  border-left: 3px solid #10B981;
}
.sabo-de-card.wb-card:focus {
  border-color: #10B981;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.5);
}

.sabo-de-card.lb-card {
  border-left: 3px solid #F59E0B;
}
.sabo-de-card.lb-card:focus {
  border-color: #F59E0B;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.5);
}

.sabo-de-card.rescue-card {
  border: 1.2px solid rgba(239, 68, 68, 0.45);
  border-left: 3.5px solid #EF4444;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 16px rgba(239, 68, 68, 0.3);
}
.sabo-de-card.rescue-card:focus {
  border-color: #EF4444;
  box-shadow: 0 0 26px rgba(239, 68, 68, 0.7);
}

.sabo-de-card.finals-card {
  border: 1.2px solid rgba(168, 85, 247, 0.4);
  border-left: 3.5px solid #A855F7;
}
.sabo-de-card.finals-card:focus {
  border-color: #A855F7;
  box-shadow: 0 0 26px rgba(168, 85, 247, 0.6);
}

.sabo-de-card.grand-final-card {
  border: 1.5px solid #FBBF24;
  border-left: 4px solid #FBBF24;
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.4);
}
.sabo-de-card.grand-final-card:focus {
  box-shadow: 0 0 34px rgba(251, 191, 36, 0.75);
}

.sabo-de-card.is-live {
  border-color: #10B981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.45);
}

/* Card Header */
.sde-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--text-muted);
  line-height: 1;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sde-num {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.sde-table {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
}

.sde-live-badge {
  color: #10B981;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.sde-status.done {
  color: var(--text-muted);
  font-size: 9px;
}

/* Card Player Rows */
.sde-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 0 4px;
  border-radius: 4px;
}

.sde-player.is-winner {
  background: rgba(251, 191, 36, 0.12);
}

.sde-p-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.sde-p-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sde-player.is-winner .sde-p-name {
  color: var(--accent-gold);
}

.sde-score {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 900;
  color: #FFFFFF;
  background: #020407;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  min-width: 22px;
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.sde-score.winner-score {
  color: var(--accent-gold);
  border-color: rgba(251, 191, 36, 0.5);
}

/* Trophy on SABO DE Canvas */
.sde-trophy-badge {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 6;
}

.sde-trophy-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, #FBBF24 0%, #D97706 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.65);
}

.sde-trophy-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--accent-gold);
  margin-top: 6px;
  text-transform: uppercase;
}

.sde-trophy-winner {
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 2px;
}
