/* ==========================================================================
   BINGO JAR ORGANIZER — DESIGN SYSTEM & VISUAL STYLE
   Vanilla CSS3 with HSL Variables, Glassmorphism, and responsive grids
   ========================================================================== */

/* --- Fonts & Core Variables --- */
:root {
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Modern HSL Color Palette (Dark Space Theme) */
  --bg-dark: 220 28% 6%;         /* #0B0E14 */
  --bg-card: 220 20% 12%;        /* #161B25 */
  --bg-card-hover: 220 20% 16%;  /* #202737 */
  --border-light: 0 0% 100% / 0.06;
  --border-active: 240 100% 70% / 0.3;
  
  /* Brand/Status Accents */
  --color-primary: 242 80% 63%;     /* Electric Indigo (#5E5CE6) */
  --color-secondary: 279 80% 63%;   /* Neon Violet (#BF5AF2) */
  --color-gold: 48 100% 50%;         /* Gold Highlight (#FFD60A) */
  --color-success: 142 66% 50%;      /* Emerald Green (#30D158) */
  --color-danger: 358 100% 62%;      /* Coral Red (#FF453A) */
  --color-info: 200 100% 55%;        /* Sky Blue */

  /* Gradients */
  --gradient-dark: linear-gradient(135deg, hsl(220 30% 6%), hsl(220 18% 11%));
  --gradient-primary: linear-gradient(135deg, hsl(242 80% 63%), hsl(279 80% 63%));
  --gradient-gold: linear-gradient(135deg, hsl(48 100% 50%), hsl(35 100% 55%));
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));

  /* UI Constants */
  --header-height: 60px;
  --nav-height: 70px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 16px hsla(242, 80%, 63%, 0.4);
  
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Base & Reset Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: hsl(var(--bg-dark));
  color: #F2F4F7;
  font-family: var(--font-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  position: fixed; /* Prevents scroll elasticity on iOS devices */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Scrollbar styling for desktop browsing */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Core App Layout --- */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100dvh;
  position: relative;
  background: var(--gradient-dark);
}

/* App Header */
.app-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(11, 14, 20, 0.7);
  z-index: 10;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-height) + env(safe-area-inset-top));
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px hsla(242, 80%, 63%, 0.5));
}

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #FFF, #BFC9D9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.date-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: #A3AED0;
}

/* Main Area Container */
.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  height: calc(100vh - var(--header-height) - var(--nav-height));
  /* safe padding for iOS home indicator bar */
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* Screens toggling logic */
.app-screen {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.app-screen.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* App Bottom Navigation Bar */
.app-nav {
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--border-light);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(22, 27, 37, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  color: #718096;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.nav-item .nav-icon {
  font-size: 1.4rem;
  transition: transform var(--transition-bounce);
}

.nav-item:hover {
  color: #E2E8F0;
}

.nav-item.active {
  color: hsl(var(--color-primary));
}

.nav-item.active .nav-icon {
  transform: scale(1.15) translateY(-2px);
  filter: drop-shadow(0 4px 10px hsla(var(--color-primary), 0.5));
}

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 24px;
  height: 3px;
  background: hsl(var(--color-primary));
  border-radius: 0 0 3px 3px;
  box-shadow: 0 2px 10px hsla(var(--color-primary), 0.8);
}

/* ==========================================================================
   UI Components (Cards, Panels, Buttons)
   ========================================================================== */

