/*
  Shared Predictor CSS
  ====================
  Common styles for all iLotto predictor pages.
  Lottery-specific overrides (--red, --red-glow, header gradient,
  bonus-ball colors, num-grid columns, gen-btn gradient) remain
  in each page's inline <style>.

  Requires: ../theme.css loaded first.
*/

/* ── Reset ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: 'Rubik', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ── Root aliases (non-brand) ── */
:root {
  --bg: var(--bg-primary);
  --surface: var(--bg-surface);
  --surface2: var(--bg-surface-2);
  --surface3: var(--bg-surface-3);
  --border: var(--border-primary);
  --gold: #ffd700;
  --gold-dim: rgba(255, 215, 0, 0.15);
  --green: #2ecc71;
  --blue: #3498db;
  --cyan: #00cec9;
  --orange: #f39c12;
  --purple: #a855f7;
  --pink: #ec4899;
  --text: var(--text-primary);
  --text-dim: var(--text-tertiary);
  --text-mid: var(--text-secondary);
  --radius: 16px;
  --radius-sm: 10px;
}

/* ── Header (layout only — gradient, border-color, box-shadow are per-lottery) ── */
.header {
  padding: 1.2rem 1.2rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.header-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-sub {
  font-size: 0.72rem;
  color: var(--text-mid);
  margin-top: 0.15rem;
}

/* ── Language Selector ── */
.lang-sel {
  position: relative;
  display: inline-flex;
}
.lang-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.lang-btn:active {
  border-color: var(--red);
}
.lang-btn .arrow {
  font-size: 0.5rem;
  color: var(--text-dim);
}
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.3rem;
  z-index: 200;
  min-width: 130px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-height: 320px;
  overflow-y: auto;
}
.lang-menu.open {
  display: block;
}
.lang-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text-mid);
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  transition: background 0.1s;
}
.lang-flag {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  object-fit: cover;
  vertical-align: middle;
}
.lang-opt:hover,
.lang-opt:active {
  background: var(--surface2);
  color: var(--text);
}
.lang-opt.active {
  color: var(--gold);
  font-weight: 700;
}

