:root {
  --bg: #101a14;
  --bg-raise: #17241c;
  --panel: #1c2c22;
  --panel-2: #24362a;
  --line: rgba(244, 239, 226, 0.14);
  --paper: #f3eee2;
  --paper-2: #e7e0cf;
  --ink: #1c1914;
  --muted: #b7c2b4;
  --soft: #d9e0d4;
  --text: #f4f1e8;
  --gold: #e2b45a;
  --gold-2: #f6d48a;
  --good: #3cba78;
  --bad: #e15a4a;
  --fl: #ef6a56;
  --ny: #79b0ea;
  --nj: #69c492;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
  --topbar: rgba(16, 26, 20, 0.92);
  --footer: #0c1611;
  --card: rgba(28, 44, 34, 0.86);
  --wash: rgba(255, 255, 255, 0.03);
  --error: #ffb4aa;
  --gold-soft: rgba(226, 180, 90, 0.14);
  --glow-gold: rgba(226, 180, 90, 0.16);
  --glow-green: rgba(60, 186, 120, 0.1);
  --pitch: #07140f;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f3efe4;
  --bg-raise: #fffdf8;
  --panel: #fffdf8;
  --panel-2: #e9e1d0;
  --line: rgba(36, 32, 24, 0.16);
  --muted: #5a6158;
  --soft: #243028;
  --text: #17211b;
  --gold-2: #7a5410;
  --good: #0d7a45;
  --bad: #b42318;
  --fl: #b33a28;
  --ny: #1d4e8f;
  --nj: #1a7044;
  --shadow: 0 16px 36px rgba(48, 38, 18, 0.08);
  --topbar: rgba(243, 239, 228, 0.94);
  --footer: #e7dfcf;
  --card: #fffdf8;
  --wash: rgba(36, 32, 24, 0.045);
  --error: #9f2d22;
  --gold-soft: rgba(154, 107, 18, 0.16);
  --glow-gold: rgba(200, 146, 42, 0.2);
  --glow-green: rgba(26, 112, 68, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1000px 420px at 0% -10%, var(--glow-gold), transparent 55%),
    radial-gradient(800px 380px at 100% 0%, var(--glow-green), transparent 46%),
    var(--bg);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app { min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--topbar);
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 168px;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #fff4d2, var(--gold) 42%, #8d6420 78%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25), 0 6px 16px rgba(0, 0, 0, 0.3);
  position: relative;
}
.mark:after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1.5px dashed rgba(28, 25, 20, 0.45);
}
.brand strong {
  display: block;
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: 0.04em;
  font-size: 18px;
}
.brand span { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.nav a {
  text-decoration: none;
  color: var(--soft);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
}
.nav a.active, .nav a:hover { background: var(--panel); color: var(--text); }
.wallet { position: relative; }
.wallet summary {
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.wallet summary::-webkit-details-marker { display: none; }
.wallet summary small { color: var(--muted); margin-right: 8px; letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; }
.wallet-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 240px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.wallet-pop p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.theme-switch {
  width: 52px;
  height: 30px;
  flex: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
}
.theme-switch-knob {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  transform: translateX(0);
  transition: transform 160ms ease;
}
.theme-switch[aria-checked="true"] {
  background: var(--gold);
  border-color: transparent;
}
.theme-switch[aria-checked="true"] .theme-switch-knob {
  transform: translateX(22px);
  background: #241a0a;
}
.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--footer);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.site-footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 28px;
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.7fr 1.3fr;
  gap: 28px;
}
.site-footer-name {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 28px;
  color: var(--text);
}
.site-footer p { margin: 0; }
.site-footer-label {
  margin: 0 0 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold-2);
}
.site-footer-links, .site-footer-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a {
  color: var(--soft);
  text-decoration: none;
}
.site-footer a:hover { color: var(--gold-2); }
.site-footer-bar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}
.site-footer-bar a {
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(40px, 6vw, 72px); line-height: 0.96; }
h2 { font-size: clamp(28px, 3vw, 40px); }
.lede { font-size: 18px; line-height: 1.5; color: var(--soft); max-width: 62ch; }
.eyebrow {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-2);
  font-size: 12px;
  margin: 0 0 10px;
}
.spanish { color: var(--gold-2); font-family: var(--serif); font-size: 20px; margin: 12px 0 0; }

.hero { display: grid; grid-template-columns: 1.3fr 0.8fr; gap: 36px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  border: 0;
  background: var(--gold);
  color: #241a0a;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 620;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost { background: var(--panel-2); color: var(--text); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.bad { background: transparent; color: var(--bad); border: 1px solid rgba(225, 90, 74, 0.4); }
.btn.full { width: 100%; }

.grid-3, .grid-2 { display: grid; gap: 14px; margin-top: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1.15fr 0.85fr; }
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}
.card h3 { font-size: 26px; margin-bottom: 6px; }
.card p, .panel p { color: var(--muted); line-height: 1.5; }
a.card, a.row { text-decoration: none; color: inherit; }

.schedule { margin-top: 28px; }
.schedule h2 { margin-bottom: 12px; }
.rows { display: grid; gap: 8px; }
.row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--wash);
}
.pill {
  font-size: 12px;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 4px 8px;
  text-align: center;
  border: 1px solid var(--line);
}
.pill.FL { color: var(--fl); }
.pill.NY { color: var(--ny); }
.pill.NJ { color: var(--nj); }
.pill.GA, .pill.PA, .pill.CT { color: var(--gold-2); }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }

