/* Fat Chance: site styles */
:root {
  --night: #15123A;
  --violet: #5B3DF5;
  --violet-dark: #3A22C9;
  --violet-mid: #9D8BFA;
  --violet-pale: #D9D1FD;
  --violet-tint: #ECE8FF;
  --coral: #E5294F;
  --coral-tint: #FFE3E9;
  --coral-ink: #6E1023;
  --yellow: #FFC531;
  --yellow-tint: #FFF4D6;
  --green: #14B86A;
  --green-tint: #E3FAEE;
  --green-ink: #0B5A33;
  --blue: #1F6BFF;
  --ink: #17142E;
  --muted: #4D4A66;
  --on-night: #C9C4EA;
  --on-night-2: #B9B4D9;
  --line: #E1DEF2;
  --line-soft: #EEECF7;
  --axis: #C9C4E0;
  --bg: #F4F3FF;
  --card: #FFFFFF;
  --head: 'Space Grotesk', Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--violet); }
a:hover { color: var(--violet-dark); }
h1, h2, h3 { font-family: var(--head); letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
p { margin: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header and menu */
.top { background: var(--night); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 16px; padding-bottom: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 21px; }
.logo:hover { color: #fff; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; font-weight: 500; }
.menu a { color: #E7E4FF; text-decoration: none; }
.menu a:hover { color: #fff; text-decoration: underline; }
.menu a.hl { color: var(--yellow); font-weight: 600; }
.menu a[aria-current="page"] { color: #fff; font-weight: 700; }

/* title band */
.band { background: var(--night); color: #fff; }
.band-in { padding-top: 22px; padding-bottom: 56px; }
.band.has-tabs .band-in { padding-bottom: 0; }
.crumbs { font-size: 14px; color: var(--on-night-2); margin-bottom: 14px; }
.crumbs a { color: var(--on-night-2); }
.band-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.band-text { flex: 1 1 520px; }
.band h1 { font-size: clamp(34px, 5vw, 48px); letter-spacing: -0.02em; margin-bottom: 8px; }
.band-sub { font-size: 17px; color: var(--on-night); max-width: 680px; }
.chip { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 4px 12px; background: var(--yellow); color: var(--ink); }
.tabs { margin-top: 22px; overflow-x: auto; }
.tabs ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.tabs a { display: inline-flex; align-items: center; min-height: 50px; padding: 0 16px; border-bottom: 4px solid transparent; color: var(--on-night-2); text-decoration: none; }
.tabs a:hover { color: #fff; }
.tabs a[aria-current="page"] { border-bottom-color: var(--yellow); color: #fff; }
.lift { margin-top: -36px; }

/* layout bits */
.stack { display: flex; flex-direction: column; gap: 24px; padding-top: 32px; padding-bottom: 56px; }
.lift.stack { padding-top: 0; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.row > .grow { flex: 999 1 560px; min-width: 0; }
.row > .side { flex: 1 1 300px; min-width: 0; }
.row > .half { flex: 1 1 460px; min-width: 0; }
.card { background: var(--card); border-radius: 20px; padding: 24px; box-shadow: 0 1px 2px rgba(23, 20, 46, 0.06); }
.card.raised { box-shadow: 0 2px 8px rgba(23, 20, 46, 0.08); }
@media (min-width: 900px) { .card.roomy { padding: 28px; } }
.card h2 { font-size: 23px; margin-bottom: 6px; }
.card .lead { font-size: 15px; color: var(--muted); margin-bottom: 18px; }
.grid-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.tile { background: var(--card); border-radius: 20px; padding: 22px; box-shadow: 0 2px 8px rgba(23, 20, 46, 0.08); border-top: 6px solid var(--violet); }
.tile.t2 { border-top-color: var(--blue); } .tile.t3 { border-top-color: var(--green); } .tile.t4 { border-top-color: var(--coral); } .tile.t5 { border-top-color: var(--yellow); }
.tile .label { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.tile .big { font-family: var(--head); font-size: 36px; font-weight: 700; margin-bottom: 6px; line-height: 1.1; }
.tile .big.mid { font-size: 28px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.mini { background: var(--bg); border-radius: 14px; padding: 14px 16px; }
.mini .big { font-family: var(--head); font-size: 32px; font-weight: 700; }
.mini.good { background: var(--green-tint); color: var(--green-ink); }
.mini.bad { background: var(--coral-tint); color: var(--coral-ink); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 0; }
.btn.primary { background: var(--violet); color: #fff; }
.btn.primary:hover { background: var(--violet-dark); color: #fff; }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.yellow:hover { color: var(--ink); filter: brightness(0.96); }
.btn.dark { background: var(--night); color: #fff; }
.btn.dark:hover { color: #fff; filter: brightness(1.3); }
.btn.outline { background: #fff; border: 2px solid var(--violet); color: var(--violet); }
.btn.ghost { background: transparent; border: 2px solid #fff; color: #fff; }
.btn.ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.btn.plain { background: #fff; border: 2px solid var(--line); color: var(--ink); }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.more { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.seg { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 4px; font-size: 14px; font-weight: 600; }
.seg button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--violet); color: #fff; }
.seg.dark button[aria-pressed="true"] { background: var(--ink); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; }

/* balls */
.ball { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; font-size: 17px; text-decoration: none; flex: none; }
.ball.lg { width: 54px; height: 54px; font-size: 21px; }
.ball.xl { width: 104px; height: 104px; font-size: 46px; }
.ball.sm { width: 36px; height: 36px; font-size: 14px; }
.ball.xs { width: 32px; height: 32px; font-size: 13px; }
.b1 { background: var(--yellow); color: var(--ink); }
.b2 { background: var(--blue); color: #fff; }
.b3 { background: var(--coral); color: #fff; }
.b4 { background: var(--green); color: var(--ink); }
.b5 { background: var(--violet); color: #fff; }
.ball.supp { background: #fff; color: var(--ink); border: 3px solid; }
.ball.supp.b1 { border-color: var(--yellow); } .ball.supp.b2 { border-color: var(--blue); } .ball.supp.b3 { border-color: var(--coral); } .ball.supp.b4 { border-color: var(--green); } .ball.supp.b5 { border-color: var(--violet); }
.ball.miss { background: #fff; color: var(--muted); border: 2px solid var(--line); }
a.ball:hover { filter: brightness(1.08); }
.balls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.balls .div { width: 1px; height: 30px; background: var(--line); margin: 0 4px; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 0; border-bottom: 1px solid var(--line); }
td { padding: 9px 0; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th + th, td + td { padding-left: 16px; }
.r { text-align: right; }
.b { font-weight: 700; }

/* frequency chart */
.chart { display: flex; gap: 8px; min-width: 760px; }
.chart-scroll { overflow-x: auto; padding-top: 16px; }
.y-axis { display: flex; flex-direction: column; justify-content: space-between; height: 260px; font-size: 11px; color: var(--muted); text-align: right; width: 30px; }
.plot-wrap { flex: 1; min-width: 0; }
.plot { position: relative; height: 260px; display: grid; grid-template-columns: repeat(45, minmax(0, 1fr)); gap: 4px; align-items: end; border-bottom: 1px solid var(--axis); }
.plot .bandzone { position: absolute; left: 0; right: 0; background: rgba(91, 61, 245, 0.10); border-top: 1px dashed var(--violet); border-bottom: 1px dashed var(--violet); pointer-events: none; }
.plot .bar { background: var(--violet); border-radius: 4px 4px 0 0; min-height: 2px; }
.plot .bar.out { background: var(--coral); }
.x-labels { display: grid; grid-template-columns: repeat(45, minmax(0, 1fr)); gap: 4px; margin-top: 6px; font-size: 11px; color: var(--muted); text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.key { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.callouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 22px 0 4px; }
.callout { background: var(--bg); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.callout.warn { background: var(--coral-tint); color: var(--coral-ink); }
.callout .count { font-family: var(--head); font-weight: 700; font-size: 30px; color: #C11C3F; min-width: 42px; text-align: center; }

/* ball board (draws since seen) */
.board-row { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.board { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 10px; max-width: 600px; flex: 999 1 420px; }
.board a { aspect-ratio: 1; min-height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; font-size: 17px; text-decoration: none; border: 2px solid transparent; }
@media (max-width: 600px) { .board { gap: 5px; } .board a { font-size: 13px; } }
.h0 { background: var(--violet); color: #fff; }
.h1 { background: var(--violet-mid); color: var(--ink); }
.h2 { background: var(--violet-pale); color: var(--ink); }
.h3 { background: #fff; color: var(--muted); border-color: var(--axis) !important; }
.waits { flex: 1 1 260px; background: var(--bg); border-radius: 16px; padding: 20px; }
.waits ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.waits li, .pair-list li { display: flex; align-items: center; gap: 12px; }
.meter { flex: 1; height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 5px; background: var(--coral); }
.meter.v i { background: var(--violet); }
.meter.p i { background: var(--violet-mid); }
.pair-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.qty { width: 84px; text-align: right; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* gap chart */
.gaps { position: relative; height: 200px; display: flex; gap: 3px; align-items: flex-end; border-bottom: 1px solid var(--axis); min-width: 560px; }
.gaps i { flex: 1; background: var(--violet); border-radius: 3px 3px 0 0; min-height: 2px; }
.gaps i.long { background: var(--coral); }
.gaps .avg { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(23, 20, 46, 0.5); }

/* home */
.hero { background: var(--night); color: #fff; }
.hero-in { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; padding-top: 48px; padding-bottom: 64px; }
.hero-text { flex: 999 1 520px; min-width: 0; }
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow); margin-bottom: 14px; }
.hero h1 { font-size: clamp(36px, 5.2vw, 52px); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 18px; }
.hero .sub { font-size: 18px; color: var(--on-night); max-width: 620px; margin-bottom: 28px; }
.hero-card { flex: 1 1 320px; min-width: 0; background: #fff; color: var(--ink); border-radius: 20px; padding: 22px; }
.game-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.game-card { background: #fff; border-radius: 20px; padding: 24px; border-top: 8px solid var(--violet); box-shadow: 0 1px 2px rgba(23, 20, 46, 0.06); display: flex; flex-direction: column; gap: 16px; }
.game-card.soon { opacity: 0.85; }
.game-card .foot-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.tool { display: block; background: #fff; border-radius: 20px; padding: 24px; color: var(--ink); text-decoration: none; box-shadow: 0 1px 2px rgba(23, 20, 46, 0.06); }
.tool:hover { color: var(--ink); box-shadow: 0 4px 14px rgba(23, 20, 46, 0.12); }
.tool .ico { width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; }
.tool h3 { font-size: 21px; margin: 14px 0 6px; }
.section-h { font-size: 32px; margin-bottom: 20px; }
.notice { background: var(--yellow-tint); color: #5A4300; border-radius: 14px; padding: 12px 16px; font-size: 14px; }

/* CTA strip */
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: var(--yellow); border-radius: 20px; padding: 28px; }
.cta h2 { font-size: 26px; margin-bottom: 6px; }
.cta p { color: #3D2E00; }

/* picker */
.methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.method { text-align: left; min-height: 96px; padding: 16px 18px; border-radius: 16px; border: 2px solid var(--line); background: #fff; color: var(--ink); font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.method strong { font-family: var(--head); font-size: 18px; }
.method span { font-size: 14px; opacity: 0.9; }
.method[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.why { background: var(--bg); border-radius: 14px; padding: 14px 16px; margin: 20px 0; }
.fine { background: var(--yellow); border-radius: 20px; padding: 24px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.tag { margin-left: auto; font-size: 14px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--line-soft); color: var(--muted); }
.tag.win { background: var(--green-tint); color: var(--green-ink); }
.tag.wait { background: var(--bg); }

/* calculator */
.pick-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 7px; }
.pick-grid button { aspect-ratio: 1; min-height: 34px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: var(--ink); font-family: var(--head); font-weight: 700; font-size: 15px; cursor: pointer; padding: 0; }
.pick-grid button[aria-pressed="true"].b1 { background: var(--yellow); border-color: var(--yellow); }
.pick-grid button[aria-pressed="true"].b2 { background: var(--blue); border-color: var(--blue); color: #fff; }
.pick-grid button[aria-pressed="true"].b3 { background: var(--coral); border-color: var(--coral); color: #fff; }
.pick-grid button[aria-pressed="true"].b4 { background: var(--green); border-color: var(--green); }
.pick-grid button[aria-pressed="true"].b5 { background: var(--violet); border-color: var(--violet); color: #fff; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
label.field select, label.field input { min-height: 46px; border: 2px solid var(--line); border-radius: 12px; padding: 0 12px; font: inherit; font-weight: 500; background: #fff; color: var(--ink); }
.best { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--yellow); }
.hidden { display: none !important; }

/* leaderboard */
.lb td { padding-top: 14px; padding-bottom: 14px; }
.lb tr.luck { background: #FFF8E3; }
.lb .rank { font-family: var(--head); font-weight: 700; font-size: 18px; }
.lb .barcell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.lb .track { position: relative; flex: 1; height: 14px; background: var(--line-soft); border-radius: 7px; }
.lb .track i { display: block; height: 14px; border-radius: 7px; background: var(--violet); }
.lb tr.luck .track i { background: var(--yellow); }
.lb .track b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.ahead { color: var(--green-ink); font-weight: 600; }
.behind { color: var(--muted); font-weight: 600; }
.dark-card { background: var(--night); color: #fff; border-radius: 20px; padding: 24px; }
.dark-card p { color: #D9D6EA; margin-bottom: 12px; }

/* results list */
.year-links { display: flex; flex-wrap: wrap; gap: 6px; }
.year-links a { padding: 6px 10px; border-radius: 8px; background: #fff; text-decoration: none; font-weight: 600; font-size: 14px; }
.results-tbl td .balls { gap: 5px; }

/* footer */
.foot { background: var(--night); color: var(--on-night); margin-top: 0; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-top: 36px; padding-bottom: 36px; font-size: 14px; line-height: 1.6; }
.foot-in > div { flex: 1 1 360px; }
.foot-h { color: #fff; font-weight: 700; margin-bottom: 8px; }
.foot a { color: var(--yellow); }
