/* =========================================================
   RASPADITA DIGITAL PREMIUM — RESPONSIVE DEFINITIVA
========================================================= */

:root {
    --scratch-green: var(--verde-361, #43b02a);
    --scratch-green-light: var(--verde-claro, #63cf45);
    --scratch-panel: var(--panel, #111a17);
    --scratch-line: var(--linea, rgba(255,255,255,.14));
}

.scratch-section,
.scratch-section * {
    box-sizing: border-box;
}

.scratch-section {
    width: 100%;
    margin-top: 20px;
    padding: 0;
    color: var(--blanco, #fff);
    background: transparent;
    font-family: inherit;
}

.scratch-shell {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 34px;
    overflow: hidden;
    border: 1px solid var(--linea);
    border-radius: 15px;
    background:
        radial-gradient(circle at 90% 10%, rgba(67,176,42,.08), transparent 36%),
        linear-gradient(145deg, rgba(20,30,26,.98), rgba(7,13,11,.98));
    box-shadow: var(--sombra);
}

.scratch-header {
    margin: 0 auto 16px;
    text-align: center;
}

.scratch-eyebrow {
    display: block;
    color: var(--scratch-green-light);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .16em;
}

.scratch-header h2 {
    margin: 5px 0 0;
    font-size: clamp(1.9rem, 4vw, 3.25rem);
    line-height: 1;
    letter-spacing: -.04em;
    text-transform: uppercase;
}

.scratch-header h2 em {
    color: var(--scratch-green);
    font-style: normal;
}

.scratch-header p {
    margin: 8px 0 0;
    color: #dfe5e0;
    font-size: .9rem;
}

.scratch-ticket {
    position: relative;
    width: min(100%, 980px);
    margin-inline: auto;
    overflow: visible;
    border-radius: 16px;
    box-shadow: 0 18px 42px rgba(0,0,0,.42);
}

.scratch-ticket__image {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    border-radius: 16px;
    object-fit: contain;
    object-position: center;
    user-select: none;
    pointer-events: none;
}

/*
Zona interactiva calibrada exclusivamente sobre los cuatro números.
No ocupa toda la tarjeta ni toda la mancha plateada.
*/
.scratch-number-zone {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 43%;
    width: 50.25%;
    height: 32.3%;
    transform: translateX(-50%);
}

.scratch-number-result,
.scratch-canvas-wrap {
    position: absolute;
    inset: 0;
    border-radius: 13% / 25%;
}

.scratch-number-result {
    z-index: 1;
    display: grid;
    place-content: center;
    justify-items: center;
    overflow: hidden;
    border: 2px solid rgba(224,164,48,.95);
    background:
        radial-gradient(circle at center, rgba(255,248,209,.98), rgba(235,196,102,.96) 68%),
        linear-gradient(145deg, #fff3c5, #d5a33e);
    box-shadow:
        inset 0 0 0 3px rgba(255,255,255,.48),
        inset 0 0 22px rgba(97,53,0,.18),
        0 0 18px rgba(255,199,47,.45);
    color: #472154;
    text-align: center;
}

.scratch-number-result span {
    margin-bottom: 2px;
    font-size: clamp(.34rem, .75vw, .63rem);
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.scratch-number-result strong {
    font-size: clamp(2.15rem, 5.8vw, 5.2rem);
    line-height: .88;
    letter-spacing: .045em;
    font-variant-numeric: tabular-nums;
    text-shadow:
        0 0 14px rgba(255,227,114,.92),
        0 3px 0 rgba(255,255,255,.62);
}

.scratch-canvas-wrap {
    z-index: 2;
    overflow: hidden;
    touch-action: none;
    cursor: crosshair;
}

.scratch-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.scratch-canvas-wrap::before {
    content: "";
    position: absolute;
    inset: -18%;
    opacity: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at center,
            rgba(255,238,154,.48) 0%,
            rgba(255,195,48,.18) 38%,
            transparent 70%);
    transition: opacity .18s ease;
}

.scratch-canvas-wrap.is-scratching::before {
    opacity: 1;
}

.scratch-silver-particles {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: none;
}

.scratch-silver-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    opacity: 0;
    background: linear-gradient(145deg, #ffffff, #8f918f);
    box-shadow: 0 0 4px rgba(255,255,255,.7);
    animation: scratchSilverFall .55s ease-out forwards;
}

.scratch-hint {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #353635;
    font-size: clamp(1.1rem, 2.2vw, 1.55rem);
    font-weight: 950;
    letter-spacing: .14em;
    text-shadow:
        0 0 8px rgba(255,255,255,.55),
        0 1px 0 rgba(255,255,255,.9);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.scratch-hint.is-hidden {
    opacity: 0;
    transform: translateY(5px);
}

.scratch-flash {
    position: absolute;
    inset: -30%;
    opacity: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at center,
            rgba(255,255,255,1) 0%,
            rgba(255,236,145,.92) 18%,
            rgba(255,190,32,.40) 42%,
            transparent 70%);
    mix-blend-mode: screen;
}

.scratch-flash.is-active {
    animation: scratchGoldFlash .7s ease-out both;
}

.scratch-help {
    margin: 10px auto 0;
    color: #ccd4ce;
    font-size: .74rem;
    text-align: center;
}

.scratch-actions {
    width: min(100%, 780px);
    margin: 13px auto 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.scratch-whatsapp,
.scratch-reset {
    min-height: 52px;
    border-radius: 12px;
    font: inherit;
}

.scratch-whatsapp[hidden],
.scratch-reset[hidden] {
    display: none !important;
}

.scratch-whatsapp {
    min-width: 320px;
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 11px;
    padding: 7px 18px 7px 11px;
    color: #fff;
    text-decoration: none;
    border: 1px solid #75df55;
    background: linear-gradient(135deg, #3ebd28, #168b13);
    box-shadow: 0 12px 24px rgba(42,190,19,.22);
    transition: transform .2s ease, box-shadow .2s ease;
}

.scratch-whatsapp:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow:
        0 16px 30px rgba(42,190,19,.31),
        0 0 0 4px rgba(67,176,42,.10);
}

.scratch-whatsapp__icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding-right: 9px;
    border-right: 1px solid rgba(255,255,255,.22);
}

.scratch-whatsapp__icon svg {
    width: 27px;
    height: 27px;
    fill: currentColor;
}

.scratch-whatsapp__copy,
.scratch-whatsapp__copy strong,
.scratch-whatsapp__copy small {
    display: block;
}

.scratch-whatsapp__copy strong {
    font-size: .78rem;
    text-transform: uppercase;
}

.scratch-whatsapp__copy small {
    margin-top: 2px;
    color: rgba(255,255,255,.82);
    font-size: .67rem;
}

.scratch-reset {
    min-width: 220px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 18px;
    color: #fff;
    border: 1px solid rgba(99,207,69,.78);
    background: #08100d;
    cursor: pointer;
}

.scratch-reset span {
    color: var(--scratch-green-light);
    font-size: 1.55rem;
}

.scratch-reset strong {
    font-size: .75rem;
    text-transform: uppercase;
}

.scratch-legal {
    margin: 10px auto 0;
    color: #99a39c;
    font-size: .62rem;
    text-align: center;
}

.scratch-confetti {
    position: absolute;
    inset: 0;
    z-index: 8;
    overflow: hidden;
    pointer-events: none;
}

.scratch-confetti__piece {
    position: absolute;
    top: 55%;
    left: 50%;
    width: 6px;
    height: 11px;
    border-radius: 2px;
    background: #f4c84a;
    opacity: 0;
    animation: scratchConfetti .85s ease-out forwards;
}

.scratch-whatsapp.is-revealed {
    animation: scratchButtonPop .6s cubic-bezier(.2,.9,.35,1.2) both;
}

@keyframes scratchGoldFlash {
    0% { opacity: 0; transform: scale(.55); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.45); }
}

@keyframes scratchButtonPop {
    0% { opacity: 0; transform: translateY(8px) scale(.97); }
    65% { opacity: 1; transform: translateY(-2px) scale(1.02); }
    100% { opacity: 1; transform: none; }
}

@keyframes scratchConfetti {
    0% {
        opacity: 0;
        transform: translate(-50%,-50%) rotate(0) scale(.8);
    }
    12% { opacity: 1; }
    100% {
        opacity: 0;
        transform:
            translate(
                calc(-50% + var(--confetti-x)),
                calc(-50% + var(--confetti-y))
            )
            rotate(var(--confetti-rotate))
            scale(1);
    }
}

/* =========================================================
   MÓVIL: TODA LA SECCIÓN CABE EN UNA PANTALLA
========================================================= */
@media (max-width: 600px) {
    .scratch-section {
        min-height: 0;
        padding: 6px;
    }

    .scratch-shell {
        width: 100%;
        max-height: calc(100svh - 12px);
        min-height: 0;
        padding: 10px 7px 8px;
        border-radius: 12px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .scratch-header {
        flex: 0 0 auto;
        margin-bottom: 7px;
    }

    .scratch-eyebrow {
        font-size: .49rem;
        letter-spacing: .12em;
    }

    .scratch-header h2 {
        margin-top: 3px;
        font-size: clamp(1.35rem, 7vw, 1.75rem);
    }

    .scratch-header p {
        margin-top: 4px;
        font-size: .61rem;
    }
    .scratch-ticket {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        border-radius: 10px;
    }
    .scratch-ticket__image {
        width: 100%;
        height: auto;
        border-radius: 10px;
    }

    .scratch-number-result {
        border-width: 1px;
        box-shadow:
            inset 0 0 0 1px rgba(255,255,255,.45),
            inset 0 0 12px rgba(97,53,0,.16),
            0 0 10px rgba(255,199,47,.34);
    }

    .scratch-number-result span {
        display: none;
    }
    .scratch-number-zone {
        left: 50%;
        top: 41%;
        width: 58.5%;
        height: 37%;
        transform: translateX(-50%);
    }

    .scratch-number-result strong {
        font-size: clamp(1.85rem, 14vw, 3.35rem);
    }

    .scratch-hint {
        font-size: .88rem;
        letter-spacing: .10em;
    }

    .scratch-help {
        flex: 0 0 auto;
        margin-top: 6px;
        font-size: .53rem;
        line-height: 1.2;
    }

    .scratch-actions {
        flex: 0 0 auto;
        width: 100%;
        margin-top: 7px;
        display: grid;
        gap: 5px;
    }

    .scratch-whatsapp,
    .scratch-reset {
        width: 100%;
        min-width: 0;
        min-height: 39px;
        border-radius: 9px;
    }

    .scratch-whatsapp {
        grid-template-columns: 30px 1fr;
        gap: 7px;
        padding: 4px 10px 4px 7px;
    }

    .scratch-whatsapp__icon {
        width: 30px;
        height: 30px;
        padding-right: 6px;
    }

    .scratch-whatsapp__icon svg {
        width: 21px;
        height: 21px;
    }

    .scratch-whatsapp__copy strong {
        font-size: .64rem;
    }

    .scratch-whatsapp__copy small {
        display: none;
    }

    .scratch-reset {
        padding: 0 10px;
    }

    .scratch-reset span {
        font-size: 1.2rem;
    }

    .scratch-reset strong {
        font-size: .62rem;
    }

    .scratch-legal {
        flex: 0 0 auto;
        margin-top: 5px;
        font-size: .47rem;
        line-height: 1.2;
    }
}

@media (max-width: 370px) {
    .scratch-header p {
        display: none;
    }

    .scratch-help {
        font-size: .48rem;
    }
}

@media (max-height: 650px) and (max-width: 600px) {
    .scratch-shell {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .scratch-eyebrow,
    .scratch-header p,
    .scratch-help {
        display: none;
    }

    .scratch-header {
        margin-bottom: 5px;
    }

    .scratch-header h2 {
        margin: 0;
        font-size: 1.3rem;
    }

    .scratch-actions {
        margin-top: 5px;
    }

    .scratch-legal {
        margin-top: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scratch-section *,
    .scratch-section *::before,
    .scratch-section *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


@keyframes scratchSilverFall {
    0% {
        opacity: .95;
        transform: translate(-50%, -50%) scale(.7) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform:
            translate(
                calc(-50% + var(--silver-x)),
                calc(-50% + var(--silver-y))
            )
            scale(1.15)
            rotate(var(--silver-rotate));
    }
}

.scratch-canvas-wrap.is-scratching::before{opacity:1;filter:blur(8px);}
.scratch-flash.is-active{animation:scratchGoldFlash .9s ease-out both;}


/* =========================================================
   INTEGRACIÓN VISUAL CON RESULTADOS.CSS
========================================================= */
.scratch-section {
    width: 100%;
    margin-top: 20px;
    padding: 0;
    background: transparent;
}

.scratch-shell {
    width: 100%;
    margin: 0;
    border: 1px solid var(--linea);
    border-radius: 15px;
    background:
        radial-gradient(circle at 90% 10%, rgba(67,176,42,.08), transparent 36%),
        linear-gradient(145deg, rgba(20,30,26,.98), rgba(7,13,11,.98));
    box-shadow: var(--sombra);
}

@media (max-width: 600px) {
    .scratch-section {
        width: 100%;
        margin-top: 20px;
        padding: 0;
    }

    .scratch-shell {
        width: 100%;
        margin: 0;
        padding: 16px;
        border: 1px solid var(--linea);
        border-radius: 15px;
        box-shadow: var(--sombra);
    }
}


/* =========================================================
   BORDE EXACTO DEL INDEX — RESULTADOS.CSS
   Replica el bloque "INDEX UNIFICADO".
========================================================= */

.scratch-shell {
    border-width: 1px;
    border-style: solid;
    border-color: rgba(106, 240, 58, .48);
    border-radius: 15px;
    box-shadow:
        0 20px 48px rgba(0, 0, 0, .30),
        0 0 0 1px rgba(104, 238, 55, .035) inset,
        0 0 24px rgba(79, 213, 36, .10);
}

/* Acento luminoso superior igual al resto de las secciones del index. */
.scratch-shell::before {
    content: "";
    position: absolute;
    z-index: 5;
    top: -1px;
    left: 28px;
    width: 118px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        transparent,
        #76ef42,
        transparent
    );
    box-shadow: 0 0 12px rgba(111, 240, 61, .75);
    pointer-events: none;
}

@media (max-width: 600px) {
    .scratch-shell {
        border-width: 1px;
        border-style: solid;
        border-color: rgba(106, 240, 58, .48);
        border-radius: 15px;
        box-shadow:
            0 20px 48px rgba(0, 0, 0, .30),
            0 0 0 1px rgba(104, 238, 55, .035) inset,
            0 0 24px rgba(79, 213, 36, .10);
    }

    .scratch-shell::before {
        left: 18px;
        width: 92px;
    }
}
