/* base.css — reset, document defaults, typography, links, tables, forms. */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--s-3);
  font-family: var(--font-display);
  line-height: var(--lh-heading);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -0.015em; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5, h6 { font-size: var(--fs-md); }

/* Figures never inherit the serif: several of the serif stacks ship
   old-style numerals, and a jackpot must line up and sit on the baseline. */
.payout-figure, .countdown-unit b, .stat-num, .pack-price, .pack-numbers,
.amount, .ticket, time, .kv td, .draw-card dd {
  font-family: var(--font-num);
  font-variant-numeric: lining-nums tabular-nums;
}

p, ul, ol, dl, table, figure, blockquote, pre { margin: 0 0 var(--s-4); }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

/* Long unbroken tokens — email addresses, ticket numbers, French compound
   terms — must wrap rather than push the page sideways on a small screen. */
p, li, dd, dt, td, th, caption, figcaption, summary, label, .foot-org { overflow-wrap: break-word; }

p, li { max-width: 66ch; text-wrap: pretty; }
li { margin-bottom: var(--s-2); }
ul, ol { padding-left: 1.35em; }
li::marker { color: var(--teal-700); }

small, .fs-xs { font-size: var(--fs-xs); }

strong, b { font-weight: 700; }

abbr[title] { text-decoration: underline dotted; cursor: help; }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-6) 0; }

a {
  color: var(--lake-700);
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
  text-decoration-color: color-mix(in srgb, currentColor 42%, transparent);
  transition: text-decoration-color 140ms ease-out, color 140ms ease-out;
}
a:hover { color: var(--lake-800); text-decoration-color: currentColor; }

/* A double ring, so focus stays obvious on white, on navy and on gold. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-halo);
  border-radius: 3px;
}

::selection { background: var(--gold-500); color: var(--on-gold); }

img, svg, video { max-width: 100%; height: auto; }
svg { display: block; }

/* --- Tables -------------------------------------------------------- */
/* Tables are set as published timetables: hairline rules, no zebra fill,
   a gold rule under the head, and figures on a common decimal axis. */
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  padding-bottom: var(--s-4);
  color: var(--ink);
}
th, td {
  text-align: left;
  padding: var(--s-4) var(--s-3);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th:first-child, td:first-child { padding-inline-start: 0; }
th:last-child, td:last-child { padding-inline-end: 0; }
thead th {
  padding-block: var(--s-2);
  border-bottom: 2px solid var(--gold-500);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  white-space: nowrap;
}
tbody th { font-weight: 700; }
tbody tr:last-child > * { border-bottom: 0; }

@media (min-width: 769px) {
  tbody tr { transition: background-color 120ms ease-out; }
  tbody tr:hover { background: var(--lake-050); }
  .amount, th.amount { text-align: right; }
}

/* --- Forms --------------------------------------------------------- */
label { display: block; font-weight: 600; margin-bottom: var(--s-1); }

input, select, textarea, button { font: inherit; color: inherit; }

input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="tel"], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
}
textarea { min-height: 9rem; resize: vertical; }

input[type="checkbox"], input[type="radio"] {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0.15rem 0 0;
  accent-color: var(--lake-700);
  flex: 0 0 auto;
}

fieldset { border: 1px solid var(--border); border-radius: var(--r-2); padding: var(--s-4); margin: 0 0 var(--s-5); }
legend { font-weight: 700; padding: 0 var(--s-2); }

[aria-invalid="true"] { border-color: var(--err); border-width: 2px; }

::placeholder { color: var(--ink-muted); opacity: 1; }

/* --- Utility ------------------------------------------------------- */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s-3);
  top: -100px;
  z-index: 999;
  background: var(--gold-500);
  color: var(--on-gold);
  font-weight: 700;
  padding: var(--s-3) var(--s-4);
  border-radius: 0 0 var(--r-2) var(--r-2);
  text-decoration: none;
  transition: top 120ms ease-out;
}
.skip-link:focus { top: 0; color: var(--on-gold); }

.text-muted { color: var(--ink-muted); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
