/* Ticket Live: la página es una pared navy limpia; cada evento es un afiche a dos tintas.
   Ley de paleta: el magenta solo marca EN VIVO y la acción principal. */

@font-face {
    font-family: "Big Shoulders Display";
    src: url("../assets/fonts/big-shoulders-display.woff2") format("woff2");
    font-weight: 600 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --wall: #12212D;
    --wall-raised: #1A2E3D;
    --wall-line: #2A4255;
    --paper: #F4F1EA;
    --paper-shade: #E6E0D2;
    --ink: #12212D;
    --ink-soft: #3B4E5C;
    --on-wall: #F4F1EA;
    --on-wall-soft: #AFC0CC;
    --cyan: #5CC1DA;
    --magenta: #E41D6C;
    --magenta-press: #C8155B;
    --error: #B3123F;
    --error-on-wall: #FF8FB5;

    --display: "Big Shoulders Display", "Arial Narrow", sans-serif-condensed, sans-serif;
    --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --gutter: clamp(1rem, 4vw, 3rem);
    --maxw: 1240px;
    --radius: 4px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-paper: 0 1px 0 rgb(5 12 18 / 0.6), 0 0 0 1px rgb(5 12 18 / 0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; scrollbar-color: var(--wall-line) var(--wall); }
body {
    font-family: var(--text);
    font-size: 1rem;
    line-height: 1.5;
    background: var(--wall);
    color: var(--on-wall);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--cyan); color: var(--ink); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.icon-fill { fill: currentColor; stroke: none; }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 300;
    background: var(--paper);
    color: var(--ink);
    padding: 0.6rem 1rem;
    font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ---------- Botones ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.55rem 1.1rem;
    border: 2px solid currentColor;
    border-radius: var(--radius);
    background: transparent;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms, color 160ms, transform 160ms var(--ease-out);
}
.btn:hover { background: rgb(244 241 234 / 0.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.55; transform: none; }

/* Acción principal: magenta, texto grande en tipografía de cartel (contraste de texto grande). */
.btn-primary {
    border-color: var(--magenta);
    background: var(--magenta);
    color: #fff;
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1;
}
.btn-primary:hover { background: var(--magenta-press); border-color: var(--magenta-press); }
.btn-primary:disabled { background: var(--ink-soft); border-color: var(--ink-soft); opacity: 0.7; }
.btn-quiet { border-color: var(--wall-line); color: var(--on-wall); }
.btn-quiet:hover { border-color: var(--on-wall-soft); }
.btn[aria-busy="true"]::after {
    content: "";
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Barra superior ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem var(--gutter);
    background: var(--wall);
    border-bottom: 1px solid var(--wall-line);
}
.topbar-logo img { height: 2.75rem; width: auto; }
.count {
    min-width: 1.6rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--cyan);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1.6rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.count.bump { animation: bump 500ms var(--ease-out); }
@keyframes bump { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }

/* ---------- Afiche (base compartida) ---------- */

.poster {
    --poster-bg: var(--paper);
    --poster-radius: 2px;
    position: relative;
    display: flex;
    flex-direction: column;
    scroll-margin-top: 5.5rem; /* clears the sticky topbar */
    background: var(--poster-bg);
    color: var(--ink);
    border-radius: var(--poster-radius);
    box-shadow: var(--shadow-paper);
}
.poster--cyan { --poster-bg: var(--cyan); }

.poster-plate {
    position: relative;
    overflow: hidden;
    background: var(--poster-bg);
    aspect-ratio: 3 / 2;
    /* The poster can't clip (stub notches and tapes stick out), so the photo rounds the poster
       corners it touches: top two when stacked, per layout below otherwise. */
    border-radius: var(--poster-radius) var(--poster-radius) 0 0;
}
.poster-plate img { width: 100%; height: 100%; object-fit: cover; }

.poster-name {
    font-family: var(--display);
    font-weight: 900;
    line-height: 0.92;
    text-transform: uppercase;
    letter-spacing: -0.005em;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
.poster-date { font-weight: 700; }
.poster-date span { display: block; font-weight: 500; color: var(--ink-soft); }
.poster--cyan .poster-date span { color: var(--ink); }
.poster-when {
    font-family: var(--display);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}
.poster-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.poster-tags li {
    list-style: none;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    padding: 0 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.5rem;
}
.poster-desc { color: var(--ink-soft); }
.poster--cyan .poster-desc { color: var(--ink); }
.poster-spots { font-weight: 700; }

/* Talón: separado del afiche por un troquel con muescas, como el isotipo. */
.stub {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem 1.1rem;
    border-top: 2px dashed rgb(18 33 45 / 0.45);
    transition: transform 280ms var(--ease-out);
}
.stub::before, .stub::after {
    content: "";
    position: absolute;
    top: -0.75rem;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--wall);
}
.stub::before { left: -0.7rem; }
.stub::after { right: -0.7rem; }
.stub-price {
    font-family: var(--display);
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.stub-price small { display: block; font-family: var(--text); font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.poster--cyan .stub-price small { color: var(--ink); }
.stub .btn { flex: none; }
.stub-note { font-weight: 700; color: var(--ink-soft); }
/* Firma: al comprar, el talón se desprende por el troquel. */
.stub.is-torn { transform: translate(0.5rem, 0.6rem) rotate(2.5deg); }

/* Franjas pegadas: EN VIVO, TU ENTRADA, FINALIZADO. */
.tape {
    position: absolute;
    z-index: 2;
    top: 1rem;
    left: -0.5rem;
    padding: 0.3rem 0.9rem 0.25rem;
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
    transform: rotate(-3deg);
    box-shadow: 0 1px 0 rgb(5 12 18 / 0.5);
}
.tape--live { background: var(--magenta); color: #fff; display: inline-flex; align-items: center; gap: 0.45rem; }
.tape--live::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #fff;
    animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }
.tape--owned { background: var(--ink); color: var(--cyan); }
.tape--ended {
    top: 4.5rem;
    left: -4%;
    right: -4%;
    text-align: center;
    background: var(--ink);
    color: var(--paper);
    font-size: 1.6rem;
    transform: rotate(-8deg);
}
.tape.is-new { animation: paste 650ms var(--ease-out) both; }
@keyframes paste {
    from { clip-path: inset(0 100% 0 0); transform: rotate(-3deg) scale(1.15); }
    to { clip-path: inset(0 0 0 0); transform: rotate(-3deg) scale(1); }
}
.poster.is-ended .poster-plate, .poster.is-ended .poster-body { opacity: 0.55; }
.poster.is-ended .poster-plate img { filter: grayscale(1); }

/* ---------- Afiche destacado ---------- */

.featured {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) 0;
}
.featured:empty { display: none; }
/* The photo is never cut: --plate-ratio is its real aspect (js/ui.js fitFeaturedPlate).
   Tall or square photos sit beside the text at about 30rem high; wide ones (.is-landscape)
   run across the top. */
.poster--featured {
    --plate-ratio: 0.8;
    display: grid;
    /* --plate-w comes from js/ui.js sizeFeaturedPlate; the clamp is the fallback before it runs. */
    grid-template-columns: var(--plate-w, clamp(28%, calc(30rem * var(--plate-ratio)), 45%)) minmax(0, 1fr) minmax(15rem, 22%);
}
.poster--featured .poster-plate { aspect-ratio: var(--plate-ratio); align-self: start; border-radius: var(--poster-radius) 0 0 var(--poster-radius); }
.poster--featured.is-landscape .poster-plate { border-radius: var(--poster-radius) 0 0 0; }
.poster--featured:not(.is-landscape) .poster-body { align-self: start; }
.poster--featured .poster-desc.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.poster--featured.is-landscape { grid-template-columns: minmax(0, 1fr) minmax(15rem, 24%); }
.poster--featured.is-landscape .poster-plate { grid-column: 1; grid-row: 1; }
.poster--featured.is-landscape .poster-body { grid-column: 1; grid-row: 2; padding-top: clamp(1.5rem, 3vw, 2.25rem); }
.poster--featured.is-landscape .stub { grid-column: 2; grid-row: 1 / span 2; }
.poster--featured .poster-body {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    padding-top: clamp(3rem, 5vw, 3.75rem);
}
.poster--featured .poster-body { container-type: inline-size; }
/* Sized from the text column, so a wide photo beside it never squeezes the name into slivers. */
.poster--featured .poster-name { font-size: clamp(2.5rem, 13cqi, 6rem); }
.poster--featured .poster-when { font-size: clamp(1.6rem, 2.6vw, 2.25rem); }
.poster--featured .poster-desc { max-width: 52ch; }
.poster--featured .stub {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 1.25rem;
    padding: 2rem 1.5rem 2.5rem;
    border-top: 0;
    border-left: 2px dashed rgb(18 33 45 / 0.45);
}
.poster--featured .stub::before, .poster--featured .stub::after { left: -0.75rem; right: auto; }
.poster--featured .stub::before { top: -0.7rem; }
.poster--featured .stub::after { top: auto; bottom: -0.7rem; }
.poster--featured .stub-price { font-size: clamp(2.5rem, 4vw, 3.5rem); }
.poster--featured .stub .btn { min-height: 3.5rem; font-size: 1.45rem; white-space: nowrap; padding-inline: 0.9rem; }
.poster--featured .stub.is-torn { transform: translate(0.6rem, 0.4rem) rotate(2deg); }

/* ---------- Cartelera ---------- */

.wall {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(3rem, 7vw, 5rem) var(--gutter) clamp(3rem, 7vw, 5rem);
}
.wall-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; margin-bottom: 1.25rem; }
.wall-head h2 {
    font-family: var(--display);
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}
.wall-head p {
    max-width: 46ch;
    padding-left: 1.5rem;
    border-left: 2px solid var(--wall-line); /* separador vertical junto al título */
    color: var(--on-wall-soft);
}

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.filter-btn {
    min-height: 2.5rem;
    padding: 0.35rem 1rem;
    border: 1.5px solid var(--wall-line);
    border-radius: 999px;
    background: transparent;
    color: var(--on-wall);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 160ms, border-color 160ms, color 160ms;
}
.filter-btn:hover { border-color: var(--on-wall-soft); }
.filter-btn.active { background: var(--paper); border-color: var(--paper); color: var(--ink); }

.events-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2.25rem 1.75rem;
    align-items: start;
}
.events-grid > * { grid-column: span 2; }
.events-grid > .no-results { grid-column: 1 / -1; }
.events-grid .span-3 { grid-column: span 3; }
.events-grid .span-4 { grid-column: span 4; }
.events-grid .span-6 { grid-column: span 6; }
.events-grid .poster--wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.events-grid .poster--wide .poster-plate { aspect-ratio: auto; height: 100%; min-height: 16rem; border-radius: var(--poster-radius) 0 0 0; }
.events-grid .poster--wide .stub { grid-column: 1 / -1; }
.events-grid .poster--wide .poster-name { font-size: clamp(2.4rem, 3.6vw, 3.25rem); }
.events-grid .poster--wide { align-self: stretch; }

