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

:root {
  color-scheme: light dark;
  --navy: #0a1628;
  --navy-mid: #122040;
  --navy-light: #1a3060;
  --gold: #c9a84c;
  --gold-light: #e8c96a;
  --gold-pale: #f5e9c3;
  --cream: #faf7f0;
  --white: #ffffff;
  --gray: #666e80;
  --gray-light: #e8eaf0;
  --text: #1a1f2e;
  --radius: 4px;
  --shadow: 0 4px 24px rgba(10,22,40,0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
}

/* ─── NAV ─── */
/* Scope to the site navbar (#top) so this fixed-position styling never leaks
   onto other <nav> elements, e.g. the matched-draws pager (nav.matches-pager). */
#top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10,22,40,0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 72px;
  border-bottom: 1px solid rgba(201,168,76,0.2);
}

#top .logo img {
  height: 48px;
  width: auto;
  display: block;
}

nav .nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

nav .nav-links a {
  color: var(--gold-pale);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}

nav .nav-links a:hover { color: var(--gold-light); }

#authSection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#authSection .btn {
  width: auto;
  white-space: nowrap;
}
.nav-greeting {
  font-size: 12px;
  color: var(--gold-pale);
  margin-right: 6px;
  white-space: nowrap;
}
.btn-signout {
  padding: 8px 16px !important;
  font-size: 12px !important;
  margin: 0 !important;
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1px solid var(--gold);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold-pale);
  transition: all 0.3s;
}

/* ─── VERIFY EMAIL BANNER ─── */
.verify-banner[hidden] { display: none; }
.verify-banner {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(18, 32, 64, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(201,168,76,0.3);
  color: var(--gold-pale);
  padding: 12px 40px;
  font-size: 14px;
}
.verify-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.verify-banner-inner p { flex: 1 1 240px; min-width: 200px; }
.verify-banner-inner strong { color: var(--gold); }
.verify-banner-actions {
  display: inline-flex;
  gap: 8px;
}
.verify-banner-actions .btn {
  width: auto;
  white-space: nowrap;
  padding: 6px 14px;
  font-size: 12px;
  margin-top: 0;
}
.verify-banner-msg[hidden] { display: none; }
.verify-banner-msg {
  flex: 1 1 100%;
  font-size: 13px;
  color: var(--gold-pale);
  margin-top: 4px;
}
.verify-banner-msg.error { color: #fca5a5; }
.verify-banner-msg.success { color: #86efac; }

body.verify-pending .hero { padding-top: calc(72px + 64px); }

/* ─── HERO ─── */
.hero {
  min-height: 560px;
  background: var(--navy);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 72px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 50%, rgba(201,168,76,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(26,48,96,0.6) 0%, transparent 60%);
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 40px 64px;
  width: 100%;
}

.hero-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-text h1 em {
  font-style: italic;
  color: var(--gold);
}

.hero-text h2 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 300;
  color: var(--gold-pale);
  line-height: 1.5;
  margin-bottom: 12px;
}

.hero-text h3 {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 300;
  color: rgba(245,233,195,0.7);
  line-height: 1.5;
  margin-bottom: 40px;
}

.hero-image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* ─── SECTION BASE ─── */
section { padding: 96px 40px; }

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

h2.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 24px;
}

h2.section-title.light { color: var(--white); }

.divider {
  width: 56px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 32px;
}

/* ─── WHAT IS KENO ─── */
.what-is-keno { background: var(--navy); border-top: 1px solid rgba(201,168,76,0.25); }

.keno-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.keno-grid img {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.keno-text p {
  color: rgba(245,233,195,0.8);
  margin-bottom: 20px;
  font-size: 1.05rem;
}

.luck-box {
  background: var(--navy);
  border-radius: 8px;
  padding: 40px;
  margin-top: 48px;
}

.luck-box h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 16px;
}

.luck-box p {
  color: var(--gold-pale);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.luck-box p:last-child { margin-bottom: 0; }

/* ─── PROUDLY CANADIAN ─── */
.canadian-badge {
  background: var(--navy);
  padding: 48px 40px;
  text-align: center;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}
.canadian-proudly {
  font-size: 1.1rem;
  color: var(--gold-pale);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 600;
}
.canadian-word {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: #dd2e30;
  font-family: 'Playfair Display', serif;
  line-height: 1.2;
  margin-bottom: 4px;
}
.canadian-tagline {
  font-size: 0.95rem;
  color: rgba(245,233,195,0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─── FORM ─── */
.form-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 12px;
  padding: 40px;
}

.form-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245,233,195,0.6);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius);
  color: var(--white);
  font-family: inherit;
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, textarea:focus {
  border-color: var(--gold);
}

textarea { resize: vertical; min-height: 80px; }

.radio-group {
  display: flex;
  gap: 20px;
  align-items: center;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: rgba(245,233,195,0.8);
  cursor: pointer;
}

.radio-group input[type="radio"] {
  width: auto;
  accent-color: var(--gold);
}

.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 36px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  width: 100%;
  margin-top: 8px;
}

.btn:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.form-msg {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  display: none;
}

.form-msg.success {
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.3);
  color: #86efac;
  display: block;
}

.form-msg.error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  display: block;
}

/* ─── NEWSLETTER ─── */
.newsletter-bar {
  background: var(--navy);
  padding: 48px 40px;
  border-top: 1px solid rgba(201,168,76,0.25);
  border-bottom: 1px solid rgba(201,168,76,0.25);
}

