/* ========================================================
   BINGO - MINI JOGO DE BINGO
   Layout Compacto, Dashboard com Painel Lateral (1 a 99)
   Sem Scroll Vertical + Cabeçalho Encolhível
   ======================================================== */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(23, 32, 54, 0.92);
  --bg-card-border: rgba(255, 255, 255, 0.12);
  --accent-gold: #fbbf24;
  --accent-gold-glow: rgba(251, 191, 36, 0.45);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;

  /* Cores das Colunas B I N G O */
  --col-b: #3b82f6;
  --col-i: #ef4444;
  --col-n: #8b5cf6;
  --col-g: #10b981;
  --col-o: #f59e0b;

  --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --header-height: 56px;
}

body.header-collapsed {
  --header-height: 36px;
}

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

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at 50% 8%, #1a2238 0%, var(--bg-primary) 70%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Confetes */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* ========================================================
   CABEÇALHO (RODATETO) COM BOTÃO DE ENCOLHER
   ======================================================== */
.app-header {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--bg-card-border);
  padding: 8px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  transition: all 0.25s ease;
}

body.header-collapsed .app-header {
  padding: 3px 14px;
}

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

.logo-ball {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
  animation: floatBall 3s ease-in-out infinite alternate;
  transition: font-size 0.2s ease;
}

body.header-collapsed .logo-ball {
  font-size: 1.25rem;
}

@keyframes floatBall {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-3px) rotate(12deg); }
}

.logo-text h1 {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  transition: font-size 0.2s ease;
}

body.header-collapsed .logo-text h1 {
  font-size: 1.05rem;
}

.logo-sub {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  display: block;
}

body.header-collapsed .logo-sub {
  display: none;
}

.header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

body.header-collapsed .btn-icon {
  padding: 3px 8px;
  font-size: 0.72rem;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.btn-icon.disabled {
  opacity: 0.45;
}

/* Botão especial de encolher rodateto */
.btn-collapse-header {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: var(--accent-gold);
}

.btn-collapse-header:hover {
  background: rgba(251, 191, 36, 0.3);
  color: #fff;
}

/* ========================================================
   TELAS GERAIS
   ======================================================== */
.screen {
  display: none;
  padding: 16px;
  max-width: 1700px;
  margin: 0 auto;
}

.screen.active {
  display: block;
  animation: fadeInScreen 0.3s ease-out;
}

@keyframes fadeInScreen {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   ETAPA 1: SETUP
   ======================================================== */
.setup-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
}

.setup-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 20px;
  padding: 32px;
  max-width: 680px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.setup-header {
  text-align: center;
  margin-bottom: 24px;
}

.setup-badge {
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(251, 191, 36, 0.35);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.setup-header h2 {
  font-size: 1.8rem;
  font-weight: 900;
  margin: 10px 0 6px;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.setup-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
}

.players-counter-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.slider-players {
  flex: 1;
  accent-color: var(--accent-gold);
  height: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.counter-display {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--bg-card-border);
}

.players-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.player-input-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
}

.player-input-card label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.player-input-card input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.player-input-card input:focus {
  border-color: var(--accent-gold);
}

.rule-box-info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.rule-icon {
  font-size: 1.4rem;
}

.rule-text strong {
  font-size: 0.82rem;
  color: #60a5fa;
  display: block;
}

.rule-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #000;
  border: none;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.6);
}

.btn-large {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

.pulse-btn {
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(251, 191, 36, 0.4); }
  50% { box-shadow: 0 0 25px rgba(251, 191, 36, 0.7); }
}

/* ========================================================
   ETAPA 2: SELEÇÃO DE CARTELAS
   ======================================================== */
.selection-banner {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 18px 24px;
  margin-bottom: 20px;
}

