:root {
  --bg: #06091a;
  --bg-2: #0b1128;
  --panel: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9edfb;
  --muted: #93a0c0;
  --muted-dim: #6b779a;
  --blue: #5b82e0;
  --hot: #ff7a6b;
  --cold: #58c9ff;
  --due: #b48cff;
  --chart-grid: rgba(255, 255, 255, 0.07);
  --chart-bar: #2f4a99;
  --chart-bar-top: #5b82e0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI",
    system-ui, sans-serif;
}

/* Accent follows the game: Mega Millions gold, Powerball red. */
body,
[data-game="home"],
[data-game="megamillions"] {
  --accent: #ffc233;
  --accent-deep: #ff9d1c;
  --accent-ink: #241a02;
  --accent-glow: rgba(255, 160, 30, 0.4);
}

[data-game="powerball"] {
  --accent: #ff5566;
  --accent-deep: #dc2440;
  --accent-ink: #ffffff;
  --accent-glow: rgba(220, 40, 64, 0.45);
}

* {
  box-sizing: border-box;
}

/* `.home`/`.layout` set display, which would otherwise defeat [hidden]. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(91, 130, 224, 0.28), transparent 62%),
    radial-gradient(900px 520px at 88% 4%, var(--accent-glow), transparent 62%),
    radial-gradient(800px 700px at 50% 108%, rgba(126, 87, 255, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 55%);
  transition: background 0.4s ease;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.03em;
  font-weight: 700;
}

a {
  color: var(--blue);
}

/* ---------------- top bar ---------------- */

.topbar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 26px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 50px;
  height: 50px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: var(--accent-ink);
  background: radial-gradient(circle at 32% 28%, #fff6, var(--accent) 42%, var(--accent-deep));
  box-shadow: 0 8px 26px var(--accent-glow), inset 0 -3px 8px rgba(0, 0, 0, 0.3);
}

.brand-text {
  display: grid;
}

.brand-name {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.nav a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 15px;
  border-radius: 999px;
  transition: all 0.16s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav a.is-on {
  color: var(--text);
  background: rgba(255, 255, 255, 0.11);
}

/* ---------------- panels ---------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.panel h2 {
  font-size: 17px;
}

/* ---------------- home ---------------- */

.hero {
  max-width: 820px;
  padding: 14px 2px 0;
}

.hero__eyebrow {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.hero h1 {
  font-size: 38px;
  line-height: 1.1;
  margin: 6px 0 10px;
}

.hero__lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.hero__note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--muted-dim);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 16px 0 0;
}

.hero-ctas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 4px;
  max-width: 640px;
}

.hero-cta {
  display: grid;
  place-items: center;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-align: center;
  text-decoration: none;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: 0 12px 28px var(--accent-glow);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.latest-strip {
  display: grid;
  gap: 14px;
}

.latest-strip__head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 68ch;
}

.latest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.latest-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  background:
    radial-gradient(120% 80% at 100% 0%, var(--accent-glow), transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
}

.latest-card__head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.latest-card__mark {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--accent-ink);
  background: radial-gradient(circle at 32% 28%, #fff8, var(--accent) 45%, var(--accent-deep));
  box-shadow: 0 6px 20px var(--accent-glow);
}

.latest-card__kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}

.latest-card__head h2 {
  margin: 2px 0 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.latest-card__head p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.balls--xl {
  gap: 10px;
  justify-content: flex-start;
  padding: 16px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line);
}

.balls--xl .ball {
  width: 56px;
  height: 56px;
  font-size: 21px;
}

.latest-card__next {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.latest-card__btn {
  display: grid;
  place-items: center;
  margin-top: auto;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: 0 10px 24px var(--accent-glow);
}

.latest-card__btn:hover {
  filter: brightness(1.06);
}

.game-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-glow);
}

.game-card__head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.game-card__mark {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--accent-ink);
  background: radial-gradient(circle at 32% 28%, #fff8, var(--accent) 45%, var(--accent-deep));
  box-shadow: 0 6px 20px var(--accent-glow);
}

.game-card__head h3 {
  font-size: 20px;
}

.game-card__head p {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.game-card__draw {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
}

.game-card__label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin-bottom: 10px;
}

