/* ============================================================
   BALONCESTO ONLINE — VISTA ESPECTADOR · TIEMPO REAL
   Liga Escolar · marcador-deportivo/www/css/sport-specific/baloncesto-online.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&display=swap');

body.theme-baloncesto {
  --c-local:        #ff4757;
  --c-visitor:      #1e90ff;
  --c-gold:         #ffd700;
  --c-accent:       #f39c12;
  --c-orange:       #e67e22;
  --c-glass:        rgba(255, 255, 255, 0.05);
  --c-glass-border: rgba(255, 255, 255, 0.1);
  --c-text:         #f0f4ff;
  --c-muted:        rgba(240, 244, 255, 0.5);
  --font-display:   'Bebas Neue', sans-serif;
  --font-body:      'Outfit', 'Segoe UI', sans-serif;
}

body {
  font-family: 'Outfit', sans-serif;
  background:
    radial-gradient(ellipse 70% 50% at 15% 10%, rgba(230, 126, 34, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 85% 85%, rgba(30, 144, 255, 0.18) 0%, transparent 55%),
    linear-gradient(160deg, #07091c 0%, #110d24 40%, #150f2e 100%);
  min-height: 100vh;
  margin: 0;
  padding: 15px;
  color: #f0f4ff;
}

/* ── HEADER ────────────────────────────────────────────────── */
.app-header {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  min-height: 100px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.07);
}

.header-bg-image {
  opacity: 0.35;
  filter: brightness(0.55) saturate(1.2);
}

.header-left h1 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-left .subtitle {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
}

/* ── ESTADO DE CONEXIÓN ────────────────────────────────────── */
.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(240,244,255,0.7);
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(189,195,199,0.6);
  box-shadow: 0 0 5px rgba(189,195,199,0.3);
  flex-shrink: 0;
  transition: background 0.4s, box-shadow 0.4s;
}

.status-dot.good {
  background: #2ecc71;
  box-shadow: 0 0 8px rgba(46,204,113,0.8);
  animation: dotPulse 2s ease-in-out infinite;
}

.status-dot.laggy {
  background: #f39c12;
  box-shadow: 0 0 8px rgba(243,156,18,0.7);
}

.status-dot.bad {
  background: #e74c3c;
  box-shadow: 0 0 8px rgba(231,76,60,0.7);
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(0.7); opacity: 0.6; }
}

/* ── BANNER DE TIEMPO Y CUARTO ─────────────────────────────── */
.game-info-online {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  backdrop-filter: blur(10px);
  text-align: center;
}

.game-info-item h3 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240,244,255,0.5);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.game-info-item .val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  line-height: 1;
  color: #fff;
  letter-spacing: 0.05em;
}

.game-info-item .val.clock {
  color: #f39c12;
  text-shadow: 0 0 10px rgba(243, 156, 18, 0.4);
}

/* ── SCOREBOARD SOLO LECTURA ───────────────────────────────── */
.scoreboard-baloncesto {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: stretch;
}

.team-card {
  flex: 1;
  border-radius: 18px;
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.team-card#team1::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff4757, rgba(255,71,87,0.3));
}

.team-card#team2::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e90ff, rgba(30,144,255,0.3));
}

.team-card#team1 {
  background: linear-gradient(160deg, rgba(255,71,87,0.07) 0%, rgba(255,255,255,0.02) 60%);
}

.team-card#team2 {
  background: linear-gradient(160deg, rgba(30,144,255,0.07) 0%, rgba(255,255,255,0.02) 60%);
}

.team-name-display {
  font-size: clamp(0.85rem, 2.2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(240,244,255,0.7);
  text-align: center;
  padding: 4px 8px;
  margin-bottom: 2px;
  word-break: break-word;
}

.team-score-display {
  font-family: 'Bebas Neue', sans-serif !important;
  font-size: clamp(5.5rem, 20vw, 10rem) !important;
  line-height: 1 !important;
  margin: 6px 0 !important;
  letter-spacing: 0.02em;
}

.team-card#team1 .team-score-display {
  color: #ff4757;
  filter: drop-shadow(0 0 20px rgba(255,71,87,0.35));
}

.team-card#team2 .team-score-display {
  color: #1e90ff;
  filter: drop-shadow(0 0 20px rgba(30,144,255,0.35));
}

.team-fouls-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #f39c12;
}

.team-fouls-badge.bonus {
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c;
  color: #ff6b6b;
  animation: pulseBonus 1.5s infinite;
}

@keyframes pulseBonus {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── JUGADORES Y FALTAS ────────────────────────────────────── */
.players-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.players-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 12px;
}

.players-card h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(240,244,255,0.5);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.players-mini-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
}

.player-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.03);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.player-mini-item.expelled {
  background: rgba(231, 76, 60, 0.15);
  border-left: 3px solid #e74c3c;
  color: #ff7675;
}