.selection-turn-badge {
  display: inline-block;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.selection-timer-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 18px;
  border-radius: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.timer-digits {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.timer-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bg-card-border);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.cards-preview-container {
  margin-top: 10px;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.selection-hint {
  font-size: 0.8rem;
  color: var(--accent-cyan);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 1300px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
}

.card-item {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.card-badge-id {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.badge-rule {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card-item.already-assigned {
  opacity: 0.45;
  filter: grayscale(40%);
  pointer-events: none;
}

.assigned-owner-badge {
  background: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  border: 1px solid #3b82f6;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 6px;
}

.btn-select-card {
  width: 100%;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-select-card:hover {
  background: var(--accent-gold);
  color: #000;
}

/* ========================================================
   MATRIZ 5x5 DE BINGO (UNIVERSAL)
   ======================================================== */
.bingo-card {
  background: rgba(10, 15, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.bingo-card-header {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.col-header {
  padding: 4px 0;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 1px;
}

.col-b { background: var(--col-b); }
.col-i { background: var(--col-i); }
.col-n { background: var(--col-n); }
.col-g { background: var(--col-g); }
.col-o { background: var(--col-o); }

.bingo-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px;
}

.bingo-cell {
  background: #141c2e;
  aspect-ratio: 1.15 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.78rem;
  color: #e5e7eb;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
}

/* Célula Marcada com X */
.bingo-cell.marked {
  background: #1b1220;
  color: #4b5563;
}

.bingo-cell.marked::after {
  content: '✕';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  font-family: var(--font-main);
  font-size: 1.25rem;
  font-weight: 900;
  color: #ff2d55;
  text-shadow: 0 0 8px rgba(255, 45, 85, 0.8);
  animation: stampPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes stampPop {
  0% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.bingo-cell.last-hit {
  background: rgba(16, 185, 129, 0.35);
  animation: hitGlow 1s ease-in-out;
}

@keyframes hitGlow {
  0% { transform: scale(1.08); background: rgba(16, 185, 129, 0.7); }
  100% { transform: scale(1); }
}

/* ========================================================
   ETAPA 3: DASHBOARD DO BINGO (PAINEL 1-99 NA ESQUERDA)
   100% ENQUADRADO NA TELA - SEM SCROLL VERTICAL NO DESKTOP
   ======================================================== */
#screen-game {
  padding: 8px 14px;
  max-width: 100vw;
  height: calc(100vh - var(--header-height));
  box-sizing: border-box;
  overflow: hidden;
}

.game-dashboard-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

/* --- BARRA LATERAL ESQUERDA: PAINEL 1 A 99 --- */
.game-sidebar-left {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
}

/* Scrollbar fina para a sidebar caso necessário */
.game-sidebar-left::-webkit-scrollbar {
  width: 4px;
}
.game-sidebar-left::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-icon {
  font-size: 0.95rem;
}

.sidebar-heading {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--accent-gold);
}

.sidebar-counter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.35);
  padding: 1px 6px;
  border-radius: 6px;
}

/* Grade dos 99 Números com Menos Colunas (6 Colunas) e Números Maiores */
.board-grid-sidebar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
}

.board-num {
  aspect-ratio: 1.1 / 1;
  min-height: 22px;
  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-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  transition: all 0.2s ease;
  user-select: none;
}

.board-num.called {
  background: var(--accent-gold);
  color: #000;
  font-weight: 900;
  border-color: #f59e0b;
  transform: scale(1.06);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.75);
}

/* Seção de Últimas Bolas na Barra Lateral (2 linhas de 5 bolas cada = 10 bolas) */
.sidebar-recent-section {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.sidebar-recent-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  display: block;
  margin-bottom: 6px;
  text-align: center;
}

.sidebar-recent-balls {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 5px;
  justify-items: center;
  align-items: center;
  min-height: 74px;
}

.empty-recent {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 10px 0;
}

.mini-called-ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #cbd5e1 50%, #64748b 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
  line-height: 1;
}

.mini-called-ball:first-child {
  transform: scale(1.06);
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.mini-called-ball.ball-b { border: 2.5px solid var(--col-b); }
.mini-called-ball.ball-i { border: 2.5px solid var(--col-i); }
.mini-called-ball.ball-n { border: 2.5px solid var(--col-n); }
.mini-called-ball.ball-g { border: 2.5px solid var(--col-g); }
.mini-called-ball.ball-o { border: 2.5px solid var(--col-o); }

.mini-ball-letter {
  font-size: 0.55rem;
  font-weight: 900;
  color: #1e293b;
  line-height: 1;
}

.mini-ball-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

/* --- ÁREA PRINCIPAL --- */
.game-main-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* DECK DE CONTROLE COMPACTO */
.game-control-deck-compact {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.deck-machine {
  display: flex;
  align-items: center;
  gap: 10px;
}

.globe-mini-cage {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px dashed rgba(251, 191, 36, 0.6);
  position: relative;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.1) 0%, rgba(10, 15, 26, 0.95) 75%);
  animation: spinCage 10s linear infinite;
  flex-shrink: 0;
}

@keyframes spinCage {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mini-ball {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.mini-ball.b1 { background: var(--col-b); top: 6px; left: 10px; }
.mini-ball.b2 { background: var(--col-i); top: 20px; left: 6px; }
.mini-ball.b3 { background: var(--col-n); top: 10px; right: 8px; }
.mini-ball.b4 { background: var(--col-g); bottom: 8px; left: 15px; }
.mini-ball.b5 { background: var(--col-o); bottom: 12px; right: 9px; }

/* Bola Central Chamada Compacta */
.bingo-ball {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #e2e8f0 30%, #94a3b8 70%, #475569 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 10px var(--accent-gold-glow);
  flex-shrink: 0;
  transition: all 0.2s;
}

.bingo-ball.ball-b { border: 2.5px solid var(--col-b); }
.bingo-ball.ball-i { border: 2.5px solid var(--col-i); }
.bingo-ball.ball-n { border: 2.5px solid var(--col-n); }
.bingo-ball.ball-g { border: 2.5px solid var(--col-g); }
.bingo-ball.ball-o { border: 2.5px solid var(--col-o); }

.bingo-ball.popping {
  animation: popBall 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popBall {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.ball-letter {
  font-size: 0.65rem;
  font-weight: 900;
  color: #1e293b;
  line-height: 1;
}

.ball-number {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

.deck-announcement-box {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.deck-status-tag {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--accent-emerald);
}

.ball-announcement {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-gold);
  white-space: nowrap;
}

/* Bloco Central: Timer, Barra de Progresso e Velocidades */
.deck-timer-and-speed {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  max-width: 520px;
}

.deck-timer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-label-box {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.timer-label-box strong {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 0.82rem;
}

.progress-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-gold));
  border-radius: 999px;
  transition: width 0.1s linear;
}

.btn-pause-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--bg-card-border);
  color: #fff;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-pause-pill:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-pause-pill.is-paused {
  background: rgba(251, 191, 36, 0.25);
  border-color: rgba(251, 191, 36, 0.6);
  color: var(--accent-gold);
}

/* Botão Chamar Bola Manual no modo Pausa */
.btn-manual-draw {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid rgba(16, 185, 129, 0.6);
  color: #fff;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 6px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
  animation: pulseManualBtn 1.8s infinite;
}

@keyframes pulseManualBtn {
  0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 16px rgba(16, 185, 129, 0.8); }
}

.btn-manual-draw:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}

.btn-manual-draw:active {
  transform: scale(0.96);
}

.btn-manual-draw.hidden {
  display: none !important;
}

.speed-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.speed-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

.speed-pills {
  display: flex;
  gap: 4px;
}

.btn-speed {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-speed.active {
  background: var(--accent-gold);
  color: #000;
  font-weight: 800;
  border-color: var(--accent-gold);
}

/* Filtros da Arena Integrados no Deck */
.deck-filters-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.arena-filter-toggles {
  display: flex;
  gap: 4px;
}

.btn-filter {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-filter:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.btn-filter.active {
  background: var(--accent-gold) !important;
  color: #000 !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5) !important;
  font-weight: 800 !important;
}

/* ========================================================
   ARENA DAS 10 CARTELAS (GRID COMPACTO 5x2)
   100% ENQUADRADO NA ALTURA SEM ROLAGEM
   ======================================================== */
.arena-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.arena-card-item {
  background: var(--bg-card);
  border: 1.5px solid var(--bg-card-border);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  min-height: 0;
}

.arena-card-item.is-human {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.15);
}

.arena-card-item.is-bot {
  border-color: rgba(255, 255, 255, 0.08);
}

.arena-card-item.close-to-bingo {
  border-color: #f43f5e;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.35);
  animation: closeToBingoPulse 1.5s infinite alternate;
}

@keyframes closeToBingoPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.015); }
}