.newsletter-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.newsletter-inner h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.newsletter-inner p {
  color: rgba(245,233,195,0.7);
  font-size: 14px;
  margin-bottom: 24px;
}

.newsletter-form {
  display: flex;
  gap: 12px;
}

.newsletter-form input {
  flex: 1;
}

.newsletter-form .btn {
  width: auto;
  white-space: nowrap;
  margin-top: 0;
}

/* ─── DATA SECTION ─── */
.data-section {
  background: var(--navy);
  text-align: center;
  border-top: 1px solid rgba(201,168,76,0.25);
}
.data-samples {
  margin-top: 56px;
  text-align: left;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.data-section .stats {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin: 48px 0;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 8px;
}

.data-section img {
  width: 100%;
  max-width: 900px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 2px solid rgba(201,168,76,0.2);
}

/* ─── FOUNDER ─── */
.founder {
  background: var(--navy);
  color: var(--white);
  border-top: 1px solid rgba(201,168,76,0.25);
}

.founder-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  align-items: start;
}

.founder-bio h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--white);
  margin-bottom: 4px;
}

.founder-bio .title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
}

.founder-story h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 20px;
}

.founder-story p {
  color: rgba(245,233,195,0.8);
  font-size: 1.02rem;
  line-height: 1.8;
}

.quote-mark {
  font-family: 'Playfair Display', serif;
  font-size: 6rem;
  color: rgba(201,168,76,0.2);
  line-height: 0.5;
  display: block;
  margin-bottom: 24px;
}

/* ─── FAQ ─── */
.faq { background: var(--navy); border-top: 1px solid rgba(201,168,76,0.25); }

.faq-list {
  list-style: none;
  margin-top: 48px;
}

.faq-item {
  border-bottom: 1px solid rgba(201,168,76,0.12);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-pale);
  gap: 24px;
}

.faq-question:hover { color: var(--gold); }

.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--gold);
  transition: transform 0.3s;
}

.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
}

.faq-item.open .faq-answer {
  max-height: 800px;
}

.faq-answer-inner {
  padding-bottom: 28px;
  color: rgba(245,233,195,0.8);
  font-size: 1rem;
  line-height: 1.8;
}

.faq-answer-inner ul {
  list-style: none;
  margin-top: 16px;
}

.faq-answer-inner ul li {
  padding: 6px 0 6px 20px;
  position: relative;
}

.faq-answer-inner ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--gold);
}

.faq-answer-inner strong { color: var(--gold); }

/* ─── INTERNATIONAL ─── */
.international {
  background: var(--navy-mid);
  color: var(--white);
  text-align: center;
}

.international h2 { color: var(--white); margin: 0 auto 16px; }

.international .divider { margin: 0 auto 32px; }

.international > .container > p {
  color: rgba(245,233,195,0.75);
  max-width: 700px;
  margin: 0 auto 48px;
  font-size: 1.05rem;
}

.locations-grid {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.location-tag {
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-pale);
  letter-spacing: 0.05em;
}

/* ─── FOOTER ─── */
footer {
  background: var(--navy);
  border-top: 1px solid rgba(201,168,76,0.25);
  padding: 60px 40px 32px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-logo img {
  height: 44px;
  margin-bottom: 20px;
}

.footer-col h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.footer-col a, .footer-col p {
  display: block;
  color: rgba(245,233,195,0.6);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--gold-light); }

.footer-bottom {
  border-top: 1px solid rgba(201,168,76,0.1);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-bottom p {
  font-size: 13px;
  color: rgba(245,233,195,0.35);
}

.footer-bottom a {
  color: rgba(201,168,76,0.5);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-bottom a:hover { color: var(--gold); }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  #top { padding: 0 20px; }
  .verify-banner { padding: 12px 20px; }
  body.verify-pending .hero { padding-top: calc(72px + 110px); }
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 72px;
    left: 0; right: 0;
    background: var(--navy);
    padding: 24px 20px;
    border-bottom: 1px solid rgba(201,168,76,0.2);
    gap: 20px;
  }

  section { padding: 64px 20px; }

  .hero-inner {
    grid-template-columns: 1fr;
    padding: 60px 20px;
    text-align: center;
  }

  .hero-image { order: -1; }

  .keno-grid,
  .membership-inner,
  .founder-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .form-row { grid-template-columns: 1fr; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form .btn {
    width: 100%;
  }

  .data-section .stats { gap: 32px; }

  .stat-number { font-size: 2.5rem; }
}

/* ─── AUTH MODAL ─── */
.auth-modal[hidden] { display: none; }
#authModal [hidden] { display: none !important; }
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,22,40,0.7);
  backdrop-filter: blur(4px);
}
.auth-modal-card {
  position: relative;
  background: var(--navy-mid);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  color: var(--white);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.auth-modal-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 24px;
  text-align: center;
}
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--gold-pale);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}
.auth-modal-close:hover { color: var(--gold); }

.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--white);
  color: var(--navy);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.auth-google-btn:hover {
  background: #f5f5f5;
  transform: translateY(-1px);
}
.auth-google-btn .g-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: rgba(245,233,195,0.5);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(201,168,76,0.2);
}

.auth-modal-card .form-group label {
  color: rgba(245,233,195,0.7);
}

.auth-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: rgba(245,233,195,0.7);
}
.auth-toggle a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}
.auth-toggle a:hover { color: var(--gold-light); text-decoration: underline; }

#authError:empty { display: none; }

.auth-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.auth-actions .btn {
  flex: 1;
  margin-top: 0;
}
.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn-secondary:hover {
  background: var(--gold);
  color: var(--navy);
}