/* ── Hamburger Menu Button ── */
.menu-btn {
  background: none;
  border: none;
  color: var(--text-mid, #9ba0c8);
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.menu-btn:hover, .menu-btn:active { color: var(--text, #eef0ff); background: rgba(255,255,255,0.08); }

/* ── Side Panel (LHS slide-out) ── */
.side-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 600;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.side-backdrop.open { display: block; }

.side-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--surface, #111228);
  border-right: 1px solid var(--border, rgba(255,255,255,0.1));
  z-index: 700;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 4px 0 30px rgba(0,0,0,0.4);
}
.side-panel.open { transform: translateX(0); }

.side-section {
  padding: 1rem 1.2rem;
}
.side-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim, #6b70a0);
  margin-bottom: 0.6rem;
}
.side-divider {
  height: 1px;
  background: var(--border, rgba(255,255,255,0.08));
  margin: 0 1rem;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.7rem 0;
  background: none;
  border: none;
  color: var(--text, #eef0ff);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.side-item:hover { background: var(--surface2, #1a1d3a); }
.side-item svg { color: var(--text-mid, #9ba0c8); flex-shrink: 0; }

.side-brand {
  margin-top: auto;
  padding: 1.2rem;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
  text-align: center;
}

/* ── Language dropdown inside side panel ── */
.lang-dropdown-wrap { position: relative; }
.lang-current {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface2, #1a1d3a);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 8px;
  cursor: pointer;
  color: var(--text, #eef0ff);
  font-size: 0.88rem;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.2s;
}
.lang-current:hover { border-color: var(--text-dim); }
.lang-current .lang-flag { width: 22px; height: 15px; border-radius: 2px; object-fit: cover; }
.lang-current .lang-arrow { margin-left: auto; font-size: 0.5rem; color: var(--text-dim); transition: transform 0.2s; }
.lang-dropdown-wrap.open .lang-arrow { transform: rotate(180deg); }

.lang-list {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface, #111228);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.lang-dropdown-wrap.open .lang-list { display: block; }

.lang-opt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text, #eef0ff);
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}
.lang-opt:hover { background: var(--surface2, #1a1d3a); }
.lang-opt.active { background: var(--surface3, #252845); font-weight: 600; color: var(--gold, #ffd700); }
.lang-opt .lang-flag { width: 22px; height: 15px; border-radius: 2px; object-fit: cover; }

/* ── Install Banner ── */
.install-banner {
  display: none;
  background: linear-gradient(135deg, #1a1400, #332900);
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: var(--radius-sm);
  margin: 0.8rem;
  padding: 0.8rem 1rem;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(255,215,0,0.1);
}
:root.light .install-banner {
  background: linear-gradient(135deg, #fff8e1, #fff3c4);
  border-color: rgba(184,134,11,0.4);
  box-shadow: 0 2px 12px rgba(184,134,11,0.1);
}
.install-banner.show {
  display: flex;
}
.install-banner span {
  flex: 1;
  font-size: 0.85rem;
  color: #ffd700;
  font-weight: 600;
}
:root.light .install-banner span {
  color: #8b6914;
}
.install-btn {
  background: linear-gradient(135deg, #b8860b, #ffd700);
  color: #1a1a00;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.2rem;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255,215,0,0.3);
  transition: all 0.2s;
}
.install-btn:hover {
  box-shadow: 0 4px 15px rgba(255,215,0,0.4);
  transform: translateY(-1px);
}
.install-btn span {
  color: #000;
}

/* ── Tabs (glossy 3D style) ── */
.tabs {
  display: flex;
  gap: 4px;
  padding: 0.5rem 0.6rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--surface, #0d0e1f);
  border-bottom: 1px solid var(--border);
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  flex-shrink: 0;
  padding: 0.5rem 0.9rem;
  border: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
}
.tab:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  color: var(--text-mid);
}
.tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  background: linear-gradient(180deg, rgba(230,57,70,0.12), rgba(230,57,70,0.04));
  border-color: rgba(230,57,70,0.15);
  border-bottom-color: var(--red);
  box-shadow: 0 -2px 8px rgba(230,57,70,0.1);
}

/* ── Tab Content ── */
.tab-content {
  display: none;
  padding: 0.8rem;
}
.tab-content.active {
  display: block;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.8rem;
}
.card-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-mid);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  font-weight: 700;
}
.card-title .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(230,57,70,0.15), rgba(230,57,70,0.05));
  border-radius: 6px;
  padding: 3px;
}
.card-title .icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--red, #e63946);
  filter: drop-shadow(0 1px 2px rgba(230,57,70,0.2));
}

/* ── Lottery Balls (base layout — colors are per-lottery) ── */
.balls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0.8rem 0;
}
.ball {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  position: relative;
  background: linear-gradient(145deg, var(--red, #e63946), color-mix(in srgb, var(--red, #e63946) 75%, #000));
  color: #fff;
  box-shadow: 0 4px 15px rgba(230,57,70,0.3), inset 0 -3px 6px rgba(0,0,0,0.2), inset 0 3px 6px rgba(255,255,255,0.15);
}
.ball::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 10px;
  width: 12px;
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  transform: rotate(-30deg);
}
.ball.small {
  width: 38px;
  height: 38px;
  font-size: 0.9rem;
}

/* ── Lucky/Bonus Ball (gold) ── */
.ball.lucky {
  background: linear-gradient(145deg, var(--gold, #ffd700), #e6a800);
  color: #1a1a2e;
  box-shadow: 0 4px 15px rgba(255,215,0,0.3), inset 0 -3px 6px rgba(0,0,0,0.15), inset 0 3px 6px rgba(255,255,255,0.3);
}

/* ── Strategy Card ── */
.strategy {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.8rem;
  transition: border-color 0.2s;
}
.strategy.recommended {
  border-color: var(--gold);
  box-shadow: 0 0 20px var(--gold-dim);
}
.strategy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.strategy-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.strategy-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-weight: 700;
}
.badge-hot {
  background: var(--red-glow);
  color: var(--red);
}
.badge-freq {
  background: rgba(52, 152, 219, 0.15);
  color: var(--blue);
}
.badge-overdue {
  background: rgba(243, 156, 18, 0.15);
  color: var(--orange);
}
.badge-mix {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
}
.badge-optimal {
  background: var(--gold-dim);
  color: var(--gold);
}
.badge-pairs {
  background: rgba(0, 206, 201, 0.15);
  color: var(--cyan);
}
.strategy-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.stat-box {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  text-align: center;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
}
.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* ── Number Grid (columns are per-lottery) ── */
.num-grid {
  display: grid;
  gap: 4px;
}
.num-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface2);
  color: var(--text-mid);
  transition: all 0.15s;
}
.num-cell.hot {
  background: var(--red-glow);
  color: var(--red);
  border: 1px solid rgba(var(--brand-primary-rgb, 230, 57, 70), 0.3);
}
.num-cell.warm {
  background: rgba(243, 156, 18, 0.15);
  color: var(--orange);
}
.num-cell.cold {
  background: rgba(52, 152, 219, 0.15);
  color: var(--blue);
}
.num-cell.overdue {
  background: rgba(168, 85, 247, 0.2);
  color: var(--purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ── Recent Draw Row ── */
.draw-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.draw-row:last-child {
  border-bottom: none;
}
.draw-date {
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 72px;
  font-weight: 500;
}
.draw-nums {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}
.draw-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--surface3);
  color: var(--text);
}

/* ── Chart Container ── */
.chart-img {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  background: var(--surface2);
}

/* ── Pair Table ── */
.pair-list {
  list-style: none;
}
.pair-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.pair-list li:last-child {
  border-bottom: none;
}
.pair-tag {
  background: var(--surface3);
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  min-width: 70px;
  text-align: center;
}
.pair-bar {
  flex: 1;
  height: 6px;
  background: var(--surface3);
  border-radius: 3px;
  overflow: hidden;
}
.pair-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red), var(--orange));
}

/* ── Strategy Info ── */
.strat-info {
  background: var(--surface2);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  animation: fadeIn 0.25s ease-out;
}
.strat-info-title {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.strat-info-body {
  font-size: 0.78rem;
  color: var(--text-mid);
  line-height: 1.6;
}
.strat-example {
  display: block;
  margin-top: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: var(--surface3);
  border-radius: 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ── Generator ── */
.gen-area {
  text-align: center;
  padding: 1.5rem 0.5rem;
}
.gen-result {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.gen-result .ball {
  width: 52px;
  height: 52px;
  font-size: 1.2rem;
  opacity: 0;
  transform: scale(0) rotate(-180deg);
}
.gen-result .ball.pop {
  animation: ballPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.gen-placeholder {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 1rem;
}
.gen-btn {
  background: linear-gradient(135deg, var(--red, #e63946), color-mix(in srgb, var(--red, #e63946) 70%, #000));
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 25px rgba(230, 57, 70, 0.35);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.gen-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(230, 57, 70, 0.45);
}
.gen-btn:active {
  transform: scale(0.96);
  box-shadow: 0 3px 15px rgba(230, 57, 70, 0.3);
}
.gen-btn.spinning {
  pointer-events: none;
}
.gen-btn.spinning::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 0.6s ease;
}
.gen-meta {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.gen-meta-item {
  font-size: 0.7rem;
  color: var(--text-dim);
  background: var(--surface2);
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
}
.gen-meta-item span {
  color: var(--text);
  font-weight: 700;
}

/* ── Strategy Picker ── */
.strat-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1.2rem;
}
.strat-chip {
  padding: 0.5rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-mid);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.strat-chip:hover {
  background: var(--surface3);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.strat-chip.active {
  border-color: var(--red);
  background: linear-gradient(135deg, var(--red-glow), rgba(230,57,70,0.15));
  color: var(--red);
  box-shadow: 0 2px 10px rgba(230,57,70,0.2);
  font-weight: 700;
}

/* ── Strategy Card (Choose Your Strategy) ── */
.strategy-card {
  border: 1px solid rgba(230,57,70,0.2);
  border-left: 4px solid var(--red, #e63946);
  background: linear-gradient(135deg, rgba(230,57,70,0.04), rgba(230,57,70,0.01));
  box-shadow: 0 4px 20px rgba(230,57,70,0.06);
}
.strategy-title {
  color: var(--red, #e63946);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.strategy-icon svg {
  stroke: var(--red, #e63946);
  filter: drop-shadow(0 2px 4px rgba(230,57,70,0.3));
}

/* ── History Card (Your Generated Numbers) ── */
#historyCard {
  border: 1px solid rgba(255,215,0,0.3);
  border-left: 4px solid var(--gold, #ffd700);
  background: linear-gradient(135deg, rgba(255,215,0,0.04), rgba(255,215,0,0.01));
  box-shadow: 0 4px 20px rgba(255,215,0,0.08);
}
#historyCard .card-title {
  color: var(--gold, #ffd700);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
#historyCard .card-title .icon svg {
  stroke: var(--gold, #ffd700);
}

/* ── History ── */
.gen-history {
  margin-top: 0.5rem;
}
.hist-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  animation: fadeIn 0.25s ease-out;
}
.hist-row:last-child {
  border-bottom: none;
}
.hist-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hist-idx {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}
.hist-strat {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  white-space: nowrap;
}
.hist-strat-data {
  background: var(--gold-dim);
  color: var(--gold);
}
.hist-strat-cluster {
  background: rgba(0, 206, 201, 0.15);
  color: var(--cyan);
}
.hist-strat-hot {
  background: var(--red-glow);
  color: #ff6b6b;
}
.hist-strat-frequent {
  background: rgba(52, 152, 219, 0.15);
  color: var(--blue);
}
.hist-strat-overdue {
  background: rgba(243, 156, 18, 0.15);
  color: var(--orange);
}
.hist-strat-balanced {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
}
.hist-strat-random {
  background: rgba(100, 100, 120, 0.15);
  color: var(--text-mid);
}
.hist-sum {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cyan, #00cec9);
  margin-left: auto;
  background: rgba(0,206,201,0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(0,206,201,0.15);
  letter-spacing: 0.02em;
}
.hist-del {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(230,57,70,0.15);
  background: rgba(230,57,70,0.06);
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1;
  margin-left: 0.2rem;
}
.hist-del:hover,
.hist-del:active {
  background: rgba(230,57,70,0.2);
  border-color: rgba(230,57,70,0.4);
  color: var(--red);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(230,57,70,0.2);
}
.hist-bottom {
  display: flex;
  align-items: center;
  gap: 3px;
  padding-left: 30px;
  flex-wrap: wrap;
}
.hist-ball {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  background: linear-gradient(145deg, var(--red, #e63946), color-mix(in srgb, var(--red, #e63946) 75%, #000));
  color: #fff;
  box-shadow: 0 2px 6px rgba(230,57,70,0.2), inset 0 -2px 3px rgba(0,0,0,0.15), inset 0 2px 3px rgba(255,255,255,0.1);
}
.hist-ball.lucky-h {
  background: linear-gradient(145deg, var(--gold, #ffd700), #e6a800);
  color: #1a1a2e;
  box-shadow: 0 2px 6px rgba(255,215,0,0.2), inset 0 -2px 3px rgba(0,0,0,0.1), inset 0 2px 3px rgba(255,255,255,0.2);
}
.hist-sep {
  width: 2px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
}

/* ── Disclaimer ── */
.disclaimer {
  background: rgba(255, 215, 0, .03);
  border: 1px solid rgba(255, 215, 0, .12);
  border-left: 3px solid var(--gold, #ffd700);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
}
.disclaimer p {
  font-size: 0.78rem;
  color: #9ba0c8;
  line-height: 1.6;
}
.disclaimer strong {
  color: var(--gold, #ffd700);
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-dim);
  font-size: 0.7rem;
}

/* ── Copy / Share / Play Action Bar ── */
.action-bar {
  display: none;
  gap: 8px;
  margin-top: 0.5rem;
  padding: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}
.action-bar.show {
  display: flex;
}
.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface3, #252845), var(--surface2, #1a1c35));
  color: var(--text-mid, #9ba0c8);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.06);
  text-decoration: none;
}
.act-btn:hover {
  background: linear-gradient(180deg, var(--surface3, #303460), var(--surface3, #252845));
  color: var(--text, #eef0ff);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}
.act-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.act-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.act-btn.play {
  background: linear-gradient(135deg, #b8860b, #ffd700, #daa520);
  color: #1a1a2e;
  border: none;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(255,215,0,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
}
.act-btn.play:hover {
  background: linear-gradient(135deg, #daa520, #ffe44d, #ffd700);
  box-shadow: 0 4px 20px rgba(255,215,0,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
  transform: translateY(-1px);
}
.act-btn.copied {
  border-color: var(--green, #2ecc71);
  color: var(--green, #2ecc71);
}
.copy-all-bar {
  display: none;
  gap: 6px;
  margin-top: .5rem;
  justify-content: center;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
}
.copy-all-bar.show {
  display: flex;
}
.hist-copy {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,215,0,0.15);
  background: rgba(255,215,0,0.06);
  color: var(--text-dim);
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
  font-family: inherit;
  position: relative;
  margin-left: auto;
}
.hist-copy:hover {
  color: var(--gold, #ffd700);
  background: rgba(255,215,0,0.15);
  border-color: rgba(255,215,0,0.3);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(255,215,0,0.15);
}
.hist-copy::after {
  content: "";
  position: absolute;
  inset: -10px;
}
.hist-copy.copied {
  color: var(--green, #2ecc71);
  background: rgba(46,204,113,0.1);
  border-color: rgba(46,204,113,0.3);
}

/* ── Keyframes ── */
@keyframes ballPop {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.15) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ── Fade-in Animations ── */
.tab-content.active .card,
.tab-content.active .strategy,
.tab-content.active .disclaimer {
  animation: fadeIn 0.3s ease-out both;
}
.tab-content.active .card:nth-child(2) {
  animation-delay: 0.05s;
}
.tab-content.active .card:nth-child(3) {
  animation-delay: 0.1s;
}
.tab-content.active .strategy:nth-child(2) {
  animation-delay: 0.05s;
}
.tab-content.active .strategy:nth-child(3) {
  animation-delay: 0.1s;
}
.tab-content.active .strategy:nth-child(4) {
  animation-delay: 0.15s;
}

/* ── Desktop / Landscape ── */
@media (min-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .balls .ball {
    width: 56px;
    height: 56px;
    font-size: 1.3rem;
  }
  .gen-result .ball {
    width: 58px;
    height: 58px;
    font-size: 1.3rem;
  }
  body {
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* ── Touch Target & Responsive Audit Fixes ── */
html {
  -webkit-text-size-adjust: 100%;
}
button, a {
  touch-action: manipulation;
}
.tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.strat-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}
.lang-opt {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.hist-del {
  position: relative;
}
.hist-del::after {
  content: "";
  position: absolute;
  inset: -10px;
}
.gen-btn {
  min-height: 48px;
}
.tabs {
  -webkit-overflow-scrolling: touch;
}

/* ── Small Screens ── */
@media (max-width: 374px) {
  .ball,
  .gen-result .ball {
    width: 40px;
    height: 40px;
    font-size: .95rem;
  }
  .num-cell {
    font-size: .6rem;
  }
  .num-grid {
    gap: 2px;
  }
}

/* ── Focus States (Accessibility) ── */
.strat-chip:focus-visible,
.gen-btn:focus-visible,
.tab:focus-visible,
.menu-btn:focus-visible,
.install-btn:focus-visible,
.act-btn:focus-visible,
.side-item:focus-visible,
.lang-current:focus-visible,
.lang-opt:focus-visible {
  outline: 2px solid var(--gold, #ffd700);
  outline-offset: 2px;
}

/* ── Light Mode Overrides (Contrast Fixes) ── */
:root.light .side-brand a { color: #8b6914; }
:root.light .side-section-label { color: #666; }
:root.light .side-item { color: #333; }
:root.light .side-item svg { color: #666; }
:root.light .card-title { color: #555; }
:root.light .card-title .icon { background: rgba(230,57,70,0.08); }
:root.light .card-title .icon svg { stroke: var(--red, #c0392b); }
:root.light #historyCard .card-title { color: #8b6914; }
:root.light #historyCard .card-title .icon svg { stroke: #8b6914; }
:root.light .strategy-title { color: #c0392b; }
:root.light .strategy-icon svg { stroke: #c0392b; }
:root.light .hist-sum { color: #0a8a85; border-color: rgba(0,150,145,0.2); background: rgba(0,150,145,0.06); }
:root.light .stat-value { text-shadow: none; }
:root.light .footer { color: #666; }
:root.light .footer a { color: #8b6914; }

/* ============================================================
   RESULTS FEATURE (expandable draw rows, hero, banner, accordion)
   ============================================================ */

/* ── 3D result ball (32px, historical draws) ── */
.result-ball {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  position: relative;
  background: linear-gradient(145deg, var(--red, var(--brand-primary, #e63946)), color-mix(in srgb, var(--red, var(--brand-primary, #e63946)) 75%, #000));
  color: #fff;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.15),
    inset 0 2px 4px rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.result-ball::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 8px;
  width: 10px;
  height: 6px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  transform: rotate(-30deg);
}
/* Hero-sized (42px, latest draw) */
.result-ball.hero {
  width: 42px;
  height: 42px;
  font-size: 1rem;
  font-weight: 800;
  box-shadow:
    0 3px 12px rgba(0,0,0,0.3),
    inset 0 -3px 5px rgba(0,0,0,0.2),
    inset 0 3px 5px rgba(255,255,255,0.15);
}
.result-ball.hero::after {
  top: 6px;
  left: 9px;
  width: 11px;
  height: 7px;
}

/* Bonus-ball variants — default fallbacks.
   Per-lottery index.html may override these with brand-specific gradients. */
.result-ball.star,
.result-ball.lucky {
  background: linear-gradient(145deg, #F8B400, #D37C09);
  color: #fff;
  box-shadow:
    0 2px 8px rgba(248,180,0,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.15),
    inset 0 2px 4px rgba(255,255,255,0.15);
}
.result-ball.hero.star,
.result-ball.hero.lucky {
  box-shadow:
    0 3px 12px rgba(248,180,0,0.35),
    inset 0 -3px 5px rgba(0,0,0,0.2),
    inset 0 3px 5px rgba(255,255,255,0.15);
}
.result-ball.powerball {
  background: linear-gradient(145deg, #d90429, #6d0015);
  color: #fff;
  box-shadow:
    0 2px 8px rgba(217,4,41,0.35),
    inset 0 -2px 4px rgba(0,0,0,0.2),
    inset 0 2px 4px rgba(255,255,255,0.15);
}
.result-ball.hero.powerball {
  box-shadow:
    0 3px 12px rgba(217,4,41,0.4),
    inset 0 -3px 5px rgba(0,0,0,0.2),
    inset 0 3px 5px rgba(255,255,255,0.15);
}
.result-ball.sz {
  background: linear-gradient(145deg, #1abc9c, #0e6b58);
  color: #fff;
  box-shadow:
    0 2px 8px rgba(26,188,156,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.15),
    inset 0 2px 4px rgba(255,255,255,0.15);
}
.result-ball.hero.sz {
  box-shadow:
    0 3px 12px rgba(26,188,156,0.35),
    inset 0 -3px 5px rgba(0,0,0,0.2),
    inset 0 3px 5px rgba(255,255,255,0.15);
}

/* ── Hero draw card ── */
.hero-draw-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}
.hero-draw-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--red, var(--brand-primary)),
    var(--red, var(--brand-primary)) 40%,
    transparent 100%);
}
.hero-draw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.hero-draw-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.hero-draw-id {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hero-draw-balls {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0.8rem 0;
}
.hero-draw-balls .result-ball.hero {
  opacity: 0;
  transform: scale(0) rotate(-180deg);
}
.hero-draw-balls .result-ball.hero.pop {
  animation: ballPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.hero-draw-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
  margin-bottom: 0.6rem;
  padding: 0 0.2rem;
}
.hero-draw-date {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.rollover-badge {
  font-size: 0.62rem;
  background: linear-gradient(135deg, var(--color-warning, #f39c12), #e6a800);
  color: #1a1a2e;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Prize tables (hero + accordion) ── */
.hero-prize-table {
  width: 100%;
  font-size: 0.82rem;
  border-collapse: collapse;
  margin-top: 0.4rem;
}
.hero-prize-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.hero-prize-table tr:last-child td {
  border-bottom: none;
}
.hero-prize-table .prize-tier {
  font-weight: 600;
  color: var(--text-primary);
}
.hero-prize-table .prize-winners {
  color: var(--text-secondary);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.hero-prize-table .prize-amount {
  font-weight: 700;
  color: var(--red, var(--brand-primary));
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.hero-prize-table tr.jackpot-tier .prize-amount {
  font-size: 0.92rem;
  text-shadow: 0 0 10px var(--red-glow, var(--brand-glow));
}
.hero-share-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* ── Divider between hero and history ── */
.results-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.8rem 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.results-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ── Next-draw banner ── */
.next-draw-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-primary);
  border-left: 4px solid var(--red, var(--brand-primary));
  border-radius: var(--radius-md);
  animation: fadeIn 0.3s ease-out;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
.next-draw-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.next-draw-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.next-draw-jackpot {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--red, var(--brand-primary));
  text-shadow: 0 0 12px var(--red-glow, var(--brand-glow));
}
.next-draw-countdown {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ── Expandable draw rows (historical) ── */
.draw-row.expandable {
  cursor: pointer;
  transition: background var(--transition-fast);
  min-height: 44px;
}
.draw-row.expandable:hover {
  background: var(--bg-surface-2);
}
.draw-row .expand-icon {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  transition: transform var(--transition-normal);
  margin-left: auto;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.draw-row.expanded .expand-icon {
  transform: rotate(90deg);
}
.draw-id {
  font-size: 0.62rem;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}

/* ── Prize breakdown accordion ── */
.prize-breakdown {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
  padding: 0 0.5rem;
  border-top: none;
}
.draw-row.expanded + .prize-breakdown,
.prize-breakdown.open {
  max-height: 400px;
  opacity: 1;
  padding: 0.6rem 0.5rem;
  border-top: 1px solid var(--border-subtle);
}
.prize-table {
  width: 100%;
  font-size: 0.75rem;
  border-collapse: collapse;
}
.prize-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}
.prize-table tr:last-child td {
  border-bottom: none;
}
.prize-tier {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.prize-winners {
  color: var(--text-secondary);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.prize-amount {
  font-weight: 700;
  color: var(--red, var(--brand-primary));
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.prize-table tr.jackpot-tier .prize-amount {
  font-size: 0.82rem;
  text-shadow: 0 0 8px var(--red-glow, var(--brand-glow));
}

/* ── Share link + icon ── */
.draw-share-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--text-tertiary);
  text-decoration: none;
  margin-top: 0.3rem;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  min-height: 44px;
}
.draw-share-link:hover {
  opacity: 1;
  color: var(--red, var(--brand-primary));
}
.share-icon {
  vertical-align: -2px;
  margin-right: 0.25rem;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3));
}

/* ── Permalink highlight ── */
.draw-row.permalink-highlight {
  animation: permalinkFlash 1.5s ease;
}
@keyframes permalinkFlash {
  0%   { background: var(--red-glow, var(--brand-glow)); }
  100% { background: transparent; }
}

/* ── Disclaimer ── */
.results-disclaimer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  opacity: 0.85;
  text-align: center;
}
.results-disclaimer .info-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.2rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  z-index: var(--z-toast, 400);
  animation: fadeIn 0.2s ease, fadeOut 0.3s ease 1.5s forwards;
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

/* ── Light theme overrides ── */
:root.light .result-ball {
  box-shadow:
    0 2px 6px rgba(0,0,0,0.12),
    inset 0 -2px 3px rgba(0,0,0,0.08),
    inset 0 2px 3px rgba(255,255,255,0.35);
}
:root.light .hero-draw-card {
  border-color: var(--border-primary);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
:root.light .hero-draw-card::before {
  opacity: 0.8;
}
:root.light .next-draw-banner {
  background: var(--bg-surface-2);
  border-color: var(--border-primary);
}
:root.light .prize-amount,
:root.light .hero-prize-table .prize-amount {
  text-shadow: none;
}
:root.light .next-draw-jackpot {
  text-shadow: none;
}
:root.light .rollover-badge {
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── Responsive: small screens (<375px) ── */
@media (max-width: 374px) {
  .result-ball {
    width: 26px;
    height: 26px;
    font-size: 0.62rem;
  }
  .result-ball::after {
    top: 4px;
    left: 6px;
    width: 8px;
    height: 5px;
  }
  .result-ball.hero {
    width: 36px;
    height: 36px;
    font-size: 0.88rem;
  }
  .result-ball.hero::after {
    top: 5px;
    left: 8px;
    width: 9px;
    height: 6px;
  }
  .hero-draw-card {
    padding: 0.8rem;
  }
  .hero-draw-balls {
    gap: 5px;
    padding: 0.5rem 0;
  }
  .hero-draw-label {
    font-size: 0.65rem;
  }
  .hero-draw-date {
    font-size: 0.72rem;
  }
  .hero-draw-id {
    font-size: 0.58rem;
    padding: 1px 5px;
  }
  .hero-prize-table {
    font-size: 0.72rem;
  }
  .hero-prize-table td {
    padding: 0.3rem 0.3rem;
  }
  .hero-prize-table tr.jackpot-tier .prize-amount {
    font-size: 0.78rem;
  }
  .next-draw-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.6rem 0.8rem;
  }
  .next-draw-jackpot {
    font-size: 0.95rem;
  }
  .draw-row {
    gap: 0.4rem;
    padding: 0.5rem 0;
  }
  .draw-date {
    min-width: 58px;
    font-size: 0.68rem;
  }
  .draw-nums {
    gap: 3px;
  }
  .draw-id {
    font-size: 0.55rem;
    padding: 1px 4px;
  }
  .prize-table {
    font-size: 0.68rem;
  }
  .prize-table td {
    padding: 0.25rem 0.3rem;
  }
  .results-divider {
    font-size: 0.65rem;
  }
  .rollover-badge {
    font-size: 0.55rem;
    padding: 1px 6px;
  }
  .toast {
    font-size: 0.72rem;
    padding: 0.5rem 0.8rem;
  }
}

/* ── Responsive: tablet/desktop (≥600px) ── */
@media (min-width: 600px) {
  .result-ball {
    width: 38px;
    height: 38px;
    font-size: 0.82rem;
  }
  .result-ball::after {
    top: 6px;
    left: 9px;
    width: 12px;
    height: 7px;
  }
  .result-ball.hero {
    width: 52px;
    height: 52px;
    font-size: 1.2rem;
    font-weight: 800;
  }
  .result-ball.hero::after {
    top: 7px;
    left: 11px;
    width: 13px;
    height: 8px;
  }
  .hero-draw-card {
    padding: 1.5rem;
  }
  .hero-draw-balls {
    gap: 10px;
    padding: 1rem 0;
  }
  .hero-draw-label {
    font-size: 0.78rem;
  }
  .hero-draw-date {
    font-size: 0.9rem;
  }
  .hero-prize-table {
    font-size: 0.88rem;
  }
  .hero-prize-table td {
    padding: 0.5rem 0.6rem;
  }
  .hero-prize-table tr.jackpot-tier .prize-amount {
    font-size: 1rem;
  }
  .next-draw-jackpot {
    font-size: 1.3rem;
  }
  .draw-nums {
    gap: 5px;
  }
  .draw-date {
    min-width: 80px;
    font-size: 0.8rem;
  }
  .prize-table {
    font-size: 0.8rem;
  }
  .prize-table td {
    padding: 0.4rem 0.6rem;
  }
  #heroDrawCard,
  #nextDrawBanner,
  #tab-recent .results-disclaimer,
  #tab-recent > .card {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }
  .hero-prize-table .prize-tier,
  .prize-table .prize-tier {
    width: 35%;
  }
  .hero-prize-table .prize-winners,
  .prize-table .prize-winners {
    width: 35%;
  }
  .hero-prize-table .prize-amount,
  .prize-table .prize-amount {
    width: 30%;
  }
}

/* ── Responsive: landscape phone ── */
@media (max-height: 420px) and (orientation: landscape) {
  .hero-draw-card {
    padding: 0.6rem 1rem;
  }
  .hero-draw-balls {
    padding: 0.3rem 0;
    gap: 6px;
  }
  .hero-prize-table td {
    padding: 0.2rem 0.4rem;
  }
  .next-draw-banner {
    padding: 0.5rem 0.8rem;
  }
}

/* ── Print styles ── */
@media print {
  .next-draw-banner,
  .draw-share-link,
  .expand-icon,
  .toast {
    display: none !important;
  }
  .hero-draw-card {
    break-inside: avoid;
    border: 1px solid #ccc;
    box-shadow: none;
  }
  .hero-draw-card::before {
    display: none;
  }
  .result-ball {
    box-shadow: none;
    border: 1px solid #999;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .prize-breakdown {
    max-height: none !important;
    opacity: 1 !important;
  }
}
