/* ============================================
   BINGO ALTOKE — Design System v2
   Neón + Glassmorphism + Profundidad
   ============================================ */

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

/* === VARIABLES === */
:root {
  /* Backgrounds */
  --bg-primary: #0f0e17;
  --bg-secondary: rgba(26, 26, 46, 0.6);
  --bg-card: rgba(22, 33, 62, 0.5);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);

  /* Accent */
  --accent: #e94560;
  --accent-light: #ff6b81;
  --accent-glow: rgba(233, 69, 96, 0.4);
  --accent-secondary: #7c3aed;
  --accent-secondary-glow: rgba(124, 58, 237, 0.3);

  /* Semantic */
  --success: #2ecc71;
  --success-glow: rgba(46, 204, 113, 0.3);
  --warning: #f39c12;

  /* Text */
  --text: #eaeaea;
  --text-muted: #8892a4;

  /* Gradients */
  --gradient-accent: linear-gradient(135deg, #ff6b81, #e94560, #c0392b);
  --gradient-hero: linear-gradient(135deg, #e94560, #7c3aed);
  --gradient-bg: radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.08), transparent 60%),
                 radial-gradient(ellipse at 80% 20%, rgba(233, 69, 96, 0.06), transparent 60%);

  /* Elevation */
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-3: 0 8px 32px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);

  /* Misc */
  --radius: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* === LIGHT MODE === */
[data-theme="light"] {
  --bg-primary: #f5f5f7;
  --bg-secondary: rgba(240, 240, 245, 0.9);
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-glass: rgba(0, 0, 0, 0.03);
  --border: rgba(0, 0, 0, 0.1);
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --accent: #d6336c;
  --accent-light: #e8457a;
  --accent-glow: rgba(214, 51, 108, 0.2);
  --accent-secondary: #6c2bd9;
  --accent-secondary-glow: rgba(108, 43, 217, 0.15);
  --success: #16a34a;
  --success-glow: rgba(22, 163, 74, 0.15);
  --warning: #d97706;
  --gradient-accent: linear-gradient(135deg, #e8457a, #d6336c, #b91c51);
  --gradient-hero: linear-gradient(135deg, #d6336c, #6c2bd9);
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-3: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
  --gradient-bg: radial-gradient(ellipse at 20% 50%, rgba(108, 43, 217, 0.04), transparent 60%),
                 radial-gradient(ellipse at 80% 20%, rgba(214, 51, 108, 0.03), transparent 60%);
}

/* Light mode overrides for components with hardcoded dark colors */
[data-theme="light"] header { background: rgba(245, 245, 247, 0.92); }
[data-theme="light"] .nav-link:hover { background: rgba(0, 0, 0, 0.06); }
[data-theme="light"] .nav-group + .nav-group { border-color: var(--border); }
[data-theme="light"] .card { backdrop-filter: none; }
[data-theme="light"] .board-cell.last-number { background: var(--accent); color: #fff; }

/* === UTILITIES FOR CSP === */
.d-flex { display: flex !important; }
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.items-center { align-items: center !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.8rem !important; }
.gap-4 { gap: 1rem !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.8rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.w-100 { width: 100px !important; }
.w-140 { width: 140px !important; }
.w-150 { width: 150px !important; }
.w-auto { width: auto !important; }
.flex-1 { flex: 1 !important; }
.fs-sm { font-size: 0.85rem !important; }
.fs-lg { font-size: 1.2rem !important; }
.fs-xl { font-size: 1.5rem !important; }
.muted { color: var(--text-muted) !important; }
.accent { color: var(--accent) !important; }
.success { color: var(--success) !important; }
.mx-1 { margin-left: 0.3rem !important; margin-right: 0.3rem !important; }
.text-normal { color: var(--text) !important; }
.opacity-5 { opacity: 0.5 !important; }
.min-w-150 { min-width: 150px !important; }
.w-80 { width: 80px !important; }
.d-block { display: block !important; }
.d-none { display: none !important; }
.fw-600 { font-weight: 600 !important; }
.badge-manual { background: var(--accent-secondary) !important; color: white !important; }

/* === MODAL CONFIRM VARIANTS === */
.modal-confirm-danger { border-color: rgba(233,69,96,0.3) !important; }
.modal-confirm-danger .modal-confirm-header { background: rgba(233,69,96,0.1) !important; }
.modal-confirm-danger #modal-confirm { background: var(--accent) !important; color: #fff !important; }

.modal-confirm-warning { border-color: rgba(255,183,77,0.3) !important; }
.modal-confirm-warning .modal-confirm-header { background: rgba(255,183,77,0.1) !important; }
.modal-confirm-warning #modal-confirm { background: var(--warning) !important; color: #fff !important; }

.modal-confirm-info { border-color: rgba(157,78,221,0.3) !important; }
.modal-confirm-info .modal-confirm-header { background: rgba(157,78,221,0.1) !important; }
.modal-confirm-info #modal-confirm { background: var(--accent-secondary) !important; color: #fff !important; }

.modal-confirm-header span { font-size: 1.3rem !important; }
.modal-confirm-actions #modal-confirm { border: none !important; }

.toast-container-dynamic {
  position: fixed !important;
  bottom: 2rem !important;
  right: 2rem !important;
  z-index: 300 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
}

.flex-center-gap-3 {
  display: flex !important;
  align-items: center !important;
  gap: 0.8rem !important;
}

.flex-row-center-gap-2 {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
}

.filter-btn-primary {
  background: var(--accent) !important;
  color: white !important;
  border-radius: 0 !important;
  border: none !important;
  border-right: 1px solid var(--border) !important;
  font-size: 0.8rem !important;
  padding: 0.4rem 1rem !important;
}

.filter-btn-secondary {
  background: var(--bg-glass) !important;
  color: var(--text-muted) !important;
  border-radius: 0 !important;
  border: none !important;
  border-right: 1px solid var(--border) !important;
  font-size: 0.8rem !important;
  padding: 0.4rem 1rem !important;
}

.btn-tiny {
  font-size: 0.75rem !important;
  padding: 3px 8px !important;
}

.fs-tiny { font-size: 0.7rem !important; }
.max-w-320 { max-width: 320px !important; }
.w-fit-content { width: fit-content !important; }
.border-none { border: none !important; }
.border { border: 1px solid var(--border) !important; }
.rounded { border-radius: 8px !important; }
.mx-1 { margin-left: 0.3rem !important; margin-right: 0.3rem !important; }

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

/* === BODY + TEXTURED BACKGROUND === */
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-bg);
  pointer-events: none;
  z-index: 0;
}

/* Everything above the gradient overlay */
header, main, .connection-indicator, #toast-container {
  position: relative;
  z-index: 1;
}

/* === HEADER === */
header {
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--accent);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-3), 0 2px 20px rgba(233, 69, 96, 0.1);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-bingo {
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 4px;
}