/* Glassmorphic Panel/Card */
.panel {
  background: var(--gradient-glass);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.panel-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFF;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.full-width-panel {
  flex: 1;
}

/* Stats Summary Cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  width: 100%;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #718096;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFF;
  letter-spacing: -0.01em;
}

.pot-card {
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.05), rgba(255, 149, 0, 0.02));
  border-color: rgba(255, 214, 10, 0.15);
}

.pot-card .stat-value {
  color: hsl(var(--color-gold));
  text-shadow: 0 0 10px rgba(255, 214, 10, 0.2);
}

.player-card {
  background: linear-gradient(135deg, rgba(94, 92, 230, 0.05), rgba(191, 90, 242, 0.02));
  border-color: rgba(94, 92, 230, 0.15);
}

.player-card .stat-value {
  color: #BFC9D9;
}

.paid-card {
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.05), rgba(255, 69, 58, 0.01));
  border-color: rgba(255, 69, 58, 0.15);
}

/* Button System */
.btn {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #FFF;
  padding: 10px 16px;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px hsla(var(--color-primary), 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
  color: #FFF;
  padding: 10px 16px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: hsl(var(--color-danger));
  color: #FFF;
  padding: 10px 16px;
}

.btn-danger:hover {
  background: hsl(var(--color-danger) / 0.85);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid hsl(var(--color-danger) / 0.4);
  color: hsl(var(--color-danger));
  padding: 10px 16px;
}

.btn-danger-outline:hover {
  background: hsl(var(--color-danger) / 0.1);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 6px;
}

.btn-large {
  font-size: 1.1rem;
  padding: 14px 28px;
  border-radius: var(--radius-md);
}

.btn-close-modal {
  background: none;
  border: none;
  color: #718096;
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close-modal:hover {
  color: #FFF;
}

.full-width {
  width: 100%;
}

/* --- Search & Form Inputs --- */
.search-bar {
  width: 100%;
  position: relative;
}

.search-bar input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: #FFF;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.search-bar input:focus {
  outline: none;
  border-color: hsl(var(--color-primary));
  box-shadow: 0 0 10px hsla(var(--color-primary), 0.25);
  background: rgba(0, 0, 0, 0.35);
}

.divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 5px 0;
}

/* ==========================================================================
   DASHBOARD SCREEN SPECIFIC
   ========================================================================== */

/* Dynamic Game pill-tabs selection */
.game-tabs-wrapper {
  width: 100%;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 5px;
}

.game-tabs {
  display: flex;
  gap: 10px;
  padding: 4px;
  background: rgba(0,0,0,0.15);
  border-radius: var(--radius-md);
  width: max-content;
  border: 1px solid var(--border-light);
}

.game-tab {
  background: none;
  border: none;
  color: #718096;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-bounce);
  white-space: nowrap;
}

.game-tab.active {
  color: #FFF;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-sm);
}

/* Split Pane Grid Layout */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  flex: 1;
}

@media (min-width: 900px) {
  .workspace-grid {
    grid-template-columns: 360px 1fr;
  }
}

.list-panel {
  max-height: 550px;
  overflow: hidden;
}

.player-list-container {
  flex: 1;
  overflow-y: auto;
  min-height: 250px;
}

/* Player entries items */
.active-player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.player-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.player-item-details {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-number-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(94, 92, 230, 0.15);
  border: 1px solid hsl(var(--color-primary) / 0.3);
  color: #A3AED0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.player-item.unpaid .player-number-pill {
  background: rgba(255, 69, 58, 0.1);
  border-color: hsl(var(--color-danger) / 0.3);
}

.player-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #FFF;
}

.player-item-meta {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Custom Custom Checkbox for cash payment */
.payment-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: #718096;
}

.payment-checkbox-wrapper input {
  display: none;
}

.checkbox-visual {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-fast);
}

.payment-checkbox-wrapper:hover .checkbox-visual {
  border-color: rgba(255,255,255,0.4);
}

.payment-checkbox-wrapper input:checked + .checkbox-visual {
  border-color: hsl(var(--color-success));
  background: hsl(var(--color-success));
}

.payment-checkbox-wrapper input:checked + .checkbox-visual::after {
  content: '✓';
  color: #FFF;
  font-weight: 800;
  font-size: 0.75rem;
}

.payment-checkbox-wrapper input:checked ~ span {
  color: hsl(var(--color-success));
}

