:root {
    --card-width: 400px;
    --card-height: 302px;
    --text-color: #14181f;
    --sheen-x: 50%;
    --sheen-y: 50%;
    --sheen-opacity: 0.06;
    --mouse-x: 50%;
    --mouse-y: 50%;
    --pointer-x: 200px;
    --pointer-y: 120px;
    --iridescent-radius: 500px;
    --pointer-x-pct: 50%;
    --pointer-y-pct: 50%;
    --foil-x: 50%;
    --foil-y: 50%;
    --foil-sheen-strength: 0.15;
    --sheen-flow-x: 0%;
    --sheen-flow-y: 0%;
    --foil-texture-shift-x: 0px;
    --foil-texture-shift-y: 0px;
    --foil-anisotropy-angle: 132deg;
    --foil-prism-hue: 0deg;
    --press-scale: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background:
        radial-gradient(
            132% 116% at 50% 12%,
            #4b5158 0%,
            #2d3137 42%,
            #1b1e23 100%
        );
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
}

/* ─── 3D Tilt Container ─── */
.card-wrapper {
    position: relative;
    width: var(--card-width);
    height: var(--card-height);
    border-radius: 16px;
    box-shadow:
        0 30px 74px rgba(0, 0, 0, 0.5),
        0 11px 0 rgba(26, 30, 36, 0.56),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    background-color: #f5f6f7;

    /* 3D Parallax tilt — driven by TiltController.js CSS custom properties.
       perspective() must be in the transform function (not the property)
       so it applies to this element itself, not just its children. */
    transform-style: preserve-3d;
    transform:
        perspective(800px)
        rotateX(calc(var(--tilt-x, 0) * 1deg))
        rotateY(calc(var(--tilt-y, 0) * 1deg))
        scale(calc(1 - var(--press-scale, 0)));
    will-change: transform;
}

