:root {
  --color-dark-bg: #070b14;
  --color-dark-surface: #0f172a;
  --color-glass: rgba(255, 255, 255, 0.05);
  --color-glass-border: rgba(0, 168, 255, 0.15);
  --color-primary: #00a8ff;
  --color-accent: #FF8C00;
  --color-gold: #FFD700;
  --color-text-bright: #f0f4fc;
  --color-text-dim: #94a3b8;
  --color-success: #00f260;
  --color-error: #ff5555;

  --shadow-neon: 0 0 18px rgba(0, 168, 255, 0.4);
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-main: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--color-dark-bg);
  color: var(--color-text-bright);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow: hidden;
  /* Desktop/Web fixed feel */
}

#app {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  padding: 10px;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top right, #0e1e38 0%, #070b14 100%);
  overflow: hidden;
}

.main-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Compact header while a game board is visible */
#app:has(#game-interface:not(.hidden)) {
  padding: 8px;
}

#app:has(#game-interface:not(.hidden)) .game-header {
  margin-bottom: 6px;
}

#app:has(#game-interface:not(.hidden)) .game-header h1 {
  font-size: 1.15rem;
  letter-spacing: 2px;
  margin: 0;
}

#app:has(#game-interface:not(.hidden)) .game-header > div:first-child {
  margin-bottom: 4px !important;
}

#app:has(#game-interface:not(.hidden)) .header-stats {
  margin: 0;
  gap: 4px;
}

#app:has(#game-interface:not(.hidden)) .stat-card {
  padding: 4px 2px;
}

.glass-card {
  background: var(--color-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
}

/* Header */
.game-header {
  text-align: center;
  margin-bottom: 12px;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 8px;
}

.game-header h1 {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  margin: 0;
}

/* Sound / Speaker Toggle Button */
.sound-toggle-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--color-glass);
  border: 1px solid var(--color-gold);
  border-radius: 20px;
  color: var(--color-gold);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2), inset 0 0 8px rgba(255, 215, 0, 0.05);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 10;
}

.sound-toggle-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
  transform: translateY(-50%) scale(1.05);
}

.sound-toggle-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.sound-toggle-btn.muted {
  color: var(--color-text-dim);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: none;
  opacity: 0.8;
}

.sound-toggle-btn.muted #voice-icon {
  filter: grayscale(1);
}

.voice-label-text {
  letter-spacing: 1px;
}

#app:has(#game-interface:not(.hidden)) .sound-toggle-btn {
  padding: 4px 8px;
  font-size: 0.65rem;
  right: 4px;
}

/* Stats Row */
.header-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 10px;
}

.stat-card {
  padding: 8px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-label {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--color-text-dim);
  text-transform: uppercase;
}

.stat-value {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-primary);
}

/* Global Countdown Banner */
.countdown-banner {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: var(--color-accent);
}

/* Main Layout – fluid gap so it scales with viewport */
/* Main Layout – Balanced 75 Board and Cartela */
.game-main-layout {
  display: grid;
  grid-template-columns: minmax(118px, 1.15fr) minmax(175px, 1.85fr);
  gap: clamp(6px, 2vw, 10px);
  flex: 1;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-items: stretch;
}

/* Big Board Columns (B-I-N-G-O) */
.big-board-container {
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 22, 36, 0.95), rgba(12, 12, 22, 0.98));
  border: 1.5px solid rgba(255, 215, 0, 0.28);
  border-radius: 12px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.win-mode-label {
  margin-top: 4px;
  text-align: center;
  font-size: 0.72rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  color: var(--color-gold);
  letter-spacing: 0.5px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 10px;
  padding: 2px 6px;
  flex-shrink: 0;
  line-height: 1.2;
}

.big-board-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  flex: 1;
  min-height: 0;
}

.bb-column {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  justify-content: space-between;
}

