/* ────────────────────────────────────────────────────────────────
   BingoPick – style.css
   Dark-mode premium design with festival theme support
──────────────────────────────────────────────────────────────── */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Default dark palette (overridden by themes.js) */
  --bg:           #0d0f1a;
  --bg-card:      #13162a;
  --bg-card2:     #1a1e35;
  --border:       rgba(255,255,255,0.07);
  --text:         #e8eaf6;
  --text-muted:   #6b7280;
  --accent:       #7c6aff;
  --accent2:      #ff5e87;
  --accent3:      #00d2ff;
  --success:      #22c55e;
  --danger:       #f43f5e;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 8px 32px rgba(0,0,0,0.45);
  --font:         'Inter', system-ui, sans-serif;

  /* Bingo column colors */
  --col-b: #6366f1;
  --col-i: #8b5cf6;
  --col-n: #10b981;
  --col-g: #f59e0b;
  --col-o: #ef4444;

  /* Ball gradient (theme overrides these) */
  --ball-a: #7c6aff;
  --ball-b: #ff5e87;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.5s, color 0.5s;
}

/* ────────────────────────────────────────────────────────────────
   CONFETTI CANVAS
──────────────────────────────────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* ────────────────────────────────────────────────────────────────
   AD SLOTS
──────────────────────────────────────────────────────────────── */
.ad-leaderboard {
  width: 100%; max-width: 728px; margin: 0 auto;
  padding: 0.5rem 1rem; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
}
.ad-rectangle {
  width: 100%; max-width: 336px; min-height: 60px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}

/* ────────────────────────────────────────────────────────────────
   HEADER
──────────────────────────────────────────────────────────────── */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(13,15,26,0.85);
  backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 100;
  transition: background 0.5s;
}

.logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 800; font-size: 1.3rem; letter-spacing: -0.03em;
}
.logo-icon { font-size: 1.6rem; animation: bounce-idle 3s ease-in-out infinite; }
@keyframes bounce-idle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  40%       { transform: translateY(-4px) rotate(-8deg); }
  60%       { transform: translateY(-4px) rotate(8deg); }
}

.theme-picker { display: flex; align-items: center; gap: 0.5rem; }
.theme-select {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: 0.82rem; font-weight: 500;
  padding: 0.35rem 0.6rem; cursor: pointer; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s; max-width: 200px;
}
.theme-select:hover, .theme-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124,106,255,0.15);
}
.theme-select option { background: #1a1e35; }

.header-actions { display: flex; align-items: center; gap: 1rem; position: relative; }

.btn-icon {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card2);
  color: var(--text-muted); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.btn-icon:hover { color: var(--text); border-color: var(--accent); background: rgba(124,106,255,0.1); }

.share-toast {
  position: absolute; right: 0; top: calc(100% + 0.5rem);
  background: var(--success); color: #fff;
  font-size: 0.8rem; font-weight: 600;
  padding: 0.4rem 0.8rem; border-radius: var(--radius-sm);
  white-space: nowrap; opacity: 0; transform: translateY(-4px);
  transition: all 0.3s; pointer-events: none;
}
.share-toast.show { opacity: 1; transform: translateY(0); }

/* ────────────────────────────────────────────────────────────────
   MAIN LAYOUT  (3 columns on desktop)
──────────────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

/* ────────────────────────────────────────────────────────────────
   LEFT PANEL – Called Numbers
──────────────────────────────────────────────────────────────── */
.called-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  display: flex; flex-direction: column; gap: 1rem;
  position: sticky; top: 80px;
}

.panel-header-row {
  display: flex; align-items: center; justify-content: space-between;
}
.panel-title { font-size: 0.95rem; font-weight: 700; }
.called-count-badge {
  font-size: 0.72rem; font-weight: 700;
  background: var(--bg-card2); border-radius: 999px;
  padding: 0.15rem 0.6rem; color: var(--text-muted);
}

