/*
 * Rifax — estilos de las páginas públicas (landing, selector de números,
 * confirmación y verificación de boletas).
 *
 * Idea: la página es el talonario. Cada bloque es una pieza de papel impreso
 * (boleta, recibo, hoja de rifas) con bordes cortados, sobre un fondo plano.
 * Papel y tinta, más un acento (el color de la marca) solo en la acción.
 */

/* ---------- Tokens ---------- */
:root {
    --paper: #e8e8e3;
    --paper-2: #dcdcd6;
    --ink: #181715;
    --muted: #57564f;
    --night: #181715;
    --night-2: #26251f;
    --night-ink: #e8e8e3;
    --night-muted: #b3b2aa;
    --accent: #bfb21a;
    --accent-ink: #181715;
    --ok: #2f6b3a;
    --warn: #8a5a00;
    --danger: #a12a1c;

    --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
    --font-text: "Barlow", "Helvetica Neue", Arial, sans-serif;

    --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
    --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
    --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
    --step-head: clamp(2.5rem, 1.2rem + 5vw, 5.5rem);
    --step-display: clamp(3.25rem, 1.4rem + 7.4vw, 7.5rem);

    --margin: clamp(1rem, 2.2vw, 2rem);
    --gutter: clamp(0.75rem, 1.4vw, 1.5rem);
    --section-gap: clamp(4.5rem, 3rem + 7vw, 11rem);
    --radius: 0;
    --dot: 5px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --dur: 520ms;

    color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-variant-numeric: tabular-nums;
    background: var(--night);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: var(--step-body);
    line-height: 1.5;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 0.07em; text-underline-offset: 0.18em; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; text-wrap: balance; hyphens: none; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

.display, .head, .title {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 0.9;
}
.display { font-size: var(--step-display); text-transform: uppercase; }
.head { font-size: var(--step-head); text-transform: uppercase; }
.title { font-size: var(--step-lead); line-height: 1.05; letter-spacing: 0; }
.lead { font-size: var(--step-lead); line-height: 1.35; }
.small { font-size: var(--step-small); line-height: 1.45; }
.muted { color: var(--muted); }

/* ---------- Page frame ---------- */
.main {
    position: relative;
    z-index: 1;
    background: var(--paper);
}
.wrap { padding-inline: var(--margin); max-width: 1760px; margin-inline: auto; }
.grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
}
.field-night { background: var(--night); color: var(--night-ink); }
.field-night .muted { color: var(--night-muted); }
.field-night .paper .muted, .paper .muted { color: var(--muted); }
.field-paper { background: var(--paper); color: var(--ink); }
.field-surface { background: var(--paper-2); color: var(--ink); }
.section { padding-block: var(--section-gap); }

