/* ==========================================================================
   Mini-app Bac Bo — estilos portados da page /bacbo do frontend original
   ========================================================================== */

:root {
  --primary-color: rgb(153, 0, 231);
  --primary-color-hover: rgb(175, 30, 255);
  --player-color: #37b5ff;
  --banker-color: #ff3366;
  --tie-color: #ffd700;
  --bg-dark: #000;
  --text-primary: #fff;
  --text-muted: rgba(255, 255, 255, 0.5);
  --border-soft: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(0, 0, 0, 0.55);

  color-scheme: dark;
  font-family: 'Poppins', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background-color: #000;
  color: var(--text-primary);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

button:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(153, 0, 231, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(153, 0, 231, 0.7);
}

/* ---------- Layout ---------- */

.app-container {
  position: relative;
  min-height: 100vh;
  padding-top: 70px;
  padding-bottom: 60px;
  background-color: #000;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-glow span {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  background: radial-gradient(circle, var(--primary-color) 0px, rgba(0, 0, 0, 0) 70%);
}

.bg-glow span:nth-child(1) {
  width: 800px;
  height: 800px;
  right: -200px;
  top: -400px;
}

.bg-glow span:nth-child(2) {
  width: 600px;
  height: 600px;
  bottom: -300px;
  left: -200px;
}

.bg-glow span:nth-child(3) {
  width: 400px;
  height: 400px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* ---------- Header ---------- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 20px;
  background-color: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.back-button svg {
  width: 18px;
  height: 18px;
}

.variant-toggle {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.variant-toggle button {
  padding: 6px 12px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.variant-toggle button.active {
  background: var(--primary-color);
  color: #fff;
}

/* ---------- Conteudo ---------- */

.page-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 20px;
  overflow-x: hidden;
  animation: fadeIn 0.6s ease;
}

.bacbo-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bacbo-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.bacbo-game {
  width: calc(100% - 180px);
  max-width: 1280px;
  margin: 0 auto;
}

.bacbo-game h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
}

.bacbo-game-frame {
  position: relative;
  width: 100%;
  height: calc(100vh - 150px);
  min-height: 480px;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.bacbo-game-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.frame-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.frame-placeholder p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 420px;
}

.frame-placeholder .hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}

.bacbo-below,
.bacbo-rest {
  margin-top: 18px;
}

.bacbo-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

/* ---------- Cards ---------- */

.card {
  position: relative;
  padding: 25px;
  margin-bottom: 30px;
  border-radius: 16px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease-in-out;
  overflow: hidden;
  min-width: 0;
}

.card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), rgba(153, 0, 231, 0.4));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 1;
}

.card h2 {
  margin-bottom: 20px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 10px rgba(120, 25, 171, 0.6);
}

.bacbo-top .card,
.bacbo-charts .card {
  margin-bottom: 0;
}

/* ---------- Filtros e legendas ---------- */

.filter-select-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.filter-select-container label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.filter-select {
  padding: 8px 15px;
  border-radius: 8px;
  border: 1px solid rgba(153, 0, 231, 0.4);
  background-color: rgba(30, 30, 30, 0.85);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(153, 0, 231, 0.25);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(40, 40, 40, 0.5);
  border: 1px solid rgba(153, 0, 231, 0.2);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Cores das legendas: em classes (e nao em style="") para a CSP poder
   dispensar 'unsafe-inline'. */
.legend-color-setor-1 {
  background-color: #00ff00;
}

.legend-color-setor-2 {
  background-color: #8a2be2;
}

.legend-color-setor-3 {
  background-color: #8b4513;
}

.loading-status {
  margin-bottom: 15px;
  text-align: center;
  color: #4caf50;
  font-size: 0.9rem;
}

.loading-status.error {
  color: #f44336;
}

.loading-status button {
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.8rem;
}

/* ---------- Grade de resultados ---------- */

.history-grid,
.history-sequences {
  display: flex;
  gap: 3px;
  height: 280px;
  padding: 10px;
  border-radius: 12px;
  background-color: rgba(20, 20, 20, 0.7);
  border: 1px solid rgba(153, 0, 231, 0.2);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
  scroll-behavior: smooth;
}

.history-sequences {
  direction: rtl;
}

.history-grid::-webkit-scrollbar,
.history-sequences::-webkit-scrollbar {
  height: 8px;
}

.history-grid::-webkit-scrollbar-thumb,
.history-sequences::-webkit-scrollbar-thumb {
  background: rgba(153, 0, 231, 0.6);
  border-radius: 4px;
}

.grid-column,
.sequence-column {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 28px;
  align-items: center;
}

.sequence-column {
  flex-direction: column-reverse;
  direction: ltr;
}

.grid-ball,
.sequence-ball {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.5rem;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.grid-ball:hover {
  transform: scale(1.2);
  z-index: 2;
}

.sequence-ball:hover {
  transform: scale(1.15);
  z-index: 2;
}

.grid-ball.highlighted {
  border: 3px solid var(--tie-color) !important;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8) !important;
  transform: scale(1.1);
  z-index: 5;
  animation: highlightPulse 2s ease-in-out infinite alternate;
}

.grid-ball.dimmed {
  opacity: 0.4;
}

.sequence-ball.pattern-highlight {
  border: 3px solid #ff00ff !important;
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.8) !important;
  transform: scale(1.1);
  z-index: 3;
  animation: patternGlow 2s ease-in-out infinite alternate;
}

