/*
 * Lotty — the whole stylesheet.
 *
 * One file, deliberately. The site is a header, a footer, cards of numbers, tables and a
 * handful of forms; splitting that across partials costs more to navigate than it saves.
 * There is no build step and no framework: what you read here is what the browser gets.
 *
 * Order matters and is the only structure you need to know:
 *   1. Tokens      — every colour, space and size, named once
 *   2. Base        — element defaults
 *   3. Layout      — page chrome
 *   4. Components  — reusable pieces, one block each
 *   5. Domain      — the lottery balls, which are the only thing here about lotteries
 *   6. Utilities   — a short, closed list
 *
 * Add a component as a new block in section 4 with its own comment. Do not add utilities:
 * the list in section 6 is meant to stay short, and a page that needs more wants a
 * component instead.
 */

/* ---------------------------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------------------------- */

/* Lotty's type, served from here: Sora for headings and numbers, Manrope for text. Fixed
   weights cut from the variable fonts (the app's App/assets/fonts, converted to woff2), with
   their licences beside them. swap: text shows at once in a fallback and changes face when
   the font lands, rather than staying invisible. */
@font-face { font-family: "Manrope"; src: url("/fonts/Manrope-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/Manrope-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/Manrope-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/Manrope-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/Manrope-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Sora"; src: url("/fonts/Sora-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Sora"; src: url("/fonts/Sora-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Sora"; src: url("/fonts/Sora-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
    color-scheme: light dark;

    /* Brand: black and gold (2026-09-28), the app's palette (App/lib/app/theme.dart).
       Light leads with black and keeps gold for accents; gold words on light surfaces are
       bronze, because plain gold on white reads at 2.1:1. Dark leads with gold. */
    --brand: #0b0b0c;
    --brand-strong: #2e2e33;
    --brand-soft: #f7e7b4;
    --gold: #d9ae45;
    --gold-soft: #f7e7b4;
    --link: #7a5714;
    --link-strong: #5c420c;

    --bg: #ffffff;
    --bg-sunken: #f6f4ef;
    --surface: #ffffff;
    --border: #e9e6de;
    --border-strong: #c9ccd1;

    --text: #0b0b0c;
    --text-muted: #5e626a;
    --text-inverse: #ffffff;

    --ok: #15803d;
    --ok-soft: #ecfdf3;
    --warn: #b45309;
    --warn-soft: #fffaeb;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --info: #1d4ed8;
    --info-soft: #eff4ff;

    /* A 4px scale. Every margin and padding below comes from here, which is what stops the
       spacing drifting as pages are added. */
    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;

    --radius: .5rem;
    --radius-lg: .75rem;
    --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 1px 3px rgb(16 24 40 / .1);
    --shadow-lg: 0 4px 6px -2px rgb(16 24 40 / .03), 0 12px 16px -4px rgb(16 24 40 / .08);

    --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Sora", var(--font);
    --font-numeric: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --container: 72rem;
    --transition: 150ms ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --brand: #d9ae45;
        --brand-strong: #e6c36a;
        --brand-soft: #2a2416;
        --gold: #d9ae45;
        --gold-soft: #2a2416;
        --link: #e6c36a;
        --link-strong: #f7e7b4;

        --bg: #111113;
        --bg-sunken: #0b0b0c;
        --surface: #151517;
        --border: #26262a;
        --border-strong: #3a3a40;

        --text: #f5f5f4;
        --text-muted: #8b8f96;
        --text-inverse: #0b0b0c;

        --ok: #4ade80;
        --ok-soft: #052e16;
        --warn: #fbbf24;
        --warn-soft: #3a2e07;
        --danger: #fca5a5;
        --danger-soft: #3f1512;
        --info: #93c5fd;
        --info-soft: #17233f;

        --shadow: 0 1px 2px rgb(0 0 0 / .4);
        --shadow-lg: 0 12px 20px -6px rgb(0 0 0 / .5);
    }
}

/* ---------------------------------------------------------------------------------------
   2. Base
   --------------------------------------------------------------------------------------- */

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

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

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg-sunken);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    /* The footer sits at the bottom on short pages without absolute positioning. */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 var(--space-3); font-family: var(--font-display); font-weight: 700; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem); letter-spacing: -.015em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-strong); }

