/* ═══════════════════════════════════════════
   THEME VARIABLES
═══════════════════════════════════════════ */
:root {
  --transition-theme: background 0.35s ease, color 0.35s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* ── LIGHT (default) ── */
body.light {
  --bg: #f5ede8;
  --surface: #ffffff;
  --surface2: #fdf6f2;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.13);
  --text: #1a1a1a;
  --muted: #888;
  --muted2: #bbb;
  --accent: #8b1a1a;
  --accent-light: rgba(139, 26, 26, 0.08);
  --accent-mid: rgba(139, 26, 26, 0.18);
  --gold: #d4860a;
  --logo-font: 'Lora', serif;
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-hero: 0 4px 24px rgba(0, 0, 0, 0.07);
  --ball-text: #fff;
  --live-color: #1e8a3a;
  --live-bg: rgba(30, 138, 58, 0.1);
  --live-border: rgba(30, 138, 58, 0.2);
  --melate: #8b1a1a;
  --revancha: #1e8a3a;
  --revanchita: #e05a00;
  --chispazo: #9b30c8;
  --tris: #d4860a;
  --ganamas: #0077cc;
}

/* ── DARK NEON ── */
body.dark {
  --bg: #0f0a08;
  --surface: #1a0e0a;
  --surface2: #221208;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.1);
  --text: #f5e8e0;
  --muted: #9a7a70;
  --muted2: #5a3a30;
  --accent: #ff6b35;
  --accent-light: rgba(255, 107, 53, 0.08);
  --accent-mid: rgba(255, 107, 53, 0.2);
  --gold: #ffaa00;
  --logo-font: 'Bebas Neue', cursive;
  --shadow-card: none;
  --shadow-hero: none;
  --ball-text: #0f0a08;
  --live-color: #39ff14;
  --live-bg: rgba(57, 255, 20, 0.08);
  --live-border: rgba(57, 255, 20, 0.2);
  --melate: #ff6b35;
  --revancha: #39ff14;
  --revanchita: #ff9500;
  --chispazo: #ff3cac;
  --tris: #ffaa00;
  --ganamas: #00e5ff;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  transition: var(--transition-theme);
}

body.dark::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 229, 255, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(255, 60, 172, 0.03) 0%, transparent 60%);
}

body.light::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 40% at 10% 10%, rgba(26, 58, 92, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 90% 90%, rgba(200, 150, 10, 0.04) 0%, transparent 60%);
}

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-strong);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  transition: var(--transition-theme);
  will-change: transform;
  transform: translateZ(0);
}

body.light header {
  background: rgba(244, 241, 235, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

body.dark header {
  background: rgba(8, 12, 16, 0.92);
  backdrop-filter: blur(20px);
}

.logo-wrap {}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  transition: var(--transition-theme);
}

body.light .logo {
  font-family: 'Lora', serif;
  letter-spacing: 0.5px;
}

body.dark .logo {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.8rem;
  letter-spacing: 2px;
}

.logo span {
  color: var(--gold);
}

.logo-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: -1px;
}

body.dark .logo-sub {
  display: none;
}

/* ── DESKTOP NAV ── */
nav {
  display: flex;
  gap: 0.2rem;
}

nav button {
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.3px;
}

nav button:hover {
  background: var(--accent-light);
  color: var(--accent);
}

body.light nav button.active {
  background: var(--accent);
  color: #fff;
}

body.dark nav button.active {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* ── HAMBURGER BUTTON ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 38px;
  height: 38px;
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  gap: 5px;
  transition: all 0.18s;
  flex-shrink: 0;
}

.hamburger span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
  display: block;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── MOBILE DROPDOWN MENU ── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 62px;
  left: 0;
  right: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border-strong);
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

body.light .mobile-menu {
  background: rgba(244, 241, 235, 0.98);
  backdrop-filter: blur(16px);
}

body.dark .mobile-menu {
  background: rgba(8, 12, 16, 0.97);
  backdrop-filter: blur(20px);
}

.mobile-menu.open {
  max-height: 500px;
}

.mobile-nav-section {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-section:last-child {
  border-bottom: none;
}

.mobile-nav-label {
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--muted2);
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.4rem 0.3rem 0.3rem;
}

.mobile-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 0.5rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.mobile-nav-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}

body.light .mobile-nav-btn.active {
  background: var(--accent);
  color: #fff;
}

body.dark .mobile-nav-btn.active {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent);
}

.mobile-theme-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
}

.mobile-theme-btn {
  flex: 1;
  padding: 0.55rem;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.mobile-theme-btn.active {
  background: var(--accent);
  color: #fff;
}

body.dark .mobile-theme-btn.active {
  color: var(--bg);
}

@media(max-width:768px) {
  nav {
    display: none !important;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .live-badge {
    display: none;
  }
}

/* LIVE BADGE */
.live-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--live-color);
  letter-spacing: 1px;
  background: var(--live-bg);
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--live-border);
  transition: var(--transition-theme);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live-color);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1)
  }

  50% {
    opacity: 0.4;
    transform: scale(1.4)
  }
}