.auth-forgot {
  margin-top: 6px;
  text-align: right;
  font-size: 12px;
}
.auth-forgot a {
  color: var(--gold);
  text-decoration: none;
}
.auth-forgot a:hover { color: var(--gold-light); text-decoration: underline; }

.password-wrapper {
  position: relative;
}
.password-wrapper input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(245,233,195,0.55);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: color 0.2s;
}
.password-toggle:hover { color: var(--gold); }
.password-toggle:focus-visible { outline: 1px solid var(--gold); outline-offset: 1px; }
.password-toggle .eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: inline; }

.strength-meter {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.strength-meter > span {
  flex: 1;
  height: 4px;
  background: rgba(245,233,195,0.15);
  border-radius: 2px;
  transition: background 0.2s;
}
.strength-meter.weak > span:nth-child(1) { background: #ef4444; }
.strength-meter.ok > span:nth-child(1),
.strength-meter.ok > span:nth-child(2) { background: var(--gold); }
.strength-meter.strong > span { background: #22c55e; }

.strength-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245,233,195,0.5);
  margin-top: 6px;
  min-height: 14px;
}
.strength-label.weak { color: #fca5a5; }
.strength-label.ok { color: var(--gold-pale); }
.strength-label.strong { color: #86efac; }

/* ─── AI CHAT WIDGET ─── */
.ai-chat-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 1000;
  transition: transform 0.2s;
}
.ai-chat-btn:hover { transform: scale(1.1); }

.ai-chat-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 350px;
  height: 500px;
  background: var(--navy);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  border: 1px solid var(--gold);
}
.ai-chat-window.open { display: flex; }

.ai-chat-header {
  background: var(--navy);
  color: var(--gold);
  padding: 16px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--cream);
}
.msg {
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 80% ;
  font-size: 14px;
  line-height: 1.4;
}
.msg.user {
  align-self: flex-end;
  background: var(--navy-light);
  color: var(--white);
}
.msg.ai {
  align-self: flex-start;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--gray-light);
}
.ai-chat-input {
  padding: 12px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--gray-light);
}
.ai-chat-input input {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--gray-light);
  border-radius: 4px;
  outline: none;
}
.ai-chat-input button {
  background: var(--gold);
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}

/* === Analytics ============================================== */
.analytics-view {
  padding: 56px 40px 96px;
  background: var(--navy);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
/* The hero sits on the same navy. Replace the hard section seam with
   a hairline gold rule so the eye reads them as one continuous wall. */
.hero + .analytics-view {
  border-top: 1px solid rgba(201,168,76,0.15);
}
.analytics-view::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 80% 20%, rgba(201,168,76,0.08) 0%, transparent 65%),
    radial-gradient(ellipse 50% 60% at 10% 90%, rgba(26,48,96,0.55) 0%, transparent 60%);
  pointer-events: none;
}
.analytics-view .container { position: relative; max-width: 1100px; margin: 0 auto; }
.analytics-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 24px;
}
.analytics-title em { font-style: italic; color: var(--gold); }

/* ------ Preview (signed-out) -------------------------------- */
.analytics-preview .preview-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 64px;
  align-items: start;
  margin-top: 8px;
}
.preview-explainer p {
  color: var(--gold-pale);
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 20px;
}
.preview-explainer p.muted { color: rgba(245,233,195,0.7); }
.preview-explainer p em { font-style: italic; color: var(--gold-light); }
.preview-explainer p strong { color: var(--gold); font-weight: 700; }
.preview-features {
  list-style: none;
  margin-top: 32px;
  padding: 0;
  display: grid;
  gap: 14px;
}
.preview-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold-pale);
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}
.preview-features .dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(201,168,76,0.12);
  flex-shrink: 0;
}

/* ------ Sample table card ----------------------------------- */
.preview-sample { position: relative; }
.sample-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(245,233,195,0.7);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sample-label strong {
  color: var(--gold-pale);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.sample-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 3px 8px;
  border: 1px solid rgba(201,168,76,0.55);
  color: var(--gold);
  border-radius: 2px;
}
.sample-frame {
  position: relative;
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  padding: 28px 24px;
  overflow: hidden;
  box-shadow:
    0 30px 60px -30px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.sample-frame .results-table { min-width: 0; }
.sample-frame .results-table th,
.sample-frame .results-table td {
  padding: 8px 4px;
  font-size: 12px;
  border-color: rgba(255,255,255,0.08);
}
.sample-frame .results-table thead th {
  background: rgba(201,168,76,0.85);
  color: var(--navy);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.sample-frame .results-table tbody th {
  background: rgba(255,255,255,0.03);
  color: var(--gold-pale);
  font-weight: 600;
  font-size: 11px;
  text-align: left;
  padding-left: 10px;
}
.sample-frame .results-table.sample tbody td {
  color: var(--gold-pale);
}

.sample-veil {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(10,22,40,0.55) 0%, rgba(10,22,40,0.85) 60%, rgba(10,22,40,0.92) 100%);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  text-align: center;
  border-radius: 12px;
}
.veil-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--gold);
  margin: 0;
}
.veil-sub {
  color: rgba(245,233,195,0.8);
  font-size: 0.95rem;
  margin: 0 0 12px;
}
.veil-cta {
  width: auto;
  padding: 10px 28px;
  font-size: 13px;
  margin: 0;
}

