:root {
  --bg:      #0a0e1a;
  --surface: #101828;
  --card:    #16223a;
  --border:  #1e3260;
  --text:    #e8f0ff;
  --muted:   #6b85b0;
  --primary: #0369a1;
  --accent:  #FFB81C;
  --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, #0369a1 22%, 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,20,60,0.5) 0%, transparent 100%); }
.mn-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,20,60,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; }
.d4-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; }
.d4-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: 10px; justify-content: center; flex-wrap: wrap; padding: 1.5rem 1rem; background: var(--surface); border-radius: 12px; border: 1px solid var(--border); margin-bottom: 1rem; min-height: 90px; align-items: center; }
.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.05em; background: linear-gradient(135deg, #0369a1, #0284c7); color: #fff; box-shadow: 0 4px 15px rgba(3,105,161,0.4); transition: all 0.2s; }
.ball.empty { background: var(--card); color: var(--muted); box-shadow: none; border: 1px dashed var(--border); }
.ball.special { background: linear-gradient(135deg, #d97706, #b45309); box-shadow: 0 4px 15px rgba(217,119,6,0.4); }
.ball.special.empty { background: var(--card); box-shadow: none; border: 1px dashed rgba(217,119,6,0.4); }
.btn-row { display: flex; gap: 10px; margin-bottom: 1.5rem; }
.btn { padding: 0.7rem 1.2rem; border-radius: 8px; font-family: 'DM Mono', monospace; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: all 0.2s; border: none; flex: 1; font-weight: 500; }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #d4a010); color: #0a0e1a; font-weight: 700; 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); }
.picker-section { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); padding: 1.2rem; margin-bottom: 1.5rem; }
.picker-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.picker-title { font-family: 'DM Mono', monospace; font-size: 0.78rem; letter-spacing: 0.15em; color: var(--gold); text-transform: uppercase; }
.picker-hint { font-size: 0.75rem; color: var(--muted); }
.number-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.num-btn { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-family: 'DM Mono', monospace; font-size: 0.85rem; cursor: pointer; transition: all 0.15s; }
.num-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.num-btn.selected { background: #0369a1; border-color: #0369a1; color: #fff; box-shadow: 0 2px 8px rgba(3,105,161,0.4); }
.num-btn.special-btn.selected { background: #d97706; border-color: #d97706; box-shadow: 0 2px 8px rgba(217,119,6,0.4); }
.num-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.result-panel { background: var(--surface); border-radius: 12px; border: 1px solid rgba(245,197,24,0.3); padding: 1.5rem; text-align: center; display: none; margin-bottom: 1.5rem; }
.result-panel.show { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.result-title { font-family: 'Bebas Neue', cursive; font-size: 1.8rem; letter-spacing: 0.1em; margin-bottom: 0.3rem; }
.result-prize { font-family: 'Bebas Neue', cursive; font-size: 1.2rem; color: var(--gold); letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.result-msg { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }
.draw-balls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0.5rem 0; }
.draw-ball { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Bebas Neue', cursive; font-size: 1.1rem; background: var(--card); color: var(--text); border: 1px solid var(--border); }
.draw-ball.match { background: linear-gradient(135deg, var(--gold), #d4a010); color: #0a0e1a; border-color: var(--gold); box-shadow: 0 2px 10px rgba(245,197,24,0.4); }
.draw-ball.special-draw { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; border-color: #d97706; }
.draw-ball.special-draw.match { box-shadow: 0 2px 10px rgba(217,119,6,0.5); }
.match-indicator { font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; margin: 0.3rem 0; }
.saved-ticket-list { display: flex; flex-direction: column; gap: 10px; }
.saved-ticket { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.saved-ticket-nums { display: flex; gap: 6px; flex-wrap: wrap; }
.saved-num { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'DM Mono', monospace; font-size: 0.78rem; font-weight: 700; background: #0369a1; color: #fff; }
.saved-num.special { background: #d97706; }
.del-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 4px 8px; border-radius: 6px; transition: color 0.15s; }
.del-btn:hover { color: #f87171; }
.prize-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.prize-table th { font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.prize-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(30,50,96,0.5); color: var(--text); }
.prize-amount { color: var(--gold) !important; font-weight: 700; }
.f-eyebrow { font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.3em; color: #0369a1; text-transform: uppercase; margin-bottom: 0.3rem; text-align: center; }
.f-heading { font-family: 'Bebas Neue', cursive; font-size: 2rem; letter-spacing: 0.1em; text-align: center; color: var(--text); margin-bottom: 1.5rem; }
.f-strategy-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1.5rem; }
.f-strategy-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.2rem; text-align: center; cursor: pointer; transition: all 0.2s; }
.f-strategy-card:hover, .f-active-freq { border-color: var(--gold); background: rgba(245,197,24,0.06); }
.f-strategy-icon { font-size: 1.8rem; display: block; margin-bottom: 0.5rem; }
.f-strategy-label { font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.2em; color: var(--gold); text-transform: uppercase; }
.f-strategy-sub { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }
.f-status-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 1.5rem; }
.f-status-cell { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem; text-align: center; }
.f-status-label { font-family: 'DM Mono', monospace; font-size: 0.62rem; letter-spacing: 0.15em; color: var(--muted); text-transform: uppercase; display: block; }
.f-status-val { font-family: 'Bebas Neue', cursive; font-size: 1.3rem; color: var(--gold); display: block; }
.f-ticket-card { background: var(--surface); border: 1px solid rgba(245,197,24,0.25); border-radius: 16px; overflow: hidden; margin-bottom: 1.5rem; }
.f-ticket-top { height: 4px; background: linear-gradient(90deg, #0369a1, var(--gold)); }
.f-ticket-header { padding: 1rem 1.2rem 0.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.f-ticket-title { font-family: 'Bebas Neue', cursive; font-size: 1.3rem; letter-spacing: 0.1em; }
.f-pill-row { display: flex; gap: 6px; }
.f-pill { font-family: 'DM Mono', monospace; font-size: 0.65rem; letter-spacing: 0.1em; padding: 3px 8px; border-radius: 100px; font-weight: 500; }
.f-pill-hot { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }
.f-pill-cold { background: rgba(56,189,248,0.12); color: #38bdf8; border: 1px solid rgba(56,189,248,0.3); }
.f-subtitle { font-size: 0.75rem; color: var(--muted); padding: 0 1.2rem 0.8rem; }
.f-mix-row { display: flex; gap: 6px; padding: 0 1.2rem 1rem; flex-wrap: wrap; }
.f-mix-btn { flex: 1; min-width: 70px; padding: 0.4rem 0.6rem; background: var(--card); border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; cursor: pointer; transition: all 0.2s; }
.f-mix-btn:hover, .f-mix-active { border-color: var(--gold); color: var(--gold); background: rgba(245,197,24,0.08); }
.f-balls-area { padding: 1rem 1.2rem; }
.f-balls-wrap { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 56px; align-items: center; }
.f-ball { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Bebas Neue', cursive; font-size: 1.2rem; cursor: pointer; transition: transform 0.15s; }
.f-ball:hover { transform: scale(1.1); }
.f-ball-hot { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; box-shadow: 0 3px 12px rgba(249,115,22,0.4); }
.f-ball-cold { background: linear-gradient(135deg, #0891b2, #0369a1); color: #fff; box-shadow: 0 3px 12px rgba(8,145,178,0.4); }
.f-legend { font-size: 0.7rem; color: var(--muted); text-align: center; padding: 0 1.2rem 1rem; }
.f-action-row { display: flex; gap: 10px; padding: 0 1.2rem 1.2rem; }
.f-btn-regen { flex: 1; padding: 0.7rem; background: var(--card); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'DM Mono', monospace; font-size: 0.78rem; letter-spacing: 0.1em; cursor: pointer; transition: all 0.2s; text-transform: uppercase; }
.f-btn-regen:hover { border-color: var(--gold); color: var(--gold); }
.f-btn-save { flex: 1; padding: 0.7rem; background: linear-gradient(135deg, var(--gold), #d4a010); border: none; border-radius: 8px; color: #0a0e1a; font-family: 'DM Mono', monospace; font-size: 0.78rem; letter-spacing: 0.1em; cursor: pointer; font-weight: 700; text-transform: uppercase; }
.f-saved-section { margin-top: 0.5rem; }
.f-saved-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.f-section-label { font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; }
.f-clear-btn { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-size: 0.72rem; font-family: 'DM Mono', monospace; padding: 3px 10px; cursor: pointer; }
.f-clear-btn:hover { border-color: #f87171; color: #f87171; }
.f-ticket-list { display: flex; flex-direction: column; gap: 8px; }
.f-saved-ticket { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0.8rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.f-saved-nums { display: flex; gap: 5px; flex-wrap: wrap; }
.disclaimer { position: relative; z-index: 5; text-align: center; padding: 2rem 1rem; font-size: 0.75rem; color: var(--muted); line-height: 1.8; border-top: 1px solid var(--border); margin-top: 2rem; }
