* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #0f172a; 
    background-image: url('./img/IA.png'); 
    background-size: cover;
    background-position: center top; 
    background-repeat: no-repeat;
    background-attachment: fixed;
    
    /* SCROLL LOCK - TRAVA A TELA E EVITA O PUXÃO NO CELULAR */
    overflow: hidden; 
    overscroll-behavior: none; 

    /* Usamos 100svh para garantir que caiba certinho em navegadores móveis (Safari/Chrome) */
    height: 100svh; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.header h1 {
    font-size: 4rem; /* Reduzi um pouco para sobrar mais espaço pra tela */
    margin-bottom: 5px;
    background: linear-gradient(to right, #38bdf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}  

.score-display {
    font-size: 1.2rem;
    font-weight: bold;
    background: linear-gradient(to left, #16a6e4, #8322e4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 10px;
    width: 100%;
    max-width: 800px; /* ERA 1000px - ACHATADO PARA CABER ADS NAS LATERAIS */
}

.card {
    background-color: #f7f7f7;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 280px; /* ERA 350px - CARTAS MAIS ESTREITAS */
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 4px solid transparent;
    touch-action: manipulation; /* TRAVA ZOOM DE DUPLO CLIQUE */
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.card h2 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #111;
}

.card img {
    width: 100%;
    height: 220px; /* Ajustado proporcionalmente à nova largura da carta */
    object-fit: cover;
    border-radius: 8px;
}

.vs-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: bold;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.5);
    border: 2px solid #67e8f9; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 10;
}

.vs-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(6, 182, 212, 0.7);
}

@keyframes slideOutUp {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-40px); opacity: 0; }
}

@keyframes slideInDown {
    0% { transform: translateY(40px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.slide-out {
    animation: slideOutUp 0.3s ease-in forwards !important;
}

.slide-in {
    animation: slideInDown 0.3s ease-out forwards !important;
}

.vs-container.theme-real {
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.5);
    border: 2px solid #fca5a5;
}

.vs-text {
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 5px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.vs-logo {
    font-size: 2.5rem;
    line-height: 1;
    background: linear-gradient(to right, #ff3d00, #ff9100);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(255, 61, 0, 0.6)) drop-shadow(0 0 20px rgba(255, 145, 0, 0.6));
}

.correct {
    border-color: #28a745;
    background-color: #e8f5e9;
}

.wrong {
    border-color: #dc3545;
    background-color: #ffebee;
}

/* MODAL STYLES (Game Over e Vitória base) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #1e293b; 
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    text-align: center;
    width: 90%;
    max-width: 350px;
    border: 1px solid #334155;
    transform: scale(0.8) translateY(30px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-title {
    color: #fb7185; 
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(251, 113, 133, 0.4);
}

.modal-stats {
    background-color: #0f172a; 
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: #e2e8f0; 
    line-height: 1.8;
    border: 1px solid #334155;
}

.modal-stats span {
    color: #38bdf8;
    font-weight: bold;
}

.start-over-btn {
    background-color: #38bdf8;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #0f172a; 
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
    transition: all 0.2s ease;
    touch-action: manipulation; /* TRAVA ZOOM DE DUPLO CLIQUE */
}

.start-over-btn:hover {
    background-color: #7dd3fc;
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
    transform: translateY(-2px);
}

.start-over-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.4);
}

/* ESTILOS DA CAIXA DE VITÓRIA */
.victory-title {
    color: #fde047; 
    text-shadow: 0 0 15px rgba(253, 224, 71, 0.5);
}

.victory-btn {
    background-color: #10b981; 
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.victory-btn:hover {
    background-color: #34d399;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.victory-btn:active {
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

/* ===============================
   OTIMIZAÇÃO PARA CELULARES
=============================== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.5rem; /* Diminuído para caber na tela sem rolar */
    }

    .game-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 5px;
    }

    .card {
        padding: 10px;
    }

    .card img {
        height: 160px; /* Reduzido para garantir que as duas cartas caibam na tela travada */
    }

    .card h2 {
        margin-bottom: 5px;
    }

    .vs-container {
        padding: 5px 15px;
        transform: scale(0.85);
    }
    
    .vs-container:hover {
        transform: scale(0.85);
    }

    .vs-text {
        font-size: 0.9rem;
    }

    .vs-logo {
        font-size: 2rem;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}