.sequence-ball.highlighted {
  border: 3px solid var(--tie-color) !important;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8) !important;
  z-index: 4;
}

.has-yellow-lines {
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4) !important;
}

.yellow-line {
  position: absolute;
  left: 15%;
  width: 70%;
  height: 2px;
  background: var(--tie-color);
  box-shadow: 0 0 3px rgba(255, 215, 0, 0.8);
  z-index: 5;
  pointer-events: none;
  transform: translateY(-1px);
}

/* ---------- Analise por numero ---------- */

.simple-analysis-header {
  margin-bottom: 20px;
  text-align: center;
}

.simple-analysis-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: #fff;
}

.simple-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-bottom: 25px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(40, 40, 40, 0.3);
  border: 1px solid rgba(153, 0, 231, 0.2);
}

.simple-legend .legend-item {
  gap: 6px;
  white-space: nowrap;
  font-size: 0.78rem;
}

.legend-symbol {
  display: inline-flex;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
}

.legend-symbol-player {
  background: linear-gradient(45deg, #37b5ff, #2196f3);
}

.legend-symbol-banker {
  background: linear-gradient(45deg, #ff3366, #e91e63);
}

.legend-symbol-tie {
  background: linear-gradient(45deg, #ffd700, #ffc107);
}

.simple-progress-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
}

.number-progress-item {
  padding: 12px;
  border-radius: 10px;
  background: rgba(30, 30, 30, 0.4);
  border: 1px solid rgba(153, 0, 231, 0.2);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.number-progress-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  border-color: var(--primary-color);
}

.number-label {
  margin-bottom: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #c084fc;
}

.total-count {
  margin-bottom: 8px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.color-counts {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 6px;
  background: rgba(20, 20, 20, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.color-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
}

.color-count .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.simple-progress-bar {
  display: flex;
  width: 100%;
  height: 24px;
  border-radius: 12px;
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.progress-segment.player {
  background: linear-gradient(45deg, #37b5ff, #2196f3);
}

.progress-segment.banker {
  background: linear-gradient(45deg, #ff3366, #e91e63);
}

.progress-segment.tie {
  background: linear-gradient(45deg, #ffd700, #ffc107);
}

/* ---------- Graficos ---------- */

.chart-container {
  position: relative;
  width: 100%;
  height: 220px;
  padding: 10px;
  border-radius: 12px;
  background-color: rgba(30, 30, 30, 0.7);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
}

.chart-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Analise de rodadas ---------- */

.round-analysis-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(240px, 0.9fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: start;
}

.ra-panel {
  min-width: 0;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-soft);
}

.ra-panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.ra-label {
  margin: 12px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.45);
}

.ra-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ra-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.ra-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ra-pattern-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 42px;
  padding: 8px;
  border-radius: 12px;
  border: 1px dashed rgba(153, 0, 231, 0.5);
  background: rgba(153, 0, 231, 0.06);
}

.ra-pattern-empty {
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

.ra-token {
  padding: 5px 9px;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

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

.ra-counter {
  min-width: 14px;
  text-align: center;
  font-weight: 700;
}

.ra-notice {
  margin-top: 10px;
  font-size: 12px;
  color: #c084fc;
}

.ra-saved-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.ra-saved-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.ra-empty {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
}

.ra-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.ra-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.ra-stat {
  padding: 10px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.ra-stat .value {
  font-size: 20px;
  font-weight: 800;
}

.ra-stat .label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.ra-levels {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  font-size: 13px;
}

.ra-level {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.ra-level .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ra-level .pct {
  min-width: 50px;
  text-align: right;
  color: rgba(255, 255, 255, 0.45);
}

.ra-mini-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.ra-mini {
  flex: 1;
  padding: 6px 2px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.ra-mini .label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

.ra-mini .value {
  font-size: 16px;
  font-weight: 800;
}

.ra-mini .pct {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.ra-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 6px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 2px;
}

.ra-history-item {
  text-align: center;
}

.ra-history-ball {
  position: relative;
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

.ra-history-badge {
  position: absolute;
  top: -7px;
  right: -8px;
  padding: 0 3px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  line-height: 13px;
  color: #000;
}

.ra-history-time {
  margin-top: 3px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

/* ---------- Admin ---------- */

.admin-container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 110px 20px 60px;
}

.admin-card {
  padding: 28px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-soft);
}

.admin-card h1 {
  margin-bottom: 6px;
  font-size: 1.4rem;
  font-weight: 700;
}

.admin-card .subtitle {
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--text-muted);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.55);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}

.field input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(153, 0, 231, 0.2);
}

.field .help {
  margin-top: 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.35);
}

.btn-primary {
  width: 100%;
  padding: 13px 18px;
  border-radius: 10px;
  background: var(--primary-color);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background: var(--primary-color-hover);
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

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

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

.admin-actions .btn-primary {
  width: auto;
  flex: 1;
}

.feedback {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
}

.feedback.show {
  display: block;
}

.feedback.ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.feedback.err {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.admin-meta {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.preview-frame {
  margin-top: 16px;
  height: 300px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #000;
  overflow: hidden;
}

.preview-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.hidden {
  display: none !important;
}

/* ---------- Animacoes ---------- */

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

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

@keyframes highlightPulse {
  0% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }
  100% { box-shadow: 0 0 25px rgba(255, 215, 0, 1), 0 0 35px rgba(255, 215, 0, 0.6); }
}

@keyframes patternGlow {
  0% { box-shadow: 0 0 10px rgba(255, 0, 255, 0.6); }
  100% { box-shadow: 0 0 20px rgba(255, 0, 255, 0.9); }
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(153, 0, 231, 0.25);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* ---------- Responsivo ---------- */

@media (max-width: 1100px) {
  .bacbo-game {
    order: -1;
    width: 100%;
    max-width: none;
  }

  .bacbo-top,
  .bacbo-charts {
    grid-template-columns: 1fr;
  }

  .bacbo-game-frame {
    height: 70vw;
    min-height: 420px;
  }

  .simple-progress-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .round-analysis-grid {
    grid-template-columns: 1fr 1fr;
  }

  .round-analysis-grid > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0 15px;
    gap: 8px;
  }

  .header-title {
    font-size: 1rem;
  }

  .history-grid,
  .history-sequences {
    height: 240px;
  }

  .grid-ball,
  .sequence-ball {
    width: 21px;
    height: 21px;
    font-size: 0.45rem;
  }

  .round-analysis-grid {
    grid-template-columns: 1fr;
  }

  .round-analysis-grid > :last-child {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .round-analysis-grid {
    grid-template-columns: 1fr;
  }

  .round-analysis-grid > :last-child {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding-top: 60px;
  }

  .header {
    height: 60px;
    padding: 0 10px;
  }

  .header-title {
    font-size: 0.92rem;
  }

  .variant-toggle button {
    padding: 5px 9px;
    font-size: 11.5px;
  }

  .back-button {
    padding: 6px 8px;
  }

  .page-content {
    padding: 14px 10px;
  }

  .card {
    padding: 16px;
  }

  .history-grid,
  .history-sequences {
    height: 200px;
  }

  .grid-ball,
  .sequence-ball {
    width: 17px;
    height: 17px;
    font-size: 0.4rem;
  }

  .number-progress-item {
    padding: 8px;
  }

  .number-label {
    font-size: 0.9rem;
  }

  .simple-progress-bar {
    height: 18px;
  }

  .admin-container {
    padding: 90px 14px 40px;
  }

  .admin-card {
    padding: 20px;
  }
}