/* THEME TOGGLE */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  transition: var(--transition-theme);
}

.theme-btn {
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 0.3rem 0.75rem;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.theme-btn.active {
  background: var(--accent);
  color: #fff;
}

body.dark .theme-btn.active {
  color: var(--bg);
}

/* LANGUAGE SELECTOR */
.lang-select {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  transition: var(--transition-theme);
}

.lang-btn {
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 0.3rem 0.6rem;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

body.dark .lang-btn.active {
  color: var(--bg);
}

/* Mobile lang row */
.mobile-lang-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
}

.mobile-lang-btn {
  flex: 1;
  padding: 0.5rem;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.mobile-lang-btn.active {
  background: var(--accent);
  color: #fff;
}

body.dark .mobile-lang-btn.active {
  color: var(--bg);
}

/* ═══════════════════════════════════════════
   API STATUS BAR
═══════════════════════════════════════════ */
#apiStatusBar {
  position: relative;
  z-index: 99;
  padding: 0.45rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s;
  border-bottom: 1px solid transparent;
}

#apiStatusBar.connecting {
  background: rgba(200, 150, 10, 0.08);
  color: var(--gold);
  border-color: rgba(200, 150, 10, 0.2);
}

#apiStatusBar.connected {
  background: var(--live-bg);
  color: var(--live-color);
  border-color: var(--live-border);
}

#apiStatusBar.error {
  background: rgba(220, 50, 50, 0.08);
  color: #dc3232;
  border-color: rgba(220, 50, 50, 0.2);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ═══════════════════════════════════════════
   GAME TABS
═══════════════════════════════════════════ */
.game-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 1rem 2rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  z-index: 1;
  transition: var(--transition-theme);
}

.game-tabs::-webkit-scrollbar {
  display: none;
}

.game-tab {
  flex-shrink: 0;
  padding: 0.45rem 1.1rem;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
}

.game-tab:hover {
  border-color: var(--tab-color, var(--accent));
  color: var(--tab-color, var(--accent));
  background: var(--accent-light);
}

.game-tab.active {
  border-color: var(--tab-color, var(--accent));
  color: var(--tab-color, var(--accent));
  background: var(--accent-light);
}

body.dark .game-tab.active {
  box-shadow: 0 0 16px -6px var(--tab-color, var(--accent));
}

.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

/* ── STICKY GAME CONTEXT BAR ── */
.game-context-bar {
  position: -webkit-sticky;
  position: sticky;
  top: 62px;
  z-index: 90;
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 2rem;
  border-bottom: 1px solid var(--border);
  transition: var(--transition-theme);
  will-change: transform;
  transform: translateZ(0);
}

.game-context-bar.visible {
  display: flex;
}

body.light .game-context-bar {
  background: rgba(244, 241, 235, 0.97);
  backdrop-filter: blur(12px);
}

body.dark .game-context-bar {
  background: rgba(8, 12, 16, 0.95);
  backdrop-filter: blur(16px);
}

.game-context-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.game-context-name {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: var(--game-color, var(--accent));
}

.game-context-page {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
}

.game-context-countdown {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--game-color, var(--accent));
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.game-context-countdown-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.game-context-spacer {
  flex: 1;
}

/* Desktop: show countdown label + timer, hide on mobile */
@media(max-width:768px) {
  .game-context-countdown {
    display: none !important;
  }

  .game-context-countdown-label {
    display: none !important;
  }

  .game-context-spacer {
    flex: 1;
  }
}

/* Mobile: hide next-draw-banner (it stays visible on mobile via the banner below hero) */
@media(min-width:769px) {
  .next-draw-banner {
    display: none !important;
  }
}

.game-context-gen-btn {
  padding: 0.3rem 0.85rem;
  border-radius: 7px;
  border: 1.5px solid var(--game-color, var(--accent));
  background: var(--game-color, var(--accent));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

body.dark .game-context-gen-btn {
  color: var(--bg);
}

.game-context-gen-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════
   MAIN
═══════════════════════════════════════════ */
main {
  position: relative;
  z-index: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Lora', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  letter-spacing: 0.3px;
}

body.dark .section-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.3rem;
  letter-spacing: 2px;
  color: var(--muted);
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

/* ── HERO RESULT ── */
.hero-result {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 1.8rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-hero);
  transition: var(--transition-theme);
}

.hero-result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

body.light .hero-result::before {
  background: linear-gradient(90deg, var(--game-color, var(--accent)), transparent 80%);
}