.events-grid:focus { outline: none; }
.events-grid .poster { transform: rotate(var(--tilt, 0deg)); transition: transform 300ms var(--ease-out); }
.events-grid .poster:nth-child(3n + 1) { --tilt: -0.6deg; }
.events-grid .poster:nth-child(3n + 2) { --tilt: 0.4deg; }
.events-grid .poster:nth-child(3n) { --tilt: -0.2deg; }
.events-grid .poster:hover, .events-grid .poster:focus-within { --tilt: 0deg; }
.events-grid .poster-body { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.1rem 1.1rem 1.25rem; flex: 1; }
.events-grid .poster-name { font-size: clamp(2rem, 2.6vw, 2.5rem); }
.events-grid .poster-when { font-size: 1.35rem; }
.events-grid .poster-desc {
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.no-results {
    grid-column: 1 / -1;
    padding: 3rem 1rem;
    border: 2px dashed var(--wall-line);
    border-radius: var(--radius);
    color: var(--on-wall-soft);
    text-align: center;
}
.no-results p + * { margin-top: 1rem; }
.no-results .btn { color: var(--on-wall); }

/* Esqueleto de carga: siluetas de afiches. */
.skeleton {
    border-radius: 2px;
    background: var(--wall-raised);
    animation: breathe 1.4s ease-in-out infinite;
}
.skeleton--poster { aspect-ratio: 3 / 4.6; }
.skeleton--featured { height: clamp(22rem, 40vw, 28rem); }
@keyframes breathe { 50% { opacity: 0.55; } }

/* ---------- Pie ---------- */

.site-foot { border-top: 1px solid var(--wall-line); }
.foot-pattern {
    height: 9rem;
    background: url("../assets/brand/patron-franja.png") repeat-x left center / auto 100%;
}
.foot-grid {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 2.5rem var(--gutter) 2rem;
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
    gap: 2rem;
    color: var(--on-wall-soft);
    font-size: 0.92rem;
}
.foot-brand img { height: 4.5rem; width: auto; margin-bottom: 1rem; }
.foot-brand strong { color: var(--on-wall); }
.foot-title {
    margin-bottom: 0.75rem;
    font-family: var(--display);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--on-wall);
}
.foot-col ul { display: grid; gap: 0.5rem; list-style: none; }
.foot-col a { color: var(--on-wall-soft); text-decoration: none; text-underline-offset: 0.2em; }
.foot-col a:hover { color: var(--on-wall); text-decoration: underline; }
.foot-legal {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1rem var(--gutter) 2rem;
    border-top: 1px solid var(--wall-line);
    color: var(--on-wall-soft);
    font-size: 0.82rem;
    text-align: center;
}
@media (max-width: 960px) {
    .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .foot-brand { grid-column: 1 / -1; display: flex; align-items: center; gap: 1.25rem; }
    .foot-brand img { margin-bottom: 0; }
}
@media (max-width: 640px) {
    .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .foot-brand { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

/* ---------- Diálogos: hoja de taquilla ---------- */

.dialog {
    width: min(36rem, calc(100% - 2rem));
    max-height: calc(100dvh - 2rem);
    margin: auto;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--ink);
    overflow: visible;
}
.dialog-wide { width: min(64rem, calc(100% - 2rem)); }
.dialog::backdrop { background: rgb(8 15 21 / 0.82); }
.dialog[open] { animation: sheet-in 360ms var(--ease-out); }
.dialog[open]::backdrop { animation: fade-in 260ms ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(1.5rem); } }
@keyframes fade-in { from { opacity: 0; } }