.logo-pro {
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 4px;
  text-shadow: 0 0 20px var(--accent-glow);
}

nav[role="navigation"] {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-group + .nav-group {
  margin-left: 0.35rem;
  padding-left: 0.6rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
  text-shadow: 0 0 12px var(--accent-glow);
}

.nav-link.nav-sa {
  color: var(--accent);
  background: rgba(233, 69, 96, 0.08);
  border: 1px solid rgba(233, 69, 96, 0.2);
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav-link.nav-sa:hover, .nav-link.nav-sa.active {
  background: rgba(233, 69, 96, 0.18);
  border-color: rgba(233, 69, 96, 0.4);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.nav-link.nav-logout {
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0.7;
}

.nav-link.nav-logout:hover {
  color: var(--accent);
  opacity: 1;
}

/* === MAIN === */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* === BUTTONS === */
.btn {
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 2px 10px var(--success-glow);
}

.btn-success:hover {
  background: #27ae60;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--success-glow);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-warning:hover {
  background: #e08e0b;
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: rgba(233, 69, 96, 0.3);
  box-shadow: 0 0 12px rgba(233, 69, 96, 0.1);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  border-radius: 14px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  filter: grayscale(0.3);
}

/* === INPUTS === */
.input {
  padding: 0.7rem 1rem;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.3s var(--ease);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

/* === CARDS (GLASSMORPHISM) === */
.card {
  background: var(--bg-secondary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-1);
  transition: all 0.3s var(--ease);
}

/* === BADGES === */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge-pending { background: rgba(243, 156, 18, 0.15); color: var(--warning); }
.badge-active { background: rgba(46, 204, 113, 0.15); color: var(--success); box-shadow: 0 0 8px var(--success-glow); }
.badge-finished { background: rgba(136, 146, 164, 0.15); color: var(--text-muted); }

/* === GAMES LIST === */
.games-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.games-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  letter-spacing: 1px;
}

.game-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.game-item:hover {
  border-color: rgba(233, 69, 96, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2), 0 0 20px rgba(233, 69, 96, 0.05);
}

.game-info h3 {
  margin-bottom: 0.3rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.game-info .game-date { color: var(--text-muted); font-size: 0.85rem; }

.game-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

/* === CREATE GAME FORM === */
.create-form {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.create-form .input { min-width: 250px; }

/* === GAME DETAIL === */
.game-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.game-detail-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.game-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* === PROGRESS BAR === */
.progress-bar {
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-hero);
  border-radius: 3px;
  transition: width 0.5s var(--ease);
  box-shadow: 0 0 10px var(--accent-glow);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}

/* === STATS GRID === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  text-align: center;
  box-shadow: var(--shadow-1);
  transition: all 0.3s var(--ease);
}

.stat-card:hover {
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: var(--shadow-2), 0 0 20px var(--accent-secondary-glow);
  transform: translateY(-2px);
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.3rem;
  font-weight: 500;
}

/* === LAST DRAWN NUMBER — HERO ELEMENT === */
.last-drawn {
  text-align: center;
  margin-bottom: 2rem;
}

.last-drawn-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 4rem;
  font-weight: 900;
  box-shadow:
    0 0 30px var(--accent-glow),
    0 0 60px rgba(233, 69, 96, 0.2),
    0 0 100px rgba(233, 69, 96, 0.1),
    inset 0 -4px 12px rgba(0, 0, 0, 0.3);
  animation: pulseGlow 2s ease-in-out infinite;
  position: relative;
}

/* Outer ring glow */
.last-drawn-number::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(233, 69, 96, 0.3);
  animation: pulseRing 2s ease-in-out infinite;
}

.last-drawn-column {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  opacity: 0.9;
  margin-top: -0.3rem;
  letter-spacing: 2px;
}

.last-drawn-label {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.no-draws {
  color: var(--text-muted);
  font-style: italic;
}

/* === ANIMATIONS === */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow:
      0 0 30px var(--accent-glow),
      0 0 60px rgba(233, 69, 96, 0.2),
      0 0 100px rgba(233, 69, 96, 0.1),
      inset 0 -4px 12px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow:
      0 0 40px var(--accent-glow),
      0 0 80px rgba(233, 69, 96, 0.3),
      0 0 120px rgba(233, 69, 96, 0.15),
      inset 0 -4px 12px rgba(0, 0, 0, 0.3);
  }
}

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

@keyframes ballDrop {
  0% { transform: scale(0.3) translateY(-40px); opacity: 0; }
  60% { transform: scale(1.15) translateY(0); opacity: 1; }
  80% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.flash-in { animation: ballDrop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes cellPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* === CONFETTI === */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 150;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall 1.2s ease-out forwards;
  opacity: 0;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(400px) rotate(720deg) scale(0.5);
  }
}

/* === NUMBER BOARD === */
.number-board {
  margin-bottom: 2rem;
}

.number-board h3 {
  margin-bottom: 1rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-2);
}