body.dark .hero-result::before {
  background: linear-gradient(90deg, transparent, var(--game-color, var(--accent)), transparent);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.game-name-big {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.4rem;
  letter-spacing: 3px;
  color: var(--game-color, var(--accent));
  line-height: 1;
}

.concurso-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: #444;
  font-weight: 700;
}

body.dark .concurso-num {
  color: #a0b0c8;
}

.concurso-date {
  font-size: 0.75rem;
  color: var(--muted2);
  margin-top: 0.2rem;
}

.concurso-info {
  text-align: right;
}

.balls-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
  animation: ballDrop 0.4s ease backwards;
  transition: transform 0.2s;
}

body.light .ball {
  background: var(--game-color, var(--accent));
  color: #fff;
  box-shadow: 0 4px 14px -4px var(--game-color, var(--accent));
}

body.dark .ball {
  background: rgba(0, 0, 0, 0.4);
  color: var(--game-color, var(--accent));
  border: 2px solid var(--game-color, var(--accent));
}

.ball:hover {
  transform: scale(1.1) rotate(5deg);
}

@keyframes ballDrop {
  from {
    transform: translateY(-16px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

.prizes-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.prize-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 1.1rem;
  min-width: 130px;
}

.prize-label {
  font-size: 0.67rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.prize-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.25rem;
}

.prize-winners {
  font-size: 0.7rem;
  color: var(--muted2);
  margin-top: 0.1rem;
}

/* ── RESULTS GRID ── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2.5rem;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

body.light .result-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--game-color, var(--accent));
  opacity: 0;
  transition: opacity 0.18s;
}

body.dark .result-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--game-color, var(--accent));
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: var(--game-color, var(--accent));
}

body.light .result-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

body.dark .result-card:hover {
  background: var(--surface2);
}

body.light .result-card:hover::after {
  opacity: 1;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-game-name {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.45rem;
  letter-spacing: 2px;
  color: var(--game-color, var(--accent));
}

.card-date {
  font-size: 0.82rem;
  color: #555;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

body.dark .card-date {
  color: #8a9ab0;
}

.card-balls {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.ball-sm {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  animation: ballDrop 0.3s ease backwards;
}

body.light .ball-sm {
  background: var(--game-color, var(--accent));
  color: #fff;
  box-shadow: 0 2px 6px -2px var(--game-color, var(--accent));
}

body.dark .ball-sm {
  background: rgba(0, 0, 0, 0.4);
  color: var(--game-color, var(--accent));
  border: 1.5px solid var(--game-color, var(--accent));
}

.card-prize {
  font-size: 0.78rem;
  color: var(--muted);
}

.card-prize span {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin-bottom: 2rem;
}

@media(max-width:700px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-panel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: var(--shadow-card);
}

.stat-panel-title {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.freq-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.freq-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text);
  width: 24px;
  text-align: right;
  font-weight: 600;
}

.freq-bar-wrap {
  flex: 1;
  background: rgba(128, 128, 128, 0.1);
  border-radius: 4px;
  height: 9px;
  overflow: hidden;
}

.freq-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.freq-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  width: 30px;
}

.hot-cold-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.hc-section h4 {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.7rem;
}

.hc-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hc-ball {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.hc-ball.hot {
  background: rgba(224, 90, 0, 0.1);
  border: 1.5px solid #e05a00;
  color: #e05a00;
}

.hc-ball.cold {
  background: rgba(0, 119, 204, 0.08);
  border: 1.5px solid #0077cc;
  color: #0077cc;
}

body.dark .hc-ball.hot {
  background: rgba(255, 107, 53, 0.12);
  border-color: var(--quina);
  color: var(--quina);
}

body.dark .hc-ball.cold {
  background: rgba(0, 229, 255, 0.08);
  border-color: var(--mega);
  color: var(--mega);
}

/* ── STATS LIMIT CONTROL ── */
.stats-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}

.stats-limit-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stats-limit-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  font-family: 'JetBrains Mono', monospace;
}

.stats-limit-btn.active,
.stats-limit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ── PICKER ── */
.picker-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}

@media(max-width:700px) {
  .picker-wrap {
    grid-template-columns: 1fr;
  }
}

.picker-panel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: var(--shadow-card);
}

.algo-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.algo-opt {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.algo-opt:hover,
.algo-opt.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.algo-opt input[type=radio] {
  accent-color: var(--accent);
  margin-top: 3px;
}

.algo-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
}

.algo-desc {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* COUNT SELECTOR */
.count-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.count-label {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
}

.count-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}

.count-btn.active,
.count-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.gen-btn {
  width: 100%;
  padding: 0.85rem;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  font-family: 'Bebas Neue', cursive;
  font-size: 1.15rem;
  letter-spacing: 2px;
  background: var(--accent);
  color: #fff;
  transition: all 0.18s;
  margin-bottom: 1.2rem;
}

body.dark .gen-btn {
  color: var(--bg);
}