/* Settled state: ease back to flat, become a static element */
.card-wrapper.settled {
    transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale(1);
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-wrapper.scratch-active {
    --press-scale: 0.006;
    box-shadow:
        0 24px 52px rgba(0, 0, 0, 0.48),
        0 11px 0 rgba(26, 30, 36, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ─── Revealed Base Layer ─── */
.card-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1;

    background:
        linear-gradient(
            42deg,
            rgba(112, 26, 74, 0.99) 0%,
            rgba(174, 51, 88, 0.985) 22%,
            rgba(233, 97, 43, 0.992) 56%,
            rgba(250, 171, 74, 0.995) 82%,
            rgba(255, 229, 143, 0.99) 100%
        ),
        radial-gradient(
            138% 118% at calc(12% + (var(--tilt-y, 0) * 1.4%)) calc(88% + (var(--tilt-x, 0) * 1.1%)),
            rgba(93, 19, 63, 0.42) 0%,
            rgba(93, 19, 63, 0) 58%
        ),
        radial-gradient(
            128% 116% at calc(88% - (var(--tilt-y, 0) * 1.6%)) calc(10% - (var(--tilt-x, 0) * 1.2%)),
            rgba(255, 236, 164, 0.52) 0%,
            rgba(255, 236, 164, 0) 62%
        );
    background-blend-mode: normal, multiply, screen;
}

/* Engraved metallic-foil micro texture, not printed grain. */
.card-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(
            168deg,
            rgba(255, 214, 146, 0.22) 0%,
            rgba(247, 147, 70, 0.1) 42%,
            rgba(97, 25, 60, 0.24) 100%
        ),
        repeating-linear-gradient(
            calc(36deg + (var(--tilt-y, 0) * 2.2deg)),
            rgba(255, 245, 219, 0.25) 0 0.75px,
            rgba(142, 46, 83, 0.08) 0.75px 1.35px,
            rgba(0, 0, 0, 0) 1.35px 2.8px
        ),
        repeating-linear-gradient(
            calc(126deg + (var(--tilt-x, 0) * -2deg)),
            rgba(255, 224, 173, 0.2) 0 0.6px,
            rgba(103, 24, 63, 0.18) 0.6px 1.4px,
            rgba(0, 0, 0, 0) 1.4px 2.9px
        ),
        radial-gradient(
            circle at 1.35px 1.35px,
            rgba(255, 255, 255, 0.16) 0.44px,
            rgba(0, 0, 0, 0) 0.84px
        ),
        radial-gradient(
            circle at 2px 2px,
            rgba(102, 25, 61, 0.16) 0.42px,
            rgba(0, 0, 0, 0) 0.82px
        );
    background-size: 100% 100%, 20px 20px, 14px 14px, 6px 6px, 8px 8px;
    background-position:
        center,
        calc(var(--foil-texture-shift-x, 0px) * 0.32) calc(var(--foil-texture-shift-y, 0px) * 0.32),
        calc(var(--foil-texture-shift-x, 0px) * -0.26) calc(var(--foil-texture-shift-y, 0px) * -0.26),
        calc(50% + (var(--foil-texture-shift-x, 0px) * 0.42)) calc(50% + (var(--foil-texture-shift-y, 0px) * 0.42)),
        calc(50% + (var(--foil-texture-shift-x, 0px) * -0.36)) calc(50% + (var(--foil-texture-shift-y, 0px) * -0.36));
    background-blend-mode: normal, overlay, multiply, screen, multiply;
    mix-blend-mode: color-dodge;
    pointer-events: none;
    z-index: 2;
    border-radius: inherit;
    opacity: 0.95;
}

/* Gloss + specular response, with a strong top-right luxury highlight. */
.card-content::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(
            142% 102% at calc(90% - (var(--tilt-y, 0) * 1.6%)) calc(10% - (var(--tilt-x, 0) * 1.3%)),
            rgba(255, 249, 224, 0.92) 0%,
            rgba(255, 239, 196, 0.42) 16%,
            rgba(255, 255, 255, 0) 56%
        ),
        repeating-linear-gradient(
            calc(128deg + (var(--foil-prism-hue, 0deg) * 0.5)),
            rgba(255, 218, 145, 0.24) calc(4.8% * 1),
            rgba(255, 184, 117, 0.22) calc(4.8% * 2),
            rgba(240, 120, 58, 0.18) calc(4.8% * 3),
            rgba(190, 62, 102, 0.17) calc(4.8% * 4),
            rgba(255, 218, 145, 0.24) calc(4.8% * 5)
        ),
        repeating-linear-gradient(
            calc(144deg + (var(--tilt-y, 0) * 1.1deg)),
            rgba(255, 255, 255, 0.16) 0 0.8px,
            rgba(255, 255, 255, 0) 0.8px 5.4px
        ),
        linear-gradient(
            calc(146deg + (var(--foil-prism-hue, 0deg) * 0.4)),
            rgba(255, 231, 170, 0.3) 0%,
            rgba(255, 176, 89, 0.08) 44%,
            rgba(111, 27, 66, 0.28) 100%
        );
    background-size: 100% 100%, 260% 260%, 20px 20px, 100% 100%;
    background-position:
        center,
        calc(((50% - var(--pointer-x-pct)) * 2) + 50%)
            calc(((50% - var(--pointer-y-pct)) * 2.3) + 50%),
        calc(var(--foil-texture-shift-x, 0px) * 0.25) calc(var(--foil-texture-shift-y, 0px) * 0.25),
        center;
    background-blend-mode: screen, soft-light, overlay, normal;
    pointer-events: none;
    z-index: 3;
    mix-blend-mode: screen;
    opacity: 0.28;
    border-radius: inherit;
    transition: opacity 0.12s linear;
}

.card-wrapper:hover .card-content::after {
    opacity: calc(0.34 + var(--foil-sheen-strength, 0.15) * 0.42);
}

.card-wrapper.scratch-active .card-content::after {
    opacity: calc(0.39 + var(--foil-sheen-strength, 0.15) * 0.44);
}