.game-card__facts {
  margin: 0;
  display: grid;
  gap: 10px;
}

.game-card__facts > div {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.game-card__facts > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.game-card__facts dt {
  color: var(--muted-dim);
  flex: none;
}

.game-card__facts dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.game-card__cta {
  margin-top: auto;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.game-card:hover .game-card__cta span {
  display: inline-block;
  transform: translateX(3px);
  transition: transform 0.18s ease;
}

.recent-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: baseline;
  margin-bottom: 16px;
}

.recent-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted-dim);
  max-width: 68ch;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 18px;
}

.recent-col {
  display: grid;
  gap: 7px;
  align-content: start;
}

.recent-col__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 6px;
}

.recent-col__mark {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 11.5px;
  color: var(--accent-ink);
  background: radial-gradient(circle at 32% 28%, #fff8, var(--accent) 45%, var(--accent-deep));
}

.recent-col__head h3 {
  font-size: 15px;
}

.recent-col__head p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted-dim);
}

.recent-col__link {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

/* ---------------- page + game layout ---------------- */

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 8px 26px 40px;
  display: grid;
  gap: 20px;
  align-content: start;
}

/* Reading pages get a single narrow column; the generator keeps its sidebar. */
body[data-view="page"] main {
  max-width: 880px;
}

body[data-view="game"] main {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}

body[data-view="game"] main > * {
  grid-column: 1;
}

.panel--settings {
  grid-column: 2 !important;
  grid-row: 1 / span 2;
  position: sticky;
  top: 18px;
}

/* ---------------- generator ---------------- */

.gen-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.gen-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 60ch;
}

.cta {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
  padding: 14px 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(135deg, #fff6, var(--accent) 40%, var(--accent-deep));
  box-shadow: 0 10px 30px var(--accent-glow);
  transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px var(--accent-glow);
}

.cta:active {
  transform: translateY(0) scale(0.985);
}

.cta:disabled {
  filter: saturate(0.4) brightness(0.75);
  cursor: progress;
  transform: none;
}

.games {
  display: grid;
  gap: 12px;
  padding: 18px 0 4px;
}

.empty-state {
  text-align: center;
  padding: 30px 16px 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.empty-state p {
  margin: 0 0 6px;
  font-size: 15px;
}

.empty-state span {
  color: var(--muted-dim);
  font-size: 12.5px;
  display: block;
  max-width: 520px;
  margin: 0 auto;
}

.empty-state__balls {
  display: flex;
  gap: 9px;
  justify-content: center;
  margin-bottom: 16px;
}

.empty-state__balls span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  animation: bob 2.4s ease-in-out infinite;
}

.empty-state__balls span:nth-child(2) {
  animation-delay: 0.15s;
}
.empty-state__balls span:nth-child(3) {
  animation-delay: 0.3s;
}
.empty-state__balls span:nth-child(4) {
  animation-delay: 0.45s;
}
.empty-state__balls span:nth-child(5) {
  animation-delay: 0.6s;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.game {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  animation: rise 0.42s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.game__no {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-dim);
  text-align: center;
  border-right: 1px solid var(--line);
  padding-right: 8px;
}

.game__main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.balls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ball {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #101728;
  background: radial-gradient(circle at 34% 26%, #ffffff, #e3e9f7 58%, #b9c4dc);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.38), inset 0 -3px 6px rgba(80, 95, 130, 0.35);
  position: relative;
  cursor: default;
  animation: pop 0.34s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.4) translateY(6px);
  }
}

.ball--special {
  color: var(--accent-ink);
  background: radial-gradient(circle at 34% 26%, #fff9, var(--accent) 50%, var(--accent-deep));
  box-shadow: 0 6px 18px var(--accent-glow), inset 0 -3px 6px rgba(0, 0, 0, 0.32);
}

.ball--hot::after,
.ball--cold::after,
.ball--due::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.6;
}

.ball--hot::after {
  color: var(--hot);
}
.ball--cold::after {
  color: var(--cold);
}
.ball--due::after {
  color: var(--due);
}

.balls__plus {
  color: var(--muted-dim);
  font-weight: 700;
  padding: 0 2px;
}

.ball-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 2px 0 14px;
  font-size: 11.5px;
  color: var(--muted-dim);
}