.player-item.unpaid {
  border-color: rgba(255, 69, 58, 0.15);
  background: rgba(255, 69, 58, 0.02);
}

.btn-delete-player {
  background: none;
  border: none;
  color: #718096;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.btn-delete-player:hover {
  color: hsl(var(--color-danger));
  background: rgba(255, 69, 58, 0.08);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #718096;
  font-size: 0.9rem;
  font-style: italic;
}

/* Grid Board (1 to 90 Layout) */
.grid-panel {
  max-width: 100%;
}

.grid-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr); /* Crucial: 10 Columns */
  gap: 6px;
  width: 100%;
  max-width: 600px;
}

.grid-cell {
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.15);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: #4A5568;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
  text-decoration: none;
  min-width: 0;
}

.grid-cell:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.25);
  color: #FFF;
}

.grid-cell.taken {
  background: rgba(94, 92, 230, 0.15);
  border: 1px solid hsl(var(--color-primary) / 0.4);
  color: hsl(var(--color-primary) / 0.8);
}

.grid-cell.taken::after {
  content: attr(data-initials);
  position: absolute;
  bottom: 2px;
  font-size: 0.55rem;
  font-weight: 700;
  color: #FFF;
  background: hsl(var(--color-primary));
  padding: 0 4px;
  border-radius: 4px;
  max-width: 85%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-cell.taken.unpaid {
  background: rgba(255, 69, 58, 0.1);
  border-color: hsl(var(--color-danger) / 0.4);
}

.grid-cell.taken.unpaid::after {
  background: hsl(var(--color-danger));
}

.grid-cell-number {
  font-size: 1rem;
  font-weight: 700;
}

.grid-cell.taken .grid-cell-number {
  color: #FFF;
  transform: translateY(-4px);
}

/* Legend colors */
.grid-legend {
  display: flex;
  gap: 15px;
  font-size: 0.8rem;
  color: #718096;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.free {
  border: 1px dashed rgba(255, 255, 255, 0.4);
}

.legend-dot.taken {
  background: hsl(var(--color-primary));
}

/* ==========================================================================
   REGULARS SCREEN SPECIFIC
   ========================================================================== */

.regulars-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.regular-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.regular-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.regular-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.regular-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFF;
}

.regular-notes {
  font-size: 0.8rem;
  color: #718096;
}

.regular-fav-numbers {
  display: flex;
  gap: 8px;
  margin-top: 5px;
  align-items: center;
}

.regular-fav-numbers-title {
  font-size: 0.75rem;
  color: #718096;
  font-weight: 500;
}

.fav-num-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #A3AED0;
}

.fav-num-badge span {
  font-size: 0.65rem;
  color: #718096;
  margin-right: 2px;
}

.regular-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   LIVE DRAW / WINNER FINDER SCREEN
   ========================================================================== */

.draw-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  flex: 1;
}

@media (min-width: 900px) {
  .draw-workspace {
    grid-template-columns: 1fr 300px;
  }
}

.draw-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.callboard-panel {
  flex: 1;
}

/* Specific styling for drawing cells */
.draw-grid .grid-cell {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #4A5568;
  aspect-ratio: 1;
  border-radius: 50%; /* Classic bingo balls shape */
  font-size: 1.1rem;
}

.draw-grid .grid-cell.drawn {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #FFF;
  box-shadow: 0 0 15px hsla(var(--color-primary), 0.6);
  transform: scale(0.95);
  animation: ball-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes ball-pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(0.95); opacity: 1; }
}

.draw-grid .grid-cell.registered-number {
  border: 1px solid hsl(var(--color-gold) / 0.4);
  color: hsl(var(--color-gold));
  background: rgba(255, 214, 10, 0.03);
}

.draw-grid .grid-cell.registered-number.drawn {
  background: var(--gradient-gold);
  border-color: transparent;
  color: #000;
  box-shadow: 0 0 20px hsla(var(--color-gold), 0.7);
}

/* sidebar draw panels */
.draw-history-panel {
  height: 250px;
}