/* ---------- Top bar ---------- */
.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gutter);
    padding-block: 1.25rem;
}
.bar-brand {
    display: inline-flex; align-items: center; gap: 0.75rem;
    font-family: var(--font-display); font-weight: 700; font-size: 1.625rem;
    letter-spacing: -0.01em; text-decoration: none; line-height: 1;
}
.bar-brand img { width: 40px; height: 40px; object-fit: contain; }
.bar-links { display: flex; gap: clamp(1rem, 2.4vw, 2.25rem); }
.bar-links a { text-decoration: none; }
.bar-links a:hover { text-decoration: underline; }
@media (max-width: 760px) { .bar-links { display: none; } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
    min-height: 48px; padding: 0.7rem 1.35rem;
    border: 0; border-radius: var(--radius);
    font-family: var(--font-text); font-weight: 500; font-size: var(--step-body);
    line-height: 1.1; text-decoration: none; cursor: pointer;
    transition: transform 160ms var(--ease-out), background-color 160ms, color 160ms;
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #000; }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-paper:hover { background: #fff; }
.btn[aria-disabled="true"], .btn:disabled {
    background: var(--paper-2); color: var(--muted); cursor: not-allowed; transform: none;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.link {
    display: inline-flex; align-items: center; min-height: 44px;
    font-weight: 500; text-decoration: underline;
}
.link:hover { text-decoration-thickness: 0.12em; }

/* ---------- Paper pieces (shared edges) ---------- */
.paper {
    background: var(--paper);
    color: var(--ink);
}
/* Perforación: fila de puntos redondos, como el corte del talonario. */
.perforated {
    border-top: var(--dot) dotted var(--night);
}
/* Muescas laterales a la altura de la perforación (color del fondo de la sección). */
.notches { position: relative; }
.notches::before, .notches::after {
    content: ""; position: absolute; top: calc(var(--dot) / -2 - 14px);
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--notch-ground, var(--night));
}
.notches::before { left: -14px; }
.notches::after { right: -14px; }
.zigzag-bottom {
    --z: 14px;
    clip-path: polygon(
        0 0, 100% 0, 100% calc(100% - var(--z)),
        97.5% 100%, 95% calc(100% - var(--z)), 92.5% 100%, 90% calc(100% - var(--z)), 87.5% 100%, 85% calc(100% - var(--z)),
        82.5% 100%, 80% calc(100% - var(--z)), 77.5% 100%, 75% calc(100% - var(--z)), 72.5% 100%, 70% calc(100% - var(--z)),
        67.5% 100%, 65% calc(100% - var(--z)), 62.5% 100%, 60% calc(100% - var(--z)), 57.5% 100%, 55% calc(100% - var(--z)),
        52.5% 100%, 50% calc(100% - var(--z)), 47.5% 100%, 45% calc(100% - var(--z)), 42.5% 100%, 40% calc(100% - var(--z)),
        37.5% 100%, 35% calc(100% - var(--z)), 32.5% 100%, 30% calc(100% - var(--z)), 27.5% 100%, 25% calc(100% - var(--z)),
        22.5% 100%, 20% calc(100% - var(--z)), 17.5% 100%, 15% calc(100% - var(--z)), 12.5% 100%, 10% calc(100% - var(--z)),
        7.5% 100%, 5% calc(100% - var(--z)), 2.5% 100%, 0 calc(100% - var(--z))
    );
    padding-bottom: calc(var(--z) + 1.5rem);
}
.scallop-top {
    --s: 22px;
    -webkit-mask: radial-gradient(var(--s) at 50% 0, #0000 98%, #000) 50% / calc(var(--s) * 3.6) 100% repeat-x;
            mask: radial-gradient(var(--s) at 50% 0, #0000 98%, #000) 50% / calc(var(--s) * 3.6) 100% repeat-x;
    padding-top: calc(var(--s) + 2rem);
}

/* ---------- Hero: la boleta ---------- */
.hero { overflow: hidden; }
.hero-stage { display: grid; justify-items: center; padding-top: clamp(1.5rem, 4vw, 3.5rem); }
.ticket { width: min(100%, 760px); overflow: hidden; }
.ticket-body { padding: clamp(1.5rem, 4vw, 3.5rem); text-align: center; }
.ticket-raffle { font-size: var(--step-small); }
.ticket h1 { margin-top: 0.85rem; }
.ticket-lede { margin: 1.5rem auto 0; max-width: 34ch; }
.ticket-desc { margin: 1rem auto 0; max-width: 46ch; }
.ticket-photo {
    margin: clamp(1.5rem, 3vw, 2.5rem) auto 0;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--paper-2);
}
.ticket-photo img { width: 100%; height: 100%; object-fit: cover; }
.ticket-facts {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem var(--gutter);
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
    text-align: left;
}
.ticket-facts dt { font-size: var(--step-small); color: var(--muted); }
.ticket-facts dd { margin: 0.15rem 0 0; font-weight: 500; }
.ticket-countdown { margin-top: 1.5rem; font-weight: 500; }
.ticket-stub { padding: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3.5rem) clamp(2.5rem, 5vw, 4rem); }
.stub-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1.5rem; }
.stub-row .btn { min-width: 220px; }

