/* LotteryDrops — "the rack". One stylesheet, no build step.
   Loaded after bootstrap-grid.min.css (Bootstrap 5 containers, rows/columns and display/flex/spacing utilities only:
   no reboot, no components, no JavaScript). Page layout is Bootstrap's grid; everything below is this site's own components.
   Order: tokens, base, layout, header/footer, rack, board, tables, small components, prose, dark, print.
   Flow spacing uses :where() (zero specificity) so any component margin wins without a fight. */

/* ---------- tokens ---------- */
:root {
  --c-paper: #F6F7FC; --c-ink: #15153B; --c-drop: #3B2CE0; --c-yolk: #FFC83A; --c-coral: #FF5A4E; --c-mist: #E3E6F5;

  --bg: var(--c-paper);
  --surface: #FFFFFF;
  --text: var(--c-ink);
  --muted: #565A80;
  --line: var(--c-mist);
  --link: var(--c-drop);
  --track: var(--c-drop);        /* rack track */
  --track-quiet: #D5D9F0;
  --btn: var(--c-drop);
  --heat: var(--c-drop);         /* heat tile hue */
  --focus: var(--c-drop);
  --amount: var(--c-ink);        /* jackpot figures; yolk on dark surfaces */

  --font-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --t-xs: .8125rem; --t-sm: .9375rem; --t-base: 1.0625rem; --t-lg: 1.25rem; --t-xl: 1.5rem;
  --t-2xl: clamp(1.6rem, 1.2rem + 1.6vw, 2.125rem);
  --t-3xl: clamp(2.1rem, 1.3rem + 3.6vw, 3.5rem);
  --t-figure: clamp(2.4rem, 1.4rem + 5vw, 4.75rem);

  --radius: 6px;                 /* panels, inputs, buttons, tiles. Racks and balls are fully round, tables square. */
  --wrap: 1120px;
  --gutter: clamp(1rem, 4vw, 2rem);
  color-scheme: light dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--t-base)/1.55 var(--font-body);
  overflow-wrap: break-word;
}
/* zero-specificity reset, so the flow rules below (also zero) and every component class win */
:where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, table) { margin: 0; }
:where(ul, ol) { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: var(--t-3xl); font-weight: 800; letter-spacing: -.03em; line-height: 1.02; }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }
:where(p, dd, figcaption, .prose li) { max-width: 70ch; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; height: auto; vertical-align: middle; }
strong, b { font-weight: 600; }
time { white-space: nowrap; }
h1 time, h2 time { white-space: normal; }   /* a long date in a heading must be able to wrap on phones */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--c-yolk); color: var(--c-ink); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 10; padding: .6rem 1rem; background: var(--c-yolk); color: var(--c-ink); font-weight: 600; border-radius: var(--radius); }
.skip:focus { top: .5rem; }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); }
.nowrap { white-space: nowrap; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- layout ---------- */
/* .container is Bootstrap's; .wrap only adds the flow spacing below. Gutter 2rem = 1rem page margin on phones. */
.container { --bs-gutter-x: 2rem; }
@media (min-width: 1400px) { .container { max-width: 1140px; } }   /* the design is tuned for ~1120px of content */
.wrap > * + .row { margin-top: calc(1.25rem - var(--bs-gutter-y)); }   /* .row has a negative top margin that would swallow the flow gap */
:where(.wrap, .stack, .row > *) > :where(* + *) { margin-top: 1.25rem; }
:where(.wrap, .stack, .row > *) > :where(* + h2) { margin-top: 2.5rem; }
:where(.wrap, .stack, .row > *) > :where(* + h3) { margin-top: 2rem; }
:where(.wrap, .stack, .row > *) > :where(h2 + *, h3 + *) { margin-top: .75rem; }

.page-head { padding-block: 1.25rem .5rem; }
.page-head h1 { margin-top: .75rem; }
.lede { font-size: var(--t-lg); line-height: 1.45; max-width: 62ch; }

.section { padding-block: clamp(1.75rem, 4.5vw, 3.25rem); }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); }
/* Ink band: a dark surface in both schemes. It re-points the tokens, so every component inside adapts by itself. */
.section--band, .site-foot {
  --bg: var(--c-ink); --surface: #1F1F52; --text: #ECEEFB; --muted: #B4B7DA; --line: #34346E; --link: #C5C0FF;
  --track: #4F42F5; --track-quiet: #34346E; --btn: #4F42F5; --heat: #7468FF; --focus: var(--c-yolk); --amount: var(--c-yolk);
  background: var(--bg); color: var(--text);
}
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1.5rem; }

.row > * { min-width: 0; }

