/* =============================================
   RASPADINHA (Scratch Card) - RifaPress
   ============================================= */

/* Container principal */
.raspadinha-section {
    margin: 20px 0;
}

.raspadinha-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.raspadinha-header {
    text-align: center;
    padding: 20px 15px 10px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.1));
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.raspadinha-header h4 {
    color: #FFD700;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 5px;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.raspadinha-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin: 0;
}

/* Wrapper do canvas */
.raspadinha-card-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    padding-bottom: 62.5%; /* fallback para navegadores sem aspect-ratio */
    cursor: pointer;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Navegadores com suporte a aspect-ratio */
@supports (aspect-ratio: 16 / 10) {
    .raspadinha-card-wrapper {
        padding-bottom: 0;
    }
}

.raspadinha-card-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    cursor: grab;
}

.raspadinha-card-wrapper canvas:active {
    cursor: grabbing;
}

/* Camada de resultado por baixo do canvas */
.raspadinha-result {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1b2a 0%, #1b2838 50%, #0d1b2a 100%);
    padding: 15px;
    text-align: center;
}

.raspadinha-result .emoji-star {
    font-size: 2rem;
    margin-bottom: 8px;
    animation: pulse-star 2s ease-in-out infinite;
}

.raspadinha-result .label {
    color: #FFD700;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.raspadinha-result .numeros {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    word-break: break-all;
    line-height: 1.5;
    max-height: 80px;
    overflow-y: auto;
    padding: 8px 12px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

/* Footer da raspadinha */
.raspadinha-footer {
    text-align: center;
    padding: 12px 15px 18px;
    background: rgba(0, 0, 0, 0.2);
}

.raspadinha-footer .hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.78rem;
    margin: 0 0 10px;
}

.raspadinha-footer .hint i {
    margin-right: 4px;
}

.raspadinha-btn-prosseguir {
    display: none;
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.raspadinha-btn-prosseguir:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.raspadinha-btn-prosseguir.show {
    display: block;
    animation: fadeInUp 0.5s ease forwards;
}

/* Overlay/Modal da raspadinha */
.raspadinha-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.raspadinha-overlay.active {
    display: flex;
}

.raspadinha-overlay .raspadinha-container {
    animation: zoomIn 0.4s ease forwards;
}

.raspadinha-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 5px;
}

.raspadinha-close:hover {
    color: #fff;
}

/* Confetti/Sparkle effects */
.raspadinha-revealed .raspadinha-header {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.3), rgba(32, 201, 151, 0.2));
}

.raspadinha-revealed .raspadinha-header h4 {
    color: #20c997;
}

/* Animações */
@keyframes pulse-star {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Botão de iniciar raspadinha (na seção de cotas) */
.btn-raspadinha {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    color: #1a1a2e !important;
    font-weight: 700 !important;
    border: none !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn-raspadinha::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 3s infinite;
}

.btn-raspadinha:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4) !important;
}

/* Responsivo */
@media (max-width: 768px) {
    .raspadinha-container {
        max-width: 100%;
        border-radius: 12px;
    }

    .raspadinha-result .numeros {
        font-size: 1.1rem;
    }

    .raspadinha-overlay {
        padding: 15px;
    }
}