/* Busca tu número (lo interactivo de la boleta) */
.lookup { margin-top: 1.75rem; text-align: left; }
.lookup label { display: block; font-weight: 500; }
.lookup-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.lookup input {
    flex: 1; min-width: 0; min-height: 52px; padding: 0 1rem;
    border: 0; border-radius: var(--radius);
    background: var(--paper-2); color: var(--ink);
    font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; letter-spacing: 0.04em;
}
.lookup input::placeholder { color: var(--muted); font-family: var(--font-text); font-weight: 400; font-size: var(--step-body); letter-spacing: 0; }
.lookup-help { margin-top: 0.5rem; font-size: var(--step-small); color: var(--muted); }
.lookup-results { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; min-height: 0; }
.lookup-results:empty { display: none; }
.chip-number {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 76px; min-height: 56px; padding: 0.4rem 0.7rem;
    background: var(--ink); color: var(--paper);
    text-decoration: none; border-radius: var(--radius);
    transition: transform 160ms var(--ease-out), background-color 160ms;
}
.chip-number strong { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; letter-spacing: 0.02em; }
.chip-number span { font-size: var(--step-small); line-height: 1.2; }
a.chip-number:hover { background: #000; transform: translateY(-2px); }
.chip-number[aria-disabled="true"] { background: var(--paper-2); color: var(--muted); }
.chip-number[aria-disabled="true"] strong { text-decoration: line-through; text-decoration-thickness: 2px; }

/* ---------- Cómo funciona: el recibo ---------- */
.steps-head { grid-column: 1 / span 5; }
.steps-head p { margin-top: 1.5rem; max-width: 30ch; }
.slip {
    grid-column: 7 / span 6;
    justify-self: end;
    width: min(100%, 560px);
    background: var(--paper); color: var(--ink);
    padding: 2rem 2rem 0;
}
.slip-group + .slip-group { margin-top: 1.75rem; }
.slip-group h3 { font-family: var(--font-text); font-size: var(--step-body); font-weight: 500; }
.slip-row { display: flex; align-items: baseline; gap: 0.6rem; margin-top: 0.6rem; }
.slip-row span:first-child { flex: 0 1 auto; }
.slip-row .lead-dots {
    flex: 1 1 2rem; min-width: 2rem; align-self: center;
    border-bottom: 4px dotted var(--muted);
}
.slip-row span:last-child { flex: none; color: var(--muted); }
.slip-total {
    display: flex; justify-content: space-between; gap: 1rem; align-items: center;
    margin: 2rem -2rem 0; padding: 0.9rem 2rem;
    background: var(--ink); color: var(--paper); font-weight: 500;
}
@media (max-width: 900px) {
    .steps-head, .slip { grid-column: 1 / -1; }
    .slip { margin-top: 2.5rem; width: 100%; padding: 1.5rem 1.25rem 0; }
    .slip-total { margin-inline: -1.25rem; padding-inline: 1.25rem; }
}
@media (max-width: 560px) {
    .slip-row { justify-content: space-between; }
    .slip-row .lead-dots { display: none; }
    .slip-row span:last-child { text-align: right; max-width: 40%; }
}

/* ---------- Rifas: la hoja impresa ---------- */
.sheet-section { display: grid; justify-items: center; }
.sheet-section > .head { justify-self: stretch; }
.sheet {
    width: min(100%, 760px);
    margin-top: clamp(2.5rem, 5vw, 4rem);
    padding: clamp(2rem, 5vw, 4rem);
}
.sheet-note { text-align: center; }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; }
.filter-chip {
    min-height: 44px; padding: 0.45rem 1rem; border: 0; border-radius: 999px;
    background: var(--paper-2); color: var(--ink); cursor: pointer;
    transition: background-color 160ms, color 160ms, transform 160ms var(--ease-out);
}
.filter-chip:hover { background: #cfcfc8; }
.filter-chip:active { transform: scale(0.97); }
.filter-chip.is-active { background: var(--ink); color: var(--paper); }
.sheet-list { list-style: none; margin: 2.5rem 0 0; padding: 0; }
.sheet-item { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 0.4rem 1.25rem; align-content: start; }
.sheet-item > :not(.sheet-thumb) { grid-column: 2; }
.sheet-item + .sheet-item { margin-top: 2.75rem; }
.sheet-item.is-hidden { display: none; }
.sheet-thumb { grid-row: 1 / span 6; width: 112px; aspect-ratio: 1; overflow: hidden; background: var(--paper-2); }
.sheet-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sheet-thumb-number {
    display: grid; place-items: center; width: 100%; height: 100%;
    font-family: var(--font-display); font-weight: 700; font-size: 2.25rem; color: var(--muted);
}
.sheet-line { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.sheet-line .title { flex: 1 1 auto; }
.sheet-price { font-family: var(--font-display); font-weight: 700; font-size: var(--step-lead); white-space: nowrap; }
.sheet-desc { }
.sheet-meta { color: var(--muted); }
.sheet-status { font-weight: 500; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-top: 0.5rem; }
.empty-state { text-align: center; }
.empty-state p { margin: 1rem auto 0; max-width: 40ch; }
@media (max-width: 560px) {
    .sheet { padding: 1.75rem 1.25rem; }
    .sheet-item { grid-template-columns: 76px minmax(0, 1fr); column-gap: 1rem; }
    .sheet-thumb { width: 76px; }
    .sheet-line { flex-direction: column; gap: 0.2rem; }
}

/* ---------- Ganadores: la lista impresa ---------- */
.winners { overflow: hidden; padding-bottom: 0; }
.winners-card {
    width: min(100%, 860px);
    margin-inline: auto;
    padding: clamp(2rem, 5vw, 3.5rem);
    transform: rotate(-1.2deg);
    margin-bottom: -2.5rem;
    text-align: center;
}
.winners-card h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); }
.winners-list { list-style: none; padding: 0; margin: 2rem 0 0; }
.winners-list li { line-height: 1.6; font-size: var(--step-lead); }
.winners-list li + li { margin-top: 1rem; }
.winners-number { font-family: var(--font-display); font-weight: 700; font-size: 2.25rem; letter-spacing: 0.02em; display: block; line-height: 1; }
.winners-list a { font-size: var(--step-body); }