.ball-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ball-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.ball-legend .dot--hot {
  color: var(--hot);
}
.ball-legend .dot--cold {
  color: var(--cold);
}
.ball-legend .dot--due {
  color: var(--due);
}

.ball-legend__hint {
  margin-left: auto;
  opacity: 0.8;
}

.game__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--muted);
}

.game__facts b {
  color: var(--text);
  font-weight: 600;
}

.game__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.score {
  text-align: center;
  min-width: 68px;
}

.score__value {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.score__label {
  font-size: 10px;
  color: var(--muted-dim);
  letter-spacing: 0.04em;
}

.score--high .score__value {
  color: var(--accent);
}
.score--mid .score__value {
  color: var(--blue);
}
.score--low .score__value {
  color: var(--muted);
}

.btn {
  appearance: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn--full {
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.gen-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.gen-foot__meta {
  font-size: 12px;
  color: var(--muted-dim);
  min-height: 18px;
}

/* ---------------- settings ---------------- */

.field {
  margin-top: 18px;
}

.field label,
.field__label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}

.field__hint {
  margin: 7px 0 0;
  font-size: 11.5px;
  color: var(--muted-dim);
  line-height: 1.45;
}

.field__hint--src {
  opacity: 0.75;
}

select {
  width: 100%;
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: rgba(9, 14, 32, 0.85);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 34px 10px 12px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 18px, calc(100% - 14px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

select:focus-visible,
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  appearance: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.chip.is-on {
  color: var(--accent-ink);
  background: linear-gradient(135deg, #fff6, var(--accent));
  border-color: transparent;
}

.sliders {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.slider__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.slider__top label {
  margin-bottom: 4px;
  font-size: 12.5px;
}

.slider__top small {
  color: var(--muted-dim);
  font-weight: 500;
}

.slider__top output {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 700;
}

.slider__ends {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted-dim);
  margin-top: 2px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cold), rgba(255, 255, 255, 0.16) 50%, var(--accent));
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cold), rgba(255, 255, 255, 0.16) 50%, var(--accent));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent-deep);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent-deep);
}

.field--toggles {
  display: grid;
  gap: 12px;
}

/* `label.switch` (not just `.switch`) so it beats the generic `.field label` rule. */
label.switch {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 0;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__box {
  flex: none;
  width: 36px;
  height: 20px;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background 0.18s ease;
}

.switch__box::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d7deef;
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + .switch__box {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: transparent;
}

.switch input:checked + .switch__box::after {
  transform: translateX(16px);
  background: #fff;
}

.switch input:focus-visible + .switch__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch__text {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}

.switch__text small {
  display: block;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--muted-dim);
  margin-top: 2px;
}

.field--data {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------------- statistics ---------------- */

.stats-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.tab {
  appearance: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-on {
  color: var(--text);
  background: rgba(255, 255, 255, 0.11);
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 8px;
  margin: 16px 0 6px;
}

.summary__item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
}

.summary__label {
  display: block;
  font-size: 11px;
  color: var(--muted-dim);
}

.summary__value {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.summary__value small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.tab-panel {
  display: none;
  padding-top: 8px;
}

.tab-panel.is-on {
  display: block;
}

.chart-caption {
  margin: 6px 0 12px;
  font-size: 12px;
  color: var(--muted);
  max-width: 90ch;
}

.hl {
  color: var(--accent);
}

.chart-box {
  position: relative;
  height: 260px;
}

.chart-box--short {
  height: 210px;
}

.chart-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-tip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  background: rgba(6, 9, 26, 0.95);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 11.5px;
  line-height: 1.45;
  white-space: nowrap;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.chart-tip.is-on {
  opacity: 1;
  transform: translateY(0);
}

.sum-legend {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
}

.cell {
  border-radius: 9px;
  border: 1px solid var(--line);
  padding: 7px 2px 5px;
  text-align: center;
  cursor: default;
}

.cell__n {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: block;
  line-height: 1.1;
}

.cell__gap {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
}

.cell.is-picked {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 14px var(--accent-glow);
}

.grid-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted-dim);
}

