
.home-qrcode-ad {
    --panel-color: #ff3ee7;
    position: relative;
    isolation: isolate;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0;
    overflow: visible;
    background:
        radial-gradient(circle at 84% 18%, rgba(44, 255, 244, 0.42), transparent 26%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 9px),
        linear-gradient(108deg, #071d63 0%, #560b91 48%, #b8099b 100%);
}

.home-qrcode-ad > canvas {
    z-index: 4;
    opacity: 0;
    transition: opacity 100ms linear;
}

.home-qrcode-ad.is-rainbow-active > canvas {
    opacity: 1;
}

.home-qrcode-ad-window {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    color: #10152b;
    text-align: left;
    background: #c9c9c9;
    box-shadow: none;
}

.home-qrcode-ad-titlebar {
    min-height: 25px;
    background: linear-gradient(90deg, #062d9b 0%, #00b9dc 40%, #ff3ed3 100%);
}

.home-qrcode-ad-title-icon {
    width: 17px;
    height: 17px;
    padding: 1px;
    object-fit: contain;
    background: white;
}

.home-qrcode-ad-titlebar-label {
    margin-left: auto;
    padding-right: 3px;
    color: #fffbd0;
    font-family: 'PixelOperatorMono', 'PixeloidSans', monospace;
    font-size: 10px;
    letter-spacing: 0.8px;
    text-shadow: 1px 1px 0 #501069;
    white-space: nowrap;
}

.home-qrcode-ad-body {
    position: relative;
    flex: 1;
    min-height: 0;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(225px, 43%);
    align-items: center;
    gap: 16px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(206, 255, 253, 0.52)),
        repeating-linear-gradient(0deg, transparent 0 18px, rgba(0, 82, 131, 0.12) 18px 19px),
        #b7ebef;
}

.home-qrcode-ad-copy,
.home-qrcode-ad-art {
    position: relative;
    z-index: 1;
}

.home-qrcode-ad-copy {
    padding-left: clamp(82px, 11vw, 132px);
}

.home-qrcode-ad-dancer {
    --dancer-translate-x: 0%;
    position: absolute;
    z-index: 2;
    left: 3px;
    bottom: -2px;
    width: clamp(84px, 12vw, 132px);
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transform: translateX(var(--dancer-translate-x)) scale(1);
    transform-origin: bottom center;
    transition: transform 220ms cubic-bezier(0.22, 0.8, 0.24, 1.35), filter 220ms ease;
    filter: drop-shadow(3px 3px 0 rgba(57, 10, 101, 0.38));
}

.home-qrcode-ad-dancer img {
    display: block;
    width: 100%;
    height: auto;
}

@media (hover: hover) {
    .home-qrcode-ad-dancer:hover:not(.is-switching) {
        transform: translateX(var(--dancer-translate-x)) scale(1.12) rotate(-2deg);
        filter: drop-shadow(5px 5px 0 rgba(57, 10, 101, 0.48));
    }
}

.home-qrcode-ad-dancer:focus-visible {
    outline: 2px dashed #ffea3b;
    outline-offset: 3px;
}

.home-qrcode-ad-dancer.is-switching {
    pointer-events: none;
    animation: home-qrcode-ad-dancer-switch 760ms cubic-bezier(0.22, 0.8, 0.24, 1.35) both;
}

@keyframes home-qrcode-ad-dancer-switch {
    0% {
        transform: translateX(var(--dancer-translate-x)) scale(1);
    }

    28% {
        transform: translateX(var(--dancer-translate-x)) scale(0.06);
    }

    58% {
        transform: translateX(var(--dancer-translate-x)) scale(1.18);
    }

    100% {
        transform: translateX(var(--dancer-translate-x)) scale(1);
    }
}

.home-qrcode-ad-kicker {
    width: fit-content;
    margin: 0 0 5px;
    padding: 2px 5px;
    border: 1px solid #4c0d70;
    background: #ffea3b;
    color: #2d0751;
    font-family: 'PixelOperatorMono', 'PixeloidSans', monospace;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.8px;
}

.home-qrcode-ad h2 {
    margin: 0;
    max-width: 620px;
    color: #142674;
    font-size: clamp(19px, 3vw, 32px);
    line-height: 0.98;
    animation: home-qrcode-ad-chromatic 1.65s steps(2, end) infinite;
}

@keyframes home-qrcode-ad-chromatic {
    0%, 100% {
        text-shadow: 2px 2px 0 #ffffff, 4px 4px 0 rgba(255, 55, 201, 0.46);
    }

    33% {
        text-shadow: -2px 1px 0 rgba(0, 242, 255, 0.82), 3px 2px 0 rgba(255, 30, 184, 0.72), 2px 2px 0 #ffffff;
    }

    67% {
        text-shadow: 2px -1px 0 rgba(0, 242, 255, 0.65), -3px 2px 0 rgba(255, 30, 184, 0.72), 2px 2px 0 #ffffff;
    }
}

.home-qrcode-ad-description {
    max-width: 600px;
    margin: 8px 0;
    color: #18294b;
    font-size: 13px;
    line-height: 1.25;
    font-weight: bold;
}

.home-qrcode-ad-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.home-qrcode-ad-badges span {
    padding: 3px 6px;
    border: 2px outset #e7f6ff;
    border-radius: 0;
    background: linear-gradient(#fffbc8 0%, #ffd95a 52%, #f49f28 100%);
    color: #152479;
    font-family: 'PixelOperatorMono', 'PixeloidSans', monospace;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 2px 2px 0 #7950a8;
}

.home-qrcode-ad-button {
    display: inline-block;
    padding: 6px 13px;
    border-color: #fffbb4 #5a006f #5a006f #fffbb4;
    background: linear-gradient(180deg, #fff865 0%, #ffb52d 50%, #ed4ba7 100%);
    color: #3b0d55;
    font-weight: bold;
    letter-spacing: 0.25px;
    text-decoration: none;
    animation: home-qrcode-ad-button-chromatic 1.45s steps(2, end) infinite;
    box-shadow: 0 0 0 1px #87258e, 2px 2px 0 rgba(48, 0, 71, 0.35);
}

@keyframes home-qrcode-ad-button-chromatic {
    0%, 100% {
        text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.45);
    }

    40% {
        text-shadow: -1px 0 0 rgba(0, 241, 255, 0.78), 2px 1px 0 rgba(255, 34, 196, 0.7), 1px 1px 0 rgba(255, 255, 255, 0.45);
    }

    72% {
        text-shadow: 1px -1px 0 rgba(0, 241, 255, 0.68), -2px 1px 0 rgba(255, 34, 196, 0.68), 1px 1px 0 rgba(255, 255, 255, 0.45);
    }
}

.home-qrcode-ad-button:hover {
    background: linear-gradient(180deg, #ffff9b 0%, #ffcd48 50%, #ff64bc 100%);
    transform: translate(-1px, -1px);
}

.home-qrcode-ad-art {
    justify-self: end;
    width: min(118%, 380px);
    padding: 5px;
    border: 2px outset #f6f6f6;
    background: #102b7d;
    transform: rotate(1.5deg);
    transform-origin: 52% 58%;
    animation: home-qrcode-ad-art-wobble 3.8s ease-in-out infinite;
    box-shadow: 4px 5px 0 rgba(82, 3, 105, 0.54), 0 0 0 3px rgba(29, 255, 243, 0.42);
}

@keyframes home-qrcode-ad-art-wobble {
    0%, 100% {
        transform: rotate(-2.2deg) translateY(1px);
    }

    50% {
        transform: rotate(2.2deg) translateY(-2px);
    }
}

.home-qrcode-ad-art img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #041059;
}

.home-qrcode-ad-statusbar {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 2px;
    padding: 2px 5px;
    border: 2px inset #a9a9a9;
    color: #192854;
    background: #d7d7d7;
    font-family: 'PixelOperatorMono', 'PixeloidSans', monospace;
    font-size: 10px;
}

@media (max-width: 700px) {
    .home-qrcode-ad-body {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .home-qrcode-ad-art {
        justify-self: center;
        width: min(100%, 340px);
    }
}

/* Mobile gets a deliberately separate, square mini-ad composition. */
@media (max-width: 600px) {
    .home-qrcode-ad {
        display: flex;
        width: 100%;
        aspect-ratio: 1 / 1;
        padding: 5px;
    }

    .home-qrcode-ad-titlebar-label {
        display: none;
    }

    .home-qrcode-ad-body {
        grid-template-rows: auto minmax(0, 1fr);
        gap: 5px;
        padding: 8px;
    }

    .home-qrcode-ad-copy {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-left: 0;
        text-align: center;
    }

    .home-qrcode-ad-kicker {
        margin-bottom: 4px;
    }

    .home-qrcode-ad h2 {
        max-width: 320px;
        font-size: clamp(18px, 6.4vw, 27px);
    }

    .home-qrcode-ad-description {
        display: none;
    }

    .home-qrcode-ad-badges {
        justify-content: center;
        margin: 6px 0 8px;
    }

    .home-qrcode-ad-art {
        align-self: center;
        width: min(77%, 275px);
    }

    .home-qrcode-ad-dancer {
        left: 50%;
        bottom: -1px;
        width: clamp(68px, 22vw, 94px);
        --dancer-translate-x: -50%;
    }

    .home-qrcode-ad-statusbar span:nth-child(2) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-qrcode-ad h2,
    .home-qrcode-ad-art,
    .home-qrcode-ad-dancer,
    .home-qrcode-ad-button {
        animation: none;
    }
}