/* ---------- Preguntas ---------- */
.faq-grid { row-gap: 3rem; }
.faq-col { grid-column: 1 / span 6; }
.faq-side { grid-column: 8 / span 5; }
.faq-list { margin-top: 2rem; }
.faq-item + .faq-item { margin-top: 0.4rem; }
.faq-item summary {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    min-height: 56px; padding: 0.75rem 0;
    font-size: var(--step-lead); font-weight: 500; line-height: 1.25;
    cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: ""; flex: none; width: 12px; height: 12px;
    border-right: 3px solid currentColor; border-bottom: 3px solid currentColor;
    transform: rotate(45deg) translate(-3px, -3px);
    transition: transform 200ms var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(225deg) translate(-3px, -3px); }
.faq-answer { padding-bottom: 1.25rem; max-width: 62ch; }
.pay-card { padding: clamp(1.75rem, 4vw, 2.75rem); background: var(--night); color: var(--night-ink); }
.pay-card h3 { font-family: var(--font-display); font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); text-transform: uppercase; }
.pay-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.pay-list li + li { margin-top: 1rem; }
.pay-list strong { display: block; font-weight: 500; }
.pay-list span { color: var(--night-muted); }
.pay-rules { margin: 1.75rem 0 0; padding-left: 1.1rem; }
.pay-rules li + li { margin-top: 0.6rem; }
@media (max-width: 900px) { .faq-col, .faq-side { grid-column: 1 / -1; } }

/* ---------- Pie: el reverso (cortina) ---------- */
.footer {
    background: var(--night); color: var(--night-ink);
    padding-block: clamp(3rem, 6vw, 5rem);
}
.footer-card { padding: clamp(2rem, 5vw, 3.5rem); }
.footer-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem var(--gutter); }
.footer-signoff { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); }
.footer-copy { margin-top: 1rem; max-width: 46ch; }
.footer-copy + .footer-copy { margin-top: 0.75rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; justify-content: start; }
.footer-imprint { margin-top: 2.5rem; text-align: center; font-size: var(--step-small); color: var(--muted); }
@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr; } }

/* ---------- Barra fija en el celular ---------- */
.sticky-cta { display: none; }
@media (max-width: 760px) {
    .sticky-cta {
        position: fixed; inset: auto 0 0 0; z-index: 20;
        display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
        padding: 0.6rem var(--margin) calc(0.6rem + env(safe-area-inset-bottom));
        background: var(--night);
    }
    .sticky-cta .btn { min-height: 48px; }
    body.has-sticky .footer { padding-bottom: 6.5rem; }
}