.sheet {
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--paper);
    color: var(--ink);
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px rgb(5 12 18 / 0.6);
    scrollbar-color: var(--paper-shade) var(--paper);
}
.sheet :focus-visible { outline-color: var(--ink); }
.sheet-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
}
.sheet-head h1, .sheet-head h2 {
    font-family: var(--display);
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}
.close-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.5rem;
    padding: 0.3rem 0.8rem;
    border: 1.5px solid currentColor;
    border-radius: 999px;
    background: transparent;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}
.close-btn:hover { background: var(--ink); color: var(--paper); }
.sheet-body { padding: 1.25rem; }
.sheet-body > * + * { margin-top: 1rem; }
.sheet-body form { display: grid; gap: 1.1rem; }
.sheet-body form > * + * { margin-top: 0; }
.sheet-body form > .btn { margin-top: 0.4rem; }
.sheet-body h3 { font-family: var(--display); font-size: 1.6rem; font-weight: 800; line-height: 1.05; text-transform: uppercase; }
.sheet .btn { width: 100%; }
.sheet .btn:not(.btn-primary) { border-color: var(--ink); }
.sheet .btn:not(.btn-primary):hover { background: rgb(18 33 45 / 0.07); }
.muted { color: var(--ink-soft); }
.small { font-size: 0.88rem; }

