/**
 * Bingo Chamado - Estilos Avançados "Máquina de Festa" & Módulos Completos
 * Inclui: Modo Jogador (Mobile), QR Code, Livro de Ganhadores, Temas, Modo TV e Impressão A4.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400..700;1,9..40,400..700&family=Space+Grotesk:wght@500;700;800;900&display=swap');

/* =============================================================================
   1. Variáveis & Temas
   ============================================================================= */
:root {
  --cream: #f6f0df;
  --paper: #fffdf7;
  --ink: #10204a;
  --blue: #1646e8;
  --blue-dark: #0c2a9b;
  --tomato: #ee4a38;
  --yolk: #f5be31;
  --mint: #2b9348;
  --mint-light: #a9dcac;
  --line: #14224c;
  --muted: #6b6c74;
  --radius: 16px;
  --shadow-hard: 6px 6px 0 var(--ink);
  --shadow-hard-sm: 4px 4px 0 var(--ink);
  --shadow-hard-lg: 8px 8px 0 var(--ink);
  --bg-gradient: linear-gradient(rgba(246, 240, 223, 0.92), rgba(246, 240, 223, 0.96));
}

/* Tema 2: Cassino Dark Luxury / Neon */
.theme-casino {
  --cream: #0c1017;
  --paper: #161c27;
  --ink: #f0f4fc;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --tomato: #ef4444;
  --yolk: #eab308;
  --mint: #10b981;
  --line: #2d3748;
  --muted: #94a3b8;
  --shadow-hard: 6px 6px 0 #000000;
  --shadow-hard-sm: 4px 4px 0 #000000;
  --shadow-hard-lg: 8px 8px 0 #000000;
  --bg-gradient: linear-gradient(rgba(12, 16, 23, 0.94), rgba(12, 16, 23, 0.98));
}

/* Tema 3: Alto Contraste */
.theme-contrast {
  --cream: #000000;
  --paper: #111111;
  --ink: #ffffff;
  --blue: #0066ff;
  --tomato: #ff2200;
  --yolk: #ffea00;
  --mint: #00e676;
  --line: #ffffff;
  --muted: #cccccc;
  --shadow-hard: 4px 4px 0 #ffffff;
  --shadow-hard-sm: 3px 3px 0 #ffffff;
  --shadow-hard-lg: 6px 6px 0 #ffffff;
  --bg-gradient: linear-gradient(rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.98));
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--cream);
  color: var(--ink);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
}

button:not(:disabled), a {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* =============================================================================
   2. App Shell & Cabeçalho
   ============================================================================= */
.bingo-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--cream);
  background-image: var(--bg-gradient), url('../img/balls-pattern.svg');
  background-size: auto, 120px 120px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Barra Superior */
.topbar {
  width: min(1420px, calc(100% - 36px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--line);
  padding: 10px 0;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.brand:hover .brand-mark {
  transform: rotate(-6deg) scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 0.85;
}

.brand-text strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.brand-text strong .wordmark-i {
  color: var(--blue);
}

.brand-text em {
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 800;
  font-style: normal;
  color: var(--tomato);
  letter-spacing: -0.02em;
  margin-left: 16px;
}

.event-badge-center {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-hard-sm);
  border-radius: 30px;
  padding: 6px 18px;
  max-width: 520px;
  overflow: hidden;
}

.event-badge-center .prize-tag {
  background: var(--yolk);
  color: #10204a;
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.event-badge-center .event-title-text {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--line);
  transition: all 0.15s ease;
}

.icon-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--line);
  background: var(--yolk);
  color: #10204a;
}

.icon-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.icon-btn.is-active {
  background: var(--yolk);
  color: #10204a;
}

/* =============================================================================
   3. Faixa de Introdução & Padrão de Vitória
   ============================================================================= */
