/* Washington Lotto — wl-styles.css */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface2: #22222e;
  --border: #2a2a3a;
  --gold: #f5c842;
  --green: #4ade80;
  --red: #f87171;
  --blue: #60a5fa;
  --text: #e8e8f0;
  --muted: #888899;
  --radius: 12px;
  --ball-size: 44px;
}

* { 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 ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wl-site-title { font-size: 1.3rem; font-weight: 700; color: var(--gold); text-decoration: none; }
.wl-header-right { display: flex; align-items: center; gap: 16px; }
.wl-state-link { color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.wl-state-link:hover { color: var(--text); }

/* ── Back link (CRITICAL — must appear before .tabs) ── */
.wl-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 10px 24px;
  transition: color .2s;
}
.wl-back:hover { color: var(--gold); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  overflow-x: auto;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 14px 18px;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-btn:hover:not(.active) { color: var(--text); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Hero ── */
.wl-hero {
  background: linear-gradient(135deg, #1a2a1a 0%, #0f1a0f 60%, #0f0f13 100%);
  border-bottom: 1px solid var(--border);
  padding: 36px 24px 32px;
  text-align: center;
}
.wl-hero h1 { font-size: 1.9rem; font-weight: 700; margin-bottom: 6px; }
.wl-hero h1 span { color: var(--green); }
.wl-hero p { color: var(--muted); font-size: 0.9rem; }

/* ── Ad slots ── */
.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 600;
}
.ad-leaderboard { width: 100%; height: 90px; margin-bottom: 28px; }
.ad-rectangle { width: 300px; height: 250px; flex-shrink: 0; }
.ad-inline { width: 100%; height: 90px; margin: 28px 0; }

/* ── Layout ── */
main { max-width: 1020px; margin: 0 auto; padding: 32px 24px 60px; }
.main-with-sidebar { display: flex; gap: 28px; align-items: flex-start; }
.main-col { flex: 1; min-width: 0; }
.sidebar-col { width: 300px; flex-shrink: 0; }

/* ── Play Panel ── */
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.panel-card h2 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.ticket-ball {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.ticket-ball:hover { border-color: var(--gold); color: var(--gold); }
.ticket-ball.selected { background: var(--gold); border-color: var(--gold); color: #000; }
.ticket-ball.hit { background: var(--green); border-color: var(--green); color: #000; animation: pop .3s ease; }

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.pick-status {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 16px;
  min-height: 22px;
}
.pick-status.ready { color: var(--green); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  flex: 1;
  min-width: 100px;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: #000;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 20px;
  transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); opacity: 1; }

/* ── Draw result ── */
.draw-result {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.draw-result.show { display: block; }
.draw-result-label { font-size: 0.75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.drawn-balls { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.drawn-ball {
  width: var(--ball-size);
  height: var(--ball-size);
  border-radius: 50%;
  background: var(--green);
  color: #000;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop .35s ease both;
}
.drawn-ball:nth-child(2) { animation-delay: .08s; }
.drawn-ball:nth-child(3) { animation-delay: .16s; }
.drawn-ball:nth-child(4) { animation-delay: .24s; }
.drawn-ball:nth-child(5) { animation-delay: .32s; }
.drawn-ball:nth-child(6) { animation-delay: .40s; }
.match-summary { font-size: 1.05rem; font-weight: 700; }
.match-summary.win { color: var(--green); }
.match-summary.partial { color: var(--gold); }
.match-summary.lose { color: var(--muted); }

.prize-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.prize-table th, .prize-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.prize-table th { color: var(--muted); font-weight: 600; font-size: 0.72rem; letter-spacing: .07em; text-transform: uppercase; }
.prize-table tr:last-child td { border-bottom: none; }
.prize-row-hit td { color: var(--green); background: rgba(74,222,128,.04); }

/* ── Frequency ── */
.freq-bar-wrap { margin-bottom: 10px; }
.freq-bar-label { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 4px; }
.freq-bar-label span:first-child { font-weight: 600; }
.freq-bar-label span:last-child { color: var(--muted); }
.freq-bar-bg { height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.freq-bar-fill { height: 100%; border-radius: 4px; background: var(--green); transition: width .4s ease; }
.freq-bar-fill.cold { background: var(--blue); }

.freq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.freq-section-title { font-size: 0.72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }

/* ── History ── */
.history-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.history-table th, .history-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.history-table th { color: var(--muted); font-weight: 600; font-size: 0.72rem; letter-spacing: .07em; text-transform: uppercase; background: var(--surface2); }
.history-table tr:hover td { background: rgba(255,255,255,.02); }
.history-balls { display: flex; gap: 6px; flex-wrap: wrap; }
.hball {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
}

/* ── Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-card .stat-label { font-size: 0.72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--gold); }
.stat-card .stat-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .main-with-sidebar { flex-direction: column; }
  .sidebar-col { width: 100%; }
  .freq-grid { grid-template-columns: 1fr; }
  .ticket-grid { grid-template-columns: repeat(7, 1fr); }
}