.board-col-header {
  background: var(--gradient-accent);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: 1.2rem;
  text-align: center;
  padding: 0.6rem;
  letter-spacing: 2px;
}

.board-cell {
  background: var(--bg-secondary);
  backdrop-filter: blur(4px);
  text-align: center;
  padding: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: all 0.3s var(--ease);
}

.board-cell.drawn {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: inset 0 0 8px rgba(233, 69, 96, 0.3);
}

.board-cell.cell-pop {
  animation: cellPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.board-cell.last-number {
  background: #fff;
  color: var(--accent);
  font-weight: 900;
  box-shadow: 0 0 12px var(--accent-glow), inset 0 0 0 2px var(--accent);
}

/* === DRAW BUTTON === */
.draw-section {
  text-align: center;
  margin: 2rem 0;
}

.btn-draw {
  padding: 1.2rem 3rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  border-radius: 50px;
  background: var(--gradient-hero);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.3s var(--ease);
  box-shadow:
    0 4px 20px var(--accent-glow),
    0 0 60px rgba(233, 69, 96, 0.15);
  position: relative;
  overflow: hidden;
}

.btn-draw::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}

.btn-draw:hover::before {
  left: 100%;
}

.btn-draw:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 8px 30px var(--accent-glow),
    0 0 80px rgba(233, 69, 96, 0.2);
}

