/*
 * =========================================
 * FONTES E ESTILOS GLOBAIS
 * =========================================
*/
body {
    font-family: 'Roboto', sans-serif;
    background-image: url('imagemfundoold.png');
    background-size: cover; 
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

/*
 * =========================================
 * CARTÃO (VALE-RASPADINHA) - ESTILOS BASE FAVORITOS
 * =========================================
*/
.vale-container {
    background-color: #f7f3e9; 
    border: 2px dashed #c0b298;
    border-radius: 15px;
    padding: 25px;
    
    max-width: 500px; 
    
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4); 
    
    /* textura sutil */
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
    background-size: auto;
    background-position: center;
    background-repeat: repeat;
}

/*
 * =========================================
 * TEXTOS DO CARTÃO (MANTIDOS)
 * =========================================
*/
.vale-container h1 {
    font-family: 'Oswald', sans-serif;
    color: #3f3020;
    font-size: 2.2rem;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 15px;
}

.vale-container .subtitle {
    font-size: 1.1rem; 
    color: #5c4a32;
    margin-bottom: 25px;
}

.vale-container .link-info {
    font-size: 1.0rem; 
    margin-top: 25px;
    line-height: 1.5;
}

.vale-container .link-info a {
    font-weight: 700;
    color: #c2571a;
    text-decoration: none;
    background-color: rgba(255, 219, 172, 0.5);
    padding: 2px 6px;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.vale-container .link-info a:hover {
    background-color: rgba(255, 219, 172, 1);
    box-shadow: 0 0 10px rgba(255, 219, 172, 0.8);
}

/*
 * =========================================
 * ÁREA DA RASPADINHA
 * =========================================
*/
.scratch-wrapper {
    position: relative;
    width: 100%;
    padding-top: 33.33%; 
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1); 
}

.prize-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #fffaf0;
    border: 2px solid #e6d5b8;
    box-sizing: border-box;
    font-family: 'Oswald', sans-serif;
    font-size: 1.8rem;
    color: #3f3020;
    text-align: center;
    line-height: 1.4;
    visibility: hidden; 
}

.prize-content span {
    font-size: 2.2rem;
    font-weight: 700;
    color: #d9534f;
    margin-top: 10px;
}

#scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer; 
}

#scratch-canvas:active {
    cursor: grabbing;
}

/*
 * =========================================
 * CAIXA DE PRESENTE
 * =========================================
*/
.gift-box {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    /* CORREÇÃO 1: Garante a compatibilidade máxima do gradiente */
    /* Sintaxe antiga com prefixo -webkit- (para Safari/iOS e navegadores baseados em Chrome antigos) */
    background: -webkit-gradient(linear, left top, right bottom, color-stop(0%, #b32400), color-stop(100%, #751a00)); 
    /* Sintaxe moderna com prefixo -webkit- */
    background: -webkit-linear-gradient(145deg, #b32400, #751a00);
    /* Sintaxe com prefixo -moz- (para Firefox) */
    background: -moz-linear-gradient(145deg, #b32400, #751a00);
    /* Sintaxe padrão (DEVE VIR POR ÚLTIMO) */
    background: linear-gradient(145deg, #b32400, #751a00); 
    
    z-index: 9999;
    overflow: hidden;
    transition: opacity 1s ease-out; 
    pointer-events: auto;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.6);
}

/* Textura leve na caixa (mantida) */
.gift-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E");
    opacity: 0.25;
    z-index: 0;
}

/* FAIXAS (FITAS) */
.gift-ribbon-left,
.gift-ribbon-center {
    position: absolute;
    /* CORREÇÃO 2: Garante a compatibilidade máxima do gradiente */
    /* Sintaxe antiga com prefixo -webkit- */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #a30000), color-stop(50%, #ff3c3c), color-stop(100%, #a30000));
    /* Sintaxe moderna com prefixo -webkit- */
    background: -webkit-linear-gradient(to bottom, #a30000, #ff3c3c, #a30000);
    /* Sintaxe com prefixo -moz- */
    background: -moz-linear-gradient(to bottom, #a30000, #ff3c3c, #a30000);
    /* Sintaxe padrão (DEVE VIR POR ÚLTIMO) */
    background: linear-gradient(to bottom, #a30000, #ff3c3c, #a30000); 

    box-shadow:
        inset 0 0 15px rgba(255,255,255,0.4),
        inset 0 0 30px rgba(0,0,0,0.4),
        0 0 20px rgba(0,0,0,0.6);
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out; 
}

/* Faixa Vertical (mantida) */
.gift-ribbon-left {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    width: 12vw;
    z-index: 10001;
}

/* Faixa Horizontal (mantida) */
.gift-ribbon-center {
    top: 50%;
    left: 0;
    transform: translateY(-50%); 
    width: 100%;
    height: 12vw;
    z-index: 10002;
    display: flex; 
    justify-content: center;
    align-items: center;
}

/* Texto central (mantido) */
.gift-box-message {
    position: absolute;
    top: 45%; 
    left: 50%;
    transform: translate(-50%, -50%); 
    
    color: #fffaf0;
    font-family: 'Oswald', sans-serif;
    font-size: 2.4em;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.7);
    z-index: 10004;
    pointer-events: none;
    
    padding: 0.4em 1em; 
    background: rgba(0, 0, 0, 0.25);
    line-height: 1; 
    
    border-radius: 8px;
    animation: pulseText 1.5s infinite alternate;
    text-align: center;
}

/*
 * =========================================
 * ANIMAÇÕES (mantidas)
 * =========================================
*/
@keyframes pulseText {
    0% { opacity: 1; text-shadow: 0 0 8px rgba(255,255,255,0.4); }
    100% { opacity: 0.7; text-shadow: 0 0 14px rgba(255,255,255,0.9); }
}

/* Efeito de corte das faixas e ocultação da mensagem (mantido) */
.gift-box.opened .gift-ribbon-left {
    transform: translateX(-50%) rotate(12deg) scaleY(0.6);
    opacity: 0;
}
.gift-box.opened .gift-ribbon-center {
    transform: translateY(-50%) rotate(-12deg) scaleX(0.6);
    opacity: 0;
}
.gift-box.opened .gift-box-message { 
    opacity: 0;
    transition: opacity 0s ease-out; 
}
.gift-box.opened {
    opacity: 0;
    pointer-events: none;
}

/*
 * =========================================
 * RESPONSIVO (mantido)
 * =========================================
*/
@media (max-width: 600px) {
    /* Garante que a frase fique em uma única linha no mobile */
    .gift-box-message { 
        font-size: 1.8em; 
        white-space: nowrap; 
        /* CORREÇÃO MOBILE: Move o ponto de âncora para baixo para centralizar no celular */
        top: 46%; 
    }
    
    /* Garante a mesma espessura para ambas as faixas no mobile */
    .gift-ribbon-left { width: 20vw; }
    .gift-ribbon-center { height: 20vw; }
}

@media (max-width: 450px) {
    .vale-container h1 {
        font-size: 1.8rem;
    }

    .scratch-wrapper {
        padding-top: 50%; 
    }
    
    .prize-content {
        font-size: 1.5rem; 
        line-height: 1.3;
    }

    .prize-content span {
        font-size: 1.8rem; 
    }
}