.bb-header {
  height: clamp(20px, 4.5vw, 26px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(0.75rem, 2.2vw, 0.92rem);
  color: white;
  border-radius: 5px;
  margin-bottom: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.bb-header.b {
  background: linear-gradient(180deg, #ff4757 0%, #c0392b 100%);
}

.bb-header.i {
  background: linear-gradient(180deg, #1e90ff 0%, #0984e3 100%);
}

.bb-header.n {
  background: linear-gradient(180deg, #ffa502 0%, #e67e22 100%);
}

.bb-header.g {
  background: linear-gradient(180deg, #2ed573 0%, #20bf6b 100%);
}

.bb-header.o {
  background: linear-gradient(180deg, #a55eea 0%, #8854d0 100%);
}

.bb-cell {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.72rem, 2.3vw, 0.92rem);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  flex: 1;
  min-height: 0;
  aspect-ratio: unset;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bb-cell.called {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 900;
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  transform: scale(1.04);
}

.bb-cell.latest-called {
  background: linear-gradient(135deg, #00f260 0%, #0575e6 100%) !important;
  color: #000000 !important;
  font-weight: 900;
  transform: scale(1.12);
  border: 1.5px solid #ffffff !important;
  box-shadow: 0 0 14px #00f260, 0 0 24px rgba(0, 242, 96, 0.7);
  animation: pulse-green 1s ease-in-out infinite alternate;
  z-index: 2;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 10px var(--color-success), 0 0 18px rgba(0, 242, 96, 0.4);
    transform: scale(1.08);
  }
  100% {
    box-shadow: 0 0 18px var(--color-success), 0 0 30px rgba(0, 242, 96, 0.8);
    transform: scale(1.14);
  }
}

/* Interaction Area */
.interaction-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  align-self: stretch;
  height: 100%;
  max-height: 100%;
}

/* Current Call Banner */
.current-call-card {
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  background: linear-gradient(145deg, rgba(28, 28, 44, 0.95), rgba(16, 16, 28, 0.98));
  border: 1.5px solid rgba(255, 215, 0, 0.28);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.call-ball {
  width: clamp(38px, 11vw, 46px);
  height: clamp(38px, 11vw, 46px);
  background: radial-gradient(circle at 35% 35%, #ffd700, #ff8c00);
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(1.1rem, 3.8vw, 1.45rem);
  font-weight: 900;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.6), 0 4px 10px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

#mini-history .bb-cell.called {
  width: clamp(26px, 7vw, 32px) !important;
  height: clamp(26px, 7vw, 32px) !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(0.75rem, 2.2vw, 0.88rem) !important;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* User's Bingo Card (Buttons) */
.bingo-header-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 2px 4px 0;
  margin-bottom: 0;
  flex-shrink: 0;
}

.bingo-header {
  aspect-ratio: auto;
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  color: white;
  border-radius: 6px;
  padding: 2px 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.bingo-header.b {
  background: linear-gradient(180deg, #ff4757 0%, #c0392b 100%);
}

.bingo-header.i {
  background: linear-gradient(180deg, #1e90ff 0%, #0984e3 100%);
}

.bingo-header.n {
  background: linear-gradient(180deg, #ffa502 0%, #e67e22 100%);
}

.bingo-header.g {
  background: linear-gradient(180deg, #2ed573 0%, #20bf6b 100%);
}

.bingo-header.o {
  background: linear-gradient(180deg, #a55eea 0%, #8854d0 100%);
}

.bingo-grid-interactive {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 4px;
}

/* Multi-card scroll container */
.player-cards-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold) transparent;
}

.player-card-wrapper {
  background: linear-gradient(145deg, rgba(26, 26, 40, 0.96), rgba(14, 14, 26, 0.98));
  border-radius: 12px;
  border: 1.5px solid rgba(255, 215, 0, 0.32);
  padding: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.player-card-wrapper.active {
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.6);
}

.player-card-wrapper.blocked {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.8);
}

/* Board number under each grid */
.player-card-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px 2px;
  font-size: 0.76rem;
  font-weight: 800;
  font-family: 'Rajdhani', sans-serif;
  color: var(--color-gold);
  letter-spacing: 0.5px;
  flex-shrink: 0;
  line-height: 1.15;
}

.player-card-number .card-status {
  color: #ff5555;
  font-weight: 900;
  font-size: 0.75rem;
  margin-left: 4px;
}

/* SINGLE CARD MODE: Expand to luxuriously fill the available height! */
.player-cards-container:not(.has-multi) {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
}

.player-cards-container:not(.has-multi) .player-card-wrapper {
  flex: 1;
  height: 100%;
  min-height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 14px;
  padding: 6px;
}

.player-cards-container:not(.has-multi) .bingo-header-row {
  gap: 4px;
  padding: 0 2px 3px;
  margin-bottom: 2px;
}

.player-cards-container:not(.has-multi) .bingo-header {
  min-height: clamp(24px, 5vw, 32px);
  font-size: clamp(0.9rem, 2.7vw, 1.1rem);
  border-radius: 7px;
}

.player-cards-container:not(.has-multi) .bingo-grid-interactive {
  flex: 1;
  grid-template-rows: repeat(5, 1fr);
  gap: clamp(4px, 1.2vw, 6px);
  padding: 2px;
}

.player-cards-container:not(.has-multi) .card-btn {
  aspect-ratio: unset;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  font-size: clamp(1.15rem, 4.2vw, 1.6rem);
}

.player-cards-container:not(.has-multi) .card-btn.free {
  font-size: clamp(0.72rem, 2.3vw, 0.92rem);
}

/* MULTI CARD MODE: Fit 2 boards cleanly with smooth scrolling */
.player-cards-container.has-multi {
  gap: 6px;
}

.player-cards-container.has-multi .player-card-wrapper {
  flex: 0 0 calc((100% - 6px) / 2);
  height: calc((100% - 6px) / 2);
  max-height: calc((100% - 6px) / 2);
  overflow: hidden;
  border-radius: 10px;
  padding: 4px;
}

.player-cards-container.has-multi .bingo-header-row {
  gap: 2px;
  padding: 2px 2px 0;
  margin-bottom: 0;
  flex-shrink: 0;
}

.player-cards-container.has-multi .bingo-header {
  min-height: 16px;
  aspect-ratio: auto;
  font-size: 0.65rem;
  border-radius: 4px;
  padding: 0;
}

.player-cards-container.has-multi .bingo-grid-interactive {
  flex: 1;
  min-height: 0;
  gap: 2px;
  padding: 2px;
  grid-template-rows: repeat(5, minmax(0, 1fr));
}

.player-cards-container.has-multi .card-btn {
  aspect-ratio: unset;
  width: 100%;
  height: 100%;
  min-height: 0;
  font-size: clamp(0.75rem, 2.3vw, 0.95rem);
  border-radius: 5px;
  padding: 0;
}

.player-cards-container.has-multi .card-btn.free {
  font-size: 0.6rem;
}

.player-cards-container.has-multi .player-card-number {
  padding: 1px 4px 2px;
  font-size: 0.68rem;
}

/* Auto mark toggle */
.auto-toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.auto-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.auto-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  transition: 0.3s;
}

.auto-toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.auto-toggle-switch input:checked + .auto-toggle-slider {
  background-color: var(--color-success);
  box-shadow: 0 0 10px rgba(0, 242, 96, 0.5);
}

.auto-toggle-switch input:checked + .auto-toggle-slider:before {
  transform: translateX(16px);
}

/* Premium Porcelain Cartela Number Tiles */
.card-btn {
  background: linear-gradient(180deg, #ffffff 0%, #edf2f7 100%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 900;
  font-size: clamp(0.95rem, 3vw, 1.35rem);
  color: #0a0a14;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  position: relative;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.card-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.card-btn:active {
  transform: scale(0.95);
}

/* Marked State – Neon Emerald / Cyan Glow */
.card-btn.marked {
  background: linear-gradient(135deg, #00f260 0%, #00b4d8 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #00f260 !important;
  box-shadow: 0 0 14px rgba(0, 242, 96, 0.75), inset 0 0 8px rgba(255, 255, 255, 0.45) !important;
  font-weight: 900 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Free State – Golden Star Token */
.card-btn.free {
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%) !important;
  color: #000000 !important;
  border: 1.5px solid #ffeaa7 !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.7), inset 0 0 8px rgba(255, 255, 255, 0.6) !important;
  font-family: 'Rajdhani', sans-serif !important;
  font-weight: 900 !important;
  letter-spacing: 0.5px;
}

/* BINGO Button – High-Energy Gradient */
.bingo-btn-premium {
  background: linear-gradient(135deg, #ff0844 0%, #ff4b2b 50%, #ff8c00 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(255, 8, 68, 0.45), 0 0 15px rgba(255, 140, 0, 0.3);
  transition: transform 0.1s, filter 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.bingo-btn-premium:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 25px rgba(255, 8, 68, 0.6), 0 0 20px rgba(255, 140, 0, 0.45);
}

.bingo-btn-premium:active {
  transform: scale(0.97);
}

/* Status Modal (Overlays) */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: var(--radius-md);
  text-align: center;
  max-width: 80%;
}


.hidden {
  display: none !important;
}

/* Toast Container - Centered */
#toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Toast Styles */
.toast {
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  min-width: 200px;
  max-width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.toast.error,
.toast.warning {
  background: linear-gradient(135deg, rgba(220, 20, 50, 0.96), rgba(150, 0, 20, 0.98)) !important;
  color: #ffffff !important;
  border: 2px solid #ff3355 !important;
  box-shadow: 0 0 35px rgba(255, 30, 70, 0.8), 0 0 70px rgba(255, 0, 0, 0.5), 0 6px 25px rgba(0, 0, 0, 0.8) !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  animation: redToastGlow 1.2s ease-in-out infinite alternate;
}

@keyframes redToastGlow {
  0% {
    box-shadow: 0 0 25px rgba(255, 30, 70, 0.7), 0 0 50px rgba(255, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.7);
    border-color: #ff3355;
  }
  100% {
    box-shadow: 0 0 45px rgba(255, 10, 60, 1), 0 0 90px rgba(255, 30, 70, 0.7), 0 8px 30px rgba(0, 0, 0, 0.9);
    border-color: #ff6688;
  }
}

.toast.success {
  background: rgba(0, 242, 96, 0.95);
  color: white;
  border: 2px solid var(--color-success);
  box-shadow: 0 0 20px rgba(0, 242, 96, 0.4);
}

.toast.info {
  background: rgba(0, 168, 255, 0.95);
  color: white;
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 20px rgba(0, 168, 255, 0.4);
}

/* ==================== BONUS GAME BANNER ==================== */
.bonus-game-banner {
  position: relative;
  overflow: hidden;
  margin: 0 0 10px 0;
  padding: 10px 14px;
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 50%, #ff4500 100%);
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.7), 0 4px 15px rgba(0, 0, 0, 0.5);
  border: 2px solid #fff5cc;
  animation: bonusBannerPulse 2s ease-in-out infinite alternate;
  text-align: center;
}

@keyframes bonusBannerPulse {
  0% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 35px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 140, 0, 0.6), 0 6px 20px rgba(0, 0, 0, 0.6);
    transform: scale(1.01);
  }
}

.bonus-game-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-25deg);
  animation: bonusShine 3s infinite;
}

@keyframes bonusShine {
  0%, 20% { left: -100%; }
  50%, 100% { left: 200%; }
}

.bonus-game-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #1a0a00;
  font-weight: 800;
  font-family: 'Rajdhani', sans-serif;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.bonus-game-title {
  font-size: 1.15rem;
  letter-spacing: 2px;
  font-weight: 900;
  color: #111;
}

.bonus-game-badge {
  background: #111;
  color: #ffd700;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 1px;
  border: 1px solid #ffd700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.bonus-game-star {
  font-size: 1.1rem;
  animation: starSpin 3s linear infinite;
}

@keyframes starSpin {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(15deg); }
}

/* ==================== MONEY RAIN WIDGET ==================== */
.money-rain-widget {
  margin: 0 0 12px 0;
  cursor: pointer;
  user-select: none;
  animation: moneyRainWidgetSlide 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes moneyRainWidgetSlide {
  from { opacity: 0; transform: translateY(-15px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.money-rain-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(10, 25, 45, 0.95) 0%, rgba(14, 40, 75, 0.95) 50%, rgba(20, 100, 50, 0.95) 100%);
  border: 2px solid #00f260;
  border-radius: 14px;
  box-shadow: 0 0 25px rgba(0, 242, 96, 0.5), 0 0 45px rgba(0, 168, 255, 0.4), 0 4px 15px rgba(0, 0, 0, 0.6);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.money-rain-inner:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0, 242, 96, 0.8), 0 0 60px rgba(0, 168, 255, 0.6);
}

.money-rain-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.money-rain-icon-wrap {
  position: relative;
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px #ffd700);
  animation: giftBounce 1.5s ease-in-out infinite alternate;
}

@keyframes giftBounce {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-6deg); }
  100% { transform: translateY(0) rotate(6deg); }
}

.money-rain-sparkle {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 0.9rem;
  animation: sparkleGlow 1s ease-in-out infinite alternate;
}

@keyframes sparkleGlow {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.3); }
}

.money-rain-text-wrap {
  display: flex;
  flex-direction: column;
}

.money-rain-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #00f260;
  text-shadow: 0 0 10px rgba(0, 242, 96, 0.6);
  line-height: 1.2;
}

.money-rain-subtitle {
  font-size: 0.75rem;
  color: #e0e0e0;
  font-weight: 600;
}

.money-rain-amt-tag {
  color: #ffd700;
  font-weight: 800;
}

.money-rain-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.money-rain-timer-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.5);
  padding: 4px 8px;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  color: #ffd700;
}