/* ------ Pricing rail ---------------------------------------- */
.pricing-section {
  margin-top: 96px;
  padding-top: 56px;
  border-top: 1px solid rgba(201,168,76,0.15);
}
.pricing-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  color: var(--white);
  font-weight: 700;
  margin-bottom: 36px;
}
.pricing-title em { font-style: italic; color: var(--gold); }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}
.pricing-grid--pair {
  grid-template-columns: repeat(2, minmax(0, 360px));
  justify-content: center;
  gap: 28px;
}
.tier {
  position: relative;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.22);
  border-radius: 14px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.tier:hover {
  transform: translateY(-3px);
  border-color: rgba(201,168,76,0.45);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
}
.tier-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0;
}
.tier-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0 2px;
}
.tier-price .amount {
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}
.tier-price .cadence {
  color: rgba(245,233,195,0.6);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}
.tier-tagline {
  color: var(--gold-pale);
  font-style: italic;
  font-size: 0.95rem;
  margin: 0 0 8px;
}
.tier-features {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  gap: 10px;
  flex-grow: 1;
}
.tier-features li {
  position: relative;
  padding-left: 22px;
  color: rgba(245,233,195,0.85);
  font-size: 0.95rem;
  line-height: 1.45;
}
.tier-features li strong { color: var(--gold-light); font-weight: 600; }
.tier-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 6px;
  border-left: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  transform: rotate(-45deg);
}
.tier-cta {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  font-size: 13px;
}
.btn.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn.btn-outline:hover {
  background: rgba(201,168,76,0.12);
  color: var(--gold-light);
}
.tier-featured {
  background:
    linear-gradient(180deg, rgba(201,168,76,0.12) 0%, rgba(201,168,76,0.04) 100%),
    rgba(255,255,255,0.04);
  border-color: var(--gold);
  box-shadow:
    0 0 0 1px rgba(201,168,76,0.2),
    0 40px 80px -40px rgba(0,0,0,0.7);
  transform: translateY(-6px);
}
.tier-featured:hover { transform: translateY(-9px); }
.tier-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ------ Signed-in dashboard --------------------------------- */
.analytics-dashboard[hidden] { display: none; }
.analytics-intro { color: var(--gold-pale); margin-bottom: 16px; font-size: 1.02rem; max-width: 720px; }
.quota-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.quota-badge {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--gold, #c9a14a);
  border-radius: 999px;
  font-size: 13px;
}
.quota-badge.exhausted { border-color: #e57373; color: #e57373; }

/* Subscribe CTA: compact, refined gold pill that sits beside the quota badge.
   The [hidden] rule is required because an author display rule would otherwise
   override the `hidden` attribute's UA `display:none`. */
.subscribe-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 8px 18px;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
  color: var(--navy);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 22px -12px rgba(201,168,76,0.8);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.subscribe-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 26px -12px rgba(201,168,76,0.95);
}
.subscribe-cta:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.subscribe-cta__icon { font-size: 13px; line-height: 1; }
.subscribe-cta[hidden] { display: none; }