.bingo-col-headers {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 2px; margin-bottom: -0.25rem;
}
.col-header {
  text-align: center; font-size: 0.7rem; font-weight: 800;
  padding: 0.15rem 0; border-radius: 4px 4px 0 0;
}
.col-b { color: var(--col-b); }
.col-i { color: var(--col-i); }
.col-n { color: var(--col-n); }
.col-g { color: var(--col-g); }
.col-o { color: var(--col-o); }

/* Number grid 1–75 */
.number-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.ng-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 600;
  border-radius: 4px;
  background: var(--bg-card2);
  color: var(--text-muted);
  transition: background 0.3s, color 0.3s, transform 0.2s;
  cursor: default;
  line-height: 1;
}
.ng-cell.called {
  background: var(--accent);
  color: #fff;
  transform: scale(0.95);
  box-shadow: 0 0 8px rgba(124,106,255,0.4);
}
.ng-cell[data-col="B"].called { background: var(--col-b); box-shadow: 0 0 8px rgba(99,102,241,0.5); }
.ng-cell[data-col="I"].called { background: var(--col-i); box-shadow: 0 0 8px rgba(139,92,246,0.5); }
.ng-cell[data-col="N"].called { background: var(--col-n); box-shadow: 0 0 8px rgba(16,185,129,0.5); }
.ng-cell[data-col="G"].called { background: var(--col-g); box-shadow: 0 0 8px rgba(245,158,11,0.5); }
.ng-cell[data-col="O"].called { background: var(--col-o); box-shadow: 0 0 8px rgba(239,68,68,0.5); }

/* Last ball */
.last-ball-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  margin-top: 0.5rem;
}
.last-ball {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: radial-gradient(135deg, var(--ball-a) 0%, var(--ball-b) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.08), 0 4px 24px rgba(0,0,0,0.4);
  transition: background 0.5s;
  position: relative;
}
.last-ball::before {
  content: '';
  position: absolute;
  top: 8px; left: 14px;
  width: 18px; height: 10px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  transform: rotate(-30deg);
}
.last-ball-col {
  font-size: 0.7rem; font-weight: 900; color: rgba(255,255,255,0.8); letter-spacing: 0.05em;
  line-height: 1;
}
.last-ball-num {
  font-size: 1.4rem; font-weight: 900; color: #fff; letter-spacing: -0.03em;
  line-height: 1;
}
.last-ball-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