.draw-history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  padding: 5px 0;
}

.history-ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #FFF;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-sm);
  animation: ball-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.history-ball.match {
  background: var(--gradient-gold);
  color: #000;
  box-shadow: 0 0 10px hsla(var(--color-gold), 0.5);
}

.empty-history {
  color: #718096;
  font-style: italic;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Winner status listing */
.draw-game-winners-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.draw-game-winner-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.draw-game-winner-item.won {
  border-color: rgba(255, 214, 10, 0.25);
  background: rgba(255, 214, 10, 0.03);
}

.winner-game-label {
  font-weight: 700;
  font-size: 0.9rem;
}

.winner-outcome {
  font-size: 0.85rem;
  font-weight: 600;
}

.winner-outcome.pending {
  color: #718096;
}

.winner-outcome.winner-found {
  color: hsl(var(--color-gold));
  text-shadow: 0 0 8px rgba(255, 214, 10, 0.3);
}

/* ==========================================================================
   SETTINGS SCREEN SPECIFIC
   ========================================================================== */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.app-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #A3AED0;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #FFF;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: hsl(var(--color-primary));
  box-shadow: 0 0 10px hsla(var(--color-primary), 0.25);
}

.price-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-prefix {
  position: absolute;
  left: 16px;
  font-weight: 700;
  color: #718096;
  pointer-events: none;
}

.price-input-wrapper input {
  padding-left: 36px !important;
}

.form-tip {
  font-size: 0.75rem;
  color: #718096;
}

/* Admin Actions section */
.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.admin-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  gap: 20px;
}

.action-desc h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFF;
  margin-bottom: 2px;
}

.action-desc p {
  font-size: 0.8rem;
  color: #718096;
  line-height: 1.4;
}

.danger-zone h3 {
  color: hsl(var(--color-danger));
}

.file-upload-label {
  display: inline-block;
}

/* ==========================================================================
   MODAL POPUPS & WINDOW OVERLAYS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 5, 8, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: hsl(var(--bg-card));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform var(--transition-bounce);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-large {
  max-width: 600px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #FFF;
}

.modal-game-selector-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 5px 0;
}

.modal-game-selector-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 15px;
  background: rgba(0,0,0,0.15);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.modal-game-selector-row.inactive {
  opacity: 0.55;
}

/* Quick Checkin specific modal */
.filter-bar {
  margin-bottom: 15px;
}

.quick-checkin-container {
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: rgba(0,0,0,0.15);
}

.quick-checkin-list {
  list-style: none;
}

.quick-checkin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition-fast);
}

.quick-checkin-item:last-child {
  border-bottom: none;
}

.quick-checkin-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.checkin-player-profile h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #FFF;
}

.checkin-player-profile p {
  font-size: 0.75rem;
  color: #718096;
  margin-top: 2px;
}

/* Custom checkbox wrapper for quick checkin */
.checkin-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkin-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-fast);
}

.quick-checkin-item.checked {
  background: rgba(94, 92, 230, 0.05);
}

.quick-checkin-item.checked .checkin-checkbox {
  border-color: hsl(var(--color-primary));
  background: hsl(var(--color-primary));
}

.quick-checkin-item.checked .checkin-checkbox::after {
  content: '✓';
  color: #FFF;
  font-weight: 800;
  font-size: 0.8rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

/* ==========================================================================
   WINNER CELEBRATION TAKEOVER OVERLAY
   ========================================================================== */

.winner-takeover-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(16, 12, 43, 0.95), rgba(4, 3, 9, 0.99));
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  overflow: hidden;
}

.winner-takeover-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.confetti-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.winner-card {
  position: relative;
  background: linear-gradient(185deg, rgba(32, 27, 65, 0.95), rgba(16, 12, 38, 0.95));
  border: 2px solid hsl(var(--color-gold) / 0.5);
  box-shadow: 0 0 50px hsla(var(--color-gold), 0.3), var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: calc(100% - 40px);
  max-width: 440px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.6) rotate(-5deg);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 210;
}

