/* ESTILOS PANTALLA TV - GRAN CASINO LAS VEGAS */
:root {
  --bg-deep: #07090E;
  --bg-surface: #0F172A;
  --bg-card: #1E293B;
  --gold-primary: #F59E0B;
  --gold-light: #FCD34D;
  --gold-dark: #B45309;
  --emerald: #10B981;
  --cyan-neon: #06B6D4;
  --red-accent: #EF4444;
  --text-main: #FFFFFF;
  --text-muted: #94A3B8;
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

/* Escenario TV 16:9 Adaptativo */
.tv-stage {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 50% 20%, #172554 0%, #07090E 70%);
  padding: 16px 24px;
  position: relative;
}

/* Marquesina Superior */
.marquee-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 16px;
  padding: 12px 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.2);
  margin-bottom: 16px;
  flex-shrink: 0;
}

.marquee-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.casino-crown {
  font-size: 38px;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8));
  animation: pulse-glow 2.5s infinite alternate;
}

.brand-text h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: 2px;
  font-weight: 900;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--gold-light) 40%, var(--gold-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text .sub-brand {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold-light);
  font-weight: 600;
  display: block;
}

/* Indicador de Ronda y Premio */
.round-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 16px;
  border-radius: 40px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.round-badge {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  color: #000;
  font-weight: 900;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 1px;
}

.figure-badge {
  color: var(--emerald);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.prize-marquee {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #F8FAFC;
  background: rgba(245, 158, 11, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px dashed var(--gold-primary);
}

.live-status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 30px;
}

.live-dot {
  width: 10px;
  height: 10px;
  background-color: var(--red-accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--red-accent);
  animation: blink 1.2s infinite;
}

.live-text {
  font-weight: 800;
  font-size: 12px;
  color: #F8FAFC;
  letter-spacing: 1px;
}

.players-count {
  font-size: 12px;
  color: var(--cyan-neon);
  font-weight: 700;
}

/* Cuerpo Central Dividido */
.stage-body {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

/* Canasta 3D y Riel Teatral */
.cage-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: radial-gradient(circle at 50% 38%, rgba(30, 58, 138, 0.4) 0%, rgba(15, 23, 42, 0.85) 55%, rgba(7, 9, 14, 0.98) 100%);
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: 24px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85), inset 0 0 50px rgba(0, 0, 0, 0.95);
}

.cage-frame {
  position: relative;
  width: 440px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#cageCanvas {
  width: 440px;
  height: 380px;
  display: block;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.9));
}

/* Riel y Pedestal de Balota Gigante */
.chute-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
}

.ball-pedestal {
  position: relative;
  z-index: 5;
}

.drawn-ball-big {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFFFFF 0%, #F8FAFC 40%, #CBD5E1 70%, #64748B 100%);
  border: 4px solid var(--gold-light);
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.7), inset -8px -8px 20px rgba(0, 0, 0, 0.6), inset 8px 8px 15px rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: scale(1);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.drawn-ball-big.active {
  animation: ball-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ball-letter {
  font-size: 26px;
  font-weight: 900;
  color: #1E293B;
  line-height: 1;
}

.ball-number {
  font-size: 54px;
  font-weight: 900;
  color: #0F172A;
  line-height: 1;
}

.ball-callout {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

/* Tablero Maestro 1 al 75 Estilo Marquesina */
.board-section {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(7, 9, 14, 0.95) 100%);
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  padding-bottom: 10px;
}

.board-header h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--gold-light);
  letter-spacing: 2px;
}

.board-stats {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.board-stats strong {
  color: var(--gold-primary);
  font-size: 16px;
}

/* Grilla del Tablero Maestro */
.master-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  justify-content: space-between;
}

.board-row {
  display: grid;
  grid-template-columns: 60px repeat(15, 1fr);
  gap: 6px;
  align-items: center;
}