.gen-btn:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -6px var(--accent);
}

.gen-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Multiple generated games */
.gen-games-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.gen-game-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.9rem 1rem;
}

.gen-game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.gen-game-label {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.gen-game-conf {
  font-size: 0.7rem;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

.gen-game-notes {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}

.suggested-balls {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-height: 48px;
  align-items: center;
}

.ball-suggested {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.92rem;
  animation: popIn 0.3s ease backwards;
}

body.light .ball-suggested {
  background: var(--game-color, var(--accent));
  color: #fff;
  box-shadow: 0 4px 12px -4px var(--game-color, var(--accent));
}

body.dark .ball-suggested {
  background: var(--game-color, var(--accent));
  color: var(--bg);
}

@keyframes popIn {
  from {
    transform: scale(0) rotate(-15deg);
    opacity: 0
  }

  to {
    transform: scale(1) rotate(0);
    opacity: 1
  }
}

.confidence-bar {
  margin-top: 1rem;
}

.conf-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.conf-track {
  background: rgba(128, 128, 128, 0.1);
  border-radius: 4px;
  height: 6px;
}

.conf-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 1s ease;
}

.empty-hint {
  color: var(--muted2);
  font-size: 0.82rem;
}

/* ── BACKTEST ── */
.backtest-controls {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 1.4rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  align-items: flex-end;
  box-shadow: var(--shadow-card);
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ctrl-group label {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
}

.ctrl-group select,
.ctrl-group input {
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  border-radius: 7px;
  padding: 0.5rem 0.8rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.83rem;
  outline: none;
  min-width: 140px;
  transition: border-color 0.18s;
}

.ctrl-group select:focus,
.ctrl-group input:focus {
  border-color: var(--accent);
}

.run-btn {
  padding: 0.55rem 1.4rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: 'Bebas Neue', cursive;
  font-size: 1rem;
  letter-spacing: 1.5px;
  background: var(--accent);
  color: #fff;
  transition: all 0.18s;
}

body.dark .run-btn {
  color: var(--bg);
}

.run-btn:hover:not(:disabled) {
  opacity: 0.88;
}

.run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.backtest-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.4rem;
}

@media(max-width:700px) {
  .backtest-results {
    grid-template-columns: 1fr 1fr;
  }
}

.bt-stat {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: var(--shadow-card);
}

.bt-stat-label {
  font-size: 0.67rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
}

.bt-stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.2rem;
}

.bt-stat-sub {
  font-size: 0.7rem;
  color: var(--muted2);
  margin-top: 0.1rem;
}

.bt-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.bt-table {
  width: 100%;
  border-collapse: collapse;
}

.bt-table th {
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.67rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1.5px solid var(--border-strong);
  background: var(--surface2);
}

.bt-table td {
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
}

.bt-table tr:last-child td {
  border-bottom: none;
}

.bt-table tr:hover td {
  background: var(--surface2);
}

.match-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.match-6 {
  background: rgba(0, 119, 204, 0.1);
  color: #0077cc;
}

.match-5 {
  background: rgba(30, 138, 58, 0.1);
  color: #1e8a3a;
}

.match-4 {
  background: rgba(224, 90, 0, 0.1);
  color: #e05a00;
}

.match-low {
  background: rgba(128, 128, 128, 0.08);
  color: var(--muted);
}

body.dark .match-6 {
  background: rgba(0, 229, 255, 0.12);
  color: var(--mega);
}

body.dark .match-5 {
  background: rgba(57, 255, 20, 0.1);
  color: var(--lotofacil);
}

body.dark .match-4 {
  background: rgba(255, 107, 53, 0.1);
  color: var(--quina);
}

/* ── PICKER TOOLS TABS ── */
.picker-tools-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.picker-tool-tab {
  padding: 0.4rem 0.9rem;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.3px;
}

.picker-tool-tab:hover,
.picker-tool-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ── GENERATOR TOOL DROPDOWN ── */
.gen-tool-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.gen-tool-label {
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}

.gen-tool-select {
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.18s;
}

.gen-tool-select:focus {
  border-color: var(--accent);
}

/* ── GEN HISTORY WITH SHARE ── */
.hist-entry {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

.hist-entry:last-child {
  border-bottom: none;
}

.hist-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hist-tool-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.hist-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}

.hist-share-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.hist-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 7px;
  border: 1px solid rgba(220, 50, 50, 0.25);
  background: none;
  color: #dc3232;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}

.hist-clear-btn:hover:not(:disabled) {
  background: rgba(220, 50, 50, 0.07);
}

.hist-top-bar {
  display: flex;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1.5px solid var(--border-strong);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
  padding-top: 0.1rem;
}

/* ── NUMBER GRID ── */
.number-grid-wrap {
  margin-bottom: 1.2rem;
}

.number-grid-info {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  max-width: 380px;
}

