/* =========================================================
   Lottery AI tool — landing page
   Theme is driven by CSS variables set in js/app.js (CONFIG).
   ========================================================= */

:root {
  /* Defaults (pastel). app.js overrides these per styleVariant + accent. */
  --accent: #6c4fd6;
  --page-bg: linear-gradient(165deg, #d6eff4 0%, #e0e2f8 52%, #ead9f5 100%);
  --pattern: none;
  --pattern-size: auto;
  --blob-a: #bfe6ec;
  --blob-b: #d7c6f2;
  --cta-gradient: linear-gradient(135deg, #6c4fd6 0%, #6c4fd6cc 60%, #6c4fd699 100%);

  --ink: #41355a;        /* headings */
  --ink-soft: #5d5170;   /* body on light */
  --ink-muted: #6d6184;
  --ink-faint: #9a8fb0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #3a2f4d;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
::selection { background: #cdb8f0; color: #3a2f4d; }

@keyframes floaty   { 0%,100%{ transform: translateY(0) rotate(var(--r,0deg)); } 50%{ transform: translateY(-14px) rotate(var(--r,0deg)); } }
@keyframes floatyB  { 0%,100%{ transform: translateY(0) rotate(var(--r,0deg)); } 50%{ transform: translateY(-22px) rotate(var(--r,0deg)); } }
@keyframes twinkle  { 0%,100%{ transform: scale(1); opacity:.85; } 50%{ transform: scale(1.18); opacity:1; } }

/* ---- page shell ---- */
.page {
  position: relative;
  overflow-x: hidden;
  background: var(--page-bg);
  color: #3a2f4d;
}
.bg-pattern {
  position: absolute; inset: 0;
  background-image: var(--pattern);
  background-size: var(--pattern-size);
  pointer-events: none;
  z-index: 0;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(15px);
  pointer-events: none;
  z-index: 0;
}
.blob--a { background: var(--blob-a); opacity: .55; }
.blob--b { background: var(--blob-b); opacity: .5; }

/* ---- shared bits ---- */
.eyebrow {
  font-weight: 800; font-size: 14px; letter-spacing: .08em;
  color: var(--accent); margin-bottom: 8px;
}
.btn-accent {
  display: inline-flex; align-items: center; height: 44px; padding: 0 22px;
  border-radius: 50px; background: var(--accent); color: #fff;
  font-weight: 800; font-size: 15px;
  box-shadow: 0 8px 18px rgba(74,58,92,.28);
}

/* floating lotto balls + twinkles */
.floaty  { position: absolute; animation: floaty 5.2s ease-in-out infinite; z-index: 3; }
.floaty--b { animation: floatyB 5.6s ease-in-out infinite; }
.twinkle { position: absolute; animation: twinkle 3.2s ease-in-out infinite; z-index: 3; }

.lotto-ball {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.lotto-ball__inner {
  border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka', sans-serif; font-weight: 700; color: #41355a;
}

/* ===== NAV ===== */
.nav {
  position: relative; z-index: 20;
  max-width: 1200px; margin: 0 auto; padding: 22px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__icon {
  width: 46px; height: 46px; border-radius: 11px; display: block;
  box-shadow: 0 4px 10px rgba(74,58,92,.18);
}
.brand__name {
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 22px;
  letter-spacing: -.01em; color: #473a5c;
}
.nav__right { display: flex; align-items: center; gap: 30px; }
.nav__links { display: flex; gap: 26px; font-weight: 700; font-size: 15px; color: #5d5170; }
.nav__links a:hover { color: var(--accent); }

/* ===== HERO ===== */
.hero {
  position: relative; z-index: 10;
  max-width: 1200px; margin: 0 auto; padding: 36px 28px 70px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center;
}
.pill-badge {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border-radius: 50px; background: rgba(255,255,255,.7);
  border: 1px solid rgba(108,79,214,.18);
  font-weight: 800; font-size: 13px; letter-spacing: .02em; color: var(--accent);
  margin-bottom: 22px;
}
.pill-badge__star { font-size: 15px; }
.hero__title {
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 58px;
  line-height: 1.04; letter-spacing: -.02em; color: var(--ink); margin: 0 0 20px;
}
.hero__lede {
  font-size: 19px; line-height: 1.55; color: var(--ink-soft); font-weight: 500;
  max-width: 480px; margin: 0 0 30px;
}
.hero__rating {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600; color: #7a6e8c;
}
.stars { display: inline-flex; gap: 2px; color: #f0a93a; font-size: 16px; }

.hero__media { position: relative; min-height: 480px; }
.hero__phone {
  position: relative; border-radius: 26px; overflow: hidden;
  box-shadow: 0 28px 60px rgba(74,58,92,.26);
}
.hero__phone img { width: 100%; display: block; }

/* store badges */
.store-badges { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.store-badges--center { justify-content: center; margin-bottom: 0; }
.store-badge {
  display: inline-flex; align-items: center; gap: 11px; height: 58px; padding: 0 22px;
  border-radius: 16px; background: #2c2536; color: #fff;
  box-shadow: 0 10px 22px rgba(44,37,54,.26);
}
.store-badge__icon { display: inline-block; }
.store-badge__text { display: flex; flex-direction: column; line-height: 1.05; }
.store-badge__text small { font-size: 11px; font-weight: 600; opacity: .85; }
.store-badge__text strong { font-size: 19px; font-weight: 700; font-family: 'Fredoka', sans-serif; }

/* ===== SECTIONS ===== */
.section {
  position: relative; z-index: 10;
  max-width: 1200px; margin: 0 auto; padding: 40px 28px 60px;
}
.section__head { text-align: center; margin-bottom: 38px; }
.section__title {
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 38px;
  color: var(--ink); margin: 0 0 10px;
}
.section__title--sm { font-size: 34px; margin: 0; }
.section__sub {
  font-size: 17px; color: var(--ink-muted); font-weight: 500;
  max-width: 540px; margin: 0 auto;
}

/* games strip */
#games { padding: 24px 28px 56px; }
#games .section__head { margin-bottom: 30px; }
.games-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.game-card {
  background: #fff; border-radius: 18px; padding: 22px 18px; text-align: center;
  box-shadow: 0 1px 2px rgba(74,58,92,.12), 0 10px 26px rgba(74,58,92,.07);
}
.game-card__badge {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 -6px 12px rgba(0,0,0,.08);
}
.game-card__initial {
  width: 30px; height: 30px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 13px;
}
.game-card__name {
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 16px;
  color: var(--ink); line-height: 1.15;
}
.game-card__tag { font-size: 12px; font-weight: 700; color: var(--ink-faint); margin-top: 5px; }

/* features */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card {
  background: #fff; border-radius: 20px; padding: 30px 26px;
  box-shadow: 0 1px 2px rgba(74,58,92,.12), 0 14px 30px rgba(74,58,92,.07);
}
.feature-card__icon {
  width: 58px; height: 58px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.feature-card__icon span { width: 30px; height: 30px; display: inline-block; }
.feature-card__title {
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 21px;
  color: var(--ink); margin-bottom: 9px;
}
.feature-card__body { font-size: 15.5px; line-height: 1.55; color: var(--ink-muted); font-weight: 500; }

/* results */
.draws-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.draw-card {
  background: #fff; border-radius: 22px; padding: 26px;
  box-shadow: 0 1px 2px rgba(74,58,92,.12), 0 16px 34px rgba(74,58,92,.08);
}
.draw-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.draw-card__game { display: flex; align-items: center; gap: 9px; }
.draw-card__dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.draw-card__name { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 18px; color: var(--ink); }
.draw-card__official {
  font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #3fb58e;
  background: #e6f7f0; padding: 4px 9px; border-radius: 50px;
}
.draw-card__date { font-size: 13px; font-weight: 700; color: var(--ink-faint); margin-bottom: 18px; }
.draw-card__balls { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.draw-card__plus { font-size: 18px; font-weight: 800; color: #cbb9e0; margin: 0 1px; }
.results-note { text-align: center; margin-top: 28px; font-size: 14px; font-weight: 600; color: var(--ink-faint); }

/* how it works */
.section--how { max-width: 1080px; padding: 50px 28px 64px; }
.how-card {
  background: #fff; border-radius: 28px; padding: 46px 40px;
  box-shadow: 0 1px 2px rgba(74,58,92,.12), 0 22px 50px rgba(74,58,92,.10);
}
.how-card__title {
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 32px;
  color: var(--ink); margin: 0 0 36px; text-align: center;
}
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.step { text-align: center; }
.step__num {
  width: 60px; height: 60px; border-radius: 50%;
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 26px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.step__title {
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 19px;
  color: var(--ink); margin-bottom: 8px;
}
.step__body { font-size: 15px; line-height: 1.5; color: var(--ink-muted); font-weight: 500; }

/* final CTA */
.section--cta { padding: 20px 28px 80px; }
.cta {
  position: relative; border-radius: 32px; padding: 58px 40px; text-align: center;
  background: var(--cta-gradient); box-shadow: 0 24px 56px rgba(74,58,92,.30); overflow: hidden;
}
.cta__inner { position: relative; z-index: 2; }
.cta__title {
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 42px;
  color: #fff; margin: 0 0 14px; letter-spacing: -.01em;
}
.cta__sub {
  font-size: 18px; color: rgba(255,255,255,.92); font-weight: 500;
  max-width: 520px; margin: 0 auto 30px;
}

/* footer */
.footer { position: relative; z-index: 10; background: #322a40; color: #cfc6dd; padding: 48px 28px 36px; }
.footer__inner { max-width: 1200px; margin: 0 auto; }
.footer__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.footer__icon { width: 42px; height: 42px; border-radius: 10px; display: block; }
.footer__name { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 20px; color: #fff; }
.footer__legal { max-width: 760px; font-size: 14px; line-height: 1.65; color: #a89cba; font-weight: 500; margin: 0 0 22px; }
.footer__bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px;
  font-size: 13px; font-weight: 600; color: #8d80a3;
}
.footer__links { display: flex; gap: 22px; }
.footer__links a:hover { color: #cfc6dd; }

/* ===== LIVE TWEAKS PANEL ===== */
.tweaks { position: fixed; right: 22px; bottom: 22px; z-index: 60; font-family: 'Nunito', sans-serif; }
.tweaks__toggle {
  position: absolute; right: 0; bottom: 0;
  width: 54px; height: 54px; border: none; border-radius: 50%; cursor: pointer;
  background: var(--accent); color: #fff;
  box-shadow: 0 10px 24px rgba(74,58,92,.34);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease;
}
.tweaks__toggle:active { transform: scale(.95); }
.tweaks__body {
  position: absolute; right: 0; bottom: 66px;
  width: 268px; padding: 18px 18px 20px;
  background: #fff; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(74,58,92,.18), 0 20px 46px rgba(74,58,92,.26);
  opacity: 0; transform: translateY(10px) scale(.98); transform-origin: bottom right;
  pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.tweaks--open .tweaks__body { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.tweaks__title {
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 18px;
  color: var(--ink); margin-bottom: 14px;
}
.tweaks__field { display: block; margin-bottom: 14px; }
.tweaks__field > span { display: block; font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--ink-faint); margin-bottom: 7px; text-transform: uppercase; }
.tweaks__field input[type="text"] {
  width: 100%; height: 38px; padding: 0 12px; font: inherit; font-weight: 600;
  color: var(--ink); border: 1px solid #e4def0; border-radius: 10px; background: #faf8fd;
}
.tweaks__field input[type="text"]:focus { outline: none; border-color: var(--accent); }
.tweaks__seg { display: flex; flex-wrap: wrap; gap: 6px; }
.tweaks__seg button {
  flex: 1 1 auto; min-width: 0; padding: 7px 10px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 700; color: #6d6184;
  background: #f4f1fa; border: 1px solid transparent; border-radius: 9px;
  white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.tweaks__seg button:hover { background: #ece6f7; }
.tweaks__seg button.is-active { background: var(--accent); color: #fff; }
.tweaks__color { display: flex; align-items: center; gap: 10px; }
.tweaks__color input[type="color"] {
  width: 46px; height: 38px; padding: 0; border: 1px solid #e4def0; border-radius: 10px;
  background: #fff; cursor: pointer;
}
.tweaks__reset {
  font: inherit; font-size: 12.5px; font-weight: 700; color: #6d6184; cursor: pointer;
  background: #f4f1fa; border: none; border-radius: 9px; padding: 8px 12px;
}
.tweaks__reset:hover { background: #ece6f7; }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .hero__title { font-size: 46px; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid, .draws-grid, .steps-grid { grid-template-columns: 1fr; }
  .nav__links { display: none; }
}
@media (max-width: 560px) {
  .hero__title { font-size: 38px; }
  .section__title { font-size: 30px; }
  .cta__title { font-size: 30px; }
  .games-grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; }
}