.picks-form { display: flex; flex-direction: column; gap: 16px; }
.picks-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(56px, 1fr));
  gap: 10px;
}
.picks-grid input {
  padding: 12px 8px;
  font-size: 18px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--white, #fff);
}
.picks-grid input.invalid { border-color: #e57373; }
.picks-grid input:focus { outline: 2px solid var(--gold, #c9a14a); }

#picksSubmitBtn:disabled { opacity: 0.5; cursor: not-allowed; }

.picks-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  color: var(--gold-pale, #e7d6a8);
}
.picks-loading[hidden] { display: none; }
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(201, 161, 74, 0.3);
  border-top-color: var(--gold, #c9a14a);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results-tabbed {
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 10px;
  margin-top: 16px;
  background: rgba(10,22,40,0.45);
}
.results-tabs {
  display: flex;
  gap: 0;
  padding: 0 0 0 4px;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}
.results-tab {
  all: unset;
  cursor: pointer;
  padding: 10px 20px 9px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(245,233,195,0.45);
  position: relative;
  transition: color 0.15s;
}
.results-tab:hover {
  color: var(--gold-pale);
}
.results-tab.active {
  color: var(--gold);
}
.results-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
}
.results-tab-panel {
  display: none;
  padding: 20px 16px 8px;
}
.results-tab-panel.active {
  display: block;
}

.picks-results { margin-top: 32px; }
.results-caption {
  font-family: 'Playfair Display', serif;
  color: var(--gold-pale, #e7d6a8);
  font-size: 18px;
  margin: 28px 0 8px;
}
.results-caption:first-child { margin-top: 0; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
/* .results-table + .results-table: removed — tables now live in separate cards */
.results-table th,
.results-table td {
  padding: 10px 8px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.results-table thead th { background: var(--gold, #c9a14a); color: #111; }
.results-table tbody th { text-align: left; background: rgba(255,255,255,0.04); }
.results-table tbody tr { transition: background-color 0.15s ease; }
.results-table tbody tr:hover { background: rgba(201,168,76,0.06); }
.form-msg { font-size: 13px; min-height: 1em; color: #e57373; }

/* --- Matched draws block --- */
.results-third { margin-top: 40px; }

.matches-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 24px 0 6px;
  gap: 4px;
}
.matches-stat-num {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.matches-stat-num.zero { color: var(--gold-pale); }
.matches-stat-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245,233,195,0.7);
  margin-top: 6px;
}
.matches-cap-note {
  font-size: 12px;
  color: rgba(245,233,195,0.6);
  text-align: center;
  margin-top: 6px;
  font-style: italic;
}

.matches-table-wrap {
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 8px;
  margin-top: 20px;
  background: rgba(255,255,255,0.02);
}
.matches-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.matches-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--gold);
  color: var(--navy);
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.matches-table tbody td {
  padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  vertical-align: top;
}
.matches-table tbody tr { transition: background-color 0.15s ease; }
.matches-table tbody tr:hover { background: rgba(100,149,237,0.06); }
.matches-table .col-draw {
  white-space: nowrap;
  text-align: center;
  color: var(--gold-pale);
  width: 1%;
}
.matches-table .col-drawn,
.matches-table .col-next {
  color: rgba(245,233,195,0.78);
}
.matches-table .nums {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  word-spacing: 0.1em;
}
.matches-table .hit {
  color: var(--gold-light);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(232,201,106,0.4);
}
.matches-empty {
  text-align: center;
  padding: 28px;
  color: rgba(245,233,195,0.55);
  font-style: italic;
}
.matches-empty[hidden] { display: none; }

.matches-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid rgba(100,149,237,0.18);
  background: rgba(22,52,120,0.25);
}
.matches-pager[hidden] { display: none; }
.pager-btn {
  background: transparent;
  border: 1px solid rgba(100,149,237,0.35);
  color: rgba(170,200,255,0.85);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
}
.pager-btn:hover:not(:disabled) {
  background: rgba(100,149,237,0.1);
  border-color: rgba(100,149,237,0.65);
  color: rgba(200,220,255,0.95);
}
.pager-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.pager-status {
  font-size: 12px;
  color: rgba(170,200,255,0.6);
  letter-spacing: 0.04em;
}

/* ─── Analytics results: card system ─────────────────────── */
.results-stats-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 40px 30px;
  background: linear-gradient(135deg, rgba(201,168,76,0.09) 0%, rgba(26,48,96,0.25) 100%);
  border: 1px solid rgba(201,168,76,0.28);
  border-top: 3px solid var(--gold);
  border-radius: 12px;
  margin-bottom: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.results-stats-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 90% at 50% 50%, rgba(201,168,76,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.results-stats-banner .matches-stat { margin: 0; position: relative; }
.results-stats-banner .matches-stat-num {
  font-size: clamp(3.5rem, 6vw, 5.2rem);
  text-shadow: 0 0 24px rgba(201,168,76,0.25);
}
.results-stats-banner .matches-stat-num.zero { text-shadow: none; }
.results-stats-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.65);
  margin-bottom: 14px;
  position: relative;
}

.analytics-table-card {
  margin-bottom: 16px;
  border-radius: 10px;
  border: 1px solid rgba(201,168,76,0.15);
  background: rgba(255,255,255,0.025);
  overflow: hidden;
}
.analytics-table-card--same { border-left: 3px solid var(--gold); }
.analytics-table-card--next { border-left: 3px solid var(--gold-light); }
.analytics-table-card--archive { border-left: 3px solid rgba(100,149,237,0.7); }

.atc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
}
.analytics-table-card--same .atc-header {
  background: linear-gradient(90deg, rgba(201,168,76,0.1) 0%, rgba(255,255,255,0.02) 60%, transparent 100%);
}
.analytics-table-card--next .atc-header {
  background: linear-gradient(90deg, rgba(232,201,106,0.08) 0%, rgba(255,255,255,0.02) 60%, transparent 100%);
}
.analytics-table-card--archive .atc-header {
  background: linear-gradient(90deg, rgba(26,48,96,0.65) 0%, rgba(100,149,237,0.04) 60%, transparent 100%);
}
.atc-header-left {
  display: flex;
  align-items: center;
  gap: 11px;
}
.atc-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid rgba(201,168,76,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.analytics-table-card--same .atc-icon {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
}
.analytics-table-card--next .atc-icon {
  background: rgba(232,201,106,0.10);
  color: var(--gold-light);
}
.analytics-table-card--archive .atc-icon {
  background: rgba(26,48,96,0.65);
  color: rgba(150,185,255,0.85);
  border-color: rgba(100,149,237,0.22);
}

.atc-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--gold-pale);
  margin: 0;
  line-height: 1.2;
}
.analytics-table-card--next .atc-title { color: var(--gold-light); }
.analytics-table-card--archive .atc-title { color: rgba(190,215,255,0.9); }
.atc-sub {
  font-size: 11px;
  color: rgba(245,233,195,0.52);
  margin: 2px 0 0;
}
.analytics-table-card--archive .atc-sub { color: rgba(150,185,255,0.45); }

.results-table-scroll { overflow-x: auto; }
.results-table-scroll .results-table { min-width: 720px; margin: 0; }

/* T2 header gets gold-light to distinguish from T1's gold */
.analytics-table-card--next .results-table thead th {
  background: var(--gold-light);
}
/* T3 archive gets a navy-blue header to visually distinguish it as a record table */
.analytics-table-card--archive .matches-table thead th {
  background: rgba(22,52,120,0.9);
  color: rgba(200,220,255,0.92);
}

/* When matches table is nested inside the archive card, kill the double border
   and let it flow seamlessly from the card header into the pager footer. */
.analytics-table-card--archive .matches-table-wrap {
  border: none;
  border-radius: 0;
  margin-top: 0;
  background: transparent;
}

@media (max-width: 960px) {
  .analytics-preview .preview-grid { grid-template-columns: 1fr; gap: 48px; }
  .pricing-grid,
  .pricing-grid--pair { grid-template-columns: 1fr; gap: 20px; justify-content: stretch; }
  .tier-featured { transform: none; }
  .tier-featured:hover { transform: translateY(-3px); }
}

@media (max-width: 600px) {
  .analytics-view { padding: 64px 20px; }
  .picks-grid { grid-template-columns: repeat(4, 1fr); }
  .sample-frame { padding: 18px 14px; }
  .sample-frame .results-table th,
  .sample-frame .results-table td { font-size: 10.5px; padding: 6px 3px; }
  .veil-title { font-size: 1.35rem; }
  .pricing-section { margin-top: 64px; padding-top: 40px; }
  .tier { padding: 28px 22px; }
  .results-stats-banner { padding: 24px 16px 20px; }
  .results-tab { padding: 8px 14px 7px; font-size: 12px; }
  .results-tab-panel { padding: 14px 10px 6px; }
  .matches-table .nums { font-size: 11.5px; }
  .matches-table-wrap { max-height: 400px; }
}

/* ── Saved-search history ── */
#historyPanel {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(201,168,76,0.15);
  border-left: 3px solid rgba(100,149,237,0.7);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 28px;
}
.history-heading {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(190,215,255,0.9);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(100,149,237,0.15);
}
/* ── Search card ── */
.search-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(201,168,76,0.15);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 28px;
}
.search-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gold);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.form-actions .btn {
  flex: 1;
  width: auto;
  margin-top: 0;
  padding: 13px 24px;
  border: 1px solid transparent;
}
.form-actions .btn-secondary {
  border-color: var(--gold);
}
.history-scroll-wrap {
  position: relative;
}
.history-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 36px 12px;
}
.history-list::-webkit-scrollbar { display: none; }
.history-scroll-btn {
  position: absolute;
  top: 0;
  bottom: 12px;
  z-index: 2;
  width: 36px;
  border: none;
  background: linear-gradient(to right, rgba(10,22,40,0.85), transparent);
  color: var(--gold);
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s, opacity 0.15s;
  padding: 0;
  line-height: 1;
  opacity: 0.5;
}
.history-scroll-btn--left {
  left: 0;
  background: linear-gradient(to right, rgba(10,22,40,0.7), transparent);
}
.history-scroll-btn--right {
  right: 0;
  background: linear-gradient(to left, rgba(10,22,40,0.7), transparent);
}
.history-scroll-btn:hover {
  opacity: 1;
  color: var(--gold-light);
  background: linear-gradient(to right, rgba(10,22,40,0.95), rgba(10,22,40,0.4));
}
.history-scroll-btn--right:hover {
  background: linear-gradient(to left, rgba(10,22,40,0.95), rgba(10,22,40,0.4));
}
.history-scroll-btn:active {
  opacity: 1;
  color: var(--gold-pale);
}
.history-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 14px 9px 28px;
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: rgba(255,255,255,0.1);
  color: var(--gold-pale);
  user-select: none;
  white-space: nowrap;
  position: relative;
}
.history-pill::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 7px;
  width: 2px;
  background: rgba(100,149,237,0.2);
  border-radius: 1px;
}
.history-pill:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.12);
}

