:root {
  --gold: #f7c948;
  --ink: #15173d;
  --royal: #2a30c6;
  --violet: #5a21a8;
  --night: linear-gradient(90deg, var(--royal), var(--violet));
  --paper: #ffffff;
  --shell: #f3f3fb;
  --comb: #d62839;
  --muted: #566078;
  --line: #dfe0ef;
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: inherit; text-underline-offset: 0.18em; }
a:focus-visible, .button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 42rem; }

h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 7vw, 4.75rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
p + p { margin-top: 1em; }

/* Header */
.site-header { background: var(--night); color: #fff; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.25rem; text-decoration: none; letter-spacing: -0.02em; }
.site-nav { display: flex; gap: 1.25rem; font-weight: 600; font-size: 0.975rem; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* Hero */
.hero { background: var(--night); color: #fff; padding: 2.5rem 0 4rem; position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { max-width: 14ch; }
.hero .lede { font-size: 1.25rem; max-width: 34rem; margin-top: 1.5rem; color: var(--gold); font-weight: 600; }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.price-note { font-weight: 600; }

.button {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
}
.button:hover { background: #262a66; }
.hero .button { background: var(--gold); color: var(--ink); }
.hero .button:hover { background: #ffd968; }

/* Balls */
.draws { margin-top: 3rem; display: flex; flex-wrap: wrap; gap: 2rem 4rem; }
.page-head .draw { margin-top: 2.5rem; }
.draw-label { font-weight: 600; margin-bottom: 0.75rem; }
.balls { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; padding: 0; margin: 0; }
.ball {
  width: 3.5rem; height: 3.5rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 28%, #fff 0, #fff 30%, #dfe1f0 100%);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0.35rem 0.9rem rgba(10, 8, 60, 0.28);
}
.ball.red { background: radial-gradient(circle at 35% 28%, #ff6b74 0, var(--comb) 45%, #a8131f 100%); color: #fff; }

/* Sections */
.section { padding: 4rem 0; }
.section.tint { background: var(--shell); }
.section h2 + p { margin-top: 1rem; }
.section-intro { max-width: 40rem; color: var(--muted); }

.features { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 2rem 2.5rem; }
.features p { margin-top: 0.4rem; color: var(--muted); }

.stat-links { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 2px solid var(--ink); }
.stat-links li { border-bottom: 1px solid var(--line); }
.stat-links a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem; padding: 1.1rem 0; text-decoration: none; }
.stat-links a:hover strong { text-decoration: underline; }
.stat-links strong { font-family: var(--display); font-size: 1.25rem; }
.stat-links span { color: var(--muted); }

/* Frequency page */
.page-head { background: var(--night); color: #fff; padding: 2rem 0 3rem; }
.page-head h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); max-width: 16ch; }
.page-head .lede { margin-top: 1.25rem; max-width: 38rem; font-size: 1.15rem; }
.crumbs { font-size: 0.95rem; font-weight: 600; margin-bottom: 1.25rem; }

.heat { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr)); gap: 0.9rem 0.5rem; }
.heat li { text-align: center; }
.heat .ball { margin: 0 auto; box-shadow: none; }
.heat .count { display: block; margin-top: 0.3rem; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.heat.red-set .ball { border: 3px solid var(--comb); }

.scale { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.5rem; font-size: 0.9rem; color: var(--muted); }
.scale i { display: block; width: 9rem; height: 0.7rem; border-radius: 999px; background: linear-gradient(90deg, #e9eaf9, #1e1b6e); }

.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2.5rem; margin-top: 2.5rem; }
.rank { list-style: none; padding: 0; margin: 1rem 0 0; }
.rank li { display: flex; align-items: center; gap: 0.9rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.rank .ball { width: 2.5rem; height: 2.5rem; font-size: 1rem; box-shadow: none; border: 2px solid var(--ink); }
.rank .n { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }

.table-scroll { overflow-x: auto; margin-top: 2rem; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: 0.9rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--ink); }
tbody th { font-family: var(--display); font-weight: 800; }

.callout { background: var(--night); color: #fff; border-radius: 1.5rem; padding: 2.5rem; display: grid; gap: 1.25rem; justify-items: start; }
.callout p { max-width: 36rem; color: #e3e2f8; }
.callout .button { background: var(--gold); color: var(--ink); }
.callout .button:hover { background: #ffd968; }

.site-footer { background: var(--shell); padding: 2.5rem 0; font-size: 0.9rem; color: var(--muted); }
.site-footer p { max-width: 52rem; }

@media (max-width: 30rem) {
  .ball { width: 3rem; height: 3rem; font-size: 1.15rem; }
  .callout { padding: 1.75rem; border-radius: 1rem; }
  .site-nav { gap: 0.9rem; font-size: 0.9rem; }
}

.brand, .site-nav a { white-space: nowrap; }

.policy h2 { font-size: 1.5rem; margin-top: 2.5rem; }
.policy h2:first-child { margin-top: 0; }
.policy h2 + p { margin-top: 0.75rem; }

/* Screenshot strip */
.shots-section { padding-bottom: 3rem; }
.shots {
  list-style: none; margin: 2rem 0 0; padding: 0.25rem 0 1.25rem; display: flex; gap: 1.25rem;
  overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: #c3c5e3 transparent;
}
.shots li { flex: 0 0 auto; width: 14.5rem; scroll-snap-align: start; }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; height: auto; border-radius: 1.75rem; border: 1px solid var(--line); background: #111; }
.shots figcaption { margin-top: 0.75rem; font-weight: 600; font-size: 0.95rem; }
.shots:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
@media (max-width: 30rem) {
  .site-header .wrap { gap: 0.75rem; }
  .brand { font-size: 1.1rem; }
  .site-nav { gap: 0.75rem; font-size: 0.85rem; }
}

.ball.mega { background: radial-gradient(circle at 35% 28%, #fff1b8 0, var(--gold) 45%, #d99a12 100%); color: var(--ink); }

/* Dark header areas: light focus rings, and decorative lottery balls in the hero */
.site-header a:focus-visible, .hero a:focus-visible, .page-head a:focus-visible, .callout a:focus-visible { outline-color: #fff; }
.heat .ball, .rank .ball { background: #fff; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 24% 24% at 36% 32%, rgba(255,255,255,.95), rgba(255,255,255,0)) no-repeat right -4rem top -5rem / 17rem 17rem,
    radial-gradient(closest-side, #eef0fa 0, #eef0fa 55%, #a9adcf 99%, transparent 100%) no-repeat right -4rem top -5rem / 17rem 17rem,
    radial-gradient(ellipse 24% 24% at 36% 32%, rgba(255,255,255,.95), rgba(255,255,255,0)) no-repeat right 14rem top 6rem / 9rem 9rem,
    radial-gradient(closest-side, #e03a48 0, #e03a48 55%, #96101b 99%, transparent 100%) no-repeat right 14rem top 6rem / 9rem 9rem,
    radial-gradient(ellipse 24% 24% at 36% 32%, rgba(255,255,255,.95), rgba(255,255,255,0)) no-repeat right 2rem top 14rem / 11rem 11rem,
    radial-gradient(closest-side, #eef0fa 0, #eef0fa 55%, #a9adcf 99%, transparent 100%) no-repeat right 2rem top 14rem / 11rem 11rem;
}
@media (max-width: 60rem) { .hero::after { display: none; } }

/* Screenshot strip arrows and edge fades */
.shots-frame { position: relative; }
.shots-frame::before, .shots-frame::after {
  content: ""; position: absolute; top: 0; bottom: 1.25rem; width: 4.5rem; pointer-events: none; opacity: 0; transition: opacity 0.2s; z-index: 1;
}
.shots-frame::before { left: 0; background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0)); }
.shots-frame::after { right: 0; background: linear-gradient(270deg, #fff, rgba(255, 255, 255, 0)); }
.shots-frame.more-left::before, .shots-frame.more-right::after { opacity: 1; }
.shots-nav {
  position: absolute; top: calc(50% - 2.5rem); z-index: 2;
  width: 3rem; height: 3rem; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--ink); color: #fff; box-shadow: 0 0.4rem 1rem rgba(21, 23, 61, 0.3);
}
.shots-nav[hidden] { display: none; }
.shots-nav.prev { left: -1rem; }
.shots-nav.next { right: -1rem; }
.shots-nav:hover { background: var(--royal); }
.shots-nav:disabled { opacity: 0; pointer-events: none; }
.shots-nav:focus-visible { outline: 3px solid var(--royal); outline-offset: 3px; }
@media (hover: none), (max-width: 40rem) { .shots-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .shots-frame::before, .shots-frame::after { transition: none; } }

/* Official App Store badge: shown unmodified, at least 40px tall, with clear space around it */
.badge { display: inline-block; border-radius: 0.6rem; margin: 0.25rem 0; }
.badge img { display: block; height: 3.5rem; width: auto; }
.badge:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