.arena-card-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Linha 1 do Header da Cartela: Colocação + Avatar + Nome + Tag HUMANO/BOT */
.arena-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.arena-card-identity {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.arena-rank-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.arena-rank-badge.rank-1 {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #000;
  border: 1px solid #f59e0b;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.arena-rank-badge.rank-2 {
  background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
  color: #000;
  border: 1px solid #e2e8f0;
}

.arena-rank-badge.rank-3 {
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
  color: #fff;
  border: 1px solid #f97316;
}

.arena-rank-badge.rank-other {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.arena-player-avatar {
  font-size: 0.95rem;
  flex-shrink: 0;
  line-height: 1;
}

.arena-player-name {
  font-weight: 800;
  font-size: 0.78rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

.arena-type-tag {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.arena-type-tag.tag-human {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.arena-type-tag.tag-bot {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.25);
}

/* Linha 2 do Header da Cartela: Cartela #ID e Pill "Faltam X" */
.arena-card-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.arena-card-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.arena-remaining-pill {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  white-space: nowrap;
}

.arena-card-item.close-to-bingo .arena-remaining-pill {
  background: rgba(244, 63, 94, 0.3);
  color: #f43f5e;
}

/* Barra de Progresso da Cartela */
.arena-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.arena-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.arena-card-item.close-to-bingo .arena-progress-fill {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

/* ========================================================
   MODAL DO VENCEDOR
   ======================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.winner-modal-card {
  background: #111827;
  border: 2px solid rgba(251, 191, 36, 0.6);
  border-radius: 20px;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 0 50px rgba(251, 191, 36, 0.3), 0 20px 50px rgba(0, 0, 0, 0.9);
  padding: 24px;
  text-align: center;
}

.winner-trophy {
  font-size: 3.2rem;
  animation: trophyFloat 2s infinite alternate ease-in-out;
  margin-bottom: 6px;
}

@keyframes trophyFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-6px) scale(1.08); }
}

.winner-modal-card h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.winner-name {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: 16px;
}

.winner-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.wstat {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
}

.wstat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.wstat strong {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-gold);
}

.winner-card-showcase {
  margin-bottom: 16px;
}

.winner-card-showcase h4 {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.winner-card-showcase .bingo-card {
  max-width: 260px;
  margin: 0 auto;
}

/* ========================================================
   RESPONSIVIDADE (Telas menores / Mobile)
   ======================================================== */
@media (max-width: 1100px) {
  #screen-game {
    height: auto;
    overflow-y: auto;
  }

  .game-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .game-sidebar-left {
    height: auto;
    max-height: 260px;
  }

  .game-control-deck-compact {
    flex-wrap: wrap;
  }

  .arena-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-template-rows: auto;
    overflow: visible;
  }
}