.pill-picks {
  font-weight: 600;
  color: var(--gold-pale);
  letter-spacing: 0.01em;
}
.pill-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(245,233,195,0.5);
  margin-right: 4px;
}
.pill-suffix {
  font-size: inherit;
  font-weight: inherit;
  color: rgba(245,233,195,0.5);
}
.pill-date {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold-pale);
  line-height: 1.4;
  opacity: 0.65;
}
.pill-matches {
  font-weight: 600;
  color: var(--gold-pale);
}
.pill-matches.low { color: rgba(245,233,195,0.5); }
.pill-matches.mid { color: var(--gold-pale); }
.pill-matches.high { color: #fff3c9; }
.history-empty, .history-error { text-align: center; padding: 18px 0; font-size: 14px; }
.history-empty { color: rgba(245,233,195,0.4); }
.history-error { color: #fca5a5; }
.history-loading:not([hidden]) { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0; }
#historyLoadMore:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  background: rgba(255,255,255,0.06);
  color: rgba(190,215,255,0.7);
  font-family: inherit;
  user-select: none;
  white-space: nowrap;
  margin: 12px auto 0;
}
#historyLoadMore:hover {
  border-color: rgba(100,149,237,0.5);
  background: rgba(100,149,237,0.12);
  color: rgba(190,215,255,0.95);
}
#historyLoadMore:focus-visible {
  outline: 2px solid rgba(100,149,237,0.6);
  outline-offset: 2px;
}

