/* Raspadinha Premiada — visual Fredoka / Lilita One */
.scratch-scene {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 8px;
    font-family: 'Fredoka', 'Segoe UI', Arial, sans-serif;
}

.scratch-spark {
    position: fixed;
    width: var(--s);
    height: var(--s);
    left: var(--x);
    top: 110%;
    background: radial-gradient(circle, rgba(255, 235, 170, 0.9) 0%, rgba(255, 215, 106, 0.25) 55%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: scratchFloatUp var(--d) linear infinite;
    animation-delay: var(--dl);
    opacity: 0;
}

@keyframes scratchFloatUp {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    10%  { opacity: 0.8; }
    90%  { opacity: 0.5; }
    100% { transform: translateY(-115vh) translateX(40px); opacity: 0; }
}

.scratch-title {
    font-family: 'Lilita One', 'Fredoka', sans-serif;
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 400;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(180deg, #fff3c4 10%, #ffd76a 45%, #e89b1c 75%, #ffdf8a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 3px 0 rgba(120, 60, 0, 0.45)) drop-shadow(0 0 22px rgba(255, 200, 80, 0.45));
}

.scratch-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scratch-hint .coin {
    font-size: 1.2rem;
    animation: scratchCoinWiggle 2.2s ease-in-out infinite;
}

.scratch-area.ready {
    box-shadow:
        inset 0 4px 14px rgba(0, 0, 0, 0.35),
        0 0 0 2px rgba(240, 192, 64, 0.55),
        0 0 22px rgba(212, 160, 23, 0.25);
    animation: scratchReadyPulse 1.8s ease-in-out infinite;
}

@keyframes scratchReadyPulse {
    0%, 100% { box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(240, 192, 64, 0.45), 0 0 16px rgba(212, 160, 23, 0.18); }
    50% { box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(240, 192, 64, 0.7), 0 0 28px rgba(212, 160, 23, 0.35); }
}

.scratch-actions {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.scratch-reveal-all {
    appearance: none;
    border: 1px solid rgba(240, 192, 64, 0.45);
    background: rgba(0, 0, 0, 0.28);
    color: #ffe9b0;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s ease;
}

.scratch-reveal-all:hover:not(:disabled) {
    background: rgba(212, 160, 23, 0.22);
    border-color: #f0c040;
}

.scratch-reveal-all:disabled,
.scratch-reveal-all[hidden] {
    display: none;
}

.scratch-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1200;
    overflow: hidden;
}

.scratch-flake {
    position: absolute;
    background: linear-gradient(135deg, #fff, #b8c0ca 45%, #8a949f);
    border-radius: 1px;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
    animation: scratchFlakeFall 0.55s ease-out forwards;
    margin-left: -2px;
    margin-top: -2px;
}

@keyframes scratchFlakeFall {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.95;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
        opacity: 0;
    }
}

@keyframes scratchCoinWiggle {
    0%, 100% { transform: rotate(-15deg) translateY(0); }
    50%      { transform: rotate(15deg) translateY(-3px); }
}

.scratch-card-wrap {
    position: relative;
    animation: scratchFloaty 5s ease-in-out infinite;
}

@keyframes scratchFloaty {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

.scratch-card-wrap::before {
    content: '';
    position: absolute;
    inset: -45px;
    background: radial-gradient(ellipse, rgba(220, 38, 38, 0.22) 0%, rgba(212, 160, 23, 0.14) 45%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: scratchAura 4s ease-in-out infinite;
}

@keyframes scratchAura {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.06); }
}

.scratch-card {
    position: relative;
    width: 100%;
    border-radius: 24px;
    padding: 5px;
    background: linear-gradient(140deg, #fff0b8 0%, #e8a820 22%, #fff5cf 40%, #c98a10 58%, #ffe9a3 78%, #dfa018 100%);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(255, 190, 60, 0.15);
    overflow: hidden;
}

.scratch-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, rgba(255, 255, 255, 0.15) 52%, transparent 65%);
    transform: translateX(-120%);
    animation: scratchSheen 4.5s ease-in-out infinite;
    pointer-events: none;
    border-radius: 24px;
}

@keyframes scratchSheen {
    0%, 55%   { transform: translateX(-120%); }
    80%, 100% { transform: translateX(120%); }
}

.scratch-card-inner {
    position: relative;
    border-radius: 20px;
    padding: 18px 18px 20px;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
        linear-gradient(160deg, #ff5f6d 0%, #d63450 55%, #961b36 100%);
}

.scratch-notch {
    position: absolute;
    top: 50%;
    width: 26px;
    height: 26px;
    background: var(--bg-elevated, #0d0d0d);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.45);
    z-index: 2;
}

.scratch-notch.l { left: -14px; }
.scratch-notch.r { right: -14px; }

.scratch-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 14px;
    color: #ffe9b0;
    font-weight: 600;
    letter-spacing: 2px;
    font-size: 0.82rem;
}

.scratch-card-top .badge {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 220, 130, 0.4);
    padding: 4px 12px;
    border-radius: 999px;
}

.scratch-area {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        inset 0 4px 14px rgba(0, 0, 0, 0.35),
        0 1px 0 rgba(255, 255, 255, 0.25);
}

.scratch-prize-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #fdf3dc;
    overflow: hidden;
    user-select: none;
}

