* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    text-align: center;
  #  background: linear-gradient(135deg, #4e73df, #1cc88a);
    color: white;
    margin: 0;
#   padding: 20px;
    min-height: 100vh;
}

h1 {
    margin-top: 10px;
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

/* TELA INICIAL */
#tela-inicio {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px 50px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 50px;
}

#tela-inicio h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

/* BOTÕES DE DIFICULDADE */
.botoes {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.botoes button {
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    min-width: 200px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-facil {
    background-color: #2ecc71;
    color: white;
}

.btn-medio {
    background-color: #f1c40f;
    color: white;
}

.btn-dificil {
    background-color: #e74c3c;
    color: white;
}

.botoes button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.botoes button:active {
    transform: scale(0.95);
}

/* ÁREA DO JOGO */
#area-jogo {
    display: none;
}

.info-jogo {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    flex-wrap: wrap;
}

#tempo-restante {
    color: #ffd700;
    font-size: 20px;
}

.botoes-jogo {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.botoes-jogo button {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background-color: white;
    color: #333;
    font-weight: bold;
    min-width: 150px;
    transition: transform 0.2s;
}

.botoes-jogo button:hover {
    transform: scale(1.05);
}

/* TABULEIRO */
.tabuleiro {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    perspective: 1000px;
}

/* CARTAS */
.carta {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #444;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.carta.virada {
    transform: rotateY(180deg);
}

.carta.encontrada {
    transform: rotateY(180deg) scale(0.95);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.8);
    cursor: default;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.1); }
    100% { transform: rotateY(180deg) scale(0.95); }
}

/* LADOS DA CARTA */
.frente, .verso {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.frente {
    background-color: #1a237e;
    border: 3px solid #0d47a1;
}

.frente img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.verso {
    background-color: #ffffff;
    transform: rotateY(180deg);
}

.verso img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* MENSAGENS */
#mensagem-vitoria,
#mensagem-tempo {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    padding: 40px 60px;
    border-radius: 20px;
    z-index: 100;
}

#mensagem-vitoria h2 {
    color: #2ecc71;
    font-size: 32px;
    margin-bottom: 15px;
}

#mensagem-tempo h2 {
    color: #e74c3c;
    font-size: 32px;
    margin-bottom: 15px;
}

#mensagem-vitoria p,
#mensagem-tempo p {
    font-size: 18px;
    margin-bottom: 20px;
}

#mensagem-vitoria button,
#mensagem-tempo button {
    background-color: #1cc88a;
    color: white;
    padding: 15px 30px;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

/* CELULAR */
@media (max-width: 600px) {
    h1 {
        font-size: 24px;
    }

    #tela-inicio {
        padding: 20px 30px;
    }

    .botoes button {
        padding: 12px 30px;
        font-size: 16px;
    }

    .info-jogo {
        font-size: 14px;
    }

    .tabuleiro {
        gap: 8px;
    }
}