/* ---------- breadcrumbs (Seo::breadcrumbHtml) ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: .1rem .5rem; font-size: var(--t-sm); color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--line); }
.crumbs a { color: inherit; }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--line); }
.site-head__in { gap: .6rem 1.75rem; padding-block: .8rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; font: 800 1.375rem/1 var(--font-display); letter-spacing: -.03em; }
.brand svg { width: 32px; height: 32px; flex: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: .1rem 1.4rem; flex: 1 1 auto; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: var(--t-sm); padding-block: .35rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--line); }
.site-nav a[aria-current] { border-bottom-color: var(--link); }
.site-head .search { flex: 0 1 17rem; }
@media (max-width: 900px) {
  .site-head .search { flex: 1 1 9rem; margin-left: auto; }
  /* one line that scrolls sideways instead of wrapping to two; negative margin lets it run to the screen edge */
  .site-nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; margin-inline: -1rem; padding-inline: 1rem; }
  .site-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 520px) { .site-head .search { flex-basis: 100%; } }

/* ---------- footer ---------- */
.site-foot { margin-top: clamp(2rem, 5vw, 4rem); padding-block: 2.5rem 1.5rem; font-size: var(--t-sm); }
.site-foot__grid > * > * + * { margin-top: .6rem; }
.site-foot h2 { font-size: var(--t-base); letter-spacing: 0; }
.site-foot .brand { font-size: 1.25rem; }
.site-foot li + li { margin-top: .35rem; }
.site-foot__legal { max-width: none; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); }

/* ---------- the rack ---------- */
/* --b is the ball diameter; track padding, gaps and radius all derive from it. */
.rack {
  --b: 2.5rem;
  display: inline-flex; flex-wrap: wrap; gap: calc(var(--b) * .12); max-width: 100%;
  padding: calc(var(--b) * .14); border-radius: calc(var(--b) * .64);
  background: var(--track); vertical-align: middle;
}
.rack--sm { --b: 1.875rem; }
.rack--md { --b: 2.5rem; }
.rack--lg { --b: clamp(2.375rem, 10.5vw, 3.5rem); }
.rack--hero { --b: clamp(2.75rem, 12vw, 5.25rem); }   /* 5.25rem: a 5+1 rack fits on one line in a col-lg-7 at xl */
@media (min-width: 992px) and (max-width: 1199.98px) { .rack--hero { --b: 4.4rem; } }   /* same, in the 960px container */
.rack--quiet { background: var(--track-quiet); }
/* Long draws (11+ balls): an even grid of --cols columns, so the track hugs the balls. The ball shrinks to fit a phone. */
.rack--grid { display: inline-grid; grid-template-columns: repeat(var(--cols), var(--b)); }
.rack--grid.rack--md { --b: min(2.5rem, calc((100vw - 2.5rem) / (var(--cols) * 1.12 + .16))); }
.rack--grid .ball--bonus { margin-left: 0; }   /* dense history tables: same rack, muted track */

