/* ==========================================================================
   ABC STATS - BASQUETEBOL TRACKER (PRO SPORTS EDITION)
   Design Moderno, Atrativo e Tecnológico para Basquetebol
   Compatível com Windows (Desktop/PWA) e Android (Telemóvel e Tablet)
   ========================================================================== */

:root {
  /* Cores Principais - Tema Pro Sports Arena */
  --bg-dark-base: #090e17;
  --bg-dark-surface: #0f172a;
  --bg-dark-card: #1e293b;
  --bg-dark-elevated: #334155;
  --primary-blue: #2563eb;
  --primary-blue-glow: rgba(37, 99, 235, 0.45);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.4);
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-crimson: #ef4444;
  --accent-purple: #8b5cf6;
  --club-navy: #1f3b88;
  
  /* Textos de Alto Contraste */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Efeitos de Vidro e Sombras */
  --glass-bg: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-subtle: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.7);
  --shadow-neon-blue: 0 0 20px rgba(37, 99, 235, 0.5);
  --shadow-neon-cyan: 0 0 20px rgba(6, 182, 212, 0.5);
  
  /* Tipografia */
  --font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Roboto Mono', 'Courier New', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark-base);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbars Modernas e Discretas */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   NAVBAR PRINCIPAL SUPERIOR (PRO SPORTS HEADER)
   ========================================================================== */

.app-navbar {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  min-height: 52px;
  z-index: 100;
  position: relative;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff9800 0%, #e65100 70%, #bf360c 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
  background: linear-gradient(135deg, #ffffff 40%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: translateY(1px);
}

.nav-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

.btn-install-pulsing {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(52, 211, 153, 0.5) !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45) !important;
  animation: pulseInstall 2.2s infinite;
}

@keyframes pulseInstall {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   BOTÕES DE GRAVAR E ABRIR FICHEIRO (SINCRONIZAÇÃO ENTRE APARELHOS)
   ========================================================================== */
.btn-sync-file {
  font-weight: 800 !important;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sync-save {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.35) 100%) !important;
  border: 1px solid rgba(52, 211, 153, 0.6) !important;
  color: #a7f3d0 !important;
}

.btn-sync-save:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border-color: #6ee7b7 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5) !important;
  transform: translateY(-1px);
}

.btn-sync-open {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(6, 182, 212, 0.3) 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.6) !important;
  color: #bae6fd !important;
}

.btn-sync-open:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.5) !important;
  transform: translateY(-1px);
}

/* Banner de Aviso de Instalação PWA */
.install-banner-tip {
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 101;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   CONTENT WRAPPER / SCREENS
   ========================================================================== */

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.screen-view {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  position: relative;
}

.screen-view.active {
  display: flex;
}

/* ==========================================================================
   ECRÃ 1: JOGO EM DIRETO (LIVE TRACKER) - PLACAR & CONTROLO
   ========================================================================== */

/* ==========================================================================
   ECRÃ 1: JOGO EM DIRETO (LIVE TRACKER) - PLACAR & CONTROLO
   ========================================================================== */

.live-game-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  background-color: var(--bg-dark-base);
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   BARRA DO PLACAR SUPERIOR (BROADCAST ARENA SCOREBOARD)
   ========================================================================== */

.live-header-bar {
  background: linear-gradient(180deg, #111827 0%, #090e17 100%);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  min-height: 70px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  z-index: 20;
  gap: 12px;
}

/* Painéis de Equipa (Casa e Visitante) */
.team-score-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  min-height: 56px;
  flex: 1;
  max-width: 320px;
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.team-score-panel.home-panel {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border-left: 4px solid #3b82f6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.team-score-panel.away-panel {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(55, 65, 81, 0.85) 100%);
  border-right: 4px solid #f97316;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  justify-content: flex-end;
}

.team-emblem-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.team-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.team-emblem-initial {
  font-size: 13px;
  font-weight: 900;
  font-family: 'Montserrat', sans-serif;
  color: #f8fafc;
  letter-spacing: 0.5px;
}

.team-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.team-meta.away-meta {
  text-align: right;
  align-items: flex-end;
}

.team-name-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f8fafc;
  text-transform: uppercase;
}

.team-sub-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.foul-pips-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.foul-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
}

.foul-pips-container {
  display: flex;
  align-items: center;
  gap: 3px;
}

