/* =============================================
   Thursday Numbers — Global Styles
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0f1117;
  --bg2:      #1a1d27;
  --bg3:      #22263a;
  --border:   #2d3148;
  --text:     #e2e8f0;
  --text-dim: #8892a4;
  --accent:   #6366f1;
  --accent2:  #818cf8;
  --hot:      #f97316;
  --cold:     #38bdf8;
  --pb:       #a855f7;
  --green:    #22c55e;
  --radius:   12px;
  --shadow:   0 4px 24px rgba(0,0,0,0.4);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
header {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
  border-bottom: 1px solid rgba(167,139,250,0.2);
  padding: 28px 16px;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.header-eyebrow {
  font-size: 11px;
  letter-spacing: 4px;
  color: #a78bfa;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.header-logo {
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fbbf24, #f97316, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-tagline {
  color: #94a3b8;
  font-size: 14px;
  margin-top: 8px;
}

/* ── Nav ── */
nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 14px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent2); border-bottom-color: var(--accent2); }

/* ── Main ── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Panels ── */
.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.panel h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}
.panel-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.panels-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 680px) {
  .panels-row { grid-template-columns: 1fr; }
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 700px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent2);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Ball ── */
.ball-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.ball-main { background: linear-gradient(135deg, var(--hot), #e55d00); }
.ball-cold { background: linear-gradient(135deg, var(--cold), #0284c7); }
.ball-pb   { background: linear-gradient(135deg, var(--pb), #7e22ce); }
.ball-freq {
  background: var(--bg3);
  border: 2px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  width: auto;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 12px;
  height: 24px;
  font-weight: 600;
}
.ball-label { font-size: 12px; color: var(--text-dim); margin-left: 4px; }

/* ── Charts ── */
.chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
}
.chart-wrap-sm { height: 200px; }

/* ── Picker — Strategy cards ── */
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.strategy-card {
  all: unset;
  box-sizing: border-box;
  display: block;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid #334155;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
  background: #1e293b;
  color: #f8fafc;
}
.strategy-card:hover { border-color: #7c3aed; }
.strategy-card.active {
  border-color: #7c3aed;
  background: #1e1b4b;
}
.strategy-name { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.strategy-desc { font-size: 11px; color: #64748b; line-height: 1.4; }

/* ── Picker — Game count toggle ── */
.count-toggle {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 16px;
}
.count-btn {
  all: unset;
  box-sizing: border-box;
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #334155;
  cursor: pointer;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  background: #1e293b;
  color: #94a3b8;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.count-btn:hover { border-color: #7c3aed; color: #f8fafc; }
.count-btn.active {
  border-color: #7c3aed;
  background: #1e1b4b;
  color: #f8fafc;
}

/* ── Picker — Generate button ── */
.btn-generate-big {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transition: opacity 0.2s, transform 0.15s;
}
.btn-generate-big:hover { opacity: 0.9; transform: translateY(-2px); }
.btn-generate-big:active { transform: translateY(0); }

/* ── Picker — Single game result ── */
.single-result {
  border-color: var(--accent);
  box-shadow: 0 0 28px rgba(99, 102, 241, 0.15);
}
.single-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.single-strategy-badge {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent2);
}
.single-meta { font-size: 12px; color: var(--text-dim); }
.single-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
}
.ball-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.ball-lg-main { background: linear-gradient(135deg, #f97316, #c2410c); box-shadow: 0 4px 14px rgba(249,115,22,0.4); }
.ball-lg-pb   { background: linear-gradient(135deg, #a855f7, #7e22ce); box-shadow: 0 4px 14px rgba(168,85,247,0.4); }
.ball-lg-divider { font-size: 28px; color: var(--border); font-weight: 200; padding: 0 6px; }
.single-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  padding: 0 4px;
  margin-top: -4px;
  margin-bottom: 12px;
}
.single-odds { text-align: center; font-size: 12px; color: var(--text-dim); font-style: italic; }

/* ── Picker — 18-game grid ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.game-row {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.game-num {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  min-width: 46px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.game-balls { display: flex; gap: 5px; flex-wrap: nowrap; align-items: center; }
.game-divider { color: var(--border); font-weight: 300; font-size: 16px; flex-shrink: 0; }
.ball-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.ball-sm.main { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.ball-sm.pb   { background: linear-gradient(135deg, var(--pb), #7e22ce); }

/* ── Picker — Strategy explainer ── */
.explainer-title { font-size: 14px; color: #94a3b8; margin-bottom: 10px; }
.strategy-explainer { display: flex; flex-direction: column; gap: 8px; }
.strategy-explainer p { font-size: 12px; color: #64748b; line-height: 1.8; margin: 0; }
.strategy-explainer strong { font-weight: 700; }
.hot-label { color: #f97316; }
.cold-label { color: #3b82f6; }
.mixed-label { color: #8b5cf6; }
.random-label { color: #94a3b8; }

/* ── Latest draw ── */
.latest-draw { font-size: 13px; }
.latest-draw-date { color: var(--text-dim); margin-bottom: 10px; }
.latest-draw-num { font-size: 20px; font-weight: 700; color: var(--text-dim); margin-bottom: 10px; }

/* ── History ── */
.history-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.history-controls input,
.history-controls select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
}
.history-controls input { flex: 1; min-width: 180px; }
.history-controls input:focus,
.history-controls select:focus { outline: 2px solid var(--accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: var(--bg3);
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:hover { background: var(--bg3); }
tbody td { padding: 10px 12px; vertical-align: middle; }
.draw-balls { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.draw-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--bg3);
  border: 1px solid var(--border);
}
.draw-ball.hot { background: linear-gradient(135deg, #f97316, #c2410c); border: none; }
.draw-ball.pb-ball { background: linear-gradient(135deg, var(--pb), #7e22ce); border: none; }

.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.page-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.page-btn:hover { background: var(--border); color: var(--text); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Disclaimer ── */
.disclaimer-panel {
  border-color: #4a3020;
  background: #1a1208;
  font-size: 13px;
  color: var(--text-dim);
}
.disclaimer-panel p { margin-bottom: 8px; }
.disclaimer-panel p:last-child { margin-bottom: 0; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  padding: 24px 16px;
  text-align: center;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-inner p { font-size: 13px; color: var(--text-dim); margin-bottom: 4px; }
.footer-disclaimer { font-size: 11px; color: #555; margin-top: 8px; }
.footer-version { font-size: 11px; color: #3a3f55; margin-top: 4px; letter-spacing: 0.5px; }

/* ── Loading state ── */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 14px;
}
.error-msg {
  background: #2d1515;
  border: 1px solid #7f1d1d;
  border-radius: 8px;
  padding: 16px;
  color: #fca5a5;
  font-size: 14px;
  margin: 16px 0;
}