.ticket {
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
  position: relative;
}
.ticket header, .ticket footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ticket header { border-bottom: 1px dashed rgba(28, 25, 20, 0.25); padding-bottom: 8px; }
.ticket footer { border-top: 1px dashed rgba(28, 25, 20, 0.25); padding-top: 8px; margin-top: 10px; color: #5e584c; }
.ticket .game {
  font-family: var(--serif);
  font-size: 28px;
  margin: 12px 0 4px;
}
.ticket .picks {
  font-family: var(--mono);
  font-size: 28px;
  letter-spacing: 0.06em;
  margin: 0;
}
.ticket .meta { margin: 8px 0 0; font-size: 14px; line-height: 1.45; }
.ticket.won { outline: 3px solid var(--good); }
.ticket.lost { outline: 3px solid transparent; }
.stamp {
  position: absolute;
  right: 16px;
  top: 58px;
  border: 3px solid var(--bad);
  color: var(--bad);
  font-family: var(--serif);
  font-size: 28px;
  padding: 2px 8px;
  transform: rotate(8deg);
  border-radius: 8px;
  letter-spacing: 0.08em;
}
.ticket.won .stamp { border-color: var(--good); color: var(--good); transform: rotate(-8deg); }

.section-title { margin: 34px 0 12px; }
.tabs, .chips, .stakes { display: flex; flex-wrap: wrap; gap: 8px; }
.tab, .chip, .key, .stake {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--soft);
}
.tab.active, .chip.active, .stake.active {
  background: var(--gold);
  color: #241a0a;
  border-color: transparent;
  font-weight: 640;
}
.draw-list { display: grid; gap: 8px; margin: 14px 0; }
.draw-pick {
  text-align: left;
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--wash);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.draw-pick.active { border-color: var(--gold); background: var(--gold-soft); }
.draw-pick small, .hint, .error { color: var(--muted); }
.error { color: var(--error); min-height: 1.2em; }

.digits, .board-balls, .pool-balls { display: flex; gap: 8px; flex-wrap: wrap; }
.ball, .digit {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.digit.active { border-color: var(--gold); color: var(--gold-2); }
.digit.dim { opacity: 0.38; }
.ball.hit, .digit.hit { background: var(--gold); color: #241a0a; border-color: transparent; }
.ball small { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.key { border-radius: 14px; min-height: 48px; font-family: var(--mono); font-size: 18px; }
.key:hover, .chip:hover, .tab:hover, .stake:hover, .draw-pick:hover { border-color: var(--gold); }
.pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.pool button {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  min-height: 40px;
  font-family: var(--mono);
}
.pool button.on { background: var(--gold); color: #241a0a; border-color: transparent; }

.field { margin-top: 14px; }
.field label, .label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.styles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.style-btn { text-align: left; border-radius: 14px; border: 1px solid var(--line); background: transparent; padding: 10px; }
.style-btn.active { border-color: var(--gold); background: var(--gold-soft); }
.style-btn b { display: block; }
.style-btn span { color: var(--muted); font-size: 12px; }

.reveal { margin-bottom: 14px; }
.reveal h3 { margin-bottom: 8px; }
.result-note { font-size: 18px; margin: 8px 0 0; }
.result-note.good { color: var(--good); }
.result-note.bad { color: var(--error); }

.rules { display: grid; gap: 14px; }
.rule h3 { margin-bottom: 8px; }
.rule p, .rule li { color: var(--soft); line-height: 1.55; }
.rule ul { margin: 8px 0 0; padding-left: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
.bench { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.mini-digits { display: flex; gap: 8px; }
.mini-digits input {
  width: 64px;
  height: 64px;
  text-align: center;
  font-family: var(--mono);
  font-size: 28px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.slip-list, .draw-history { display: grid; gap: 10px; }
.slip {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--wash);
  border: 1px solid var(--line);
}
.slip b { font-family: var(--serif); font-size: 20px; font-weight: 540; }
.won-text { color: var(--good); }
.lost-text { color: var(--muted); }

.football-layout { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 16px; }
canvas#pitch {
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: var(--pitch);
  display: block;
}
.hud { display: flex; justify-content: space-between; gap: 8px; margin: 10px 0; font-variant-numeric: tabular-nums; }
.score { font-family: var(--serif); font-size: 32px; }
.aim-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.aim-grid button, button.digit {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  min-height: 44px;
}
button.digit { width: 54px; height: 54px; padding: 0; border-radius: 50%; font-family: var(--mono); font-size: 18px; }
.aim-grid button.active { border-color: var(--gold); color: var(--gold-2); }
.aim-grid button:disabled, button.digit:disabled { opacity: 0.45; }
.ball.pos { width: auto; min-width: 92px; height: auto; min-height: 58px; border-radius: 16px; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.match { padding: 12px 0; border-bottom: 1px solid var(--line); }
.match .teams { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.odds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.timeline { color: var(--muted); font-family: var(--mono); font-size: 12px; margin: 6px 0 0; }

.empty { padding: 28px 8px; color: var(--muted); }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; padding: 14px; }
  .hero, .grid-3, .grid-2, .bench, .football-layout { grid-template-columns: 1fr; }
  .nav { order: 3; width: 100%; }
  .row, .slip { grid-template-columns: 1fr; }
  .brand { min-width: 0; }
  .site-footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .site-footer-inner, .site-footer-bar { grid-template-columns: 1fr; display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .theme-switch-knob { transition: none; }
}