.scratch-sunburst {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 200%;
    aspect-ratio: 1;
    background: repeating-conic-gradient(
        rgba(232, 155, 28, 0.16) 0deg 14deg,
        transparent 14deg 28deg
    );
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: scratchSunSpin 14s linear infinite;
}

@keyframes scratchSunSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.scratch-prize-value {
    position: relative;
    font-family: 'Lilita One', 'Fredoka', sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 10vw, 3.4rem);
    color: #b02545;
    letter-spacing: 1.5px;
    line-height: 1.05;
    text-align: center;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
    filter: drop-shadow(0 6px 12px rgba(120, 40, 0, 0.2));
}

.scratch-prize-value.win {
    color: #8b6914;
}

.scratch-prize-value.lose {
    font-size: clamp(1.1rem, 5.5vw, 1.45rem);
    color: #7a2030;
    text-transform: uppercase;
}

.scratch-prize-label {
    position: relative;
    font-family: 'Lilita One', 'Fredoka', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: #b02545;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

.scratch-area.revealed .scratch-prize-value {
    animation: scratchPop 0.6s cubic-bezier(0.3, 1.7, 0.5, 1);
}

.scratch-area.revealed .scratch-prize-label {
    animation: scratchSlideUp 0.5s 0.12s cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
}

@keyframes scratchPop {
    0%   { transform: scale(0.4) rotate(-14deg); }
    60%  { transform: scale(1.3) rotate(7deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes scratchSlideUp {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.scratch-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, transparent 65%);
    opacity: 0;
    pointer-events: none;
    z-index: 3;
}

.scratch-area.revealed .scratch-flash {
    animation: scratchFlash 0.7s ease-out;
}

@keyframes scratchFlash {
    0%  { opacity: 0; }
    25% { opacity: 1; }
    100% { opacity: 0; }
}

#scratchCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    transition: opacity 0.7s;
    z-index: 4;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'><ellipse cx='18' cy='20' rx='11' ry='10' fill='%23d4a017' stroke='%238a6410' stroke-width='2'/><ellipse cx='15' cy='16' rx='4' ry='2.5' fill='%23ffe9a0' opacity='0.55'/><rect x='14' y='4' width='8' height='10' rx='2' fill='%23c0c6ce' stroke='%2378828c' stroke-width='1.5'/></svg>") 10 28, crosshair;
}

.scratch-area.revealed #scratchCanvas {
    opacity: 0;
    pointer-events: none;
}

.scratch-area.locked #scratchCanvas {
    cursor: not-allowed;
}

.scratch-progress {
    margin-top: 14px;
    height: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.scratch-progress i {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ffd76a, #ffb020);
    box-shadow: 0 0 10px rgba(255, 200, 80, 0.8);
    transition: width 0.25s ease-out;
}

.scratch-result {
    min-height: 1.7em;
    margin-top: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #ffd76a;
    text-shadow: 0 0 18px rgba(255, 200, 80, 0.6);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.45s cubic-bezier(0.3, 1.4, 0.5, 1);
    text-align: center;
}

.scratch-result.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.scratch-confetti {
    position: fixed;
    top: 42%;
    left: 50%;
    width: 10px;
    height: 15px;
    background: var(--c);
    border-radius: 2px;
    pointer-events: none;
    z-index: 999;
    animation: scratchBurst 1.5s ease-out forwards;
}

.scratch-confetti.round {
    border-radius: 50%;
    width: 9px;
    height: 9px;
}

@keyframes scratchBurst {
    0%   { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
    70%  { opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.7); opacity: 0; }
}

.game-content--scratch .bet-input-group {
    margin-top: 8px;
}