.winner-takeover-overlay.active .winner-card {
  transform: scale(1) rotate(0deg);
}

.prize-trophy {
  font-size: 5rem;
  filter: drop-shadow(0 0 15px hsla(var(--color-gold), 0.6));
  animation: float 3s ease-in-out infinite;
  margin-bottom: 10px;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.winner-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: hsl(var(--color-gold));
  text-shadow: 0 0 20px rgba(255, 214, 10, 0.6);
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.winner-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  width: 100%;
}

.winner-highlight-name {
  font-size: 2.25rem;
  font-weight: 800;
  color: #FFF;
  letter-spacing: -0.02em;
  word-break: break-word;
  line-height: 1.1;
}

.winner-stat-text {
  font-size: 1.1rem;
  color: #A3AED0;
  font-weight: 500;
}

.text-glow {
  color: hsl(var(--color-primary));
  font-weight: 700;
  text-shadow: 0 0 10px hsla(var(--color-primary), 0.5);
}

.prize-pill {
  background: var(--gradient-gold);
  border-radius: 20px;
  padding: 10px 30px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  box-shadow: 0 0 30px hsla(var(--color-gold), 0.5);
  margin: 10px 0;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 25px hsla(var(--color-gold), 0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 40px hsla(var(--color-gold), 0.7); }
}

.prize-currency {
  font-size: 1.25rem;
  font-weight: 800;
  color: #000;
  margin-right: 4px;
}

#winner-prize-amount {
  font-size: 2.75rem;
  font-weight: 900;
  color: #000;
  line-height: 1;
}

.winner-bubble-info {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.9rem;
  color: #A3AED0;
}

.winner-bubble-info strong {
  color: #FFF;
  font-size: 1.1rem;
  font-weight: 800;
  margin-left: 4px;
}

.btn-winner-confirm {
  width: 100%;
  background: var(--gradient-gold);
  color: #000;
  box-shadow: 0 0 20px hsla(var(--color-gold), 0.4);
}

.btn-winner-confirm:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 30px hsla(var(--color-gold), 0.6);
}

/* Unpaid Warning Overlay Specifics */
.warning-card {
  border-color: hsl(var(--color-warning));
  box-shadow: 0 0 50px hsla(var(--color-warning), 0.3), var(--shadow-lg);
  background: linear-gradient(185deg, rgba(65, 45, 27, 0.95), rgba(38, 24, 12, 0.95));
}

.warning-title {
  color: hsl(var(--color-warning));
  text-shadow: 0 0 20px rgba(255, 149, 0, 0.6);
}

.warning-details {
  background: rgba(0,0,0,0.2);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 149, 0, 0.3);
}

.warning-bubble {
  background: rgba(255, 149, 0, 0.1);
  border-color: rgba(255, 149, 0, 0.3);
  margin: 10px 0;
}

.warning-explanation {
  color: hsl(var(--color-warning));
  font-weight: 600;
  font-size: 0.95rem;
}

.warning-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 10px;
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */

.toast-container {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}

.toast {
  background: rgba(22, 27, 37, 0.9);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  color: #FFF;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  pointer-events: auto;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.1rem;
}

.toast.success {
  border-left: 4px solid hsl(var(--color-success));
}
.toast.success .toast-icon { color: hsl(var(--color-success)); }

.toast.error {
  border-left: 4px solid hsl(var(--color-danger));
}
.toast.error .toast-icon { color: hsl(var(--color-danger)); }

.toast.info {
  border-left: 4px solid hsl(var(--color-info));
}
.toast.info .toast-icon { color: hsl(var(--color-info)); }

/* ==========================================================================
   CONFETTI GENERATION STYLING
   ========================================================================== */

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #ffd700;
  top: -20px;
  opacity: 0.8;
  z-index: 205;
}