@media(max-width:480px) {
  .number-grid {
    max-width: 100%;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
  }
}

.grid-num {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.13s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.grid-num:hover:not(.selected):not(.disabled):not(.gn-avoid) {
  border-color: var(--game-color, var(--accent));
  color: var(--game-color, var(--accent));
  background: var(--accent-light);
  transform: scale(1.1);
}

.grid-num.selected {
  background: var(--game-color, var(--accent));
  border-color: var(--game-color, var(--accent));
  color: #fff;
  transform: scale(1.12);
  box-shadow: 0 2px 8px -2px var(--game-color, var(--accent));
}

body.dark .grid-num.selected {
  color: var(--bg);
}

.grid-num.disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.grid-num.gn-avoid {
  background: rgba(220, 50, 50, 0.1);
  border-color: rgba(220, 50, 50, 0.4);
  color: #dc3232;
  cursor: not-allowed;
}

.grid-num.gn-fix {
  background: rgba(30, 138, 58, 0.15);
  border-color: rgba(30, 138, 58, 0.5);
  color: var(--live-color, #1e8a3a);
}

/* ── MANUAL TICKET LAYOUT ── */
.manual-ticket-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.4rem;
  align-items: start;
}

@media(max-width:640px) {
  .manual-ticket-wrap {
    grid-template-columns: 1fr;
  }
}

.ticket-grid-side {}

.ticket-preview-side {
  background: var(--surface2);
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  padding: 1rem;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.selected-preview .empty-hint {
  font-size: 0.75rem;
}

.grid-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.grid-action-btn {
  flex: 1;
  min-width: 80px;
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.3px;
  text-align: center;
}

.grid-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.grid-action-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

body.dark .grid-action-btn.primary {
  color: var(--bg);
}

.grid-action-btn.danger {
  border-color: rgba(220, 50, 50, 0.3);
  color: #dc3232;
}

.grid-action-btn.danger:hover {
  background: rgba(220, 50, 50, 0.08);
  border-color: rgba(220, 50, 50, 0.5);
}

/* ── SURPRISE ME ── */
.surprise-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.surprise-card {
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  border-radius: 9px;
  padding: 0.8rem;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}

.surprise-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.surprise-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.surprise-icon {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.surprise-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

.surprise-desc {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.3;
}

/* ── SAVED GAMES PANEL ── */
.saved-games-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 320px;
  overflow-y: auto;
}

.saved-game-row {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.saved-game-balls {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  flex: 1;
}

.saved-game-meta {
  font-size: 0.65rem;
  color: var(--muted2);
  width: 100%;
  margin-top: 0.2rem;
}

.saved-game-del {
  border: none;
  background: none;
  color: var(--muted2);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.saved-game-del:hover {
  color: #dc3232;
  background: rgba(220, 50, 50, 0.08);
}

/* ── TOOL HISTORY TOGGLE BUTTON ── */
.tool-hist-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  margin-left: auto;
}

.tool-hist-toggle-btn:hover {
  border-color: var(--game-color, var(--accent));
  color: var(--game-color, var(--accent));
}

.tool-hist-toggle-btn.active {
  border-color: var(--game-color, var(--accent));
  color: var(--game-color, var(--accent));
  background: color-mix(in srgb, var(--game-color, var(--accent)) 10%, var(--surface2));
}

.tool-hist-badge {
  background: var(--game-color, var(--accent));
  color: #fff;
  border-radius: 10px;
  padding: 0 5px;
  font-size: 0.6rem;
  margin-left: 0.2rem;
}

/* ── TOOL HISTORY PANEL (inline, on generator page) ── */
#toolHistPanel {
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  animation: fadeIn 0.18s ease;
}

.tool-hist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 0.6rem;
}

.tool-hist-item {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 0.65rem 0.75rem;
}

.tool-hist-meta {
  font-size: 0.6rem;
  color: var(--game-color, var(--accent));
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: 0.3px;
}

.tool-hist-algo {
  font-size: 0.58rem;
  color: var(--muted);
  font-weight: 500;
}

.tool-hist-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 0.45rem;
}