.grid-legend__scale {
  width: 120px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(45, 62, 130, 0.35),
    rgba(92, 98, 192, 0.45) 35%,
    rgba(150, 92, 180, 0.5) 60%,
    rgba(226, 112, 100, 0.6) 82%,
    rgba(255, 194, 51, 0.78)
  );
}

.grid-legend__spacer {
  flex: 1;
}

.recent {
  display: grid;
  gap: 7px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 4px;
}

.draw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  flex-wrap: wrap;
}

.draw-row__date {
  font-size: 12px;
  color: var(--muted);
  min-width: 92px;
  font-variant-numeric: tabular-nums;
}

.draw-row .ball {
  width: 33px;
  height: 33px;
  font-size: 13px;
  animation: none;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.3), inset 0 -2px 4px rgba(80, 95, 130, 0.3);
}

.draw-row .ball--special {
  box-shadow: 0 3px 12px var(--accent-glow), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.draw-row__sum {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted-dim);
  font-variant-numeric: tabular-nums;
}

/* ---------------- editorial content ---------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 40;
  background: var(--bg-2);
  color: var(--text);
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

.section {
  padding: 6px 2px;
}

.section__title {
  font-size: 21px;
}

.section__lead,
.section__after {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 88ch;
}

.section .guide-cards,
.section .game-cards {
  margin-top: 16px;
}

.panel--flat {
  box-shadow: none;
}

.text-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.text-link:hover {
  border-bottom-color: var(--accent);
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.guide-card {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.guide-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.guide-card__kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.guide-card h3 {
  font-size: 16.5px;
  line-height: 1.3;
}

.guide-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.guide-card__more {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted-dim);
}

.guide-card:hover .guide-card__more {
  color: var(--text);
}

/* prose */

.prose--article,
.prose--page {
  padding: 30px 34px 34px;
}

.prose h1 {
  font-size: 33px;
  line-height: 1.15;
  margin: 4px 0 0;
}

.prose h2 {
  font-size: 21px;
  margin: 34px 0 0;
  padding-top: 4px;
}

.prose h3 {
  font-size: 16.5px;
  margin: 24px 0 0;
  color: #f4f6ff;
}

.prose p,
.prose li {
  color: #cdd5ec;
  font-size: 15px;
  line-height: 1.72;
}

.prose p {
  margin: 12px 0 0;
}

.prose ul,
.prose ol {
  margin: 12px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 9px;
}

.prose b,
.prose strong {
  color: #fff;
}

.prose em {
  color: #e6ebff;
}

.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.prose a:hover {
  border-bottom-color: var(--accent);
}

.prose code {
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}

.lede {
  font-size: 17px !important;
  line-height: 1.62 !important;
  color: #e2e8fb !important;
}

.page-kicker {
  margin: 0 !important;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent) !important;
}