.player-dorsal-tag {
  font-weight: 700;
  color: #f39c12;
}

.fouls-dots {
  display: flex;
  gap: 3px;
}

.foul-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}

.foul-dot.active {
  background: #f39c12;
  box-shadow: 0 0 5px rgba(243, 156, 18, 0.6);
}

.foul-dot.expelled {
  background: #e74c3c;
  box-shadow: 0 0 5px rgba(231, 76, 60, 0.8);
}

/* ── HISTORIAL Y COMENTARISTA IA ───────────────────────────── */
.history-section {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 0;
  backdrop-filter: blur(10px);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.history-header h3 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(240,244,255,0.45);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 0.82rem;
  color: rgba(240,244,255,0.85);
  animation: fadeIn 0.3s ease;
}

.history-item.local-point {
  border-left-color: #ff4757;
  background: rgba(255,71,87,0.07);
}

.history-item.visitor-point {
  border-left-color: #1e90ff;
  background: rgba(30,144,255,0.07);
}

.history-item.foul {
  border-left-color: #f39c12;
  background: rgba(243,156,18,0.07);
}

.history-item.quarter-change {
  border-left-color: #9b59b6;
  background: rgba(155,89,182,0.09);
  font-weight: 600;
}

.history-item.host-message {
  border-left-color: #e67e22;
  background: rgba(230, 126, 34, 0.14);
  box-shadow: 0 2px 10px rgba(230, 126, 34, 0.15);
}

.history-time {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.06em;
  color: rgba(240,244,255,0.4);
  font-size: 0.78rem;
  margin-right: 10px;
  min-width: 44px;
  flex-shrink: 0;
}

/* ── GRÁFICA DE EVOLUCIÓN ──────────────────────────────────── */
.chart-section {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 0;
  backdrop-filter: blur(10px);
}

.chart-container {
  position: relative;
  height: 240px;
  width: 100%;
}

/* ── COMPARTIR ─────────────────────────────────────────────── */
.control-group {
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.control-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(240,244,255,0.35);
  margin-bottom: 10px;
}

.export-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 75px;
  height: 75px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1) !important;
  cursor: pointer;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  gap: 6px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.btn-icon i { font-size: 1.35rem; }

.btn-icon:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(255,255,255,0.22) !important;
}

.btn-whatsapp {
  background: linear-gradient(145deg, #0e7736, #25d366);
  box-shadow: 0 4px 14px rgba(37,211,102,0.3);
}

.btn-share-current {
  background: linear-gradient(145deg, #e67e22, #d35400);
  box-shadow: 0 4px 14px rgba(230, 126, 34, 0.3);
}

#share-result-text {
  background: linear-gradient(145deg, #8e44ad, #9b59b6);
}

/* ── TOAST NOTIFICATIONS ───────────────────────────────────── */
.toast-notification {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(15, 12, 40, 0.94);
  color: #f0f4ff;
  padding: 12px 22px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 28px rgba(0,0,0,0.6);
  z-index: 1002;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
  backdrop-filter: blur(16px);
  white-space: nowrap;
}

.toast-notification.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast-notification.host-message {
  background: rgba(230, 126, 34, 0.95);
  border-color: #f39c12;
  color: #fff;
  white-space: normal;
  max-width: 90vw;
  text-align: center;
}

/* ── VISTA DE ENTRADA (LANDING) ────────────────────────────── */
.landing-view {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
  padding: 20px 0;
}

.landing-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 30px 24px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.landing-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.landing-card p {
  font-size: 0.88rem;
  color: rgba(240,244,255,0.65);
  margin-bottom: 20px;
  line-height: 1.4;
}

.input-group-landing {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.input-group-landing input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 0.95rem;
}

.input-group-landing button {
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.landing-note {
  font-size: 0.78rem !important;
  color: rgba(240,244,255,0.4) !important;
  margin: 0 !important;
}

/* ── OVERLAY DE RESUMEN FINAL ──────────────────────────────── */
.final-summary-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 28, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: 20px;
}

.final-summary-overlay.active {
  opacity: 1;
  visibility: visible;
}

.final-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}

.final-card h2 {
  font-size: 1.5rem;
  color: #ffd700;
  margin-bottom: 12px;
}

.final-winner {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.final-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem;
  color: #fff;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* ── BOTONES FLOTANTES ─────────────────────────────────────── */
.floating-home-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 1001;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.floating-home-btn:hover {
  background: linear-gradient(135deg, #e67e22, #d35400);
  transform: scale(1.08);
}

.hidden {
  display: none !important;
}

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

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .scoreboard-baloncesto {
    gap: 8px;
  }

  .team-card {
    padding: 14px 10px;
  }

  .game-info-online {
    grid-template-columns: 1fr 1fr;
  }

  .game-info-item:last-child {
    grid-column: span 2;
  }

  .players-section {
    grid-template-columns: 1fr;
  }
}
