/* ── ART: three lottery tickets, scratched by dragging the coin over them ── */
/* overflow-x: clip keeps the dragged coin from widening the page on phones; it can still move up and down. */
.art-section { position: relative; overflow-x: clip; overflow-y: visible; padding-top: 48px; padding-bottom: 64px; }
.art-section .section-label { width: auto; margin: 0 0 30px; opacity: .55; }
.art-stage {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: clamp(32px, 5vw, 80px);
}
.art-editorial-grid {
    --ticket-w: clamp(150px, 14.5vw, 206px);
    display: flex;
    gap: clamp(14px, 1.8vw, 26px);
    width: auto;
    margin: 0;
}

/* The paper. Its perforated edges are a mask on ::before so the shadow follows them. */
.art-ticket {
    --ink: #1E1A15;
    position: relative;
    isolation: isolate;
    flex: 0 0 var(--ticket-w);
    width: var(--ticket-w);
    min-width: 0;
    padding: 11px 10px 0;
    color: var(--ink);
    transform: rotate(var(--tilt, 0deg));
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .4)) drop-shadow(0 12px 14px rgba(0, 0, 0, .5));
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.art-ticket::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .35 0 0 0 0 .24 0 0 0 .55 -.12'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23p)'/%3E%3C/svg%3E") 0 0 / 160px 160px,
        linear-gradient(172deg, #F3ECDC 0%, #E9E0CA 62%, #E0D5BC 100%);
    -webkit-mask:
        radial-gradient(circle at 50% 0, #0000 2.3px, #000 2.8px) top / 7px 51% repeat-x,
        radial-gradient(circle at 50% 100%, #0000 2.3px, #000 2.8px) bottom / 7px 51% repeat-x;
    mask:
        radial-gradient(circle at 50% 0, #0000 2.3px, #000 2.8px) top / 7px 51% repeat-x,
        radial-gradient(circle at 50% 100%, #0000 2.3px, #000 2.8px) bottom / 7px 51% repeat-x;
}
.art-ticket.is-revealed { transform: rotate(calc(var(--tilt, 0deg) * .4)) translateY(-3px); }

.ticket-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
    font-family: 'DM Mono', monospace;
    font-size: 7px;
    letter-spacing: .16em;
    text-transform: uppercase;
    white-space: nowrap;
}
.ticket-brand { font-family: 'Cinzel', serif; font-size: 7.5px; letter-spacing: .14em; overflow: hidden; text-overflow: ellipsis; }
.ticket-no { color: var(--red); letter-spacing: .1em; }

.ticket-panel {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 3px;
    overflow: hidden;
    background: #161514;
    box-shadow: 0 0 0 1px rgba(30, 26, 21, .5), inset 0 1px 3px rgba(0, 0, 0, .6);
}
.art-ticket .art-editorial-card {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: #161514;
}
.art-ticket .art-editorial-card::before { content: none; }
.art-ticket .art-cover {
    filter: none;
    opacity: 1;
    transform: scale(1.01);
}
.art-ticket .art-cover--inverted { opacity: .55; transform: rotate(180deg) scale(.94); }
.art-ticket .art-editorial-card:hover .art-cover,
.art-ticket .art-editorial-card:focus-visible .art-cover { opacity: 1; transform: scale(1.06); }
.art-ticket .art-editorial-card:hover .art-cover--inverted { opacity: .7; transform: rotate(180deg) scale(1); }
.art-ticket .art-soon { font-size: 10px; opacity: .75; color: #EDE7D9; }

.ticket-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 9px 1px 0;
}
.art-ticket .art-frame-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: clamp(16px, 1.55vw, 22px);
    letter-spacing: .03em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--ink);
}
.ticket-of { font-family: 'DM Mono', monospace; font-size: 7.5px; letter-spacing: .1em; opacity: .55; }

/* A row of punched dots, then the small print on the stub. */
.ticket-stub {
    position: relative;
    margin: 8px -10px 0;
    padding: 8px 10px 12px;
    font-family: 'DM Mono', monospace;
    font-size: 6.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .6;
}
.ticket-stub::before {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    top: 0;
    height: 2px;
    background: radial-gradient(circle, rgba(30, 26, 21, .55) .9px, transparent 1.2px) 0 0 / 5px 2px repeat-x;
}

/* Scratch coating and its keyboard / tap button */
.ticket-coating {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    transition: opacity .55s ease;
}
.art-ticket.is-revealed .ticket-coating { opacity: 0; }
.ticket-key {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.ticket-key:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* The coin */
.art-coin-dock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: none;
}
.art-coin-dock[hidden] { display: none; }
.art-coin {
    position: relative;
    z-index: 40;
    width: 92px;
    height: 92px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.art-coin img {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .55)) drop-shadow(0 9px 10px rgba(0, 0, 0, .5));
    animation: coin-idle 3.4s ease-in-out infinite;
    transition: transform .2s ease, filter .2s ease;
}
.art-coin:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.art-coin.is-dragging { cursor: grabbing; }
.art-coin.is-dragging img {
    animation: none;
    transform: scale(1.08);
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)) drop-shadow(0 22px 18px rgba(0, 0, 0, .5));
}
.art-coin.is-used img { animation: none; }
.art-coin.nudge img { animation: coin-nudge .7s cubic-bezier(.3, .6, .3, 1); }
@keyframes coin-idle {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(6deg) translateY(-3px); }
}
@keyframes coin-nudge {
    0% { transform: none; }
    22% { transform: translateY(-14px) rotate(-18deg); }
    46% { transform: translateY(0) rotate(12deg); }
    66% { transform: translateY(-5px) rotate(-6deg); }
    100% { transform: none; }
}
.art-coin-hint {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--cream-dim);
    white-space: nowrap;
    transition: opacity .4s ease;
}
.art-coin-hint.is-hidden { opacity: 0; }
.art-coin-hint.is-pulsing { animation: hint-pulse .45s ease-in-out 3 alternate; }
@keyframes hint-pulse { to { color: var(--red); } }
.art-flake {
    position: fixed;
    z-index: 60;
    width: 5px;
    height: 4px;
    pointer-events: none;
    border-radius: 1px;
    background: linear-gradient(135deg, #f0d48a, #9c7428);
}
.art-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Phones and tablets: tickets across the full width, coin underneath within thumb reach. */
@media (max-width: 960px) {
    .art-section { padding-top: 40px; padding-bottom: 52px; }
    .art-stage { flex-direction: column-reverse; align-items: stretch; gap: 26px; }
    .art-editorial-grid { --ticket-w: auto; width: 100%; max-width: 640px; margin: 0 auto; gap: clamp(9px, 2.6vw, 20px); }
    .art-ticket { flex: 1 1 0; width: auto; }
    .art-coin-dock { flex-direction: row; justify-content: center; gap: 16px; }
    .art-coin { width: 70px; height: 70px; }
}
/* Phones: the tickets lie scattered down the table, big enough to see the art.
   The coin waits in a small tray that stays at the bottom of the screen, so it is
   always within reach of whichever ticket you are looking at. */
@media (max-width: 600px) {
    .art-editorial-grid { flex-direction: column; gap: 0; max-width: none; }
    .art-ticket { flex: none; width: min(80%, 300px); padding: 13px 12px 0; }
    .art-ticket:nth-child(odd) { align-self: flex-start; }
    .art-ticket:nth-child(even) { align-self: flex-end; }
    .art-ticket + .art-ticket { margin-top: -6px; }
    .ticket-head { margin-bottom: 10px; font-size: 8px; }
    .ticket-brand { font-size: 8.5px; }
    .art-ticket .art-frame-title { font-size: 24px; }
    .ticket-of { font-size: 8.5px; }
    .ticket-title { margin-top: 11px; }
    .ticket-stub { margin: 10px -12px 0; padding: 9px 12px 14px; font-size: 7.5px; }
    .art-ticket .art-soon { font-size: 12px; }
    .art-coin-dock {
        position: sticky;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        z-index: 30;
        align-self: center;
        gap: 14px;
        padding: 7px 20px 7px 8px;
        border: 1px solid var(--rule);
        border-radius: 999px;
        background: rgba(11, 11, 11, .86);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
    }
    :root[data-theme="light"] .art-coin-dock { background: rgba(238, 232, 218, .9); box-shadow: 0 10px 26px rgba(60, 45, 25, .2); }
    .art-coin { width: 58px; height: 58px; }
    /* Once the coin has been used, the tray shrinks to just the coin. */
    .art-coin-hint.is-hidden { display: none; }
    .art-coin-dock:has(.art-coin-hint.is-hidden) { padding: 7px; }
}
@media (prefers-reduced-motion: reduce) {
    .art-coin img, .art-coin.nudge img { animation: none; }
    .art-ticket, .ticket-coating { transition: none; }
}