code {
    font-family: var(--font-numeric);
    font-size: .9em;
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: .25rem;
    padding: .05em .35em;
}

/* One focus ring for everything, always visible against both themes. Keyboard users are a
   minority of visitors and the entire audience for this rule. */
:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: .2rem;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ---------------------------------------------------------------------------------------
   3. Layout
   --------------------------------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: 3.75rem;
    flex-wrap: wrap;
}

.site-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -.02em;
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.site-brand::before {
    /* The mark - the checked L in gold on matte black, as App/tool/brand/mark.svg - drawn
       inline rather than downloaded: no request, no layout shift. */
    content: "";
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 22%;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='f' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23F7E7B4'/%3E%3Cstop offset='.3' stop-color='%23D9AE45'/%3E%3Cstop offset='.55' stop-color='%239C7424'/%3E%3Cstop offset='.78' stop-color='%23E6C36A'/%3E%3Cstop offset='1' stop-color='%23B8892B'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M30 28.5V71.5H48L70 41.5' fill='none' stroke='url(%23f)' stroke-width='11' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat,
        radial-gradient(120% 100% at 20% 0%, #2e2e33 0%, #151517 48%, #0b0b0c 100%);
    flex: none;
}

.site-nav { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: var(--space-1) 0;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}

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

/* aria-current is set by the server, so the active item is correct with JavaScript off. */
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); }

/* The admin pages' own row of sections, under the site header. */
.admin-nav { margin-bottom: var(--space-4); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); }

.site-header__end { margin-inline-start: auto; display: flex; align-items: center; gap: var(--space-3); }

.site-main { flex: 1 0 auto; padding-block: var(--space-6) var(--space-7); }

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .875rem;
    padding-block: var(--space-5);
}

.site-footer p { margin-bottom: var(--space-2); }
.site-footer p:last-child { margin-bottom: 0; }

/* The mandatory notices. Set apart from the rest of the footer by a rule and a tighter
   measure rather than by colour: these have to stay legible, and muting them to match the
   copyright line is how a required notice becomes decoration. */
.compliance {
    border-block-end: 1px solid var(--border);
    margin-block-end: var(--space-4);
    padding-block-end: var(--space-4);
    max-width: 70ch;
}

.compliance strong { color: var(--text); font-weight: 650; }

.compliance__age { display: flex; align-items: center; gap: var(--space-2); }

.badge-age {
    flex: none;
    display: inline-grid;
    place-items: center;
    min-width: 2.25rem;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

/* Lets a keyboard user reach the content without tabbing the whole nav. Off-screen until
   focused rather than hidden, because display:none is not focusable. */
.skip-link {
    position: absolute;
    left: var(--space-3);
    top: calc(var(--space-3) * -6);
    z-index: 100;
    background: var(--brand);
    color: var(--text-inverse);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius);
    transition: top var(--transition);
}

.skip-link:focus { top: var(--space-3); color: var(--text-inverse); }

.page-header { margin-bottom: var(--space-5); }
.page-header p { color: var(--text-muted); margin-bottom: 0; }

.stack > * + * { margin-top: var(--space-5); }

/* ---------------------------------------------------------------------------------------
   4. Components
   --------------------------------------------------------------------------------------- */