.money-rain-claim-pill {
  background: linear-gradient(135deg, #00f260, #0575e6);
  color: #000;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 1px;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 242, 96, 0.6);
  transition: all 0.2s ease;
}

.money-rain-claim-pill:hover {
  transform: scale(1.06);
  box-shadow: 0 0 25px rgba(0, 242, 96, 0.9);
}

.money-rain-claim-pill.claimed {
  background: #444;
  color: #aaa;
  border: 1px solid #666;
  box-shadow: none;
  cursor: default;
}

/* ==================== MONEY RAIN MODAL ==================== */
.money-rain-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.money-rain-modal-card {
  background: linear-gradient(145deg, #091322 0%, #0d1e15 100%) !important;
  border: 2px solid #00f260 !important;
  box-shadow: 0 0 50px rgba(0, 242, 96, 0.6), 0 0 100px rgba(0, 168, 255, 0.5) !important;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  position: relative;
  animation: modalScaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.money-rain-modal-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 10px;
  animation: giftBounce 1.2s ease-in-out infinite alternate;
}

.money-rain-modal-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffd700;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
  margin-bottom: 6px;
}

.money-rain-modal-desc {
  font-size: 0.85rem;
  color: #ccc;
  margin-bottom: 16px;
  line-height: 1.4;
}

.money-rain-modal-reward {
  background: linear-gradient(135deg, rgba(0, 242, 96, 0.2), rgba(255, 215, 0, 0.15));
  border: 2px dashed #00f260;
  border-radius: 14px;
  padding: 14px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 2.4rem;
  font-weight: 900;
  color: #00f260;
  text-shadow: 0 0 20px rgba(0, 242, 96, 0.8);
  margin-bottom: 14px;
}

.money-rain-modal-reward .currency {
  font-size: 1.2rem;
  color: #ffd700;
}

.money-rain-modal-balance-info {
  font-size: 0.9rem;
  color: #eee;
  margin-bottom: 20px;
}

.money-rain-modal-balance-info strong {
  color: #ffd700;
}

.money-rain-collect-btn {
  background: linear-gradient(135deg, #00f260, #0575e6) !important;
  color: #000 !important;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  padding: 12px;
  border-radius: 12px;
  border: none;
  box-shadow: 0 0 20px rgba(0, 242, 96, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.money-rain-collect-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 30px rgba(0, 242, 96, 0.9);
}

/* LOBBY / HOME BUTTON AT TOP OF HEADER */
.lobby-home-btn {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--color-glass, rgba(255, 255, 255, 0.08));
  border: 1px solid var(--color-gold, #ffd700);
  border-radius: 20px;
  color: var(--color-gold, #ffd700);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  z-index: 10;
  line-height: 1;
}

.lobby-home-btn svg {
  display: block;
  flex-shrink: 0;
}

.lobby-home-btn:hover {
  background: rgba(255, 215, 0, 0.18);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
  color: #fff;
  transform: translateY(-50%) scale(1.04);
}

.lobby-home-btn:active {
  transform: translateY(-50%) scale(0.95);
}

@media (max-width: 480px) {
  .game-header h1 {
    font-size: 1.25rem !important;
    letter-spacing: 1.5px !important;
  }
  .lobby-home-btn {
    padding: 4px 8px;
    font-size: 0.68rem;
  }
  .sound-toggle-btn {
    padding: 4px 8px;
    font-size: 0.68rem;
  }
}