.last-ball.pop {
  animation: ball-pop 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes ball-pop {
  from { transform: scale(0.5) rotate(-15deg); opacity: 0.4; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ────────────────────────────────────────────────────────────────
   CENTER – Bingo Card
──────────────────────────────────────────────────────────────── */
.card-section {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}

/* Mode tabs */
.mode-tabs {
  display: flex; gap: 0.25rem;
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: 4px; border: 1px solid var(--border);
}
.mode-tab {
  background: none; border: none; font-family: var(--font);
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
  padding: 0.4rem 1rem; border-radius: 6px;
  cursor: pointer; transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.mode-tab.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.mode-tab:hover:not(.active) { color: var(--text); background: var(--bg-card2); }

/* Custom prizes panel */
.custom-prizes-panel {
  width: 100%; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem;
}
.prizes-textarea {
  width: 100%; background: var(--bg-card2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font); font-size: 0.85rem;
  padding: 0.7rem; resize: vertical; outline: none;
  transition: border-color 0.2s; line-height: 1.6;
}
.prizes-textarea:focus { border-color: var(--accent); }
.prizes-textarea::placeholder { color: var(--text-muted); }
.custom-prizes-actions { display: flex; gap: 0.5rem; align-items: center; }
.prizes-hint { font-size: 0.75rem; color: var(--text-muted); }

/* Bingo card */
.bingo-card-wrap {
  width: 100%; max-width: 440px;
}

.bingo-card-header {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 4px; margin-bottom: 4px;
}
.bc-col {
  text-align: center; font-size: 1.4rem; font-weight: 900;
  padding: 0.3rem 0;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}
.bc-b { color: var(--col-b); }
.bc-i { color: var(--col-i); }
.bc-n { color: var(--col-n); }
.bc-g { color: var(--col-g); }
.bc-o { color: var(--col-o); }

.bingo-card {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.bingo-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  font-size: 1rem; font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  user-select: none;
  text-align: center;
  padding: 2px;
  line-height: 1.1;
}
.bingo-cell:hover:not(.free):not(.marked) {
  border-color: var(--accent);
  background: rgba(124,106,255,0.06);
}
.bingo-cell.free {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em;
  border-color: transparent;
  cursor: default;
  box-shadow: 0 2px 12px rgba(124,106,255,0.3);
}
.bingo-cell.marked {
  background: linear-gradient(135deg, var(--ball-a) 0%, var(--ball-b) 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 0 16px rgba(124,106,255,0.35);
  animation: cell-mark 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.bingo-cell.winning {
  animation: cell-win 0.6s ease infinite alternate;
}
@keyframes cell-mark {
  from { transform: scale(0.7); }
  to   { transform: scale(1); }
}
@keyframes cell-win {
  from { box-shadow: 0 0 12px var(--accent2); transform: scale(1); }
  to   { box-shadow: 0 0 28px var(--accent2), 0 0 60px var(--accent2); transform: scale(1.05); }
}

/* stamp overlay on marked cells */
.bingo-cell.marked::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 35% 30%, rgba(255,255,255,0.15) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}

/* Custom words bingo – smaller font */
.bingo-card.words-mode .bingo-cell {
  font-size: 0.52rem; font-weight: 600; padding: 3px;
  word-break: break-word;
}

/* Card controls */
.card-controls {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; justify-content: center;
}
.btn-secondary {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-family: var(--font); font-size: 0.85rem; font-weight: 600;
  padding: 0.45rem 1rem; cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  border-color: var(--accent); color: var(--text);
  background: rgba(124,106,255,0.08);
}

/* ────────────────────────────────────────────────────────────────
   RIGHT PANEL – Game Controls
──────────────────────────────────────────────────────────────── */
.controls-panel {
  display: flex; flex-direction: column; gap: 1.25rem;
  position: sticky; top: 80px;
}

/* Status card */
.game-status-card {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.65rem 1rem;
  font-size: 0.85rem; font-weight: 600;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted); flex-shrink: 0;
  transition: background 0.3s;
}
.status-dot.ready  { background: var(--text-muted); }
.status-dot.active { background: var(--success); animation: pulse-dot 1.5s ease-in-out infinite; }
.status-dot.paused { background: #f59e0b; }
.status-dot.done   { background: var(--accent2); }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* Draw button */
.btn-draw {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--ball-a) 0%, var(--ball-b) 100%);
  border: none; border-radius: var(--radius);
  color: #fff; font-family: var(--font); font-weight: 800;
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  transition: transform 0.15s, box-shadow 0.15s, background 0.5s;
  letter-spacing: 0.02em;
}
.btn-draw:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.btn-draw:active:not(:disabled) { transform: translateY(0); }
.btn-draw:disabled {
  background: var(--bg-card2); color: var(--text-muted); cursor: not-allowed;
  box-shadow: none;
}
.draw-icon { font-size: 1.3rem; animation: spin-slow 4s linear infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* Section label */
.section-label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* Auto-caller */
.autocaller-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.autocaller-header { display: flex; align-items: center; justify-content: space-between; }

.speed-row { display: flex; align-items: center; gap: 0.6rem; }
.speed-label { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; min-width: 34px; }
.speed-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 999px;
  background: var(--bg-card2); outline: none; cursor: pointer;
}
.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 6px rgba(0,0,0,0.4); cursor: pointer;
  transition: transform 0.15s;
}
.speed-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.speed-val { font-size: 0.75rem; color: var(--text-muted); min-width: 42px; text-align: right; }

/* Win patterns */
.patterns-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.pattern-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.pattern-opt {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  background: var(--bg-card2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.55rem 0.4rem;
  cursor: pointer; transition: all 0.2s; font-size: 0.7rem;
  font-weight: 600; color: var(--text-muted);
}
.pattern-opt input { display: none; }
.pattern-opt.active, .pattern-opt:has(input:checked) {
  border-color: var(--accent); background: rgba(124,106,255,0.1);
  color: var(--text);
}
.pattern-opt:hover { border-color: var(--accent); color: var(--text); }

/* Mini pattern icons */
.pattern-icon { display: flex; flex-direction: column; gap: 1px; }
.pi-row { display: flex; gap: 1px; }
.pi-cell {
  width: 5px; height: 5px; border-radius: 1px;
  background: var(--border);
}
.pi-cell.filled { background: var(--accent); }

/* Players */
.players-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem;
  display: flex; flex-direction: column; gap: 0.65rem;
}
.players-header { display: flex; align-items: center; justify-content: space-between; }
.player-count {
  font-size: 0.72rem; font-weight: 700;
  background: var(--accent); color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.add-player-row { display: flex; gap: 0.4rem; }
.input-player {
  flex: 1; background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: 0.82rem;
  padding: 0.45rem 0.7rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-player::placeholder { color: var(--text-muted); }
.input-player:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,106,255,0.15); }

.btn-add-player {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: none; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s, transform 0.15s; flex-shrink: 0;
}
.btn-add-player:hover { background: #6a58f0; transform: scale(1.05); }

.player-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; max-height: 180px; overflow-y: auto; }
.player-list::-webkit-scrollbar { width: 3px; }
.player-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.player-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.6rem; border-radius: 6px;
  background: var(--bg-card2); border: 1px solid transparent;
  font-size: 0.82rem; font-weight: 500;
  transition: all 0.2s; cursor: pointer; animation: slide-in 0.2s ease;
}
.player-item:hover { border-color: var(--accent); background: rgba(124,106,255,0.07); }
.player-item.has-bingo { border-color: var(--accent2)!important; background: rgba(255,94,135,0.08)!important; }

.player-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; flex-shrink: 0;
  color: #fff;
}
.player-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bingo-badge {
  font-size: 0.65rem; font-weight: 700;
  background: var(--accent2); color: #fff;
  padding: 0.1rem 0.4rem; border-radius: 999px;
  display: none;
}
.player-item.has-bingo .player-bingo-badge { display: block; }
.player-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.9rem; padding: 0.1rem;
  border-radius: 3px; opacity: 0; transition: opacity 0.2s, color 0.2s;
}
.player-item:hover .player-remove { opacity: 1; }
.player-remove:hover { color: var(--danger); }

