@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;
  --green: #4ade80;
  --red: #f87171;
  --blue: #60a5fa;
  --text: #e8e8e8;
  --muted: #888;
  --nsj-accent: #22c55e;
}

* { 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;
}
.nsj-logo { font-size: 1.3rem; font-weight: 700; color: var(--gold); text-decoration: none; }

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

/* Ad slots */
.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, #001a08 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(--nsj-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(--nsj-accent); border-bottom-color: var(--nsj-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; }

/* Play tab */
.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; }

.ball-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.85rem;
  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(--nsj-accent); color: var(--nsj-accent); }
.ball.selected { background: var(--nsj-accent); border-color: var(--nsj-accent); color: #000; }

.selected-display {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 50px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  align-items: center;
}
.sel-ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--nsj-accent);
  color: #000;
  font-weight: 700;
  font-size: 0.88rem;
  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(--nsj-accent); color: #000; }
.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: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.drawn-ball {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--nsj-accent); color: #000;
  font-weight: 700; font-size: 0.88rem;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Sans', sans-serif;
}
.drawn-ball.match { background: var(--gold); box-shadow: 0 0 12px rgba(245,200,66,0.5); }
.prize-msg { font-size: 1.1rem; font-weight: 700; color: var(--gold); }

/* Frequency tab */
.freq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.freq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
}
.freq-num { font-size: 1rem; font-weight: 700; color: var(--nsj-accent); }
.freq-count { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.freq-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.freq-fill { height: 100%; background: var(--nsj-accent); border-radius: 2px; }

/* History tab */
.history-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.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: 30px; height: 30px; border-radius: 50%;
  background: var(--nsj-accent); color: #000;
  font-weight: 700; font-size: 0.78rem; margin: 1px;
  font-family: 'DM Sans', sans-serif;
}

/* Stats tab */
.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;
}
