:root {
  --bg:      #0d1420;
  --surface: #12203a;
  --card:    #172a4a;
  --border:  #1e3660;
  --text:    #e8f0ff;
  --muted:   #6b85b0;
  --primary: #1a7a1a;
  --accent:  #4ade80;
  --gold:    #f5c518;
  --green:   #22c55e;
}
*, *::before, *::after { 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;
  line-height: 1.5;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, color-mix(in srgb, #1a7a1a 25%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(0,0,0,0.2) 0%, transparent 50%);
  pointer-events: none; z-index: 0;
}
.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.star { position: absolute; background: white; border-radius: 50%; animation: twinkle var(--dur, 3s) ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.1; } 50% { opacity: 0.8; } }
header {
  position: relative; z-index: 10;
  text-align: center; padding: 2.5rem 1rem 1.5rem;
  border-bottom: 2px solid rgba(245,197,24,0.2);
  background: linear-gradient(180deg, rgba(0,40,0,0.5) 0%, transparent 100%);
}
.ca-badge {
  display: inline-block;
  font-family: 'DM Mono', monospace; font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.25em; color: var(--gold);
  background: rgba(245,197,24,0.1); border: 1px solid rgba(245,197,24,0.2);
  padding: 0.3rem 1rem; border-radius: 2px; margin-bottom: 1rem;
  text-transform: uppercase;
}
h1 {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(3rem, 10vw, 5.5rem);
  letter-spacing: 0.05em; line-height: 0.9;
  background: linear-gradient(135deg, #fff 0%, var(--gold) 40%, #fff 70%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  filter: drop-shadow(0 0 25px rgba(245,197,24,0.3)); margin-bottom: 0.5rem;
}
.subtitle { font-family: 'DM Mono', monospace; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.15em; text-transform: uppercase; }
.jackpot-banner {
  position: relative; z-index: 5; text-align: center; padding: 2rem 1rem;
  background: linear-gradient(135deg, rgba(0,40,0,0.3), rgba(0,0,0,0.2));
  border-bottom: 1px solid rgba(245,197,24,0.2);
}
.jackpot-label { font-family: 'DM Mono', monospace; font-size: 0.75rem; letter-spacing: 0.3em; color: var(--muted); text-transform: uppercase; margin-bottom: 0.5rem; }
.jackpot-amount { font-family: 'Bebas Neue', cursive; font-size: clamp(2.5rem, 8vw, 4.5rem); color: var(--gold); text-shadow: 0 0 40px rgba(245,197,24,0.5); letter-spacing: 0.02em; }
.jackpot-sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; }
main { position: relative; z-index: 5; max-width: 700px; margin: 0 auto; padding: 2rem 1rem 4rem; }
/* ── Back to California ───────────────────────────────────────── */
.f5-back {
  display: block;
  text-align: center;
  padding: 8px;
  background: rgba(0,0,0,0.3);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color 0.15s;
}
.f5-back:hover { color: var(--gold); text-decoration: none; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; gap: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 0.7rem 1.1rem; font-family: 'DM Mono', monospace; font-size: 0.78rem;
  font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.2s;
  background: none; border-top: none; border-left: none; border-right: none;
  white-space: nowrap; flex-shrink: 0;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab:hover:not(.active) { color: var(--text); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.section-label {
  font-family: 'DM Mono', monospace; font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.3em; color: var(--gold); text-transform: uppercase;
  margin-bottom: 1rem; display: flex; align-items: center; gap: 1rem;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: rgba(245,197,24,0.2); }
.selected-display {
  display: flex; gap: 0.6rem; align-items: center; margin-bottom: 1.5rem;
  flex-wrap: wrap; min-height: 56px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem 1rem;
}
.ball {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', cursive; font-size: 1.3rem; letter-spacing: 0.02em;
  flex-shrink: 0; position: relative; transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.ball.main-ball { background: radial-gradient(circle at 35% 35%, #1a7a1a, #0a3a0a); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.ball.bonus-ball { background: radial-gradient(circle at 35% 35%, #ffd700, #c8a000); color: #111; box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 20px rgba(245,197,24,0.4); }
.ball.empty { background: rgba(255,255,255,0.05); border: 2px dashed rgba(255,255,255,0.15); color: rgba(255,255,255,0.2); font-size: 0.8rem; }
.ball.matched { box-shadow: 0 0 20px rgba(245,197,24,0.7) !important; outline: 2px solid var(--gold); }
.separator { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.1em; padding: 0 0.2rem; align-self: center; }
.picker-section { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; }
.picker-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.2rem; }
.picker-title { font-family: 'Bebas Neue', cursive; font-size: 1.2rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text); }
.picker-hint { font-size: 0.78rem; color: var(--muted); font-family: 'DM Mono', monospace; }
.number-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 0.5rem; }
.num-btn {
  aspect-ratio: 1; border: 1.5px solid rgba(255,255,255,0.1); border-radius: 50%;
  background: rgba(255,255,255,0.04); color: var(--text);
  font-family: 'DM Mono', monospace; font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
  display: flex; align-items: center; justify-content: center;
}
.num-btn:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); transform: scale(1.06); }
.num-btn.selected { background: var(--primary); border-color: var(--accent); color: white; box-shadow: 0 0 15px color-mix(in srgb, #1a7a1a 50%, transparent); transform: scale(1.06); }
.num-btn.bonus-selected { background: var(--gold); border-color: #b8860b; color: #111; box-shadow: 0 0 15px rgba(245,197,24,0.6); transform: scale(1.06); }
.num-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-row { display: flex; gap: 0.8rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.btn { flex: 1; min-width: 120px; padding: 0.9rem 1.5rem; border: none; border-radius: 6px; font-family: 'Bebas Neue', cursive; font-size: 1.05rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: all 0.2s ease; }
.btn-secondary { background: transparent; color: var(--muted); border: 1px solid rgba(255,255,255,0.15); }
.btn-secondary:hover { background: rgba(255,255,255,0.05); color: var(--text); border-color: rgba(255,255,255,0.3); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #c9a010); color: #111; box-shadow: 0 4px 15px rgba(245,197,24,0.3); }
.btn-gold:hover { box-shadow: 0 6px 25px rgba(245,197,24,0.5); transform: translateY(-1px); }
.result-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; display: none; text-align: center; }
.result-panel.visible { display: block; }
.result-title { font-family: 'Bebas Neue', cursive; font-size: 2rem; letter-spacing: 0.05em; margin-bottom: 0.3rem; }
.result-win { color: var(--gold); text-shadow: 0 0 30px rgba(245,197,24,0.5); }
.result-lose { color: var(--muted); }
.result-prize { font-family: 'Bebas Neue', cursive; font-size: 1.3rem; color: var(--gold); margin: 0.5rem 0; }
.result-msg { font-size: 0.9rem; color: var(--muted); margin-bottom: 1.2rem; }
.draw-balls { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.match-indicator { font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; margin-top: 0.5rem; }
@keyframes ballDrop { from { transform: translateY(-30px) scale(0.8); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.draw-balls .ball { animation: ballDrop 0.4s cubic-bezier(0.34,1.56,0.64,1) both; }
.draw-balls .ball:nth-child(1) { animation-delay: 0.05s; }
.draw-balls .ball:nth-child(2) { animation-delay: 0.15s; }
.draw-balls .ball:nth-child(3) { animation-delay: 0.25s; }
.draw-balls .ball:nth-child(4) { animation-delay: 0.35s; }
.draw-balls .ball:nth-child(5) { animation-delay: 0.45s; }
.draw-balls .ball:nth-child(6) { animation-delay: 0.60s; }
.saved-ticket-list { display: flex; flex-direction: column; gap: 0.8rem; }
.saved-ticket { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 1rem 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.saved-balls { display: flex; gap: 0.4rem; align-items: center; }
.mini-ball { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Bebas Neue', cursive; font-size: 1rem; flex-shrink: 0; }
.mini-ball.main-ball { background: radial-gradient(circle at 35% 35%, #1a7a1a, #0a3a0a); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.mini-ball.bonus-ball { background: radial-gradient(circle at 35% 35%, #ffd700, #c8a000); color: #111; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.saved-date { font-size: 0.72rem; color: var(--muted); font-family: 'DM Mono', monospace; }
.del-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0.2rem 0.4rem; border-radius: 4px; transition: all 0.15s; line-height: 1; }
.del-btn:hover { color: #c8102e; background: rgba(200,16,46,0.1); }
.prize-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.prize-table th { font-family: 'DM Mono', monospace; font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--border); }
.prize-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text); font-size: 0.83rem; }
.prize-table tr:last-child td { border-bottom: none; }
.prize-table tr:hover td { background: rgba(255,255,255,0.03); }
.prize-amount { color: var(--gold); font-weight: 600; font-family: 'DM Mono', monospace; }
.confetti-piece { position: fixed; width: 8px; height: 8px; pointer-events: none; z-index: 1000; animation: confettiFall var(--dur, 3s) ease-in var(--delay, 0s) forwards; }
@keyframes confettiFall { 0% { transform: translateY(-20px) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }
.empty-state { text-align: center; padding: 2rem; color: var(--muted); font-size: 0.88rem; font-family: 'DM Sans', sans-serif; }
.empty-state-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.disclaimer { text-align: center; font-size: 0.7rem; color: var(--muted); padding: 1.5rem 1rem; border-top: 1px solid var(--border); line-height: 1.7; position: relative; z-index: 5; font-family: 'DM Sans', sans-serif; }
/* Frequency tab */
.f-strategy-row { display: flex; gap: 12px; margin-bottom: 20px; }
.f-strategy-card { flex: 1; padding: 14px 16px; border-radius: 10px; border: 2px solid #1e3660; background: #132240; cursor: pointer; text-align: center; transition: all 0.2s ease; }
.f-strategy-card:hover { border-color: #2e4f80; }
.f-strategy-card.f-active-freq { border-color: #f97316; box-shadow: 0 0 18px rgba(249,115,22,0.3); }
.f-strategy-card.f-active-rand { border-color: #3b82f6; box-shadow: 0 0 18px rgba(59,130,246,0.3); }
.f-strategy-icon { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.f-strategy-label { font-family: 'Bebas Neue', cursive; font-size: 1rem; letter-spacing: 0.06em; color: #e8f0ff; }
.f-strategy-sub { font-size: 0.72rem; color: #6b85b0; margin-top: 2px; }
.f-status-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.f-status-cell { flex: 1; background: #0d1b2e; border: 1px solid #1e3660; border-radius: 8px; padding: 10px 12px; text-align: center; }
.f-status-label { font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase; color: #6b85b0; font-family: 'DM Mono', monospace; display: block; margin-bottom: 4px; }
.f-status-val { font-family: 'Bebas Neue', cursive; font-size: 1.15rem; letter-spacing: 0.04em; color: #e8f0ff; }
.f-ok { color: #22c55e !important; }
.f-warn { color: #f97316 !important; }
.f-ticket-card { background: #132240; border: 1px solid #1e3660; border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.f-ticket-top { height: 4px; background: linear-gradient(90deg, #f97316, #3b82f6); }
.f-ticket-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 10px; }
.f-ticket-title { font-family: 'Bebas Neue', cursive; font-size: 1.6rem; letter-spacing: 0.06em; color: #e8f0ff; }
.f-pill-row { display: flex; gap: 8px; align-items: center; }
.f-pill { padding: 4px 10px; border-radius: 20px; font-size: 0.72rem; font-family: 'DM Mono', monospace; font-weight: 500; }
.f-pill-hot { background: rgba(249,115,22,0.18); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }
.f-pill-cold { background: rgba(59,130,246,0.18); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.f-mix-row { display: flex; gap: 6px; padding: 0 20px 14px; flex-wrap: wrap; }
.f-mix-btn { padding: 6px 12px; border-radius: 6px; border: 1px solid #1e3660; background: #0d1b2e; color: #6b85b0; font-family: 'DM Mono', monospace; font-size: 0.75rem; cursor: pointer; transition: all 0.15s; }
.f-mix-btn:hover { border-color: #2e4f80; color: #a0b8d8; }
.f-mix-btn.f-mix-active { border-color: #f97316; color: #fb923c; background: rgba(249,115,22,0.12); }
.f-balls-area { padding: 20px; background: #0d1b2e; border-top: 1px solid #1e3660; border-bottom: 1px solid #1e3660; }
.f-balls-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; min-height: 80px; align-items: center; }
.f-ball { width: 68px; height: 68px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Bebas Neue', cursive; font-size: 22px; letter-spacing: 0.02em; color: #fff; position: relative; flex-shrink: 0; animation: fBallDrop 0.45s cubic-bezier(0.34,1.56,0.64,1) both; }
.f-ball::after { content: ''; position: absolute; top: 14%; left: 22%; width: 38%; height: 22%; background: rgba(255,255,255,0.45); border-radius: 50%; transform: rotate(-20deg); pointer-events: none; }
.f-ball.hot { background: radial-gradient(circle at 35% 30%, #ffcf80, #f97316 52%, #c2500a); box-shadow: 0 6px 22px rgba(249,115,22,0.6); }
.f-ball.cold { background: radial-gradient(circle at 35% 30%, #bfdbfe, #3b82f6 52%, #1d4ed8); box-shadow: 0 6px 22px rgba(59,130,246,0.6); }
.f-ball.bonus-hot { background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 52%, #b45309); box-shadow: 0 6px 22px rgba(245,158,11,0.6); outline: 3px solid #fff; outline-offset: 2px; }
.f-ball.bonus-cold { background: radial-gradient(circle at 35% 30%, #d9f99d, #65a30d 52%, #3f6212); box-shadow: 0 6px 22px rgba(101,163,13,0.6); outline: 3px solid #fff; outline-offset: 2px; }
@keyframes fBallDrop { from { transform: scale(0.3) translateY(-20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.f-separator { font-family: 'DM Mono', monospace; font-size: 0.65rem; color: #6b85b0; letter-spacing: 0.1em; align-self: center; }
.f-legend { text-align: center; font-size: 0.73rem; color: #6b85b0; padding: 10px 20px; font-family: 'DM Sans', sans-serif; }
.f-action-row { display: flex; gap: 10px; padding: 16px 20px; }
.f-btn-regen { flex: 1; padding: 12px; background: #0d1b2e; border: 1px solid #1e3660; border-radius: 8px; color: #a0b8d8; font-family: 'Bebas Neue', cursive; font-size: 1.1rem; letter-spacing: 0.08em; cursor: pointer; transition: all 0.2s; }
.f-btn-regen:hover { background: #132240; color: #e8f0ff; border-color: #2e4f80; }
.f-btn-save { flex: 1.4; padding: 12px; background: linear-gradient(135deg, #f5c518, #d4a010); border: none; border-radius: 8px; color: #0d1b2e; font-family: 'Bebas Neue', cursive; font-size: 1.1rem; letter-spacing: 0.08em; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 15px rgba(245,197,24,0.35); }
.f-btn-save:hover { box-shadow: 0 6px 25px rgba(245,197,24,0.55); transform: translateY(-1px); }
.f-subtitle { font-size: 0.75rem; color: #6b85b0; padding: 0 20px 4px; font-family: 'DM Sans', sans-serif; }
.f-saved-section { margin-top: 24px; }
.f-saved-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.f-section-label { font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: #f97316; }
.f-clear-btn { font-size: 0.75rem; color: #6b85b0; background: none; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: color 0.15s; }
.f-clear-btn:hover { color: #c8102e; }
.f-ticket-list { display: flex; flex-direction: column; gap: 10px; }
.f-saved-ticket { background: #132240; border: 1px solid #1e3660; border-radius: 8px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.f-mini-balls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.f-mini-ball { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Bebas Neue', cursive; font-size: 1rem; color: #fff; flex-shrink: 0; }
.f-mini-ball.hot { background: radial-gradient(circle at 35% 30%, #ffcf80, #f97316 52%, #c2500a); }
.f-mini-ball.cold { background: radial-gradient(circle at 35% 30%, #bfdbfe, #3b82f6 52%, #1d4ed8); }
.f-mini-sep { font-size: 0.6rem; color: #6b85b0; font-family: 'DM Mono', monospace; }
.f-ticket-meta { font-size: 0.72rem; color: #6b85b0; margin-top: 4px; font-family: 'DM Sans', sans-serif; }
.f-del-btn { background: none; border: none; color: #6b85b0; cursor: pointer; font-size: 1rem; padding: 4px 6px; border-radius: 4px; transition: all 0.15s; line-height: 1; }
.f-del-btn:hover { color: #c8102e; background: rgba(200,16,46,0.1); }
.f-empty { text-align: center; padding: 2rem; color: #6b85b0; font-size: 0.88rem; font-family: 'DM Sans', sans-serif; }
.f-eyebrow { font-family: 'DM Mono', monospace; font-size: 0.65rem; letter-spacing: 0.25em; text-transform: uppercase; color: #6b85b0; margin-bottom: 4px; }
.f-heading { font-family: 'Bebas Neue', cursive; font-size: 1.8rem; letter-spacing: 0.05em; color: #e8f0ff; margin-bottom: 20px; }
@media (max-width: 500px) {
  .f-ball { width: 56px; height: 56px; font-size: 18px; }
  .f-strategy-label { font-size: 0.85rem; }
  .f-mix-btn { font-size: 0.68rem; padding: 5px 9px; }
  .number-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 0.35rem; }
  .num-btn { font-size: 0.8rem; }
  .ball { width: 42px; height: 42px; font-size: 1.15rem; }
  .tab { padding: 0.6rem 0.8rem; font-size: 0.72rem; }
}