.card-wrapper.revealed .card-content::after {
    background-image:
        radial-gradient(
            146% 108% at calc(90% - (var(--tilt-y, 0) * 1.8%)) calc(10% - (var(--tilt-x, 0) * 1.6%)),
            rgba(255, 247, 213, 0.96) 0%,
            rgba(255, 227, 157, 0.46) 16%,
            rgba(255, 255, 255, 0) 60%
        ),
        repeating-linear-gradient(
            calc(128deg + (var(--foil-prism-hue, 0deg) * 0.78)),
            rgba(255, 232, 161, 0.34) calc(4.8% * 1),
            rgba(255, 196, 128, 0.3) calc(4.8% * 2),
            rgba(241, 123, 63, 0.25) calc(4.8% * 3),
            rgba(188, 62, 102, 0.24) calc(4.8% * 4),
            rgba(255, 232, 161, 0.34) calc(4.8% * 5)
        ),
        repeating-linear-gradient(
            calc(var(--foil-anisotropy-angle) + 10deg),
            rgba(255, 255, 255, 0.26) 0 0.8px,
            rgba(128, 36, 76, 0.22) 0.8px 1.8px,
            rgba(0, 0, 0, 0) 1.8px 3.1px
        ),
        linear-gradient(
            146deg,
            rgba(255, 231, 173, 0.2) 0%,
            rgba(255, 255, 255, 0) 52%,
            rgba(119, 30, 70, 0.3) 100%
        );
    background-size: 100% 100%, 300% 300%, 19px 19px, 100% 100%;
    background-position:
        center,
        calc(((50% - var(--pointer-x-pct)) * 2.2) + 50%)
            calc(((50% - var(--pointer-y-pct)) * 2.6) + 50%),
        calc(var(--foil-texture-shift-x, 0px) * 0.5) calc(var(--foil-texture-shift-y, 0px) * 0.5),
        center;
    background-blend-mode: screen, soft-light, overlay, normal;
    mix-blend-mode: screen;
    filter:
        saturate(1.66) brightness(1.12) contrast(1.16)
        hue-rotate(calc(var(--foil-hue-rotate, 0deg) + var(--foil-prism-hue, 0deg) * 1.2));
    opacity: calc(0.5 + var(--foil-sheen-strength, 0.15) * 0.42);
}

.card-wrapper.revealed .card-content::before {
    filter: saturate(1.24) contrast(1.14) brightness(1.04);
}

/* Settled specular: subtle fixed glow */
.card-wrapper.settled .card-content::after {
    transition: opacity 0.6s ease;
    opacity: 0.32;
}

/* ─── Prize Text ─── */
.prize-stack {
    position: relative;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    transform: translateY(14px);
}

.prize-text {
    font-family: "Luckiest Guy", "Arial Black", "Impact", sans-serif;
    font-size: clamp(46px, 7.8vw, 62px);
    font-weight: 400;
    color: #c78819;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.95px;
    margin: 0;
    background-image:
        radial-gradient(
            138% 116% at var(--pointer-x-pct) var(--pointer-y-pct),
            rgba(255, 255, 255, 0.92) 0%,
            rgba(255, 255, 255, 0.28) 20%,
            rgba(255, 255, 255, 0) 62%
        ),
        linear-gradient(
            182deg,
            rgba(255, 243, 187, 0.98) 0%,
            rgba(255, 223, 121, 0.97) 20%,
            rgba(235, 171, 46, 0.97) 42%,
            rgba(255, 238, 162, 0.95) 58%,
            rgba(212, 138, 22, 0.98) 76%,
            rgba(124, 73, 10, 0.99) 100%
        ),
        repeating-linear-gradient(
            calc(130deg + (var(--foil-prism-hue, 0deg) * 1.12)),
            rgba(119, 68, 9, 0.96) 0%,
            rgba(233, 170, 41, 0.94) 14%,
            rgba(255, 239, 167, 0.95) 28%,
            rgba(206, 132, 23, 0.96) 43%,
            rgba(255, 225, 136, 0.92) 58%,
            rgba(119, 68, 9, 0.96) 74%
        ),
        linear-gradient(
            36deg,
            rgba(255, 216, 132, 0.28) 0%,
            rgba(255, 255, 255, 0) 42%,
            rgba(154, 89, 14, 0.36) 100%
        );
    background-size: 100% 100%, 100% 100%, 250% 250%, 150% 150%;
    background-position:
        center,
        center,
        calc(((50% - var(--pointer-x-pct)) * 2.1) + 50%)
            calc(((50% - var(--pointer-y-pct)) * 2.4) + 50%),
        center;
    background-blend-mode: screen, normal, overlay, soft-light;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow:
        0 1px 0 rgba(255, 248, 224, 0.95),
        0 4px 0 rgba(93, 22, 67, 0.66),
        0 10px 20px rgba(78, 16, 56, 0.42),
        0 0 14px rgba(255, 214, 111, 0.32);
    filter: saturate(1.5) brightness(1.14) contrast(1.18);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 4;
}