/* Card — the container for everything that is not prose. */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card__header {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    background: var(--bg-sunken);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.card__body { padding: var(--space-4); }

/* A card that is entirely a link. The ::after covers the card so the whole thing is
   clickable while the accessible name stays the heading text alone. */
.card--link { position: relative; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.card--link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card--link a::after { content: ""; position: absolute; inset: 0; }

/* Grid — auto-fitting, so no breakpoint list to maintain as games are added or removed. */
.grid { display: grid; gap: var(--space-4); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.grid--halves { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }

/* Button. One base, three intents, one size modifier. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: .55rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 550;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), border-color var(--transition), opacity var(--transition);
}

.btn:hover { background: var(--bg-sunken); border-color: var(--border-strong); color: var(--text); }

.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--text-inverse); }
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--text-inverse); }

.btn--danger { background: var(--danger); border-color: var(--danger); color: var(--text-inverse); }
.btn--danger:hover { filter: brightness(.92); color: var(--text-inverse); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--link); }
.btn--ghost:hover { background: var(--brand-soft); }

.btn--sm { padding: .35rem .7rem; font-size: .875rem; }

/* Disabled covers both the attribute and the busy state below, so a button that is waiting
   cannot be pressed again. Double-submitting a back-fill would spend the allowance twice. */
.btn:disabled,
.btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; pointer-events: none; }

/* Spinner — shown only while a control is busy. */
.spinner {
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    flex: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Alert — the same shape for every message, so the colour is the only thing to read. */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    border: 1px solid;
    border-left-width: 4px;
}

.alert + .alert { margin-top: var(--space-3); }
.alert--info    { background: var(--info-soft);   border-color: var(--info);   color: var(--text); }
.alert--success { background: var(--ok-soft);     border-color: var(--ok);     color: var(--text); }
.alert--warn    { background: var(--warn-soft);   border-color: var(--warn);   color: var(--text); }
.alert--danger  { background: var(--danger-soft); border-color: var(--danger); color: var(--text); }

/* asp-validation-summary always renders its element, tagging it validation-summary-valid
   when there is nothing to report. Paired with .alert--danger that paints an empty red box
   on a page where nothing is wrong - on four views, the login page among them. Keyed off the
   framework's own class rather than :empty, because the tag helper leaves an empty <ul>
   inside and :empty would not match. */
.validation-summary-valid { display: none; }

.alert__title { font-weight: 650; display: block; }

/* Badge */
.badge {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    border: 1px solid var(--border-strong);
    background: var(--bg-sunken);
    color: var(--text-muted);
}

.badge--ok   { background: var(--ok-soft);   border-color: var(--ok);   color: var(--ok); }
.badge--warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }

/* Table. The wrapper scrolls rather than the page, so a wide prize breakdown does not make
   the whole layout scroll sideways on a phone. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: var(--space-3); text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-sunken); }
.table__num { text-align: right; font-variant-numeric: tabular-nums; }
.table__nowrap { white-space: nowrap; }

/* Form fields */
.form { display: grid; gap: var(--space-4); }
.form--narrow { max-width: 34rem; }

.field { display: grid; gap: var(--space-1); }
.field__label { font-weight: 550; font-size: .925rem; }
.field__hint { color: var(--text-muted); font-size: .825rem; }
.field__error { color: var(--danger); font-size: .85rem; font-weight: 500; }
.field__error:empty { display: none; }

.input, .select, textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input:focus, .select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
    outline: none;
}

.input[aria-invalid="true"] { border-color: var(--danger); }

.select[multiple] { padding: var(--space-2); min-height: 9rem; }

.check { display: flex; align-items: flex-start; gap: var(--space-2); }
.check input { margin-top: .3rem; width: 1rem; height: 1rem; flex: none; accent-color: var(--brand); }
.check label { font-weight: 500; }

.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4); display: grid; gap: var(--space-2); }
.fieldset legend { font-weight: 600; padding-inline: var(--space-2); }

.form-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

/* A big single number — the allowance remaining, and nothing else so far. */
.stat { display: flex; align-items: baseline; gap: var(--space-2); }
.stat__value { font-size: 2.5rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__unit { color: var(--text-muted); }
.stat__caption { margin-top: var(--space-2); }

/* A table long enough to need its own scroll rather than growing the page. Used for the
   back-fill plan, which can list a couple of hundred draws. */
.scroll-y { max-height: 22rem; overflow-y: auto; }

/* Description list used for draw facts. */
.facts { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-4); }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-size: .9rem; margin-bottom: var(--space-3); color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb__sep { color: var(--border-strong); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }
.pager__status { color: var(--text-muted); font-size: .9rem; }
/* On a phone two long dates ("Sat 26 Sep 2026") and the status between them did not fit, and
   the next button ran off the screen (seen 2026-10-15): the status takes its own line. */