.empty-players {
  font-size: 0.75rem; color: var(--text-muted); text-align: center;
  padding: 0.5rem; display: flex; align-items: center; justify-content: center;
}

/* Sound toggle */
.sound-row { display: flex; align-items: center; }

/* Toggle */
.toggle-label {
  display: flex; align-items: center; gap: 0.6rem;
  cursor: pointer; font-size: 0.85rem; color: var(--text-muted);
  user-select: none; transition: color 0.2s;
}
.toggle-label:hover { color: var(--text); }
.toggle-label input { display: none; }
.toggle-label.toggle-small { font-size: 0.78rem; }

.toggle-track {
  width: 36px; height: 20px; background: var(--bg-card2);
  border-radius: 999px; border: 1px solid var(--border);
  position: relative; transition: background 0.2s; flex-shrink: 0;
}
.toggle-thumb {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted); top: 2px; left: 2px;
  transition: transform 0.2s, background 0.2s;
}
input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); background: #fff; }

/* Reset button */
.btn-reset {
  width: 100%; padding: 0.6rem;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-family: var(--font); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.btn-reset:hover { color: var(--danger); border-color: var(--danger); background: rgba(244,63,94,0.05); }

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; font-family: var(--font); font-weight: 600;
  font-size: 0.9rem; padding: 0.55rem 1.2rem; border-radius: var(--radius-sm);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(124,106,255,0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,106,255,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.btn-small { font-size: 0.8rem; padding: 0.4rem 0.8rem; }

.btn-text {
  background: none; border: none; cursor: pointer;
  font-family: var(--font); font-size: 0.82rem; font-weight: 500;
  color: var(--text-muted); padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm); transition: color 0.2s, background 0.2s;
}
.btn-text:hover { color: var(--text); background: var(--bg-card2); }
.btn-text.btn-small { font-size: 0.78rem; }

.hidden { display: none !important; }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ────────────────────────────────────────────────────────────────
   MODALS
──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; animation: fade-in 0.25s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 2.5rem 3rem; text-align: center;
  box-shadow: var(--shadow), 0 0 80px rgba(124,106,255,0.25);
  animation: pop-in 0.4s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 460px; width: calc(100% - 2rem);
}
.modal-card-wide { max-width: 500px; text-align: left; }

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.65); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-emoji { font-size: 4rem; margin-bottom: 0.5rem; animation: bounce 0.6s ease 0.2s both; }
@keyframes bounce {
  from { transform: scale(0.4) rotate(-15deg); }
  60%  { transform: scale(1.2) rotate(5deg); }
  to   { transform: scale(1) rotate(0deg); }
}