.intro-band {
  width: min(1420px, calc(100% - 36px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  border-bottom: 2px solid var(--line);
  min-height: 160px;
}

.intro-copy {
  padding: 22px 0 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow, .section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.intro-copy h1 {
  margin: 6px 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(28px, 3.4vw, 46px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.intro-copy h1 i {
  color: var(--tomato);
  font-style: normal;
}

.intro-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.pattern-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--line);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.intro-image {
  position: relative;
  min-height: 140px;
  overflow: hidden;
  border-left: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 253, 247, 0.2);
}

.intro-image img {
  max-height: 150px;
  width: auto;
  object-fit: contain;
}

.image-sticker {
  position: absolute;
  top: 14px;
  right: 18px;
  padding: 5px 10px;
  transform: rotate(5deg);
  color: #10204a;
  border: 2px solid var(--line);
  background: var(--yolk);
  box-shadow: 3px 3px 0 var(--line);
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

/* =============================================================================
   4. Layout do Jogo (3 Colunas)
   ============================================================================= */
.game-layout {
  width: min(1420px, calc(100% - 36px));
  margin: 24px auto 32px;
  display: grid;
  grid-template-columns: minmax(310px, 0.9fr) minmax(540px, 1.45fr) minmax(210px, 0.55fr);
  gap: 22px;
  align-items: stretch;
}

.stage-card {
  position: relative;
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-hard);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.control-stage {
  padding: 20px;
  gap: 14px;
}

.stage-heading, .board-header, .history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stage-heading > span:first-child {
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.stage-count {
  display: grid;
  place-items: center;
  padding: 3px 9px;
  color: var(--cream);
  background: var(--ink);
  border-radius: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.ball-pedestal {
  display: grid;
  place-items: center;
  padding: 6px 0;
}

.call-machine {
  --machine-col: var(--blue);
  width: min(100%, 250px);
  min-height: 275px;
  padding: 12px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 3px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(150deg, #1c2333, #0b0f19 80%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), var(--shadow-hard);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.call-machine::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--machine-col);
  transition: background 0.3s ease;
}

.call-machine.ball-col-b { --machine-col: var(--blue); }
.call-machine.ball-col-i { --machine-col: var(--tomato); }
.call-machine.ball-col-n { --machine-col: var(--yolk); }
.call-machine.ball-col-g { --machine-col: var(--mint); }
.call-machine.ball-col-o { --machine-col: #10204a; }

.machine-letter {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(54px, 5vw, 70px);
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  text-shadow: 2px 3px 0 rgba(0,0,0,0.6);
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.05em;
}

.bingo-ball {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  padding: 9px;
  display: grid;
  place-items: center;
  border: 3.5px solid #ffffff;
  background: var(--machine-col);
  box-shadow: 
    inset -8px -10px 0 rgba(0,0,0,0.25),
    inset 7px 7px 0 rgba(255,255,255,0.3),
    0 10px 0 rgba(0,0,0,0.35);
  transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1), background 0.25s ease;
}

.ball-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #090909;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 3px rgba(16, 32, 74, 0.08);
}

.ball-core strong {
  color: #080808;
  font-family: "Space Grotesk", sans-serif;
  font-size: 82px;
  font-weight: 900;
  letter-spacing: -0.1em;
  line-height: 1;
  transform: translateY(2px);
}

.bingo-ball.is-drawing {
  animation: roll-ball 0.76s cubic-bezier(0.77, 0, 0.175, 1) both;
}

.bingo-ball.has-number {
  animation: ball-arrive 0.35s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.callout {
  min-height: 52px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--line);
  background: rgba(242, 234, 216, 0.6);
  box-shadow: 2px 2px 0 var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.mini-chip {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: white;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 900;
  font-size: 12px;
  flex-shrink: 0;
}

.mini-chip.chip-blue { background: var(--blue); }
.mini-chip.chip-red { background: var(--tomato); }
.mini-chip.chip-yellow { background: var(--yolk); color: #10204a; }
.mini-chip.chip-mint { background: var(--mint); }
.mini-chip.chip-navy { background: #10204a; }

.draw-counter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.counter-box {
  border: 1.5px solid var(--line);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}

.counter-box span {
  font-family: "Space Grotesk", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.counter-box strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--ink);
}

.counter-box strong small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.control-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-draw {
  width: 100%;
  padding: 15px 18px;
  background: var(--blue);
  color: #ffffff;
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hard-sm);
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.btn-draw:hover:not(:disabled) {
  background: var(--blue-dark);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hard);
}

.btn-draw:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.btn-auto {
  padding: 11px 14px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hard-sm);
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-auto:hover:not(:disabled) {
  background: var(--yolk);
  color: #10204a;
  transform: translate(-1px, -1px);
}

.btn-auto.is-active {
  background: var(--yolk);
  color: #10204a;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), var(--shadow-hard-sm);
}

.btn-restart {
  width: 44px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hard-sm);
  transition: all 0.15s ease;
}

.btn-restart:hover {
  background: #fde8e8;
  color: var(--tomato);
  transform: translate(-1px, -1px);
}

.btn-bingo {
  width: 100%;
  padding: 13px 18px;
  background: linear-gradient(135deg, var(--tomato), #d62828);
  color: #ffffff;
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hard-sm);
  font-family: "Space Grotesk", sans-serif;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.btn-bingo:hover:not(:disabled) {
  background: linear-gradient(135deg, #f03e2e, #b71c1c);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hard);
  animation: pulse-btn 1.2s infinite;
}

.btn-checker-trigger {
  width: 100%;
  padding: 9px;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-checker-trigger:hover {
  background: #eef2ff;
  border-color: var(--blue);
  color: var(--blue);
}

.keyboard-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}

.keyboard-hint kbd {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  box-shadow: 1px 1px 0 var(--line);
}

/* 4.2 Coluna da Cartela Mestra */
.board-stage {
  padding: 20px;
  gap: 14px;
}

.board-header h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.progress-meter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-meter span {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
}

.progress-bar-track {
  width: 120px;
  height: 9px;
  background: rgba(0,0,0,0.1);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--blue);
  transition: width 0.3s ease;
}

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

.board-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.col-header {
  height: 40px;
  border-radius: 10px;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-hard-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
}

.col-header.col-blue { background: var(--blue); }
.col-header.col-red { background: var(--tomato); }
.col-header.col-yellow { background: var(--yolk); color: #10204a; }
.col-header.col-mint { background: var(--mint); }
.col-header.col-navy { background: #10204a; }

.numbers-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.number-tile {
  height: 36px;
  border: 1.5px solid rgba(16, 32, 74, 0.2);
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #33394a;
  transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.number-tile .tile-check {
  display: none;
  font-size: 10px;
}

.number-tile.is-called {
  border-color: var(--line);
  color: #ffffff;
  box-shadow: 2px 2px 0 var(--line);
  transform: scale(1.02);
}

.number-tile.is-called.tile-blue { background: var(--blue); }
.number-tile.is-called.tile-red { background: var(--tomato); }
.number-tile.is-called.tile-yellow { background: var(--yolk); color: #10204a; }
.number-tile.is-called.tile-mint { background: var(--mint); }
.number-tile.is-called.tile-navy { background: #10204a; }

.number-tile.is-called .tile-check {
  display: inline-block;
}

.number-tile.is-current {
  border: 2px solid #ffffff;
  outline: 3px solid var(--yolk);
  box-shadow: 0 0 12px rgba(245, 190, 49, 0.9), var(--shadow-hard-sm);
  animation: pulse-current 1.5s infinite;
  z-index: 2;
}

.board-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1.5px solid rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.legend-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.legend-dot.called { background: var(--blue); }
.legend-dot.pending { background: #ffffff; }

/* 4.3 Coluna do Histórico */
.history-stage {
  padding: 20px;
  gap: 14px;
}

.history-heading h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.history-count {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--yolk);
  color: #10204a;
  border: 1.5px solid var(--line);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 2px 2px 0 var(--line);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.recent-ball {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: #10204a;
  box-shadow: var(--shadow-hard-sm);
  transition: transform 0.2s ease;
}

.recent-ball.newest {
  background: #fff8e6;
  transform: scale(1.03);
}

.recent-col-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 900;
  border: 1.5px solid var(--line);
}

.recent-col-badge.badge-blue { background: var(--blue); }
.recent-col-badge.badge-red { background: var(--tomato); }
.recent-col-badge.badge-yellow { background: var(--yolk); color: #10204a; }
.recent-col-badge.badge-mint { background: var(--mint); }
.recent-col-badge.badge-navy { background: #10204a; }

.recent-number {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #10204a;
}

.empty-history {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 10px;
  color: var(--muted);
  gap: 12px;
}

.empty-history img {
  width: 80px;
  opacity: 0.7;
}

.empty-history p {
  font-size: 12px;
  font-weight: 600;
}

/* =============================================================================
   5. Modo Telão / TV (Display para Salão e Projetores)
   ============================================================================= */
.tv-mode .topbar {
  min-height: 90px;
}

.tv-mode .intro-band {
  display: none;
}

.tv-mode .game-layout {
  grid-template-columns: minmax(380px, 1.1fr) minmax(650px, 1.9fr);
  gap: 24px;
  margin: 16px auto;
}

.tv-mode .history-stage {
  display: none;
}

.tv-mode .call-machine {
  width: 100%;
  min-height: 380px;
  padding: 20px;
}

.tv-mode .machine-letter {
  font-size: 96px;
  min-height: 100px;
}

.tv-mode .bingo-ball {
  width: 220px;
  height: 220px;
}

.tv-mode .ball-core strong {
  font-size: 118px;
}

.tv-mode .col-header {
  height: 52px;
  font-size: 30px;
}

.tv-mode .number-tile {
  height: 48px;
  font-size: 20px;
}

/* =============================================================================
   6. Modo Jogador Virtual no Celular (Mobile Player Card)
   ============================================================================= */
.player-view-container {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 16px 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.player-card-shell {
  border: 3px solid var(--line);
  background: var(--paper);
  border-radius: 20px;
  box-shadow: var(--shadow-hard);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
}

.player-grid-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.player-grid-table th {
  height: 42px;
  color: #ffffff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 900;
  border: 2px solid var(--line);
}

.player-grid-table td {
  height: 62px;
  border: 2px solid var(--line);
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 900;
  background: #ffffff;
  color: #10204a;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  position: relative;
}

.player-grid-table td:active {
  transform: scale(0.95);
}

.player-grid-table td.marked {
  background: var(--blue);
  color: #ffffff;
  box-shadow: inset 0 0 0 3px #ffffff;
}

.player-grid-table td.marked::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 11px;
}

.player-grid-table td.center-free {
  background: var(--yolk);
  color: #10204a;
  font-size: 22px;
}

.btn-player-bingo {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--tomato), #b71c1c);
  color: #ffffff;
  border: 3px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-hard);
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.08em;
  animation: pulse-btn 1.4s infinite;
}

/* =============================================================================
   7. Modais & Janelas de Diálogo
   ============================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 32, 74, 0.82);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: min(100%, 540px);
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-hard-lg);
  padding: 30px 26px;
  text-align: center;
  position: relative;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card.modal-large {
  width: min(100%, 820px);
}

.modal-icon {
  font-size: 50px;
  margin-bottom: 8px;
}

.modal-card h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--tomato);
  line-height: 1;
  margin-bottom: 6px;
}

.modal-card p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-modal-primary {
  width: 100%;
  padding: 14px;
  background: var(--blue);
  color: #ffffff;
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hard-sm);
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 900;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-modal-primary:hover {
  background: var(--blue-dark);
  transform: translate(-1px, -1px);
}

.btn-modal-whatsapp {
  width: 100%;
  padding: 13px;
  background: #25d366;
  color: #ffffff;
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hard-sm);
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-modal-whatsapp:hover {
  background: #1ebc59;
  transform: translate(-1px, -1px);
}

.btn-modal-secondary {
  width: 100%;
  padding: 12px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 800;
  transition: all 0.15s ease;
}

.btn-modal-secondary:hover {
  background: rgba(0,0,0,0.06);
}

/* Formulários em Modais */
.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.form-input, .form-select {
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  box-shadow: 2px 2px 0 var(--line);
}

.theme-pill-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-theme-pill {
  padding: 8px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--line);
}

.btn-theme-pill.active {
  background: var(--yolk);
  color: #10204a;
}

/* Livro de Ganhadores */
.winners-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  margin: 16px 0;
  font-size: 13px;
}

.winners-table th {
  border-bottom: 2px solid var(--line);
  padding: 8px 6px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 900;
}

.winners-table td {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 10px 6px;
}

/* QR Code Box */
.qr-code-box {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-hard-sm);
  margin: 16px auto;
  max-width: 240px;
}

.qr-code-box img, .qr-code-box svg {
  width: 190px;
  height: 190px;
}

/* =============================================================================
   8. Gerador de Cartelas & Impressão (@media print)
   ============================================================================= */
.cards-print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 20px 0;
  max-height: 480px;
  overflow-y: auto;
  padding: 8px;
}

.bingo-printable-card {
  border: 2px solid #10204a;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #10204a;
  box-shadow: 3px 3px 0 #10204a;
}

.card-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid #10204a;
  padding-bottom: 6px;
}

.card-header-banner strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 900;
  color: #1646e8;
}

.card-serial {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 800;
  background: #f5be31;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #10204a;
}

.card-table-grid {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.card-table-grid th {
  background: #1646e8;
  color: #ffffff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 900;
  padding: 6px 0;
  border: 1.5px solid #10204a;
}

.card-table-grid td {
  height: 42px;
  border: 1.5px solid #10204a;
  font-family: "Space Grotesk", sans-serif;
  font-size: 17px;
  font-weight: 800;
}

.card-table-grid td.center-free {
  background: #fff3d0;
  color: #ee4a38;
  font-size: 20px;
}

/* Verificador de Cartela */
.checker-box {
  background: rgba(0,0,0,0.03);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin: 16px 0;
  text-align: left;
}

.chips-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.check-chip {
  padding: 3px 8px;
  border-radius: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--line);
}

.check-chip.hit {
  background: var(--mint);
  color: #ffffff;
}

.check-chip.miss {
  background: #fde8e8;
  color: var(--tomato);
  border-color: var(--tomato);
}

/* =============================================================================
   9. Regras de Impressão (@media print)
   ============================================================================= */
@media print {
  body, .bingo-app {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .topbar, .intro-band, .game-layout, .app-footer, .player-view-container, .modal-overlay:not(#print-area-modal), .modal-card > :not(.cards-print-grid) {
    display: none !important;
  }

  .modal-overlay#print-area-modal {
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    display: block !important;
  }

  .modal-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-height: none !important;
  }

  .cards-print-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    max-height: none !important;
    padding: 0 !important;
  }

  .bingo-printable-card {
    page-break-inside: avoid !important;
    box-shadow: none !important;
    border: 2px solid #000000 !important;
  }

  .card-table-grid th {
    background: #000000 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .card-table-grid td {
    border: 1.5px solid #000000 !important;
  }
}

/* =============================================================================
   10. Rodapé & Animações
   ============================================================================= */
.app-footer {
  margin-top: auto;
  border-top: 2px solid var(--line);
  padding: 14px 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper);
}

.app-footer kbd {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
}

@keyframes roll-ball {
  0% { transform: translateY(-30px) rotate(-180deg) scale(0.85); }
  50% { transform: translateY(15px) rotate(180deg) scale(1.08); }
  100% { transform: translateY(0) rotate(360deg) scale(1); }
}

@keyframes ball-arrive {
  0% { transform: scale(0.7) translateY(-20px); opacity: 0; }
  70% { transform: scale(1.1) translateY(4px); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes pulse-btn {
  0%, 100% { box-shadow: var(--shadow-hard); }
  50% { box-shadow: 0 0 16px rgba(238, 74, 56, 0.8), var(--shadow-hard); }
}

@keyframes pulse-current {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

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

@keyframes modalPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* =============================================================================
   11. Responsividade
   ============================================================================= */
@media (max-width: 1180px) {
  .game-layout {
    grid-template-columns: 1fr 1fr;
  }
  .history-stage {
    grid-column: 1 / -1;
  }
  .recent-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .recent-ball {
    flex: 1 1 calc(33.33% - 10px);
  }
}

@media (max-width: 820px) {
  .intro-band {
    grid-template-columns: 1fr;
  }
  .intro-image {
    display: none;
  }
  .game-layout {
    grid-template-columns: 1fr;
  }
  .bingo-board {
    gap: 6px;
  }
  .col-header {
    font-size: 18px;
    height: 36px;
  }
  .number-tile {
    height: 32px;
    padding: 0 6px;
    font-size: 13px;
  }
}
