@media (max-width: 600px) {
    .home-scratch-panel {
        /* content-sized: tickets + shop stacked, not overlapping */
        height: auto;
        min-height: 0;
        padding: 12px 10px 16px 12px;
    }

    .home-scratch-title {
        font-size: 13px;
    }

    .home-scratch-background {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .home-scratch-top {
        position: relative;
        z-index: 2;
        flex: 0 0 auto;
        gap: 5px;
        padding: 7px 7px 10px;
        min-width: 0;
    }

    .home-scratch-particles {
        display: none;
    }

    .home-scratch-shop {
        position: relative;
        z-index: 1;
        left: auto;
        bottom: auto;
        width: min(94%, 420px);
        margin: 4px auto 0;
        transform: none;
        flex: 0 0 auto;
        overflow: hidden;
        /* crop empty banner-pole region; show counter + cat */
        aspect-ratio: 463 / 250;
    }

    .home-scratch-shop-banner {
        display: none;
    }

    .home-scratch-shop-stand {
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        z-index: var(--shop-stand-layer);
    }

    .home-scratch-counter-pattern {
        top: auto;
        bottom: 28%;
        height: 42%;
    }

    .home-scratch-character {
        --character-width: 34%;
        --character-bottom: 8%;
    }

    .home-scratch-cash-register {
        --register-bottom: 22%;
    }

    .home-scratch-shop-sign {
        top: 28%;
    }

    .home-scratch-tickets {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
        width: 100%;
        min-width: 0;
        padding: 2px 4px 8px;
        padding-inline-end: 18px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        scrollbar-color: #24ddd4 #2a1760;
        scrollbar-width: thin;
    }

    .home-scratch-tickets::-webkit-scrollbar {
        height: 10px;
    }

    .home-scratch-tickets::-webkit-scrollbar-track {
        border: 2px solid #14102e;
        background: #2a1760;
        box-shadow: inset 1px 1px 0 #10385d, inset -1px -1px 0 #9ffff1;
    }

    .home-scratch-tickets::-webkit-scrollbar-thumb {
        border: 2px solid #14102e;
        background: linear-gradient(180deg, #a8f2ff 0%, #24ddd4 55%, #1a9aaa 100%);
        box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.55);
    }

    .home-scratch-ticket {
        flex: 0 0 58vw;
        max-width: 180px;
        scroll-snap-align: start;
        touch-action: pan-x;
        grid-template-rows: auto minmax(1.8em, 1.8em) minmax(28px, auto) minmax(2.4em, 2.4em) auto auto;
        filter: drop-shadow(2px 2px 0 rgba(20, 10, 45, 0.55));
    }

    .home-scratch-ticket-icon {
        width: clamp(22px, 12vw, 34px);
        margin: 0 auto;
    }

    .home-scratch-ticket-name {
        font-size: clamp(11px, 3.4vw, 14px);
    }

    .home-scratch-ticket-prize {
        font-size: clamp(8px, 2.4vw, 10px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-scratch-background,
    .home-scratch-counter-pattern,
    .home-scratch-character-performer,
    .home-scratch-speech-bubble,
    .home-scratch-marquee-track,
    .home-scratch-logo-main,
    .home-scratch-ticket,
    .home-scratch-ticket::after,
    .home-scratch-ticket.is-attention-prompt {
        animation: none;
        transition: none;
    }
}

.home-scratch-wallet-status {
    min-height: 1em;
    color: #fff3a5;
    font-size: clamp(10px, 1.9cqw, 12px);
    line-height: 1.15;
    text-align: center;
    text-shadow: 1px 1px 0 #2b114f;
}

.home-scratch-wallet.is-denied {
    animation: scratch2000WalletDenied 300ms steps(3, end);
}

.home-scratch-ticket.is-unaffordable {
    cursor: not-allowed;
    filter: grayscale(0.42) brightness(0.72) drop-shadow(3px 3px 0 rgba(20, 10, 45, 0.65));
}

.home-scratch-ticket.is-unaffordable .home-scratch-ticket-buy {
    cursor: not-allowed;
}

.home-scratch-ticket.is-attention-prompt {
    z-index: 2;
    animation: homeScratchTicketAttention 820ms cubic-bezier(0.2, 0.86, 0.32, 1.2) both;
}

@keyframes homeScratchTicketAttention {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0);
        filter: saturate(1) drop-shadow(3px 3px 0 rgba(20, 10, 45, 0.65));
    }
    22% {
        transform: translateY(-4px) scale(1.09) rotate(-1.8deg);
        filter: saturate(1.24) brightness(1.12) drop-shadow(6px 7px 0 rgba(48, 12, 92, 0.76));
    }
    38% {
        transform: translateY(-3px) scale(1.08) rotate(1.6deg);
    }
    53% {
        transform: translateY(-3px) scale(1.06) rotate(-1.1deg);
    }
    72% {
        transform: translateY(1px) scale(0.97) rotate(0.4deg);
    }
    88% {
        transform: translateY(-1px) scale(1.025) rotate(-0.2deg);
    }
}