/* Pasos de la compra: siempre visibles. */
.steps {
    display: flex;
    margin: 0;
    padding: 0.75rem 1.25rem;
    gap: 0.5rem;
    background: var(--paper-shade);
    list-style: none;
    counter-reset: step;
}
.steps:empty { display: none; }
.steps li {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink-soft);
    counter-increment: step;
}
.steps li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    flex: none;
    width: 1.6rem;
    height: 1.6rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    font-size: 0.8rem;
}
.steps li[aria-current="step"] { color: var(--ink); }
.steps li[aria-current="step"]::before { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.steps li.done { color: var(--ink); }
.steps li.done::before {
    content: "";
    border-color: var(--cyan);
    background: var(--cyan) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%2312212D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 70% no-repeat;
}

/* Resumen del evento en la hoja. */
.summary {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed rgb(18 33 45 / 0.35);
}
.summary-price {
    font-family: var(--display);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

/* Formularios. */
.field label { display: block; margin-bottom: 0.4rem; font-weight: 700; font-size: 0.92rem; }
.field input, .field select {
    width: 100%;
    min-height: 2.9rem;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font-size: 1rem;
    caret-color: var(--magenta);
    accent-color: var(--ink);
}
.field input::placeholder { color: #6B7A85; }
.field input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgb(179 18 63 / 0.15); }
.field-error { margin-top: 0.35rem; color: var(--error); font-weight: 700; font-size: 0.9rem; }
.field-error:empty { display: none; }
.field-hint { margin-top: 0.35rem; font-size: 0.85rem; color: var(--ink-soft); }
.field-row { display: flex; gap: 0.5rem; }
.field-row select { width: auto; flex: none; }
.field-row input { flex: 1; min-width: 0; }
.fieldset-note {
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius);
    background: var(--paper-shade);
    font-size: 0.9rem;
}
.form-error { color: var(--error); font-weight: 700; }
.form-error:empty { display: none; }

/* Pago Móvil. */
.amount {
    padding: 1rem;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    text-align: center;
}
.amount-label { font-weight: 700; font-size: 0.9rem; }
.amount-value {
    margin: 0.25rem 0 0.5rem;
    font-family: var(--display);
    font-size: clamp(2.6rem, 9vw, 3.4rem);
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.amount .copy-btn { margin: 0 auto; }
.pay-list { display: grid; gap: 0; }
.pay-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.25rem 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--paper-shade);
}
.pay-row dt { grid-column: 1; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); }
.pay-row dd { grid-column: 1; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.pay-row .copy-btn { grid-column: 2; grid-row: 1 / span 2; }
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.4rem;
    padding: 0.25rem 0.75rem;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}