.tool-hist-share-btn {
  width: 100%;
  padding: 0.3rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.tool-hist-share-btn:hover {
  border-color: var(--game-color, var(--accent));
  color: var(--game-color, var(--accent));
}

.tool-hist-empty {
  font-size: 0.78rem;
  color: var(--muted2);
  text-align: center;
  padding: 1rem 0;
}

/* ── SIDE HISTORY PANEL ── */
.side-hist-item {
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.45rem;
}

.side-hist-game {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.side-hist-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 0.45rem;
}

.side-hist-ball {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--game-color, var(--accent));
  background: color-mix(in srgb, var(--game-color, var(--accent)) 12%, transparent);
  color: var(--game-color, var(--accent));
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.side-hist-copy {
  width: 100%;
  padding: 0.3rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.side-hist-copy:hover {
  border-color: var(--game-color, var(--accent));
  color: var(--game-color, var(--accent));
}

.side-hist-empty {
  font-size: 0.72rem;
  color: var(--muted2);
  text-align: center;
  padding: 0.8rem 0;
}

/* ── AVOID / FIX FILTER PANEL ── */
.filter-panel {
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-top: 0.9rem;
}

.filter-panel-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-section {
  margin-bottom: 0.7rem;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-balls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 28px;
  align-items: center;
}

.filter-ball {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.13s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.filter-ball.avoid-active {
  background: rgba(220, 50, 50, 0.15);
  border-color: rgba(220, 50, 50, 0.5);
  color: #dc3232;
}

.filter-ball.fix-active {
  background: rgba(30, 138, 58, 0.15);
  border-color: rgba(30, 138, 58, 0.5);
  color: var(--live-color, #1e8a3a);
}

.filter-clear-btn {
  font-size: 0.62rem;
  color: var(--muted2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  transition: all 0.15s;
  margin-left: auto;
}

.filter-clear-btn:hover {
  color: #dc3232;
}

/* ── BET QUEUE ── */
.bet-queue-wrap {
  margin-top: 0.75rem;
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 0.8rem 1rem;
}

.bet-queue-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.bet-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.bet-queue-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.5rem;
  background: var(--surface);
  border-radius: 7px;
  border: 1px solid var(--border);
}

.bet-queue-num {
  font-size: 0.6rem;
  color: var(--muted2);
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}

.bet-queue-del {
  background: none;
  border: none;
  color: var(--muted2);
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.bet-queue-del:hover {
  color: #dc3232;
}

.bet-send-btn {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1.5px solid var(--game-color, var(--accent));
  background: var(--game-color, var(--accent));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.3px;
}

body.dark .bet-send-btn {
  color: var(--bg);
}

.bet-send-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.empty {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

.skeleton-card {
  height: 140px;
  border-radius: 12px;
}

.skeleton-hero {
  height: 220px;
  border-radius: 16px;
  margin-bottom: 2rem;
}

.skeleton-freq {
  height: 11px;
  margin-bottom: 0.6rem;
}

.error-banner {
  background: rgba(220, 50, 50, 0.07);
  border: 1px solid rgba(220, 50, 50, 0.2);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  color: #dc3232;
  font-size: 0.83rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.retry-btn {
  margin-left: auto;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(220, 50, 50, 0.3);
  background: transparent;
  color: #dc3232;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}

.retry-btn:hover {
  background: rgba(220, 50, 50, 0.1);
}

@media(max-width:600px) {
  main {
    padding: 1rem;
  }

  header {
    padding: 0 1rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .picker-wrap {
    grid-template-columns: 1fr;
  }
}

/* ── COUNTRY SWITCHER ── */
.country-switcher {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  transition: var(--transition-theme);
}

.country-btn {
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.6rem;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  white-space: nowrap;
}

.country-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.country-btn.current {
  background: var(--accent);
  color: #fff;
  pointer-events: none;
}

body.dark .country-btn.current {
  color: var(--bg);
}

.mobile-country-row {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem;
  flex-wrap: wrap;
}

.mobile-country-btn {
  flex: 1;
  min-width: 80px;
  padding: 0.5rem 0.3rem;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.mobile-country-btn.current {
  background: var(--accent);
  color: #fff;
  pointer-events: none;
}

body.dark .mobile-country-btn.current {
  color: var(--bg);
}


/* ══ SIDE MENU ══ */
.side-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease
}

.side-menu-overlay.open {
  opacity: 1
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 301;
  width: min(300px, 85vw);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden
}

body.light .side-menu {
  background: #f4f1eb;
  border-right: 1px solid var(--border-strong);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12)
}

body.dark .side-menu {
  background: #0a0f18;
  border-right: 1px solid var(--border-strong);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.5)
}

.side-menu.open {
  transform: translateX(0)
}

.side-menu-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  height: 58px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-strong)
}

body.light .side-menu-header {
  background: rgba(244, 241, 235, 0.95)
}

body.dark .side-menu-header {
  background: rgba(8, 12, 16, 0.92)
}

.side-menu-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent)
}

body.light .side-menu-logo {
  font-family: 'Lora', serif
}

body.dark .side-menu-logo {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.3rem;
  letter-spacing: 2px
}

.side-menu-logo span {
  color: var(--gold)
}

.side-menu-close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s
}

.side-menu-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0
}

.side-menu-body::-webkit-scrollbar {
  width: 3px
}

.side-menu-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px
}

.side-section {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border)
}

.side-section:last-child {
  border-bottom: none
}

.side-label {
  font-size: 0.58rem;
  letter-spacing: 2px;
  color: var(--muted2);
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.4rem 0.2rem 0.5rem;
  display: block
}