.btn-draw:active { transform: translateY(0) scale(0.98); }

.btn-draw:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  filter: grayscale(0.3);
}

.btn-draw:disabled::before { display: none; }

/* === HISTORY === */
.history { margin-top: 2rem; }
.history h3 {
  margin-bottom: 1rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.history-item {
  background: var(--bg-card);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s var(--ease);
}

.history-item:hover {
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 0 8px var(--accent-secondary-glow);
}

.history-item .col-letter {
  color: var(--accent);
  margin-right: 2px;
  font-weight: 800;
}

/* === GENERATE CARDS SECTION === */
.generate-section {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* === CARDS VIEWER === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.bingo-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 0.8rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  transition: all 0.3s var(--ease);
}

.bingo-card:hover {
  border-color: rgba(233, 69, 96, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.bingo-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
}

.bingo-card-header {
  background: var(--gradient-accent);
  color: #fff;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  padding: 0.3rem;
  font-size: 0.8rem;
}

.bingo-card-cell {
  background: var(--bg-secondary);
  text-align: center;
  padding: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.bingo-card-cell.free {
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 800;
  text-shadow: 0 0 8px var(--accent-glow);
}

.bingo-card-cell.matched {
  background: rgba(233, 69, 96, 0.3);
  color: #fff;
  font-weight: 800;
}

.bingo-card-id {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 1px;
}

/* === PAGINATION === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* === SECTIONS === */
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* === BACK LINK === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  transition: all 0.3s var(--ease);
}

.back-link:hover {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
  transform: translateX(-3px);
}

/* === TOAST === */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  animation: slideIn 0.3s ease-out;
  max-width: 350px;
  box-shadow: var(--shadow-2);
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--accent); }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  to { transform: translateX(20px); opacity: 0; }
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
}

/* === LOADING === */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* === CONNECTION INDICATOR === */
.connection-indicator {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-size: 0.75rem;
  z-index: 200;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  transition: all 0.3s var(--ease);
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: background 0.3s;
}

.connection-online .connection-dot {
  background: var(--success);
  box-shadow: 0 0 6px var(--success-glow);
}

.connection-offline .connection-dot {
  background: var(--warning);
  animation: blink 1s infinite;
}

.connection-offline .connection-text { color: var(--warning); }

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

/* Highlight animation for newly created games */
@keyframes highlightNew {
  0% { box-shadow: 0 0 0 3px var(--accent); transform: scale(1.01); }
  50% { box-shadow: 0 0 20px var(--accent-glow); }
  100% { box-shadow: none; transform: scale(1); }
}

/* Old .modal-overlay/.modal-box removed — use .modal-confirm-overlay system (see below) */

/* === SOUND TOGGLE === */
.sound-toggle {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.4rem 0.8rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.sound-toggle:hover {
  border-color: rgba(233, 69, 96, 0.3);
  color: var(--text);
}

.sound-toggle.active {
  border-color: rgba(46, 204, 113, 0.3);
  color: var(--success);
}

/* === FULLSCREEN PROJECTION MODE === */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fullscreen-overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-bg);
  pointer-events: none;
}

.fullscreen-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.fullscreen-topbar h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 1px;
}

.fullscreen-topbar .badge {
  margin-left: 0.8rem;
}

.fullscreen-close {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-close:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.fullscreen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  position: relative;
  z-index: 1;
  padding: 1rem 2rem;
  overflow-y: auto;
}

.fullscreen-body .last-drawn-number {
  width: 220px;
  height: 220px;
  font-size: 5.5rem;
}

.fullscreen-body .last-drawn-number::before {
  inset: -12px;
  border-width: 3px;
}

.fullscreen-body .last-drawn-column {
  font-size: 1.3rem;
}