.prize-text.revealed-pulse {
    transform: scale(1.1);
}

.bingo-icon {
    width: 18px;
    height: 18px;
    margin-top: 8px;
    color: #183265;
    stroke-width: 2.15;
    filter: drop-shadow(0 1px 0 rgba(255, 247, 231, 0.8)) drop-shadow(0 5px 10px rgba(19, 38, 72, 0.2));
    opacity: 0.92;
}

.scratch-hint {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 7;
    font-size: 10px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: rgba(255, 239, 216, 0.92);
    text-shadow: 0 1px 0 rgba(116, 39, 19, 0.35);
    pointer-events: none;
    user-select: none;
}

.reveal-check {
    font-size: 14px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(42, 93, 63, 0.98);
    text-shadow: none;
    opacity: 0;
    transform: translateY(7px) scale(0.96);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: none;
}

.reveal-check.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ─── Branding & Metadata ─── */
.branding {
    position: absolute;
    top: 20px;
    width: calc(100% - 40px);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: rgba(20, 24, 31, 0.72);
    font-weight: bold;
    letter-spacing: 1px;
    z-index: 4;
}

.metadata {
    position: absolute;
    bottom: 20px;
    width: calc(100% - 40px);
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: rgba(32, 38, 46, 0.55);
    letter-spacing: 0.5px;
    z-index: 4;
}

/* ─── Scratch Overlay Canvas ─── */
#scratch-foil {
    position: absolute;
    inset: 36px 14px 14px 14px;
    z-index: 5;
    border-radius: 12px;
    touch-action: none;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.52s ease-out;

    --scratch-mask-image: none;
    -webkit-mask-image: var(--scratch-mask-image);
    mask-image: var(--scratch-mask-image);
    -webkit-mask-mode: alpha;
    mask-mode: alpha;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-position: center;
    mask-position: center;

    --foil-anisotropy-angle: calc(132deg + (var(--tilt-y, 0) * 1.85deg) - (var(--tilt-x, 0) * 0.95deg));
    background-color: #c9ced4;
    background-image:
        linear-gradient(
            160deg,
            #f3f5f8 0%,
            #d3d9e1 28%,
            #b9c1cc 55%,
            #eef2f7 83%,
            #b1b8c4 100%
        ),
        radial-gradient(
            138% 108% at 88% 6%,
            rgba(255, 255, 255, 0.44) 0%,
            rgba(255, 255, 255, 0) 56%
        ),
        radial-gradient(
            132% 104% at 10% 90%,
            rgba(108, 121, 139, 0.22) 0%,
            rgba(108, 121, 139, 0) 64%
        ),
        repeating-linear-gradient(
            var(--foil-anisotropy-angle),
            rgba(250, 253, 255, 0.3) 0 0.7px,
            rgba(183, 191, 202, 0.17) 0.7px 1.4px,
            rgba(255, 255, 255, 0.05) 1.4px 2.2px
        ),
        repeating-linear-gradient(
            calc(var(--foil-anisotropy-angle) + 84deg),
            rgba(255, 255, 255, 0.14) 0 0.55px,
            rgba(119, 131, 149, 0.1) 0.55px 1.5px,
            rgba(0, 0, 0, 0) 1.5px 2.7px
        ),
        radial-gradient(
            circle at 1.4px 1.4px,
            rgba(255, 255, 255, 0.2) 0.55px,
            rgba(0, 0, 0, 0) 0.9px
        ),
        radial-gradient(
            circle at 2.1px 2.1px,
            rgba(55, 66, 82, 0.13) 0.45px,
            rgba(0, 0, 0, 0) 0.85px
        );
    background-size: 100% 100%, 100% 100%, 100% 100%, 180% 180%, 160% 160%, 6px 6px, 7px 7px;
    background-position:
        center,
        center,
        center,
        calc(50% + (var(--foil-texture-shift-x, 0px) * 0.5)) calc(50% + (var(--foil-texture-shift-y, 0px) * 0.5)),
        calc(50% - (var(--foil-texture-shift-x, 0px) * 0.5)) calc(50% - (var(--foil-texture-shift-y, 0px) * 0.5)),
        var(--foil-texture-shift-x, 0px) var(--foil-texture-shift-y, 0px),
        calc(0px - var(--foil-texture-shift-x, 0px)) calc(0px - var(--foil-texture-shift-y, 0px));
    background-blend-mode: normal, screen, multiply, soft-light, overlay, screen, multiply;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.28),
        inset 0 0 0 1px rgba(255, 255, 255, 0.44),
        inset 0 20px 30px rgba(255, 255, 255, 0.34),
        inset 0 -28px 36px rgba(74, 84, 98, 0.32);
    filter: saturate(1.09) brightness(1.01);
    transition: opacity 0.52s ease-out, filter 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.foil-signature {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -62%) rotate(-2.8deg);
    z-index: 0;
    color: #0e2959;
    -webkit-text-fill-color: transparent;
    font-family: "Snell Roundhand", "Apple Chancery", "Zapfino", "URW Chancery L", "Brush Script MT", "Lucida Handwriting", cursive;
    font-size: clamp(36px, 8.8vw, 56px);
    font-weight: 500;
    letter-spacing: 0.8px;
    line-height: 1;
    background-image:
        repeating-linear-gradient(
            calc(132deg + (var(--foil-prism-hue, 0deg) * 0.82)),
            rgba(6, 38, 93, 0.98) 0%,
            rgba(20, 56, 125, 0.96) 16%,
            rgba(85, 174, 255, 0.84) 34%,
            rgba(18, 58, 130, 0.95) 52%,
            rgba(7, 36, 92, 0.98) 100%
        ),
        radial-gradient(
            132% 112% at var(--pointer-x-pct) var(--pointer-y-pct),
            rgba(255, 255, 255, 0.86) 0%,
            rgba(255, 255, 255, 0.18) 20%,
            rgba(255, 255, 255, 0) 56%
        );
    background-size: 225% 225%, 100% 100%;
    background-position:
        calc(((50% - var(--pointer-x-pct)) * 2.2) + 50%)
            calc(((50% - var(--pointer-y-pct)) * 2.4) + 50%),
        center;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.34),
        0 7px 16px rgba(14, 41, 89, 0.2);
    filter: saturate(1.34) brightness(1.03) contrast(1.08);
    mix-blend-mode: multiply;
    opacity: 0.95;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