.ball {
  position: relative;   /* contains the sr-only bonus label, so it cannot stick out of a scrolling table */
  flex: none; display: grid; place-items: center; width: var(--b); height: var(--b); border-radius: 50%;
  background: #fff; color: var(--c-ink);
  font: 700 calc(var(--b) * .44)/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.ball--long { font-size: calc(var(--b) * .34); }                       /* 3+ characters */
.ball--bonus { background: var(--c-yolk); margin-left: calc(var(--b) * .3); }
.ball--bonus ~ .ball--bonus { margin-left: 0; }
.ball--ghost { background: none; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .45); }  /* empty slot, for empty states */
.rack-key { margin-top: .5rem; font-size: var(--t-sm); color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.rack-key::before { content: ""; width: .7em; height: .7em; border-radius: 50%; background: var(--c-yolk); flex: none; }

/* The one piece of load motion: balls of the hero rack drop in and settle. */
@media (prefers-reduced-motion: no-preference) {
  .rack--drop .ball { animation: ball-drop .62s cubic-bezier(.34, 0, .6, 1) both; animation-delay: calc(min(var(--i, 0), 8) * 110ms + 120ms); }   /* capped: a 22-ball keno rack must not take 3 s */
  @keyframes ball-drop {
    0% { transform: translateY(-200%); opacity: 0; }
    15% { opacity: 1; }
    62% { transform: translateY(0); }
    80% { transform: translateY(-13%); }
    100% { transform: translateY(0); }
  }
}

/* ---------- results board ---------- */
.board { border-top: 2px solid var(--text); }
.board__row {
  display: grid; align-items: center; gap: .35rem 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line);
  grid-template-columns: 2.75rem minmax(9rem, 1fr) 6.75rem minmax(0, 21.5rem) minmax(0, 8.5rem);
  grid-template-areas: "logo name date rack jack";
}
.board__logo { grid-area: logo; }
.board__game { grid-area: name; min-width: 0; line-height: 1.25; }
.board__name { font: 700 var(--t-lg)/1.15 var(--font-display); letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.board__name:hover { text-decoration: underline; }
.board__place { display: block; font-size: var(--t-sm); color: var(--muted); }
.board__date { grid-area: date; font-size: var(--t-sm); color: var(--muted); }
.board__rack { grid-area: rack; min-width: 0; }
.board__jack { grid-area: jack; text-align: right; font: 700 var(--t-lg)/1.15 var(--font-display); font-variant-numeric: tabular-nums; color: var(--amount); }
.board__jack small { display: block; font: 400 var(--t-xs)/1.3 var(--font-body); color: var(--muted); }
@media (max-width: 900px) {
  .board__row { grid-template-columns: 2.75rem minmax(0, 1fr) auto; grid-template-areas: "logo name jack" "logo date jack" "rack rack rack"; }
  .board__rack { margin-top: .3rem; }
}

/* Game logo tile: always on white so state logos stay legible in the dark scheme. */
.logo { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: none; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.logo--initials { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-yolk); font: 800 1rem/1 var(--font-display); letter-spacing: -.02em; }
.logo--lg { width: 4.5rem; height: 4.5rem; font-size: 1.5rem; }

.tag { display: inline-block; padding: .1rem .5rem; border-radius: var(--radius); background: var(--line); color: var(--text); font-size: var(--t-xs); font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: .1em; }
.tag--live { background: var(--c-coral); color: var(--c-ink); }   /* coral is reserved for "draws today" */

/* ---------- tables (square) ---------- */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table caption { text-align: left; padding-bottom: .5rem; color: var(--muted); }
.table th, .table td { padding: .65rem .9rem .65rem 0; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table thead th { font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--text); white-space: nowrap; }
.table tbody th { font-weight: 600; }
.table .num, .table .is-num { text-align: right; }
.table td:has(> .rack) { min-width: 14.5rem; }
/* Phones: date, a 5+1 rack and the jackpot fit side by side in 328px; wider tables scroll in .table-scroll. */
@media (max-width: 480px) {
  .table { font-size: var(--t-xs); }
  .table th, .table td { padding-right: .5rem; }
  .table td:has(> .rack) { --tb: clamp(1.3rem, 5.8vw, 1.5rem); min-width: calc(var(--tb) * 7.2 + .55rem); }   /* 7.2 balls = a 5+1 rack with its gaps */
  .table .rack--sm { --b: var(--tb, 1.5rem); }
}
.table--prize td.num { font-size: var(--t-base); }

/* ---------- facts list ---------- */
.facts > div { display: flex; justify-content: space-between; gap: 1.5rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.facts > div:first-child { border-top: 2px solid var(--text); }
.facts dt { color: var(--muted); flex: none; }
.facts dd { text-align: right; font-weight: 600; min-width: 0; }

/* ---------- jackpot figure ---------- */
.jackpot { display: flex; flex-direction: column; gap: .15rem; }
.jackpot__label { font-weight: 500; color: var(--muted); }
.jackpot__amount { font: 800 var(--t-figure)/.95 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.04em; color: var(--amount); }
.jackpot__note { font-size: var(--t-sm); color: var(--muted); }

/* ---------- link lists and chips ---------- */
.linklist { columns: 13rem auto; column-gap: 2.5rem; }
.linklist li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.linklist a { font-weight: 600; text-decoration: none; }
.linklist a:hover { text-decoration: underline; }
.linklist span { font-size: var(--t-sm); color: var(--muted); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-block; padding: .35rem .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: var(--t-sm); font-weight: 500; text-decoration: none; }
.chip:hover, .chip[aria-current] { border-color: var(--link); color: var(--link); }

/* ---------- number-frequency heat tiles ---------- */
/* --h (0..1) on each tile sets intensity; --cols on the list sets the column count. */
.heat { display: grid; grid-template-columns: repeat(var(--cols, 10), minmax(0, 1fr)); gap: 3px; max-width: calc(var(--cols, 10) * 4rem); }
.heat__tile {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; border-radius: 3px;
  background: color-mix(in srgb, var(--heat) calc(6% + var(--h, 0) * 50%), var(--surface)); color: var(--text);
  font: 700 clamp(.8rem, 2.6vw, 1.125rem)/1 var(--font-display); font-variant-numeric: tabular-nums;
}
.heat__tile small { font: 400 .6875rem/1 var(--font-body); }
.heat-key { display: flex; align-items: center; gap: .5rem; font-size: var(--t-sm); color: var(--muted); }
.heat-key::before { content: ""; width: 6rem; height: .6rem; border-radius: 3px; background: linear-gradient(90deg, color-mix(in srgb, var(--heat) 6%, var(--surface)), color-mix(in srgb, var(--heat) 56%, var(--surface))); }
@media (max-width: 560px) { .heat__tile small { display: none; } }

/* ---------- jackpot sparkline (inline svg) ---------- */
.spark__svg { display: block; width: 100%; height: auto; overflow: visible; }
.spark__line { fill: none; stroke: var(--link); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark__area { fill: var(--link); opacity: .12; stroke: none; }
.spark__base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark__dot { fill: var(--c-yolk); stroke: var(--text); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark figcaption { margin-top: .5rem; font-size: var(--t-sm); color: var(--muted); }

/* ---------- faq ---------- */
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item:first-of-type { border-top: 2px solid var(--text); }
.faq__item summary { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; cursor: pointer; list-style: none; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; font: 400 1.5rem/1 var(--font-display); color: var(--muted); }
.faq__item[open] summary::after { content: "\2212"; }
.faq__item h3 { font-size: var(--t-lg); letter-spacing: -.01em; line-height: 1.25; }
.faq__item p { padding-bottom: 1.1rem; }

/* ---------- pager ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .5rem; font-size: var(--t-sm); }
.pager__now { color: var(--muted); margin-inline: auto; white-space: nowrap; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- buttons and forms ---------- */
.btn { display: inline-block; padding: .65rem 1.1rem; border: 1px solid var(--btn); border-radius: var(--radius); background: var(--btn); color: #fff; font: 600 var(--t-sm)/1.2 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn:hover { filter: brightness(1.12); }
.btn--quiet { background: transparent; border-color: var(--line); color: var(--link); }
.btn--quiet:hover { border-color: var(--link); filter: none; }

.search { display: flex; min-width: 0; }
.search input { flex: 1 1 auto; min-width: 0; width: 100%; padding: .5rem .75rem; border: 1px solid var(--muted); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search button { flex: none; padding: .5rem .85rem; border: 1px solid var(--btn); border-radius: 0 var(--radius) var(--radius) 0; background: var(--btn); color: #fff; font: 600 var(--t-sm)/1.2 var(--font-body); cursor: pointer; }
.search--lg { max-width: 34rem; }
.search--lg input { padding: .8rem 1rem; font-size: var(--t-base); }
.search--lg button { padding-inline: 1.4rem; font-size: var(--t-base); }

/* ---------- empty state ---------- */
.empty { padding: clamp(1.25rem, 4vw, 2rem); border: 1px dashed var(--muted); border-radius: var(--radius); }
.empty > * + * { margin-top: .6rem; }
.empty__title { font: 700 var(--t-xl)/1.15 var(--font-display); letter-spacing: -.02em; }
.empty .rack { background: var(--track-quiet); }
.empty .ball--ghost { box-shadow: inset 0 0 0 2px var(--surface); }

/* ---------- prose pages ---------- */
.prose { max-width: 70ch; }
:where(.prose) > :where(* + *) { margin-top: 1.1rem; }
:where(.prose) > :where(* + h2) { margin-top: 2.5rem; }
:where(.prose) > :where(* + h3) { margin-top: 1.75rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4rem; }
.prose li::marker { color: var(--muted); }

/* ---------- dark scheme (system preference only) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0E2A; --surface: #17173F; --text: #ECEEFB; --muted: #A9ACD0; --line: #2C2C60; --link: #B3ADFF;
    --track: #4F42F5; --track-quiet: #2C2C60; --btn: #4F42F5; --heat: #7468FF; --focus: var(--c-yolk); --amount: var(--c-yolk);
  }
  .section--band, .site-foot { --bg: #17173F; --surface: #20205A; --line: #34346E; }
  .site-foot { border-top: 1px solid var(--line); }
  .logo--initials { border-color: var(--line); }
}

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --line: #bbb; --link: #000; --amount: #000; }
  .site-head .search, .site-nav, .site-foot nav, .skip, .pager, .btn { display: none; }
  .section--band, .site-foot { background: none; color: #000; --text: #000; --muted: #444; --amount: #000; }
  .rack { background: none; padding: 0; }
  .ball { border: 1.5px solid #000; }
  .ball--bonus { border-width: 3px; }
  .section { padding-block: 1rem; }
}
