@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

:root {
  --bg: #0d0d0d; --surface: #1a1a1a; --surface2: #222; --border: #2a2a2a;
  --gold: #f5c842; --text: #e8e8e8; --muted: #888;
  --pb-accent: #ef4444; --pb-ball: #f97316;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; min-height: 100vh; }
header { background: #111; border-bottom: 1px solid var(--border); padding: 16px 24px; display: flex; align-items: center; gap: 12px; }
.pb-logo { font-size: 1.3rem; font-weight: 700; color: var(--gold); text-decoration: none; }

.pb-back {
  font-family: 'DM Sans', sans-serif;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  margin-left: auto;
  transition: color 0.2s;
}
.pb-back:hover { color: var(--gold); }

.ad-banner { background: #111; border: 1px dashed #2e2e2e; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #3a3a3a; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; font-family: 'DM Sans', sans-serif; }
.ad-leaderboard { width: 728px; max-width: 100%; height: 90px; margin: 20px auto; }
.ad-rect { width: 300px; height: 250px; }
.ad-section { display: flex; justify-content: center; padding: 8px 24px; }
.hero { background: linear-gradient(135deg, #200000 0%, #0d0d0d 70%); padding: 40px 24px 28px; text-align: center; border-bottom: 1px solid var(--border); }
.hero h1 { font-size: 2rem; font-weight: 700; color: var(--pb-accent); margin-bottom: 6px; }
.hero p { color: var(--muted); font-size: 0.9rem; }
.tabs { display: flex; gap: 2px; background: #111; border-bottom: 1px solid var(--border); padding: 0 24px; overflow-x: auto; }
.tab-btn { padding: 14px 20px; background: none; border: none; color: var(--muted); font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: color 0.2s, border-color 0.2s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--pb-accent); border-bottom-color: var(--pb-accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.main-layout { max-width: 1100px; margin: 32px auto; padding: 0 24px; display: grid; grid-template-columns: 1fr 300px; gap: 32px; }
@media (max-width: 800px) { .main-layout { grid-template-columns: 1fr; } .ad-leaderboard { display: none; } }
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.ticket-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; margin-bottom: 20px; }
.ticket-card h2 { font-size: 1.1rem; color: var(--gold); margin-bottom: 20px; }
.section-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; }
.ball-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; margin-bottom: 16px; }
.ball { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface2); color: var(--text); font-size: 0.78rem; font-weight: 700; font-family: 'DM Sans', sans-serif; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.ball:hover { border-color: var(--pb-accent); color: var(--pb-accent); }
.ball.selected { background: var(--pb-accent); border-color: var(--pb-accent); color: #fff; }
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; margin-bottom: 16px; }
.pball { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #3a1800; background: #1a0a00; color: var(--pb-ball); font-size: 0.78rem; font-weight: 700; font-family: 'DM Sans', sans-serif; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.pball:hover { border-color: var(--pb-ball); }
.pball.selected { background: var(--pb-ball); border-color: var(--pb-ball); color: #000; }
.selected-display { display: flex; gap: 8px; flex-wrap: wrap; min-height: 48px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 14px; align-items: center; }
.sel-ball { width: 36px; height: 36px; border-radius: 50%; background: var(--pb-accent); color: #fff; font-weight: 700; font-size: 0.78rem; display: flex; align-items: center; justify-content: center; font-family: 'DM Sans', sans-serif; }
.sel-pball { width: 36px; height: 36px; border-radius: 50%; background: var(--pb-ball); color: #000; font-weight: 700; font-size: 0.78rem; display: flex; align-items: center; justify-content: center; font-family: 'DM Sans', sans-serif; }
.btn { padding: 12px 24px; border-radius: 8px; border: none; font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s; }
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--pb-accent); color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-gold { background: var(--gold); color: #000; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.result-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-top: 20px; display: none; }
.result-card.show { display: block; }
.result-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 12px; }
.result-balls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.drawn-ball { width: 38px; height: 38px; border-radius: 50%; background: var(--pb-accent); color: #fff; font-weight: 700; font-size: 0.78rem; display: flex; align-items: center; justify-content: center; font-family: 'DM Sans', sans-serif; }
.drawn-ball.match { background: var(--gold); color: #000; box-shadow: 0 0 10px rgba(245,200,66,0.5); }
.drawn-pball { width: 38px; height: 38px; border-radius: 50%; background: var(--pb-ball); color: #000; font-weight: 700; font-size: 0.78rem; display: flex; align-items: center; justify-content: center; font-family: 'DM Sans', sans-serif; margin-left: 8px; }
.drawn-pball.match { box-shadow: 0 0 10px rgba(249,115,22,0.7); border: 2px solid #fff; }
.prize-msg { font-size: 1.1rem; font-weight: 700; color: var(--gold); }
.freq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 7px; }
.freq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 5px; text-align: center; }
.freq-num { font-size: 0.9rem; font-weight: 700; color: var(--pb-accent); }
.freq-count { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.freq-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.freq-fill { height: 100%; background: var(--pb-accent); border-radius: 2px; }
.history-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.history-table th { padding: 10px 12px; text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); }
.history-table td { padding: 10px 12px; border-bottom: 1px solid #1e1e1e; }
.history-table tr:hover td { background: var(--surface2); }
.h-ball { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--pb-accent); color: #fff; font-weight: 700; font-size: 0.7rem; margin: 1px; font-family: 'DM Sans', sans-serif; }
.h-pball { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--pb-ball); color: #000; font-weight: 700; font-size: 0.7rem; margin: 1px; font-family: 'DM Sans', sans-serif; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.stat-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.info-box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.info-box h3 { color: var(--gold); font-size: 0.95rem; margin-bottom: 12px; }
.info-box p, .info-box li { font-size: 0.85rem; color: var(--muted); line-height: 1.7; }
.info-box ul { padding-left: 18px; }
footer { text-align: center; padding: 40px 24px; color: var(--muted); font-size: 0.78rem; border-top: 1px solid var(--border); margin-top: 40px; }