.modal-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.35rem; }
.modal-winner {
  font-size: 2.2rem; font-weight: 900; letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 0.75rem; word-break: break-word;
}
.modal-prize { color: var(--accent2); font-size: 1rem; font-weight: 600; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: center; align-items: center; }

/* Player card modal */
.player-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.player-modal-name { font-size: 1.1rem; font-weight: 800; }

/* ────────────────────────────────────────────────────────────────
   RESPONSIVE
──────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .app { grid-template-columns: 200px 1fr 260px; gap: 1rem; padding: 1rem; }
  .bingo-card-wrap { max-width: 380px; }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 1rem;
  }
  .called-panel {
    position: static;
    /* Show number grid in a horizontal scroll */
  }
  .bingo-card-wrap { max-width: 100%; }
  .controls-panel { position: static; }
}

@media (max-width: 480px) {
  .header { padding: 0.75rem 1rem; }
  .logo-text { display: none; }
  .bc-col { font-size: 1.1rem; }
  .bingo-cell { font-size: 0.85rem; }
  .bingo-card.words-mode .bingo-cell { font-size: 0.42rem; }
  .modal-card { padding: 1.75rem 1.5rem; }
  .modal-winner { font-size: 1.6rem; }
}

/* ────────────────────────────────────────────────────────────────
   CREATE ROOM BUTTON (header)
──────────────────────────────────────────────────────────────── */
.btn-create-room {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.9rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--accent);
  background: rgba(124,106,255,0.1);
  color: var(--accent); font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: var(--font);
  white-space: nowrap;
}
.btn-create-room:hover {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 16px rgba(124,106,255,0.35);
}

/* ────────────────────────────────────────────────────────────────
   PAUSE / RESUME BUTTON
──────────────────────────────────────────────────────────────── */
.btn-pause {
  width: 100%; padding: 0.55rem;
  background: rgba(245,158,11,0.1);
  border: 1.5px solid rgba(245,158,11,0.4);
  border-radius: var(--radius-sm); color: #f59e0b;
  font-family: var(--font); font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.btn-pause:hover:not(:disabled) {
  background: rgba(245,158,11,0.2);
  border-color: #f59e0b;
}
.btn-pause:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-pause.resumed {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.4);
  color: var(--success);
}