.copy-btn:hover { background: var(--ink); color: var(--paper); }
.copy-btn.is-copied { background: var(--cyan); border-color: var(--cyan); color: var(--ink); }

.timer { display: grid; gap: 0.4rem; }
.timer-text { display: flex; justify-content: space-between; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-bar { height: 0.5rem; border-radius: 999px; background: var(--paper-shade); overflow: hidden; }
.timer-bar span { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; transition: transform 1s linear; }
.timer.is-urgent .timer-text { color: var(--magenta-press); }
.timer.is-urgent .timer-bar span { background: var(--magenta); }

.live-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius);
    background: var(--paper-shade);
    font-size: 0.92rem;
}
.live-line::before {
    content: "";
    flex: none;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--cyan);
}
.live-line.is-warning::before { background: var(--magenta); }

/* Resultado: sello pegado. */
.result { text-align: center; padding: 0.5rem 0; }
.stamp {
    display: inline-block;
    padding: 0.5rem 1.25rem 0.4rem;
    font-family: var(--display);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transform: rotate(-3deg);
    animation: paste 650ms var(--ease-out) both;
}
.stamp--ok { background: var(--ink); color: var(--cyan); }
.stamp--wait { background: var(--cyan); color: var(--ink); }
.stamp--bad { background: var(--paper-shade); color: var(--ink); border: 2px solid var(--ink); }
.result p { margin-top: 1rem; }
.actions { display: grid; gap: 0.6rem; }

.confirm-box {
    padding: 1rem;
    border: 2px solid var(--magenta);
    border-radius: var(--radius);
    background: #fff;
}
.confirm-box .actions { margin-top: 0.8rem; grid-template-columns: 1fr 1fr; }

/* Mis entradas: talones. */
.ticket-list { display: grid; gap: 0.9rem; list-style: none; }
.ticket-item {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 1rem 1.1rem 1rem 1.4rem;
    background: #fff;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
}
.ticket-item::before, .ticket-item::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: -0.55rem;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--paper);
}
.ticket-item::before { left: -0.6rem; clip-path: inset(0 0 0 calc(50% - 2px)); }
.ticket-item::after { right: -0.6rem; clip-path: inset(0 calc(50% - 2px) 0 0); }
.ticket-item .name { font-family: var(--display); font-size: 1.45rem; font-weight: 800; line-height: 1.05; text-transform: uppercase; }
.ticket-item .meta { font-size: 0.88rem; color: var(--ink-soft); }
.ticket-item .btn { width: auto; }
.ticket-state { font-weight: 700; font-size: 0.85rem; }
.ticket-state.is-live { color: var(--magenta-press); }

/* ---------- Reproductor ---------- */