#scratch-foil::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    background-image:
        /* Layer 1: Pointer-driven glare core */
        radial-gradient(
            farthest-corner circle at var(--pointer-x-pct) var(--pointer-y-pct),
            hsla(0, 0%, 100%, 0.82) 7%,
            hsla(0, 0%, 100%, 0.54) 18%,
            hsla(0, 0%, 0%, 0.2) 86%
        ),
        /* Layer 2: Spectrum bands inspired by pokemon-cards-css sunpillar layering */
        repeating-linear-gradient(
            133deg,
            rgba(72, 224, 255, 0.44) calc(4.6% * 1),
            rgba(150, 246, 188, 0.42) calc(4.6% * 2),
            rgba(255, 224, 120, 0.4) calc(4.6% * 3),
            rgba(255, 170, 198, 0.42) calc(4.6% * 4),
            rgba(181, 146, 255, 0.44) calc(4.6% * 5),
            rgba(136, 198, 255, 0.43) calc(4.6% * 6),
            rgba(72, 224, 255, 0.44) calc(4.6% * 7)
        ),
        repeating-linear-gradient(
            calc(var(--foil-anisotropy-angle) + 6deg),
            rgba(246, 250, 255, 0.32) 0 0.8px,
            rgba(95, 108, 127, 0.2) 0.8px 1.8px,
            rgba(0, 0, 0, 0) 1.8px 3.2px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(188, 209, 226, 0.26) 0%,
            rgba(198, 225, 241, 0.33) 3.2%,
            rgba(185, 206, 223, 0.22) 6.1%,
            rgba(122, 138, 158, 0.24) 7.4%,
            rgba(122, 138, 158, 0.24) 8%
        ),
        radial-gradient(
            138% 112% at calc(50% + var(--sheen-flow-x, 0%)) calc(50% + var(--sheen-flow-y, 0%)),
            rgba(255, 255, 255, 0.28) 0%,
            rgba(255, 255, 255, 0) 62%
        );
    background-size: 100% 100%, 280% 280%, 180% 180%, 300% 100%, 100% 100%;
    background-position:
        center,
        calc(((50% - var(--pointer-x-pct)) * 2.4) + 50%)
            calc(((50% - var(--pointer-y-pct)) * 2.9) + 50%),
        calc(50% + (var(--foil-texture-shift-x, 0px) * 0.5))
            calc(50% + (var(--foil-texture-shift-y, 0px) * 0.5)),
        0% calc(((50% - var(--pointer-y-pct)) * 1.9) + 50%),
        center;
    background-blend-mode: soft-light, hue, overlay, screen, normal;
    mix-blend-mode: color-dodge;
    filter:
        brightness(0.76) contrast(2.35) saturate(1.65)
        hue-rotate(calc(var(--foil-hue-rotate, 0deg) + var(--foil-prism-hue, 0deg)));
    opacity: calc(0.42 + var(--foil-sheen-strength, 0.15) * 0.56);
    will-change: opacity, filter, background-position;
    transition: opacity 0.14s linear;
}