.side-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.7rem 0.6rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px
}

.side-nav-btn:hover {
  background: var(--accent-light);
  color: var(--accent)
}

body.light .side-nav-btn.active {
  background: var(--accent);
  color: #fff
}

body.dark .side-nav-btn.active {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent)
}

.side-theme-row,
.side-lang-row,
.side-country-row,
.side-follow-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.3rem 0;
  flex-wrap: wrap
}

.side-theme-btn {
  flex: 1;
  min-height: 40px;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem
}

.side-theme-btn.active {
  background: var(--accent);
  color: #fff
}

body.dark .side-theme-btn.active {
  color: var(--bg)
}

.side-lang-btn {
  flex: 1;
  min-height: 40px;
  padding: 0.4rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center
}

.side-lang-btn.active {
  background: var(--accent);
  color: #fff
}

body.dark .side-lang-btn.active {
  color: var(--bg)
}

.side-country-btn {
  flex: 1;
  min-width: 72px;
  min-height: 40px;
  padding: 0.45rem 0.3rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem
}

.side-country-btn.current {
  background: var(--accent);
  color: #fff;
  pointer-events: none
}

body.dark .side-country-btn.current {
  color: var(--bg)
}

.side-social-btn {
  flex: 1;
  min-width: 56px;
  min-height: 52px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  text-decoration: none;
  padding: 0.3rem
}

.side-social-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent)
}

.side-social-label {
  font-size: 0.55rem;
  font-weight: 700;
  color: inherit;
  text-transform: uppercase
}

/* TikTok - active */
.side-social-tiktok {
  border-color: #69C9D0;
  background: #010101;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(105, 201, 208, 0.4);
}

.side-social-tiktok:hover {
  border-color: #EE1D52;
  background: #010101;
  color: #EE1D52;
  box-shadow: 0 0 12px rgba(238, 29, 82, 0.5);
}

/* YouTube - active */
.side-social-youtube {
  border-color: #FF0000;
  background: #FF0000;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.4);
}

.side-social-youtube:hover {
  border-color: #cc0000;
  background: #cc0000;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(204, 0, 0, 0.6);
}

/* ══ HEADER ══ */
header {
  padding: 0 1rem !important;
  gap: 0.75rem !important;
  justify-content: flex-start !important;
  overflow: hidden
}

.hamburger {
  display: flex !important;
  min-width: 44px !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 10px !important
}

.logo-wrap {
  flex: 1;
  min-width: 0
}

.logo {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.live-badge {
  font-size: 0.58rem !important;
  padding: 0.18rem 0.5rem !important;
  margin-left: auto;
  flex-shrink: 0
}

.live-dot {
  width: 5px !important;
  height: 5px !important
}

nav {
  flex-shrink: 0
}

@media(max-width:900px) {
  nav {
    display: none !important
  }
}

.header-right {
  display: none !important
}

/* ══ NEXT DRAW ══ */
.next-draw-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--game-color, var(--accent));
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.2rem;
  transition: var(--transition-theme)
}

.next-draw-label {
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap
}

.next-draw-countdown {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--game-color, var(--accent))
}

.next-draw-date {
  font-size: 0.72rem;
  color: var(--muted2);
  white-space: nowrap
}

.next-draw-urgency {
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 700;
  margin-left: auto
}

.next-draw-gen-btn {
  margin-left: auto;
  padding: 0.3rem 0.85rem;
  border-radius: 7px;
  border: 1.5px solid var(--game-color, var(--accent));
  background: var(--game-color, var(--accent));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0
}

body.dark .next-draw-gen-btn {
  color: var(--bg)
}

.next-draw-gen-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px)
}

/* ══ ACUMULOU INLINE ══ */
.accum-spin {
  display: inline-block;
  animation: spinSlow 4s linear infinite;
  margin-right: 0.3rem
}

@keyframes spinSlow {
  0% {
    transform: rotate(0)
  }

  100% {
    transform: rotate(360deg)
  }
}

.accum-pulse {
  animation: acumulouPulse 2s ease-in-out infinite
}

@keyframes acumulouPulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.65
  }
}

/* ══ HELP MODAL ══ */
.help-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem
}

.help-modal-overlay.open {
  display: flex
}

.help-modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 1.6rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  position: relative
}

body.dark .help-modal {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6)
}

.help-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s
}

.help-modal-close:hover {
  color: var(--text);
  background: var(--border)
}

.help-modal-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.3rem;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 0.8rem;
  padding-right: 2rem
}

.help-modal-body {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-line
}

.help-modal-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  transition: opacity 0.15s
}

.help-modal-link:hover {
  opacity: 0.75
}

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid var(--muted2);
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: middle;
  margin-left: 0.4rem;
  flex-shrink: 0;
  line-height: 1
}