@media (max-width: 36rem) {
    .pager { flex-wrap: wrap; }
    .pager__status { order: 3; flex-basis: 100%; text-align: center; }
}

/* An empty state is a designed state. A blank page reads as broken; this does not. */
.empty { text-align: center; padding: var(--space-7) var(--space-4); color: var(--text-muted); }
.empty__title { font-weight: 650; color: var(--text); display: block; margin-bottom: var(--space-2); font-size: 1.05rem; }

/* Navigation progress bar. Lotty is fast, so this is normally invisible — it only appears
   when a page genuinely takes a moment, which is exactly when a reader needs to see it. */
.progress {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    height: 3px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: 0 50%;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
}

body.is-navigating .progress { animation: progress 8s cubic-bezier(.1, .8, .3, 1) forwards; opacity: 1; }

@keyframes progress {
    0%   { transform: scaleX(0); }
    40%  { transform: scaleX(.6); }
    100% { transform: scaleX(.96); }
}

/* A label/value list. Two columns where there is room, stacked where there is not - a
   max-content label column and a long value would otherwise squeeze the value to nothing on
   a phone. */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); margin: 0; }
.kv dt { color: var(--text-muted); font-size: .875rem; padding-top: .1rem; }
.kv dd { margin: 0; }

@media (max-width: 30rem) {
    .kv { grid-template-columns: 1fr; gap: var(--space-1); }
    .kv dd { margin-bottom: var(--space-3); }
    .kv dd:last-child { margin-bottom: 0; }
}

/* ---------------------------------------------------------------------------------------
   5. Domain — the lottery balls
   --------------------------------------------------------------------------------------- */

/* A draw as one sentence above its balls (Results/_Answer.cshtml). */
.draw-answer { margin: 0 0 var(--space-3); }

.ball-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: 0; margin: 0; list-style: none; }

.ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Sized so six numbers plus the bonus fit one line in a card at the narrowest column
       width. Some rows wrapping and others not looks like a fault rather than a layout. */
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    font-family: var(--font-display);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    /* Platinum, in both modes, so the black digit reads at 9:1 or better on either. */
    background: radial-gradient(circle at 35% 30%, #ffffff 0%, #ecedef 45%, #bfc2c7 100%);
    border: 1px solid var(--border-strong);
    color: #0b0b0c;
    flex: none;
}

/* The supplementary ball is a different thing, not a bigger one. Distinguished by colour
   AND by the visually-hidden label beside it, because colour alone is not available to
   every reader. */
.ball--bonus {
    background: radial-gradient(circle at 35% 30%, #fff4cc 0%, #e6bf5c 40%, #b8892b 85%, #8a6414 100%);
    border-color: #b8892b;
}

.ball-bonus-group { display: inline-flex; align-items: center; gap: var(--space-2); }
.ball-separator { color: var(--text-muted); font-size: .85rem; font-weight: 600; }

.ball--small { width: 2.1rem; height: 2.1rem; font-size: .85rem; }

/* A number on the reader's ticket that was drawn. Colour and a thicker ring, and the
   visually-hidden "(drawn)" beside it, because colour alone is not available to everyone. */
.ball--hit { background: var(--ok-soft); border-color: var(--ok); border-width: 3px; color: var(--text); }

/* The ticket form: fields side by side where there is room. */
.ticket-form { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) {
    .ticket-form { grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; }
}
.input--short { width: 5rem; }

/* The prize-table row a checked ticket falls in. Colour plus the visually-hidden
   "(your ticket)" in its first cell, for readers who do not see the colour. */
.table__row--hit td { background: var(--ok-soft); font-weight: 600; }

/* Every number in the pool with its count. auto-fill rather than a fixed column count, so
   a pool of 36 and a pool of 52 both fill the width instead of one of them leaving a ragged
   half-row. minmax with a floor keeps the ball and its two lines of text legible when the
   grid is at its narrowest. */
.tally-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
    gap: var(--space-3);
    padding: 0;
    margin: 0;
    list-style: none;
}