.article-head {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.article-dek {
  font-size: 16px !important;
  color: var(--muted) !important;
  max-width: 72ch;
}

.article-meta {
  margin-top: 14px !important;
  font-size: 12.5px !important;
  color: var(--muted-dim) !important;
}

.formula {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  font-size: 14px;
  color: #dfe6ff;
  overflow-x: auto;
  font-variant-numeric: tabular-nums;
}

.note {
  font-size: 13px !important;
  color: var(--muted-dim) !important;
}

.contact-line {
  font-size: 16px !important;
}

.callout {
  margin: 22px 0 0;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.callout h3 {
  margin: 0 0 2px;
  font-size: 14.5px;
}

.callout--warn {
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.callout p:first-of-type {
  margin-top: 6px;
}

/* tables */

.table-wrap {
  margin: 18px 0 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

caption {
  caption-side: bottom;
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  color: var(--muted-dim);
  border-top: 1px solid var(--line);
}

thead th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #d3dbf1;
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

td b,
td small {
  color: #fff;
}

td small {
  color: var(--muted-dim);
  font-size: 11.5px;
}

.table--compare tbody td:first-child {
  color: var(--muted);
  width: 34%;
}

/* article furniture */

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 2px;
  font-size: 12.5px;
  color: var(--muted-dim);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text);
}

.article-foot {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.disclaimer-text {
  font-size: 13px !important;
  color: var(--muted) !important;
  line-height: 1.6 !important;
}

.article-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.article-nav__side {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  color: inherit;
}

.article-nav__side:hover {
  border-color: var(--line-strong);
}

.article-nav__side span {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.article-nav__side b {
  font-size: 14.5px;
  line-height: 1.35;
}

.article-nav__side--next {
  text-align: right;
}

/* generator page extras */

.next-draw {
  margin: 6px 0 0 !important;
  font-size: 13px;
  color: var(--muted);
}

.next-draw b {
  color: var(--accent);
}

.inline-disclaimer {
  margin: 18px 0 0;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  font-size: 12.5px;
  line-height: 1.6;
  color: #eef1fb;
}

.panel--reference h2 {
  margin-top: 0;
}

.panel--disclaimer {
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
}

.panel--disclaimer h2 {
  font-size: 17px;
}

.panel--disclaimer p {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 92ch;
}

.reference__cross {
  margin-top: 20px !important;
}

.hero--slim h1 {
  font-size: 34px;
  margin: 6px 0 0;
}

.faq-list {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  padding: 0 16px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 650;
  padding: 14px 0;
  color: var(--text);
}

.faq-item__body {
  padding: 0 0 14px;
}

.faq-item__body p:first-child {
  margin-top: 0;
}

.glossary {
  margin: 18px 0 0;
  display: grid;
  gap: 0;
}

.glossary__row {
  display: grid;
  grid-template-columns: minmax(120px, 28%) minmax(0, 1fr);
  gap: 12px 20px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.glossary dt {
  font-weight: 700;
  color: #fff;
}

.glossary dd {
  margin: 0;
  color: #cdd5ec;
}

.sources {
  margin-top: 28px;
  padding-top: 8px;
}

.sources ul {
  margin: 10px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.draw-cell {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.ball--sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.draw-highlight {
  margin: 12px 0 0;
}

.table--results td:nth-child(2) {
  white-space: nowrap;
}

.ad-slot {
  min-height: 1px;
  margin: 4px 0;
  overflow: hidden;
}

/* ---------------- footer / toast ---------------- */

.footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 26px 46px;
  color: var(--muted-dim);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

.footer__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 40px;
  align-items: start;
  padding-bottom: 16px;
}

.footer__cols h2 {
  font-size: 15px;
  color: var(--text);
}

.footer__cols p {
  margin: 5px 0 0;
  max-width: 62ch;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer__links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 12.5px;
}

.footer__links a:hover {
  color: var(--text);
}

.footer p {
  margin: 10px 0 0;
  line-height: 1.65;
}

.footer__disclaimer {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
}

.footer__disclaimer strong {
  color: var(--text);
}

.footer__warn {
  opacity: 0.85;
}

.footer__meta {
  opacity: 0.7;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: rgba(6, 9, 26, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- responsive ---------------- */

@media (max-width: 1080px) {
  body[data-view="game"] main {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel--settings {
    grid-column: 1 !important;
    grid-row: auto;
    position: static;
  }

  .hero h1,
  .hero--slim h1 {
    font-size: 32px;
  }

  .footer__cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .topbar,
  main,
  .footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .panel,
  .game-card,
  .latest-card {
    padding: 16px;
  }

  .prose--article,
  .prose--page {
    padding: 20px 16px 24px;
  }

  .prose h1 {
    font-size: 26px;
  }

  .prose h2 {
    font-size: 19px;
  }

  .prose p,
  .prose li {
    font-size: 14.5px;
  }

  .article-nav__side--next {
    text-align: left;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero h1,
  .hero--slim h1 {
    font-size: 27px;
  }

  .glossary__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .table--results td:nth-child(2) {
    white-space: normal;
  }

  .cta {
    width: 100%;
    justify-content: center;
  }

  .game {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .game__no {
    display: none;
  }

  .hero-ctas {
    grid-template-columns: 1fr;
  }

  .balls--xl .ball {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .ball {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .draw-row .ball {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .number-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .chart-box {
    height: 220px;
  }

  .game-card__facts > div {
    flex-direction: column;
    gap: 2px;
  }

  .game-card__facts dd {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