.help-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light)
}

/* ══ ODD/EVEN TABLE ══ */
.odd-even-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.65rem
}

.odd-even-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
  width: 60px;
  flex-shrink: 0
}

.odd-even-bar-wrap {
  flex: 1;
  background: rgba(128, 128, 128, 0.1);
  border-radius: 4px;
  height: 13px;
  overflow: hidden;
  display: flex
}

.odd-even-bar-even {
  height: 100%;
  background: var(--accent);
  transition: width 0.9s ease;
  border-radius: 4px 0 0 4px
}

.odd-even-bar-odd {
  height: 100%;
  background: var(--gold);
  transition: width 0.9s ease;
  border-radius: 0 4px 4px 0
}

.odd-even-pcts {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted);
  display: flex;
  gap: 0.6rem;
  min-width: 120px;
  flex-shrink: 0
}

.odd-even-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle
}

/* ══ PRIZE TIERS ══ */
.prize-tiers-wrap {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card)
}

.prize-tiers-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 340px
}

.prize-tiers-table th {
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1.5px solid var(--border-strong);
  background: var(--surface2);
  white-space: nowrap
}

.prize-tiers-table td {
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap
}

.prize-tiers-table tr:last-child td {
  border-bottom: none
}

.prize-tiers-table tr:hover td {
  background: var(--surface2)
}

.tier-name {
  font-weight: 600;
  color: var(--text)
}

.tier-winners {
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted)
}

.tier-prize {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--accent)
}

/* ══ SEE MORE ══ */
.see-more-wrap {
  text-align: center;
  padding: 1rem 0 0.5rem
}

.see-more-btn {
  padding: 0.6rem 2rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.5px
}

.see-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light)
}

.see-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed
}

/* ══ TIER PILLS ══ */
.tier-pills-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border)
}

.tier-pill {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--pill-color, var(--muted2));
  background: color-mix(in srgb, var(--pill-color, var(--muted2)) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill-color, var(--muted2)) 25%, transparent);
  border-radius: 20px;
  padding: 2px 7px;
  white-space: nowrap
}

.tier-pill b {
  font-weight: 800
}

.card-expand-hint {
  font-size: 0.55rem;
  color: var(--muted2);
  text-align: right;
  margin-top: 6px;
  cursor: pointer
}

.card-tier-table {
  margin-top: 4px
}

.result-card {
  cursor: pointer
}

/* ══ LAZY STATS ══ */
.stat-card-lazy {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.3s
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  flex-wrap: wrap;
  gap: 8px
}

.stat-lazy-body {
  padding: 0 14px 12px
}

.stat-lazy-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid color-mix(in srgb, var(--btn-color) 40%, transparent);
  background: color-mix(in srgb, var(--btn-color) 10%, transparent);
  color: var(--btn-color);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap
}

.stat-lazy-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--btn-color) 20%, transparent)
}

.stat-lazy-btn:disabled {
  opacity: 0.7;
  cursor: default
}

/* ══ MOBILE ══ */
html {
  overflow-x: clip
}

body {
  overflow-x: clip
}

#apiStatusBar {
  padding: 0.4rem 1rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis
}

.game-tabs {
  padding: 0.75rem 1rem
}

.game-context-bar {
  top: 62px;
  padding: 0.5rem 1rem
}

main {
  padding: 1.2rem 1rem;
  max-width: 100vw
}

.hero-result {
  padding: 1.2rem 1rem
}

.balls-row {
  gap: 0.5rem;
  margin-bottom: 1.2rem
}

.ball {
  width: clamp(36px, 10vw, 52px);
  height: clamp(36px, 10vw, 52px);
  font-size: clamp(0.75rem, 2.5vw, 1rem)
}

.ball-sm {
  width: clamp(26px, 7.5vw, 33px);
  height: clamp(26px, 7.5vw, 33px);
  font-size: clamp(0.6rem, 1.8vw, 0.72rem)
}

.prizes-row {
  gap: 0.6rem
}

.prize-card {
  min-width: 0;
  flex: 1 1 120px;
  padding: 0.7rem 0.9rem
}

.bt-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch
}

.bt-table {
  min-width: 520px
}

.bt-table th,
.bt-table td {
  white-space: nowrap;
  padding: 0.6rem 0.8rem
}

@media(max-width:600px) {
  .results-grid {
    grid-template-columns: 1fr
  }

  .result-card {
    padding: 0.9rem
  }

  .game-name-big {
    font-size: 1.6rem
  }

  .stat-panel,
  .picker-panel {
    padding: 1rem
  }

  .backtest-controls {
    flex-direction: column
  }

  .ctrl-group select,
  .ctrl-group input {
    min-width: 0;
    width: 100%
  }

  .run-btn {
    width: 100%
  }

  main {
    padding: 0.9rem
  }
}