.tally {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    text-align: center;
}

.tally__count { font-weight: 700; font-variant-numeric: tabular-nums; }
.tally__meta { color: var(--text-muted); font-size: .75rem; line-height: 1.3; }

/* A number never drawn is dimmed rather than hidden. It is still a fact, and in a small
   sample it is one of the more honest ones on the page. */
.tally--never { opacity: .55; }

.jackpot {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    /* Amounts group with non-breaking spaces; this keeps a long one on one line. */
    white-space: nowrap;
}

/* Gold foil on black, as in the app. Only in dark mode: foil on a white card reads at about
   2:1, so light mode keeps the figure black. */
@media (prefers-color-scheme: dark) {
    .jackpot {
        background: linear-gradient(135deg, #f7e7b4 0%, #d9ae45 30%, #9c7424 55%, #e6c36a 78%, #b8892b 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}

.game-card__meta { color: var(--text-muted); font-size: .875rem; margin-bottom: var(--space-3); }
.game-card__jackpot { margin-top: var(--space-4); margin-bottom: 0; }
.game-card__jackpot span { display: block; }
.game-card__jackpot .label { color: var(--text-muted); font-size: .8rem; }
.game-card__title { font-size: 1.1rem; margin-bottom: var(--space-1); }
.game-card__title a { text-decoration: none; color: var(--text); }
.game-card__title a:hover { color: var(--link); }

/* The date picker above a date page. A row on a wide screen, stacked on a narrow one, and
   the input is left at its native width so the browser's own date control is not clipped. */
.date-jump {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.date-jump label { color: var(--text-muted); font-size: .875rem; }

/* .input is full-width by design, which is right in a stacked form and wrong in this row. */
.date-jump .input { width: auto; }

/* The single sentence that answers the question in the heading above it. Set larger than body
   text because on a question-shaped page it is the whole point, and a reader scanning for
   "what days does PowerBall draw" should land on it without reading anything else. */
.answer { font-size: 1.05rem; margin-bottom: var(--space-4); }
.answer:last-child { margin-bottom: 0; }

@media (max-width: 30rem) {
    .ball { width: 2.2rem; height: 2.2rem; font-size: .9rem; }
}

/* ---------------------------------------------------------------------------------------
   6. Utilities — a closed list. Prefer a component.
   --------------------------------------------------------------------------------------- */

/* The row of buttons that sits above a page's main content. */
.page-actions { margin-bottom: var(--space-4); }

/* A remark that follows a block of content rather than introducing it. */
.note { margin-top: var(--space-5); color: var(--text-muted); font-size: .875rem; }

.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }

/* One step of separation, matching the gap .stack puts between siblings - so a block added
   outside a stack still sits at the same rhythm as everything else on the page. */
.mt-5 { margin-top: var(--space-5); }

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

/* Consent banner (_Consent.cshtml). Fixed to the bottom so it never pushes the results a
   reader came for out of view, and both choices share one style - see the partial. */
.consent {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 50;
    background: var(--surface);
    border-top: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    padding-block: var(--space-4);
}
.consent[hidden] { display: none; }
.consent__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.consent__text { flex: 1 1 24rem; margin: 0; font-size: .9375rem; }
.consent__actions { display: flex; gap: var(--space-2); }

/* A button that reads as a link, for actions that belong in running text such as the
   footer's "Cookie settings". */
.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--link);
    text-decoration: underline;
    cursor: pointer;
}

/* Ad slots (_AdSlot.cshtml, planning/decisions/ad-ceiling.md). Labelled as advertising, set
   apart from the results, and never taller than about 100px at the top on a phone, so
   tonight's numbers stay on the first screen. The fallback is a plain Lotty link, styled as
   ours rather than dressed up as an ad. */
.ad-slot {
    margin-block: var(--space-4);
    text-align: center;
}
.ad-slot__label {
    display: block;
    margin-bottom: var(--space-1);
    font-size: .6875rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.ad-slot__unit { display: block; width: 100%; }
.ad-slot--top .ad-slot__unit { height: 100px; }
@media (min-width: 48rem) {
    .ad-slot--top .ad-slot__unit { height: 90px; }
}
.ad-slot__unit[hidden], .ad-slot__fallback[hidden] { display: none !important; }
.ad-slot__fallback {
    display: block;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-sunken);
    color: var(--link);
    font-weight: 600;
    text-decoration: none;
}
.ad-slot__fallback:hover { background: var(--brand-soft); }

/* WhatsApp share (_Share.cshtml). Raised above a clickable card's stretched link - .card--link
   stretches every anchor over the card, which would otherwise make the whole card a share
   button, or the share button unreachable. */
.share-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    font-size: .875rem;
    font-weight: 600;
    color: var(--link);
}
.card--link .share-link::after { content: none; }
.share-link__icon { width: 1rem; height: 1rem; }