.row-letter-header {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1E293B, #0F172A);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--gold-light);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* Celda Bombillo del Tablero */
.board-cell {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Estado Bombillo Encendido en Oro */
.board-cell.lit {
  background: radial-gradient(circle at 50% 50%, #FEF08A 0%, #F59E0B 60%, #B45309 100%);
  color: #000000;
  font-weight: 900;
  border-color: #FEF08A;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.9), 0 0 30px rgba(245, 158, 11, 0.4);
  transform: scale(1.05);
  z-index: 2;
}

/* Último número extraído parpadea */
.board-cell.latest {
  animation: neon-pulse 1.2s infinite alternate;
  border: 2px solid #FFFFFF;
}

/* Bandeja Inferior de Historial */
.history-tray {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 14px;
  padding: 8px 16px;
  margin-top: 14px;
  height: 54px;
  flex-shrink: 0;
}

.tray-title {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 1px;
}

.tray-balls {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  align-items: center;
}

.tray-ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFFFFF 0%, #E2E8F0 50%, #94A3B8 100%);
  color: #0F172A;
  font-weight: 900;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.empty-tray-text {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* Modal Overlay de Ganador con Celebración */
.winner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

.winner-overlay.hidden {
  display: none;
  opacity: 0;
}

#fireworksCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.winner-modal {
  background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
  border: 3px solid var(--gold-primary);
  border-radius: 28px;
  padding: 40px 60px;
  text-align: center;
  max-width: 600px;
  position: relative;
  box-shadow: 0 0 80px rgba(245, 158, 11, 0.6);
  animation: zoom-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.winner-ribbon {
  background: linear-gradient(90deg, #DC2626, #EF4444, #DC2626);
  color: #FFFFFF;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 18px;
  padding: 8px 30px;
  border-radius: 30px;
  letter-spacing: 2px;
  margin-bottom: 20px;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
  position: relative;
  z-index: 2;
}

.winner-radiance {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, rgba(239, 68, 68, 0.15) 45%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
  animation: radiance-spin 12s linear infinite;
  z-index: 1;
}

.winner-cup-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 8px;
  z-index: 2;
}

.winner-crown {
  font-size: 86px;
  display: inline-block;
  filter: drop-shadow(0 0 25px rgba(245, 158, 11, 0.9)) drop-shadow(0 0 45px rgba(254, 240, 138, 0.6));
  animation: cup-bounce 2s ease-in-out infinite;
}

.cup-sparkle {
  position: absolute;
  font-size: 24px;
  pointer-events: none;
  animation: sparkle-float 1.8s ease-in-out infinite alternate;
}

.cup-sparkle.s1 { top: -5px; left: -15px; animation-delay: 0s; }
.cup-sparkle.s2 { top: -12px; right: -10px; animation-delay: 0.6s; font-size: 28px; }
.cup-sparkle.s3 { bottom: 5px; right: -20px; animation-delay: 1.2s; }

.winner-modal h2 {
  font-size: 42px;
  font-weight: 900;
  color: #FFFFFF;
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(245, 158, 11, 0.6);
  position: relative;
  z-index: 2;
}

.winner-card-pill {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  font-weight: 800;
  font-size: 18px;
  padding: 6px 20px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 16px;
}

.winner-prize {
  font-size: 24px;
  font-weight: 800;
  color: var(--emerald);
  margin-bottom: 16px;
}

.winner-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.btn-continue-game {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-primary) 100%);
  color: #000;
  font-weight: 900;
  font-size: 16px;
  padding: 12px 36px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
  transition: transform 0.2s;
}

.btn-continue-game:hover {
  transform: scale(1.05);
}

/* Animaciones */
@keyframes pulse-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5)); }
  100% { transform: scale(1.1); filter: drop-shadow(0 0 25px rgba(245, 158, 11, 0.9)); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes neon-pulse {
  0% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.9); }
  100% { box-shadow: 0 0 35px rgba(254, 240, 138, 1), 0 0 60px rgba(245, 158, 11, 0.8); }
}

@keyframes ball-pop {
  0% { transform: scale(0.3) rotate(-30deg); opacity: 0; }
  70% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes zoom-in {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes cup-bounce {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  50% { transform: translateY(-10px) scale(1.08) rotate(-3deg); }
}

@keyframes sparkle-float {
  0% { transform: scale(0.6) rotate(0deg); opacity: 0.4; }
  100% { transform: scale(1.3) rotate(35deg); opacity: 1; }
}

@keyframes radiance-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}