.fullscreen-body .last-drawn-label {
  font-size: 1.1rem;
}

.fullscreen-body .btn-draw {
  padding: 1.5rem 4rem;
  font-size: 1.6rem;
}

.fullscreen-stats {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.fullscreen-stat {
  text-align: center;
}

.fullscreen-stat .stat-value {
  font-size: 2.5rem;
}

.fullscreen-stat .stat-label {
  font-size: 0.9rem;
}

.fullscreen-progress {
  width: 100%;
  max-width: 500px;
}

.fullscreen-history {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 600px;
}

.fullscreen-board-mini {
  max-width: 500px;
  width: 100%;
}

.fullscreen-board-mini .board-grid {
  font-size: 0.85rem;
}

/* === EMOTIONAL STATES (intensity levels) === */
/* Low intensity: numbers 1-25 (default) — normal state */

/* Mid intensity: numbers 26-50 */
.intensity-mid .last-drawn-number {
  animation-duration: 1.5s;
}

.intensity-mid .progress-fill {
  box-shadow: 0 0 15px var(--accent-glow);
}

.intensity-mid .btn-draw {
  box-shadow:
    0 4px 25px var(--accent-glow),
    0 0 70px rgba(233, 69, 96, 0.2);
}

/* High intensity: numbers 51-75 */
.intensity-high .last-drawn-number {
  animation-duration: 1s;
}

.intensity-high .last-drawn-number::before {
  border-color: rgba(233, 69, 96, 0.5);
  animation-duration: 1s;
}

.intensity-high .progress-fill {
  box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(233, 69, 96, 0.15);
}

.intensity-high .btn-draw {
  box-shadow:
    0 4px 30px var(--accent-glow),
    0 0 80px rgba(233, 69, 96, 0.25);
  animation: btnPulse 1.5s ease-in-out infinite;
}

.intensity-high .board-cell.drawn {
  box-shadow: inset 0 0 10px rgba(233, 69, 96, 0.4);
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 4px 30px var(--accent-glow), 0 0 80px rgba(233, 69, 96, 0.25); }
  50% { box-shadow: 0 4px 40px var(--accent-glow), 0 0 100px rgba(233, 69, 96, 0.35); }
}