/* ── Light mode — matches can-dokenofunclub.com brand palette ── */
@media (prefers-color-scheme: light) {
  #top {
    background: #ffffff;
    border-bottom: 2px solid #dd2e30;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  }
  nav .nav-links a { color: #273163; }
  nav .nav-links a:hover { color: #334bb7; }
  .hamburger span { background: #273163; }
  .nav-greeting { color: #273163; }
  .btn-signout { background: transparent; color: #273163; border-color: #273163; }
  .btn-signout:hover { background: #273163; color: #ffffff; }

  .verify-banner { background: #ffffff; color: #273163; border-bottom: 1px solid rgba(0,0,0,0.08); }

  .analytics-view { background: #f7f7f5; color: #273163; }
  .analytics-title { color: #273163; }
  .analytics-title em { color: #334bb7; }
  .analytics-intro { color: #555; }
  .section-label { color: #334bb7; }

  .preview-explainer p, .preview-features li { color: #273163; }
  .preview-explainer p.muted, .sample-label { color: #777; }
  .sample-frame { background: #ffffff; border: 1px solid rgba(0,0,0,0.1); box-shadow: 0 4px 24px rgba(0,0,0,0.06); }
  .sample-frame .results-table th,
  .sample-frame .results-table td { border-color: rgba(0,0,0,0.06); }
  .sample-veil {
    background: linear-gradient(to top, rgba(255,255,255,0.95), rgba(255,255,255,0.8) 60%, rgba(255,255,255,0.6));
  }
  .veil-title { color: #334bb7; }
  .veil-sub { color: #555; }

  .pricing-section { border-top: 1px solid rgba(0,0,0,0.08); }
  .pricing-title { color: #273163; }
  .tier { background: #ffffff; border: 1px solid rgba(0,0,0,0.1); }
  .tier:hover { border-color: #334bb7; box-shadow: 0 4px 24px rgba(51,75,183,0.12); }
  .tier-name { color: #334bb7; }
  .tier-price .amount { color: #273163; }
  .tier-price .cadence { color: #777; }
  .tier-tagline { color: #555; }
  .tier-features li { color: #444; }
  .tier-features li strong { color: #334bb7; }

  .quota-badge { border-color: rgba(0,0,0,0.15); color: #555; }
  .quota-badge.exhausted { border-color: #dd2e30; color: #dd2e30; }

  .picks-grid input { background: #ffffff; border: 1px solid rgba(0,0,0,0.15); color: #273163; }
  .picks-grid input:focus { outline: 2px solid #334bb7; }
  .picks-grid input.invalid { border-color: #dd2e30; }
  input[type="text"], input[type="email"], input[type="tel"], input[type="password"], textarea {
    background: #ffffff; border: 1px solid rgba(0,0,0,0.15); color: #273163;
  }
  label, .radio-group label { color: #555; }
  .picks-loading { color: #555; }

  .btn { background: #273163; color: #ffffff; border: none; }
  .btn:hover { background: #334bb7; color: #ffffff; }
  .btn-secondary { background: transparent; color: #273163; border: 1px solid #273163; }
  .btn-secondary:hover { background: #273163; color: #ffffff; }
  .form-actions .btn-secondary { border-color: #273163; }

  .subscribe-cta { background: #273163; color: #ffffff; }
  .subscribe-cta:hover { background: #334bb7; }

  .results-stats-banner {
    background: linear-gradient(135deg, rgba(51,75,183,0.06), rgba(51,75,183,0.02));
    border: 1px solid rgba(51,75,183,0.2);
    border-top: 3px solid #334bb7;
  }
  .results-stats-label { color: #334bb7; }
  .matches-stat-num { color: #273163; }
  .matches-stat-label { color: #555; }
  .matches-cap-note { color: #777; }

  .results-tabbed { background: #ffffff; border: 1px solid rgba(0,0,0,0.1); }
  .results-tabs { border-bottom: 1px solid rgba(0,0,0,0.08); }
  .results-tab { color: #777; }
  .results-tab:hover { color: #273163; }
  .results-tab.active { color: #334bb7; }
  .results-tab.active::after { background: #334bb7; }

  .results-table thead th { background: #334bb7; color: #ffffff; }
  .analytics-table-card--next .results-table thead th { background: #44acbc; color: #ffffff; }
  .results-table tbody th { background: rgba(0,0,0,0.02); }
  .results-table tbody tr:hover { background: rgba(51,75,183,0.05); }
  .results-table th, .results-table td { border-color: rgba(0,0,0,0.08); }

  .analytics-table-card { background: #ffffff; border: 1px solid rgba(0,0,0,0.08); }
  .atc-header { background: rgba(0,0,0,0.01); border-bottom: 1px solid rgba(0,0,0,0.05); }
  .analytics-table-card--same .atc-header { background: linear-gradient(90deg, rgba(51,75,183,0.04), transparent); }
  .analytics-table-card--next .atc-header { background: linear-gradient(90deg, rgba(51,75,183,0.03), transparent); }
  .analytics-table-card--archive .atc-header { background: linear-gradient(90deg, rgba(51,75,183,0.04), transparent); }
  .atc-title { color: #273163; }
  .analytics-table-card--same .atc-title { color: #334bb7; }
  .analytics-table-card--next .atc-title { color: #334bb7; }
  .analytics-table-card--archive .atc-title { color: #334bb7; }
  .atc-sub { color: #777; }
  .analytics-table-card--archive .atc-sub { color: #777; }
  .atc-icon { border: 1px solid rgba(0,0,0,0.1); }
  .analytics-table-card--same .atc-icon { background: rgba(51,75,183,0.06); color: #334bb7; }
  .analytics-table-card--next .atc-icon { background: rgba(51,75,183,0.06); color: #334bb7; }
  .analytics-table-card--archive .atc-icon { background: rgba(51,75,183,0.06); color: #334bb7; border-color: rgba(51,75,183,0.2); }
  .analytics-table-card--same { border-left: 3px solid #334bb7; }
  .analytics-table-card--next { border-left: 3px solid #44acbc; }
  .analytics-table-card--archive { border-left: 3px solid #334bb7; }
  .analytics-table-card--archive .atc-title { color: #334bb7; }
  .analytics-table-card--archive .atc-icon { color: #334bb7; }

  .matches-table-wrap { border: 1px solid rgba(0,0,0,0.1); background: #ffffff; }
  .matches-table thead th { background: #334bb7; color: #ffffff; }
  .matches-table tbody td { border-top: 1px solid rgba(0,0,0,0.05); }
  .matches-table tbody tr:hover { background: rgba(51,75,183,0.03); }
  .matches-table .col-draw { color: #273163; }
  .matches-table .col-drawn, .matches-table .col-next { color: #555; }
  .matches-table .hit { color: #334bb7; text-shadow: none; }
  .matches-empty { color: #777; }
  .matches-pager { border-top: 1px solid rgba(0,0,0,0.08); background: rgba(0,0,0,0.02); }
  .pager-btn { border: 1px solid rgba(0,0,0,0.15); color: #555; }
  .pager-btn:hover:not(:disabled) { background: rgba(51,75,183,0.06); border-color: #334bb7; color: #334bb7; }
  .pager-status { color: #777; }
  .analytics-table-card--archive .matches-table thead th { background: #334bb7; color: #ffffff; }

  #historyPanel { background: #ffffff; border: 1px solid rgba(0,0,0,0.08); border-left: 3px solid #44acbc; }
  .history-heading { color: #273163; border-bottom: 1px solid rgba(0,0,0,0.06); }

  .history-scroll-btn { color: #44acbc; }
  .history-scroll-btn--left { background: linear-gradient(to right, #f7f7f5, transparent); }
  .history-scroll-btn--right { background: linear-gradient(to left, #f7f7f5, transparent); }
  .history-scroll-btn:hover { color: #273163; }
  .history-scroll-btn--left:hover { background: linear-gradient(to right, #f7f7f5, transparent); }
  .history-scroll-btn--right:hover { background: linear-gradient(to left, #f7f7f5, transparent); }

  .history-pill { background: #f7f7f5; border: 1px solid rgba(0,0,0,0.08); color: #273163; }
  .history-pill:hover { border-color: #44acbc; background: #f0fafb; }
  .history-pill::before { background: #44acbc; opacity: 0.4; }
  .pill-picks { color: #273163; }
  .pill-date { color: #777; }
  .pill-matches { color: #273163; }
  .pill-matches.low { color: #777; }
  .pill-matches.mid { color: #334bb7; }
  .pill-matches.high { color: #273163; }
  .pill-label, .pill-suffix { color: rgba(0,0,0,0.35); }
  .history-empty { color: rgba(0,0,0,0.25); }

  #historyLoadMore { border: 1px solid rgba(0,0,0,0.1); background: transparent; color: #555; }
  #historyLoadMore:hover { border-color: #44acbc; background: rgba(68,172,188,0.06); color: #44acbc; }

  .search-card { background: #ffffff; border: 1px solid rgba(0,0,0,0.08); border-left: 3px solid #44acbc; }
  .search-heading { color: #334bb7; border-bottom: 1px solid rgba(0,0,0,0.06); }

  /* ─── HOME PAGE LIGHT MODE ─── */
  .hero { background: #f7f7f5; }
  .hero::before { background: radial-gradient(ellipse 60% 50% at 70% 50%, rgba(51,75,183,0.04) 0%, transparent 70%), radial-gradient(ellipse 40% 60% at 20% 80%, rgba(0,0,0,0.02) 0%, transparent 60%); }
  .hero-text h1 { color: #273163; }
  .hero-text h1 em { color: #334bb7; }
  .hero-text h2 { color: #555; }
  .hero-text h3 { color: #777; }
  .hero-image img { box-shadow: 0 20px 60px rgba(0,0,0,0.1); }

  .canadian-badge { background: #f7f7f5; border-bottom-color: rgba(0,0,0,0.12); }
  .canadian-proudly { color: #273163; }
  .canadian-word { color: #dd2e30; }
  .canadian-tagline { color: #777; }

  h2.section-title.light { color: #273163; }

  .what-is-keno { background: #f7f7f5; border-top-color: rgba(0,0,0,0.12); }
  .keno-text p { color: #555; }
  .luck-box { background: #ffffff; border: 1px solid rgba(0,0,0,0.1); }
  .luck-box h3 { color: #334bb7; }
  .luck-box p { color: #555; }

  .form-card { background: #ffffff; border-color: rgba(0,0,0,0.1); }
  .form-card h3 { color: #334bb7; }

  .newsletter-bar { background: #f7f7f5; border-top-color: rgba(0,0,0,0.12); border-bottom-color: rgba(0,0,0,0.12); }
  .newsletter-inner h3 { color: #273163; }
  .newsletter-inner p { color: #555; }

  .data-section { background: #f7f7f5; border-top-color: rgba(0,0,0,0.12); }
  .data-section > .container > p { color: #555; }
  .stat-number { color: #273163; }

  .founder { background: #f7f7f5; color: #273163; border-top-color: rgba(0,0,0,0.12); }
  .founder-bio h3 { color: #273163; }
  .founder-bio .title { color: #334bb7; }
  .founder-story p { color: #555; }
  .founder-story h3 { color: #334bb7; }
  .quote-mark { color: rgba(0,0,0,0.06); }

  .faq { background: #f7f7f5; border-top-color: rgba(0,0,0,0.12); }
  .faq-question { color: #273163; }
  .faq-question:hover { color: #334bb7; }
  .faq-item { border-bottom-color: rgba(0,0,0,0.1); }
  .faq-answer-inner { color: #555; }
  .faq-answer-inner strong { color: #334bb7; }

  footer { background: #f7f7f5; border-top-color: rgba(0,0,0,0.12); }
  .footer-col a, .footer-col p { color: #555; }
  .footer-col a:hover { color: #334bb7; }
  .footer-col h4 { color: #334bb7; }
  .footer-bottom { border-top-color: rgba(0,0,0,0.1); }
  .footer-bottom p { color: #777; }
  .footer-bottom a { color: rgba(51,75,183,0.6); }
  .footer-bottom a:hover { color: #334bb7; }
}