.foul-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.foul-pip.pip-empty {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.foul-pip.pip-filled {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
  border: 1px solid #fbbf24;
}

.foul-pip.pip-orange {
  background: #f97316;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.85);
  border: 1px solid #fdba74;
}

.foul-pip.pip-red {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.95);
  border: 1px solid #fca5a5;
  animation: pulseBonus 1s infinite alternate;
}

.bonus-indicator {
  display: inline-block;
  background: rgba(239, 68, 68, 0.2);
  color: #94a3b8;
  font-weight: 800;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  letter-spacing: 0.5px;
  opacity: 0.4;
}

.bonus-indicator.active {
  background: #ef4444;
  color: #ffffff;
  opacity: 1;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.9);
  animation: pulseBonus 1.2s infinite;
}

.timeouts-pill {
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

.team-big-score {
  font-size: 40px;
  font-weight: 900;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: -1px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  min-width: 48px;
  text-align: center;
}

/* Centro: Hub de Jogo & Relógio */
.center-game-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.period-pills-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.9);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.period-pill {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.period-pill:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
}

.period-pill.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.5);
  font-weight: 800;
}

.clock-broadcast-hub {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-clock-adj {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clock-adj:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-clock-adj:active {
  transform: translateY(1px);
}

.btn-clock-gear {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clock-gear:hover {
  background: rgba(51, 65, 85, 0.95);
  transform: rotate(45deg);
}

.clock-display-box {
  background: #000000;
  border: 2px solid #334155;
  border-radius: 10px;
  padding: 3px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 12px rgba(56, 189, 248, 0.15);
  transition: all 0.2s ease;
}

.clock-display-box:hover {
  border-color: #38bdf8;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 16px rgba(56, 189, 248, 0.4);
}

.clock-digits {
  font-family: 'Montserrat', monospace;
  font-size: 26px;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 1.5px;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.btn-clock-play {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
}

.btn-clock-play:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
}

.btn-possession {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  color: #f1f5f9;
  transition: all 0.2s ease;
}

.btn-possession.home {
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.btn-possession.away {
  border-color: #f97316;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

.header-action-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-tool-subs,
.btn-tool-finish {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-tool-subs:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #60a5fa;
  transform: translateY(-1px);
}

.btn-tool-finish {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(185, 28, 28, 0.3));
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-tool-finish:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

/* ==========================================================================
   LATERAIS DE JOGADORES (ATHLETIC ROSTER CARDS)
   ========================================================================== */

.live-court-wrapper {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  background: #090e17;
  min-height: 0;
}

.players-sidebar {
  width: 122px;
  min-width: 122px;
  flex-shrink: 0;
  background: rgba(11, 16, 27, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 8px 6px;
  gap: 8px;
  z-index: 5;
  box-shadow: var(--shadow-sm);
  overflow-y: auto;
}

.players-sidebar.away-sidebar {
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-roster-header {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: center;
  padding: 4px;
  border-radius: 6px;
  margin-bottom: 2px;
}

.sidebar-roster-header.home {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.sidebar-roster-header.away {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

/* Cartão Pro de Jogador */
.player-jersey-card {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 80px;
  justify-content: space-between;
}

.player-jersey-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.player-jersey-card:active {
  transform: scale(0.97);
}

.jersey-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 2px;
}

.jersey-pos-tag {
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.jersey-pts-badge {
  font-size: 10px;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.jersey-number-large {
  font-size: 26px;
  font-weight: 900;
  font-family: 'Montserrat', sans-serif;
  line-height: 1;
  color: #f8fafc;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  margin: 3px 0;
}

.jersey-player-name {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  max-width: 105px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e2e8f0;
}

.jersey-pips {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
}

.player-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.player-pip.pip-empty {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.player-pip.pip-filled {
  background: #f59e0b;
  border: 1px solid #fbbf24;
}

.player-pip.pip-orange {
  background: #f97316;
  border: 1px solid #fdba74;
}

.player-pip.pip-red {
  background: #ef4444;
  border: 1px solid #fca5a5;
  box-shadow: 0 0 6px #ef4444;
}

/* Card Selecionado com Halo Neon */
.player-jersey-card.selected {
  background: linear-gradient(145deg, #1e3a8a 0%, #1e40af 100%) !important;
  border: 2px solid #38bdf8 !important;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.7), inset 0 0 10px rgba(56, 189, 248, 0.25) !important;
  transform: scale(1.03);
}

.player-jersey-card.away-card.selected {
  background: linear-gradient(145deg, #9a3412 0%, #c2410c 100%) !important;
  border: 2px solid #fb923c !important;
  box-shadow: 0 0 18px rgba(251, 146, 60, 0.7), inset 0 0 10px rgba(251, 146, 60, 0.25) !important;
  transform: scale(1.03);
}

/* Área Central do Campo (O Campo é Mantido 100% Intacto) */
.court-interactive-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090e17;
  overflow: hidden;
}

.court-canvas-container {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Feed de Jogadas (Play-by-play) sobreposto no campo */
.court-pbp-overlay {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
  max-width: 82%;
  z-index: 6;
}

.pbp-line {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: #f1f5f9;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: fadeInPbp 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@keyframes fadeInPbp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   BARRA INFERIOR DE AÇÕES RESTRUTURADA (PRO SPORTS COMMAND DECK)
   ========================================================================== */

.live-bottom-bar {
  background: rgba(11, 16, 27, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px;
  min-height: 60px;
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.7);
  z-index: 10;
  overflow-x: auto;
}

.action-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 6px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-action-hero,
.btn-action-deck {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.btn-action-hero:hover,
.btn-action-deck:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.btn-action-hero:active,
.btn-action-deck:active {
  transform: translateY(2px) scale(0.96);
}

.btn-icon {
  font-size: 14px;
}

/* Cluster de Pontuação */
.btn-score-1 {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  border-color: #34d399;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-score-2 {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.btn-score-3 {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #ffffff;
  border-color: #c084fc;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.35);
}

/* Ressaltos */
.btn-reb-of {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-reb-def {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

/* Botão Central de Ações */
.btn-hero-ball {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.6);
  transition: all 0.15s ease;
  letter-spacing: 0.5px;
}

.btn-hero-ball:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 0 28px rgba(249, 115, 22, 0.85);
}

.btn-hero-ball:active {
  transform: translateY(2px) scale(0.96);
}

.ball-glow {
  font-size: 18px;
}

/* Defesa & Criação */
.btn-assist,
.btn-steal,
.btn-block {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
}

.btn-assist:hover { border-color: #38bdf8; color: #38bdf8; }
.btn-steal:hover { border-color: #facc15; color: #facc15; }
.btn-block:hover { border-color: #f87171; color: #f87171; }

/* Erros */
.btn-turnover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-turnover:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
  border-color: #ef4444;
}

.btn-foul {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde047;
}

.btn-foul:hover {
  background: rgba(245, 158, 11, 0.3);
  color: #ffffff;
  border-color: #f59e0b;
}

/* Anular */
.btn-undo {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.btn-undo:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Ticker de Percentagens Rápidas no Fundo */
.live-stats-ticker {
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 18px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.3px;
  z-index: 5;
}

.ticker-side {
  display: flex;
  gap: 16px;
  align-items: center;
}

.ticker-center-ball {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5));
}

/* Menu de Ajuda Amarelo Flutuante */
.help-yellow-flyout {
  position: absolute;
  top: 56px;
  left: 10px;
  background: rgba(23, 23, 23, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(245, 158, 11, 0.2);
  width: 220px;
  animation: flyoutSlide 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes flyoutSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-help-yellow-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-help-yellow-item:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  border-color: #f59e0b;
  transform: translateX(3px);
}

/* ==========================================================================
   MODAIS & DIÁLOGOS DE AÇÃO (PRO GLASS DIALOGS)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeInModal 0.2s ease;
}

.modal-backdrop.active {
  display: flex;
}

.modal-window {
  background: var(--bg-dark-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 92%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  animation: popUpModal 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popUpModal {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.6);
  border-color: #ef4444;
  color: #fff;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  color: var(--text-primary);
}

/* ==========================================================================
   MODAIS: HERO CARDS & PAINEL TÁTICO
   ========================================================================== */

.modal-shot-dialog {
  max-width: 480px;
}

.modal-shot-header-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 12px;
  text-align: center;
  margin-bottom: 16px;
}

.modal-player-tag {
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
}

.modal-shot-badge {
  font-size: 22px;
  font-weight: 900;
  font-family: 'Montserrat', sans-serif;
  color: #38bdf8;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.shot-hero-decision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-shot-hero {
  border-radius: var(--radius-lg);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.btn-shot-hero:hover {
  transform: translateY(-3px) scale(1.02);
}

.btn-shot-hero:active {
  transform: translateY(2px) scale(0.97);
}

.btn-shot-made {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  border-color: #34d399;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-shot-miss {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #ffffff;
  border-color: #f87171;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.shot-hero-icon {
  font-size: 32px;
}

.shot-hero-texts {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shot-hero-title {
  font-size: 16px;
  font-weight: 900;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.5px;
}

.shot-hero-sub {
  font-size: 11px;
  opacity: 0.9;
  font-weight: 600;
}

.shot-extra-options-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px;
}

.shot-checkbox-pills {
  display: flex;
  gap: 10px;
}

.chip-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Modal Painel Tático */
.modal-tactical-actions {
  max-width: 560px;
}

.action-category-block {
  margin-bottom: 14px;
}

.category-header {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
  padding-left: 2px;
}

.action-grid-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-action-modal {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 11px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.btn-action-modal:hover {
  background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
}

.action-btn-ft {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(6, 182, 212, 0.25) 100%) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  color: #38bdf8 !important;
  font-weight: 800 !important;
}

.action-btn-ft:hover {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%) !important;
  color: #ffffff !important;
}

.danger-tone {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}

.danger-tone:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
}

.warning-tone {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fde047 !important;
}

.warning-tone:hover {
  background: #d97706 !important;
  color: #ffffff !important;
}

.timeout-tone {
  background: rgba(59, 130, 246, 0.15) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  color: #93c5fd !important;
}

.timeout-tone:hover {
  background: #2563eb !important;
  color: #ffffff !important;
}

/* Modal de Substituições */
.subs-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.subs-column-header {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--glass-border);
}

.sub-player-item {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-player-item:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(2px);
}

.sub-player-item.selected {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  border-color: #60a5fa;
  box-shadow: 0 0 12px var(--primary-blue-glow);
}

.btn-confirm-sub {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: 1px solid #34d399;
  border-radius: var(--radius-lg);
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
  width: 100%;
  cursor: pointer;
  margin-top: 14px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: all 0.15s ease;
}

.btn-confirm-sub:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.6);
}

/* ==========================================================================
   ECRÃ 2: VER ESTATÍSTICAS (VIEW STATS / ANALYTICS DASHBOARD)
   ========================================================================== */

.stats-screen-container {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.stats-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-dark-surface);
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.stats-filter-tabs {
  display: flex;
  gap: 6px;
}

.stats-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stats-tab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.stats-tab-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-export-excel {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  border: 1px solid #34d399;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: all 0.15s ease;
}

.btn-export-excel:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

/* Tabela de Marcador por Quarto */
.quarter-score-summary-card {
  background: var(--bg-dark-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.quarter-score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: center;
}

.quarter-score-table th,
.quarter-score-table td {
  padding: 10px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.quarter-score-table th {
  background: rgba(30, 41, 59, 0.7);
  font-weight: 700;
  color: var(--text-secondary);
}

.quarter-score-table td.team-name-cell {
  text-align: left;
  font-weight: 800;
  color: #ffffff;
}

.quarter-score-table td.total-cell {
  font-weight: 900;
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
}

/* Cartões Comparativos de Equipas */
.comp-stats-table-box {
  background: var(--bg-dark-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
}

.comp-table th,
.comp-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comp-team-header {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.comp-label-cell {
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  font-size: 13px;
}

.comp-val-cell {
  font-weight: 800;
  font-size: 14px;
  color: #ffffff;
  text-align: center;
}

/* Tabela de Jogadores - 30 Parâmetros do Excel */
.stats-table-wrapper {
  background: var(--bg-dark-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: var(--shadow-sm);
  max-height: 600px;
}

.stats-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.stats-data-table thead {
  position: sticky;
  top: 0;
  background: #1e293b;
  z-index: 2;
  border-bottom: 2px solid var(--primary-blue);
}

.stats-data-table th {
  padding: 10px 8px;
  font-weight: 800;
  color: #cbd5e1;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-data-table th.th-name {
  text-align: left;
  position: sticky;
  left: 0;
  background: #1e293b;
  z-index: 3;
}

.stats-data-table td {
  padding: 8px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}

.stats-data-table td.td-name {
  text-align: left;
  font-weight: 700;
  position: sticky;
  left: 0;
  background: var(--bg-dark-surface);
  z-index: 1;
  color: #ffffff;
}

.stats-data-table tr:hover td {
  background: rgba(37, 99, 235, 0.12);
}

.stats-data-table tr.total-row td {
  background: rgba(30, 41, 59, 0.95);
  font-weight: 900;
  border-top: 2px solid var(--primary-blue);
  color: #38bdf8;
}

.btn-row-chart {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-row-chart:hover {
  background: var(--primary-blue);
  transform: scale(1.1);
}

/* ==========================================================================
   ECRÃS 3 E 4: GERIR JOGOS E GERIR EQUIPAS
   ========================================================================== */

.manage-games-screen,
.manage-teams-screen {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.manage-top-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-dark-surface);
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.games-cards-grid,
.teams-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.game-card-item,
.team-card-item {
  background: var(--bg-dark-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-card-item:hover,
.team-card-item:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-md);
}

.game-card-scores {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
}

.score-row .team-pts {
  font-size: 20px;
  font-weight: 900;
  color: #38bdf8;
}

.accent-line-bar {
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  border-radius: 2px;
  margin: 4px 0;
}

.game-card-venue {
  font-size: 12px;
  color: var(--text-secondary);
}

.game-tags-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.game-card-buttons {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
}

.btn-card-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  text-align: center;
  transition: all 0.15s ease;
}

.btn-card-action:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-card-action.btn-resume {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.btn-card-delete {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-card-delete:hover {
  background: #ef4444;
  color: white;
}

.floating-add-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 99;
}

.floating-add-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.6);
}

/* ==========================================================================
   ECRÃ 5: MAPA DE LANÇAMENTOS (SHOT CHART)
   ========================================================================== */

.shot-chart-screen {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.shot-chart-header-summary {
  width: 100%;
  background: var(--bg-dark-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 15px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.shot-chart-canvas-box {
  width: 100%;
  max-width: 650px;
  height: 540px;
  background: #090e17;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Formulários nos Modais */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #cbd5e1;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: #ffffff;
  outline: none;
  transition: all 0.15s ease;
}

.form-control:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

/* ==========================================================================
   UPLOAD DE SÍMBOLO DO CLUBE & EMBLEMAS
   ========================================================================== */

.team-logo-upload-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.team-logo-preview-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.team-logo-preview-badge:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.logo-preview-placeholder {
  font-size: 28px;
}

.logo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-logo-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.logo-upload-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.btn-danger-text {
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

.btn-danger-text:hover {
  background: rgba(239, 68, 68, 0.25) !important;
}

/* Logos nos Cartões de Equipa e Laterais */
.team-card-logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.team-card-logo-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.sidebar-team-logo {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 4px;
  display: inline-block;
}

/* ==========================================================================
   OTIMIZAÇÕES RESPONSIVAS PARA ANDROID, SMARTPHONES & TABLETS
   ========================================================================== */

@media (max-width: 992px) {
  .live-header-bar {
    padding: 6px 10px;
    gap: 8px;
  }
  .team-name-title {
    max-width: 120px;
    font-size: 13px;
  }
  .team-big-score {
    font-size: 32px;
  }
  .clock-digits {
    font-size: 22px;
  }
  .players-sidebar {
    width: 100px;
    min-width: 100px;
    padding: 6px 4px;
    gap: 6px;
  }
  .player-jersey-card {
    min-height: 72px;
    padding: 6px 4px;
  }
  .jersey-number-large {
    font-size: 22px;
  }
  .jersey-player-name {
    font-size: 10px;
    max-width: 88px;
  }
  .live-bottom-bar {
    padding: 6px 8px;
    gap: 6px;
  }
  .action-cluster {
    padding: 3px 4px;
    gap: 4px;
  }
  .btn-action-hero,
  .btn-action-deck {
    padding: 6px 9px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .app-navbar {
    padding: 6px 8px;
    gap: 4px;
  }
  .brand-subtitle {
    display: none;
  }
  .nav-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .live-header-bar {
    flex-wrap: wrap;
    padding: 6px;
    gap: 6px;
    min-height: auto;
  }
  .team-score-panel {
    max-width: 48%;
    padding: 4px 8px;
  }
  .center-game-controls {
    order: 3;
    width: 100%;
    margin-top: 4px;
  }
  .header-action-tools {
    display: none;
  }
  .team-name-title {
    max-width: 80px;
    font-size: 11px;
  }
  .team-big-score {
    font-size: 24px;
  }
  .clock-digits {
    font-size: 20px;
  }
  .players-sidebar {
    width: 80px;
    min-width: 80px;
    padding: 4px 2px;
  }
  .player-jersey-card {
    min-height: 64px;
    padding: 4px 2px;
  }
  .jersey-number-large {
    font-size: 18px;
  }
  .jersey-player-name {
    font-size: 9px;
    max-width: 70px;
  }
  .live-bottom-bar {
    justify-content: flex-start;
  }
}