.mb-0 { margin-bottom: 0; }

/* Game landing page (Results/Landing.cshtml). */
.landing__won { margin: var(--space-3) 0 0; color: var(--ok); }
.landing__next-date { font-size: 1.25rem; font-weight: 700; margin-bottom: var(--space-2); }
.countdown { font-weight: 600; color: var(--link); }
.countdown:not(:empty)::before { content: " — "; color: var(--text-muted); font-weight: 400; }
.install[hidden], [data-install-button][hidden], [data-install-ios][hidden] { display: none; }

/* Two-step sign-in (#58). The QR code keeps a white ground in dark mode too - scanners need
   dark modules on light, and its own quiet zone. */
.qr-code { width: 220px; max-width: 100%; padding: 0.5rem; background: #fff; border-radius: 8px; }
.qr-code svg { display: block; width: 100%; height: auto; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.5rem; padding: 0; margin: 0; list-style: none; }

/* The website's app promotion (#129, _AppPromotion and _AppBanner), shown only while
   website.promote-app is on. The front page's section: text beside a phone screenshot where
   there is room; on a narrow phone the screenshot and the three points drop, so tonight's
   numbers stay near the first screen. */
.app-promo { margin-bottom: var(--space-5); border-color: var(--gold); }
.app-promo__body { display: flex; gap: var(--space-5); align-items: center; }
.app-promo__text { flex: 1; min-width: 0; }
.app-promo__kicker { margin: 0 0 var(--space-1); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--link); }
/* A heading's look whether it is an <h2> (_MoreInTheApp) or a paragraph (_AppPromotion). */
.app-promo__title { font-family: var(--font-display); font-weight: 700; line-height: 1.25; font-size: 1.5rem; margin: 0 0 var(--space-2); }
.app-promo__points { margin: var(--space-3) 0 var(--space-4); padding-left: 1.1rem; }
.app-promo__points li + li { margin-top: var(--space-1); }
.app-promo__small { margin: var(--space-2) 0 0; color: var(--text-muted); font-size: .8rem; }
.app-promo__shot { flex: none; width: 180px; height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
@media (max-width: 36rem) {
    .app-promo__shot, .app-promo__points { display: none; }
    .app-promo__title { font-size: 1.25rem; }
    /* Below a page's draws the points are the reason to read on, so they stay (_MoreInTheApp). */
    .app-promo--more .app-promo__points { display: block; }
}

/* The slim banner on every other results page: one row, wrapping on a phone. */
.app-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-sunken);
}
.app-banner__icon { flex: none; border-radius: var(--radius); }
.app-banner__text { flex: 1 1 14rem; margin: 0; font-size: .9rem; }