#scratch-foil::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    background:
        /* Pointer-tracking specular glare */
        radial-gradient(
            farthest-corner circle at var(--pointer-x-pct) var(--pointer-y-pct),
            hsla(0, 0%, 100%, 0.42) 10%,
            hsla(0, 0%, 100%, 0.2) 30%,
            hsla(0, 0%, 0%, 0) 80%
        ),
        repeating-linear-gradient(
            var(--foil-anisotropy-angle),
            rgba(255, 255, 255, 0.2) 0 0.7px,
            rgba(0, 0, 0, 0) 0.7px 2.35px
        ),
        repeating-linear-gradient(
            calc(var(--foil-anisotropy-angle) + 90deg),
            rgba(80, 92, 109, 0.11) 0 0.55px,
            rgba(0, 0, 0, 0) 0.55px 1.7px
        ),
        radial-gradient(
            circle at 1px 1px,
            rgba(255, 255, 255, 0.2) 0.48px,
            rgba(0, 0, 0, 0) 0.82px
        ),
        radial-gradient(
            circle at 1.6px 1.6px,
            rgba(60, 74, 92, 0.1) 0.44px,
            rgba(0, 0, 0, 0) 0.8px
        ),
        repeating-linear-gradient(
            112deg,
            rgba(255, 255, 255, 0.065) 0 1px,
            rgba(0, 0, 0, 0) 1px 5px
        ),
        linear-gradient(
            148deg,
            rgba(255, 255, 255, 0.07) 0%,
            rgba(255, 255, 255, 0) 46%,
            rgba(255, 255, 255, 0.06) 100%
        );
    background-size: 100% 100%, 170% 170%, 170% 170%, 4px 4px, 5px 5px, 16px 16px, 100% 100%;
    background-position:
        center,
        calc(50% + (var(--foil-texture-shift-x, 0px) * 0.85)) calc(50% + (var(--foil-texture-shift-y, 0px) * 0.85)),
        calc(50% - (var(--foil-texture-shift-x, 0px) * 0.85)) calc(50% - (var(--foil-texture-shift-y, 0px) * 0.85)),
        var(--foil-texture-shift-x, 0px) var(--foil-texture-shift-y, 0px),
        calc(0px - var(--foil-texture-shift-x, 0px)) calc(0px - var(--foil-texture-shift-y, 0px)),
        calc(50% + (var(--foil-texture-shift-x, 0px) * 0.3)) calc(50% + (var(--foil-texture-shift-y, 0px) * 0.3)),
        center;
    background-blend-mode: screen, overlay, multiply, normal, normal, soft-light, normal;
    mix-blend-mode: soft-light;
    filter: brightness(1.08) contrast(1.7);
    opacity: 0.68;
}

.card-wrapper:hover #scratch-foil {
    filter: saturate(1.17) brightness(1.04);
}

.card-wrapper.scratch-active #scratch-foil {
    filter: saturate(1.3) brightness(1.06);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.55),
        inset 0 16px 28px rgba(255, 255, 255, 0.28),
        inset 0 -22px 34px rgba(72, 82, 97, 0.38);
}

.card-wrapper.scratch-active #scratch-foil::before {
    opacity: calc(0.5 + var(--foil-sheen-strength, 0.15) * 0.68);
}

#scratch-foil.fade-out {
    opacity: 0;
    pointer-events: none;
}

#scratch-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    touch-action: none;
}

#scratch-overlay.fade-out {
    opacity: 0;
}