.sheet-dark { background: var(--wall); color: var(--on-wall); border: 1px solid var(--wall-line); scrollbar-color: var(--wall-line) var(--wall); }
.sheet-dark :focus-visible { outline-color: var(--cyan); }
.sheet-dark .sheet-head { background: var(--wall); border-bottom-color: var(--wall-line); }
.sheet-dark .muted { color: var(--on-wall-soft); }
.sheet-dark .close-btn:hover { background: var(--paper); color: var(--ink); }
.sheet-dark .btn:not(.btn-primary) { border-color: var(--on-wall-soft); color: var(--on-wall); }
.player-wrapper { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
#playerMount {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1.5rem;
    text-align: center;
    background: var(--wall-raised) url("../assets/brand/patron-franja.png") repeat-x center bottom / auto 40%;
}
#playerMount h2 { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 900; line-height: 1; text-transform: uppercase; }
#playerMount .btn { width: auto; }
#playerMount .live-badge { position: static; }
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.9rem 0.25rem;
    background: var(--magenta);
    color: #fff;
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1;
    transform: rotate(-3deg);
}
.live-badge::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #fff; animation: blink 1.6s ease-in-out infinite; }
.live-video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.player-overlay {
    position: absolute;
    left: 50%;
    bottom: 3.5rem;
    transform: translateX(-50%);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: rgb(18 33 45 / 0.85);
    color: var(--on-wall);
    pointer-events: none;
}
.player-overlay[hidden] { display: none; }
.state-info { padding: 0.9rem 1.25rem; color: var(--on-wall-soft); }
.state-info:empty { display: none; }

/* ---------- Aviso flotante ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    z-index: 400;
    max-width: calc(100% - 2rem);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font-weight: 700;
    border: 2px solid var(--ink);
    transform: translateX(-50%);
    animation: toast-in 320ms var(--ease-out);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 1rem); } }

/* ---------- Páginas de enlace (acceso, inscripción) ---------- */

.link-page { max-width: 32rem; margin: clamp(2rem, 8vw, 5rem) auto; padding: 0 var(--gutter); }
.link-page .sheet { overflow: visible; max-height: none; }

/* ---------- Pantallas pequeñas ---------- */

@media (max-width: 960px) {
    .poster--featured { grid-template-columns: var(--plate-w, clamp(30%, calc(24rem * var(--plate-ratio)), 50%)) minmax(0, 1fr); }
    .poster--featured.is-landscape { grid-template-columns: minmax(0, 1fr); }
    .poster--featured.is-landscape .poster-plate,
    .poster--featured.is-landscape .poster-body,
    .poster--featured.is-landscape .stub { grid-column: 1; grid-row: auto; }
    .poster--featured .stub {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        padding: 1.25rem 1.5rem;
        border-left: 0;
        border-top: 2px dashed rgb(18 33 45 / 0.45);
    }
    .poster--featured .stub::before { top: -0.75rem; left: -0.7rem; bottom: auto; }
    .poster--featured .stub::after { top: -0.75rem; right: -0.7rem; left: auto; bottom: auto; }
    .poster--featured .stub .btn { flex: 0 1 18rem; }
    .poster--featured .poster-plate { border-radius: var(--poster-radius) 0 0 0; }
    .poster--featured.is-landscape .poster-plate { border-radius: var(--poster-radius) var(--poster-radius) 0 0; }
    .events-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .events-grid .span-3 { grid-column: span 2; }
    .events-grid .span-4, .events-grid .span-6 { grid-column: span 4; }
}
@media (max-width: 640px) {
    .topbar-logo img { height: 2.25rem; }
    .wall-head p { padding-left: 0; border-left: 0; }
    .btn-quiet span:not(.count) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .poster--featured { grid-template-columns: 1fr; }
    .poster--featured .poster-plate,
    .poster--featured.is-landscape .poster-plate,
    .events-grid .poster--wide .poster-plate { border-radius: var(--poster-radius) var(--poster-radius) 0 0; }
    .poster--featured .poster-plate { aspect-ratio: var(--plate-ratio); }
    .poster--featured .poster-body { padding-top: 1.5rem; }
    .poster--featured .stub { flex-direction: column; align-items: stretch; }
    .poster--featured .stub .btn { flex: none; }
    .events-grid { grid-template-columns: 1fr; }
    .events-grid > *, .events-grid .poster--wide, .events-grid .span-3, .events-grid .span-4, .events-grid .span-6 { grid-column: auto; }
    .events-grid .poster--wide { display: flex; }
    .events-grid .poster--wide .poster-plate { aspect-ratio: 3 / 2; height: auto; min-height: 0; }
    .events-grid .poster--wide { align-self: auto; }
    .dialog, .dialog-wide { width: 100%; max-width: 100%; max-height: 94dvh; margin: auto auto 0; }
    .dialog[open] { animation-name: sheet-up; }
    .sheet { max-height: 94dvh; border-radius: 10px 10px 0 0; }
    .steps li { font-size: 0.78rem; }
    @keyframes sheet-up { from { transform: translateY(100%); } }
}

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