/* ---------- Selector de números ---------- */
.picker-hero { padding-block: 0 clamp(2.5rem, 5vw, 4rem); }
.picker-hero .grid { align-items: end; row-gap: 1.5rem; }
.picker-title { grid-column: 1 / span 8; }
.picker-title h1 { font-size: clamp(2.25rem, 1.4rem + 3.4vw, 4rem); }
.picker-title p { margin-top: 1rem; max-width: 52ch; }
.picker-clock { grid-column: 9 / span 4; justify-self: end; text-align: right; }
.picker-clock-value { font-family: var(--font-display); font-weight: 700; font-size: var(--step-lead); line-height: 1.1; }
@media (max-width: 900px) {
    .picker-title, .picker-clock { grid-column: 1 / -1; justify-self: start; text-align: left; }
}
.picker-body { padding-block: clamp(2rem, 4vw, 3.5rem) 9rem; }
.picker-summary { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
.picker-summary strong { font-weight: 500; }
.notice { margin-top: 1.5rem; padding: 1.25rem 1.5rem; background: var(--paper-2); }
.notice strong { font-weight: 500; }
.notice-ok { background: #d7e3d3; }
.notice-warn { background: #efdcc0; }
.notice p + p { margin-top: 0.4rem; }
.picker-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: 2rem; }
.picker-search { flex: 1 1 280px; max-width: 420px; }
.picker-search input {
    width: 100%; min-height: 52px; padding: 0 1rem; border: 0; border-radius: var(--radius);
    background: var(--paper-2); font-size: var(--step-body);
}
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; margin: 0; padding: 0; font-size: var(--step-small); }
.legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend-swatch { width: 16px; height: 16px; flex: none; }
.legend-swatch--available { background: var(--paper-2); }
.legend-swatch--selected { background: var(--ink); }
.legend-swatch--reserved { background: #e6c98f; }
.legend-swatch--paid { background: #a9a8a1; }
.legend-swatch--winner { background: var(--accent); }
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 6px;
    margin-top: 1.5rem;
}
.number-button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem;
    min-height: 64px; padding: 0.4rem 0.25rem;
    border: 0; border-radius: var(--radius);
    background: var(--paper-2); color: var(--ink);
    cursor: pointer;
    transition: transform 140ms var(--ease-out), background-color 140ms, color 140ms;
}
.number-label { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.number-state { font-size: var(--step-small); line-height: 1.1; }
.number-button[data-status="available"]:hover { background: #cfcfc8; }
.number-button[data-status="available"]:active { transform: scale(0.96); }
.number-button.is-selected { background: var(--ink); color: var(--paper); }
.number-button.is-selected .number-state::before { content: "✓ "; }
.number-button[data-status="reserved"] { background: #e6c98f; color: #4a3500; cursor: not-allowed; }
.number-button[data-status="paid"] { background: #a9a8a1; color: var(--ink); cursor: not-allowed; }
.number-button[data-status="paid"] .number-label { text-decoration: line-through; text-decoration-thickness: 2px; }
.number-button[data-status="winner"] { background: var(--accent); color: var(--accent-ink); cursor: not-allowed; }
.number-button:disabled { opacity: 1; }
.numbers-status { margin-top: 1rem; font-size: var(--step-small); color: var(--muted); min-height: 1.45em; }
.picker-bar {
    position: fixed; inset: auto 0 0 0; z-index: 20;
    background: var(--night); color: var(--night-ink);
}
.picker-bar-inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.75rem 1.5rem; padding-block: 0.9rem calc(0.9rem + env(safe-area-inset-bottom));
}
.picker-bar-text { min-width: 0; }
.picker-bar-count { font-family: var(--font-display); font-weight: 700; font-size: var(--step-lead); line-height: 1.1; }
.picker-bar-help { font-size: var(--step-small); color: var(--night-muted); }
.picker-bar .btn[aria-disabled="true"] { background: var(--night-2); color: var(--night-muted); }
.feedback { font-size: var(--step-small); }
.feedback:empty { display: none; }
.feedback.is-error { color: #f2a89c; }
@media (max-width: 560px) {
    .picker-bar .btn { width: 100%; }
    .picker-bar-inner { padding-block: 0.7rem calc(0.7rem + env(safe-area-inset-bottom)); gap: 0.5rem; }
    #cta-help-text { display: none; }
    .picker-body { padding-bottom: 11rem; }
    .numbers-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
}

/* ---------- Páginas de resultado (confirmación, boleta) ---------- */
.result { min-height: 100svh; display: grid; align-content: start; justify-items: center; padding-block: clamp(1.5rem, 4vw, 3rem) var(--section-gap); }
.result-card { width: min(100%, 720px); }
.result-body { padding: clamp(1.75rem, 5vw, 3.5rem); }
.result-body h1 { margin-top: 0.5rem; }
.result-body .lead { margin-top: 1.25rem; }
.result-numbers { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.75rem; }
.result-numbers span {
    min-width: 76px; padding: 0.5rem 0.75rem; text-align: center;
    background: var(--ink); color: var(--paper);
    font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; line-height: 1; letter-spacing: 0.02em;
}
.result-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem var(--gutter); margin: 2rem 0 0; }
.result-facts dt { font-size: var(--step-small); color: var(--muted); }
.result-facts dd { margin: 0.15rem 0 0; font-weight: 500; overflow-wrap: anywhere; }
.result-stub { padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.75rem, 5vw, 3.5rem) clamp(2rem, 5vw, 3rem); }
.result-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; }
.result-image { margin-top: 2rem; background: var(--paper-2); }
.result-image img { width: 100%; height: auto; }
.status-pill {
    display: inline-block; padding: 0.3rem 0.8rem; border-radius: 999px;
    font-size: var(--step-small); font-weight: 500;
    background: var(--paper-2); color: var(--ink);
}
.status-pill.is-ok { background: #d7e3d3; color: #1f4a27; }
.status-pill.is-warn { background: #efdcc0; color: #5c3c00; }
.status-pill.is-bad { background: #f0d2cc; color: #6e1b10; }
@media (max-width: 560px) { .result-facts, .ticket-facts { grid-template-columns: 1fr; } }

/* ---------- Movimiento ---------- */
@keyframes rfx-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes rfx-drift { from { transform: scale(1.06); } to { transform: scale(1); } }
@keyframes rfx-pop { 0% { transform: scale(0.92); opacity: 0; } 100% { transform: none; opacity: 1; } }
.ticket { animation: rfx-rise 700ms var(--ease-out) both; }
.ticket-photo img { animation: rfx-drift 9s var(--ease-out) both; }
.chip-number, .result-numbers span { animation: rfx-pop 320ms var(--ease-out) both; }
.result-numbers span:nth-child(2) { animation-delay: 60ms; } .result-numbers span:nth-child(3) { animation-delay: 120ms; }
.result-numbers span:nth-child(n+4) { animation-delay: 180ms; }
.result-body > *, .result-stub > *, .result-facts > div { animation: rfx-rise 600ms var(--ease-out) both; }
.result-body > :nth-child(2) { animation-delay: 70ms; } .result-body > :nth-child(3) { animation-delay: 140ms; }
.result-body > :nth-child(4) { animation-delay: 210ms; } .result-body > :nth-child(n+5) { animation-delay: 280ms; }
.result-facts > div:nth-child(2) { animation-delay: 340ms; } .result-facts > div:nth-child(n+3) { animation-delay: 400ms; }
.result-stub > * { animation-delay: 420ms; }
.bar { animation: rfx-rise 500ms var(--ease-out) both; }
/* Entradas por sección: el contenido ya está en la página; solo se desplaza. */
.js .reveal { opacity: 0; transform: translateY(24px); }
.js .reveal.is-in { opacity: 1; transform: none; transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); transition-delay: var(--delay, 0ms); }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}

/* Premios anticipados: hoja impresa dentro de la página de la rifa y de la portada. */
.early-prizes { max-width: 72ch; }
.early-prizes-lead { margin-top: 0.75rem; }
.early-prizes-list { margin-top: 2rem; }
.early-prize .title { font-size: var(--step-lead); }
.early-prize.is-pending .sheet-status { color: var(--muted); }
.early-prize.is-void .sheet-status { color: var(--muted); text-decoration: none; }
.early-prize.is-won .sheet-status { font-weight: 500; }
.early-prizes-section { padding-block: clamp(2.5rem, 2rem + 3vw, 5rem); }
.early-prizes-fold-section { padding-block: 1rem; border-bottom: 1px dotted var(--rule, currentColor); }
.early-prizes-fold { max-width: none; }
.early-prizes-fold summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem;
  cursor: pointer; list-style: none; min-height: 44px; padding-right: 2rem; position: relative;
}
.early-prizes-fold summary::-webkit-details-marker { display: none; }
.early-prizes-fold summary .title { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: var(--step-lead); }
.early-prizes-fold summary::after {
  content: ""; position: absolute; right: 0.5rem; top: 0.9rem; width: 9px; height: 9px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 160ms ease-out;
}
.early-prizes-fold[open] summary::after { transform: rotate(225deg) translate(-3px, -3px); }
.early-prizes-fold .early-prizes-list, .early-prizes-fold .early-prizes-lead { max-width: 72ch; }