/* === RESPONSIVE: TABLET === */
@media (max-width: 768px) {
  .header-content { flex-direction: column; gap: 0.5rem; }
  nav[role="navigation"] { flex-wrap: wrap; justify-content: center; }
  .nav-group + .nav-group { margin-left: 0; padding-left: 0; border-left: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .last-drawn-number { width: 120px; height: 120px; font-size: 3rem; }
  .last-drawn-number::before { inset: -6px; }
  .btn-draw { padding: 1rem 2rem; font-size: 1.1rem; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* === RESPONSIVE: MOBILE SMALL === */
@media (max-width: 480px) {
  header { padding: 0.75rem 1rem; }
  .logo-bingo, .logo-pro { font-size: 1.2rem; letter-spacing: 2px; }
  .board-cell { padding: 0.3rem; font-size: 0.75rem; }
  .board-col-header { font-size: 1rem; padding: 0.4rem; }
  .btn-draw { width: 100%; max-width: 300px; }
  .history-list { max-height: 120px; overflow-y: auto; }
  .connection-indicator { top: auto; bottom: 1rem; right: 1rem; }
  .last-drawn-number { width: 100px; height: 100px; font-size: 2.5rem; }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  /* Desactivar animaciones decorativas pero preservar transiciones funcionales (ej: hover, collapse) */
  .confetti-piece,
  .confetti-container,
  .last-drawn-number.flash-in,
  .progress-fill::after,
  .waiting-dots span,
  .spinner {
    animation: none !important;
  }
  .last-drawn-number,
  .btn-draw {
    transition-duration: 0.01ms !important;
  }
}

/* === ROUNDS === */
.rounds-section { padding: 1.5rem; }

.rounds-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.round-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  transition: all 0.3s var(--ease);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.round-item.active-round {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.round-item.completed {
  opacity: 0.7;
}

.round-info {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.round-name { font-weight: 700; }
.round-pattern {
  font-size: 0.8rem;
  color: var(--accent-light);
  background: rgba(233, 69, 96, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.round-prize {
  font-size: 0.8rem;
  color: var(--success);
}

.round-status {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

/* === WINNERS === */
.winners-section { padding: 1.5rem; }

.winners-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.winner-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(46, 204, 113, 0.03));
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.winner-round { font-weight: 600; }
.winner-name { color: var(--success); font-weight: 700; }
.winner-prize { font-size: 0.85rem; color: var(--text-muted); }

/* === ASSIGN === */
.assign-results-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.assign-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  gap: 0.5rem;
}

/* === ACCESSIBILITY — LARGE FONT === */
body.font-large {
  font-size: 1.1rem;
}

body.font-large .stat-value { font-size: 2.5rem; }
body.font-large .board-cell { font-size: 0.95rem; width: 50px; height: 50px; }
body.font-large .btn { font-size: 1rem; padding: 0.8rem 1.6rem; }

body.font-extra-large {
  font-size: 1.25rem;
}

body.font-extra-large .stat-value { font-size: 3rem; }
body.font-extra-large .board-cell { font-size: 1.1rem; width: 56px; height: 56px; }
body.font-extra-large .btn { font-size: 1.1rem; padding: 1rem 2rem; }
body.font-extra-large .last-drawn-number { width: 200px; height: 200px; font-size: 5rem; }

/* === BREADCRUMBS === */
.breadcrumbs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs .breadcrumb-sep {
  margin: 0 0.4rem;
  opacity: 0.5;
}

.breadcrumbs .breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

/* === CONFIRM MODAL === */
.modal-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modalFadeIn 0.2s ease-out;
}

.modal-confirm-overlay.modal-closing {
  animation: modalFadeOut 0.2s ease-out forwards;
}

.modal-confirm {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 420px;
  width: 92%;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(233, 69, 96, 0.08);
  overflow: hidden;
  animation: modalSlideUp 0.25s ease-out;
}

.modal-closing .modal-confirm {
  animation: modalSlideDown 0.2s ease-out forwards;
}

.modal-confirm-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.2rem 1.5rem;
}

.modal-confirm-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.modal-confirm-body {
  padding: 0.5rem 1.5rem 1.2rem;
}

.modal-confirm-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.modal-confirm-actions {
  display: flex;
  gap: 0.6rem;
  padding: 0 1.5rem 1.5rem;
  justify-content: flex-end;
}

.modal-confirm-actions .btn {
  min-width: 100px;
  justify-content: center;
  font-size: 0.85rem;
  padding: 0.55rem 1.2rem;
}

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes modalSlideDown { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(10px) scale(0.97); } }

/* === PRINT === */
@media print {
  header, .back-link, .btn, .game-actions, .draw-section,
  .generate-section, .connection-indicator, #toast-container,
  .progress-bar, .confetti-container, .fullscreen-overlay, .modal-confirm-overlay { display: none; }
  body { background: white; color: black; }
  body::before { display: none; }
  .card, .stat-card { border: 1px solid #ccc; background: white; backdrop-filter: none; }
  .stat-value { color: black; }
  .board-cell.drawn { background: #333; color: white; }
  .bingo-card { page-break-inside: avoid; border: 1px solid #333; backdrop-filter: none; }
  main { max-width: 100%; margin: 0; padding: 0.5rem; }
}

/* === ACCESSIBILITY === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 999;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  overflow: visible;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  z-index: 999;
}

/* === CHAT === */
.chat-messages { max-height: 300px; overflow-y: auto; padding: 0.5rem; }
.chat-message { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.chat-sender { font-weight: 700; font-size: 0.85rem; color: var(--accent); }
.chat-sender.operator { color: var(--success); }
.chat-text { font-size: 0.9rem; }
.chat-time { font-size: 0.7rem; color: var(--text-muted); }
.chat-input-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.chat-input-row .input { flex: 1; }

/* === HELP TOOLTIPS === */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 0.3rem;
  flex-shrink: 0;
}
.help-tip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(max(-50%, calc(-100vw + 260px)));
  background: var(--bg-primary, #0f0e17);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: normal;
  width: max-content;
  max-width: min(240px, 80vw);
  z-index: 100;
  box-shadow: var(--shadow-2);
  line-height: 1.4;
}
.help-tip:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
  z-index: 101;
}