/* ────────────────────────────────────────────────────────────────
   ROOM LOBBY PANEL
──────────────────────────────────────────────────────────────── */
.room-panel {
  background: var(--bg-card); border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  box-shadow: 0 0 24px rgba(124,106,255,0.1);
}
.room-panel-header { display: flex; align-items: center; justify-content: space-between; }
.room-id-chip {
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em;
  background: var(--accent); color: #fff;
  padding: 0.2rem 0.6rem; border-radius: 999px;
}
.room-link-row {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.35rem 0.6rem;
}
.room-link-text {
  flex: 1; font-size: 0.65rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: monospace;
}
.btn-copy-link {
  background: none; border: none; cursor: pointer; font-size: 0.9rem;
  padding: 0.1rem 0.2rem; border-radius: 4px;
  transition: background 0.2s;
}
.btn-copy-link:hover { background: var(--bg-card); }

.room-players-header { display: flex; align-items: center; justify-content: space-between; }

.room-player-list {
  list-style: none; display: flex; flex-direction: column; gap: 0.3rem;
  max-height: 160px; overflow-y: auto;
}
.room-player-list::-webkit-scrollbar { width: 3px; }
.room-player-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.room-player-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.6rem; border-radius: 6px;
  background: var(--bg-card2); font-size: 0.8rem;
  animation: slide-in 0.2s ease;
}
.room-player-icon { font-size: 0.85rem; }
.room-player-name { flex: 1; font-weight: 600; }
.room-player-status { font-size: 0.7rem; color: var(--text-muted); }
.room-player-status.has-bingo { color: var(--accent2); font-weight: 700; }

.room-hint { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }

.btn-start-game {
  width: 100%; padding: 0.65rem;
  background: linear-gradient(135deg, var(--success), #16a34a);
  border: none; border-radius: var(--radius-sm); color: #fff;
  font-family: var(--font); font-size: 0.9rem; font-weight: 800;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}
.btn-start-game:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(34,197,94,0.45);
}
.btn-start-game:disabled {
  background: var(--bg-card2); color: var(--text-muted);
  cursor: not-allowed; box-shadow: none;
}

/* ────────────────────────────────────────────────────────────────
   HOST BADGE (replaces Create Room button after room is created)
──────────────────────────────────────────────────────────────── */
.btn-room-badge {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.8rem; border-radius: var(--radius-sm);
  border: 1.5px solid rgba(34,197,94,0.5);
  background: rgba(34,197,94,0.1);
  color: var(--success); font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: var(--font);
  white-space: nowrap;
}
.btn-room-badge:hover { background: rgba(34,197,94,0.2); border-color: var(--success); }
.host-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  animation: pulse-dot 1.5s ease-in-out infinite; flex-shrink: 0;
}
.host-room-id {
  font-size: 0.75rem; font-weight: 900; letter-spacing: 0.1em;
  background: rgba(34,197,94,0.2); color: var(--success);
  padding: 0.1rem 0.45rem; border-radius: 4px;
}
.host-player-count { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }

/* ────────────────────────────────────────────────────────────────
   ROOM MODAL
──────────────────────────────────────────────────────────────── */
.room-modal-card {
  max-width: 480px; width: calc(100% - 2rem);
  text-align: left; padding: 1.75rem 2rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.room-modal-header {
  display: flex; align-items: center; justify-content: space-between;
}
.room-modal-title {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1rem; font-weight: 800;
}
.room-modal-section { display: flex; flex-direction: column; gap: 0.5rem; }
.room-modal-label {
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
  display: flex; align-items: center; gap: 0.5rem;
}
.room-empty-hint {
  font-size: 0.8rem; color: var(--text-muted); padding: 0.75rem;
  text-align: center; border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.copy-toast {
  font-size: 0.78rem; color: var(--success); font-weight: 600;
  opacity: 0; transform: translateY(-4px);
  transition: all 0.3s; pointer-events: none;
}
.copy-toast.show { opacity: 1; transform: translateY(0); }

/* Kick button (host room modal player list) */
.kick-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.8rem; padding: 0.1rem 0.3rem;
  border-radius: 4px; transition: color 0.2s, background 0.2s;
  margin-left: auto; flex-shrink: 0; opacity: 0;
}
.room-player-item:hover .kick-btn { opacity: 1; }
.kick-btn:hover { color: var(--danger); background: rgba(244,63,94,0.1); }


