
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

body{
    margin:0;
    padding:8px 16px;
    background: linear-gradient(135deg, #1a0533, #3b0764, #dc2626);
    min-height:100vh;
    color:white;
    font-family:Arial, Helvetica, sans-serif;
    text-align:center;
    overflow-x:hidden;
    height:100dvh;
}

/* =========================================
   TOPO
========================================= */

.topo{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:6px;
}

/* =========================================
   TÍTULO
========================================= */

.titulo-pokemon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    margin-top: 10px;
}

.titulo-pokemon svg {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
}

.titulo-pokemon h1 {
    margin: 0;
    font-size: 36px;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    letter-spacing: 1px;
    background: linear-gradient(135deg, #facc15, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =========================================
   BOTÃO FECHAR
========================================= */

.btn-fechar{
    width:40px;
    height:40px;
    border:none;
    border-radius:15px;
    background: linear-gradient(135deg, #ff5f5f, #ef4444);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition:0.25s;
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
    margin-top: 10px;
}

.btn-fechar span{
    font-size:20px;
    color:white;
    line-height:1;
    transform:translateY(-2px);
}

.btn-fechar:hover{
    transform:scale(1.08);
    background: linear-gradient(135deg, #ff7b7b, #dc2626);
}

/* =========================================
   INFORMAÇÕES
========================================= */

#info{
    font-size:20px;
    background:rgba(255,255,255,0.12);
    padding:8px 24px;
    border-radius:14px;
    backdrop-filter:blur(10px);
    width:fit-content;
    margin: 6px auto 24px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* =========================================
   TABULEIRO
========================================= */

.tabuleiro{
    display:grid;
    gap:12px;
    width:min(95vw, 1400px);
    margin:10px auto;
    justify-content:center;
}

/* =========================================
   FASES
========================================= */

.tabuleiro.fase-1{
    grid-template-columns:repeat(4, 100px);
}

.tabuleiro.fase-2{
    grid-template-columns:repeat(5, 100px);
}

.tabuleiro.fase-3{
    grid-template-columns:repeat(7, 100px);
}

/* =========================================
   CARTA
========================================= */

.carta{
    width:100%;
    aspect-ratio:1 / 1;
    border-radius:18px;
    cursor:pointer;
    perspective:1000px;
}

/* =========================================
   INTERNO
========================================= */

.carta-interna{
    width:100%;
    height:100%;
    position:relative;
    border-radius:18px;
    transform-style:preserve-3d;
    transition:transform 0.5s;
}

/* =========================================
   VIRADA
========================================= */

.carta.virada .carta-interna{
    transform:rotateY(180deg);
}

/* =========================================
   FRENTE / VERSO
========================================= */

.frente,
.verso{
    position:absolute;
    inset:0;
    border-radius:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    backface-visibility:hidden;
    overflow:hidden;
}

/* =========================================
   FRENTE (Pokébola — carta virada p/ baixo)
========================================= */

.frente{
    background: linear-gradient(135deg, #1e0536, #3b0764);
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.15);
}

.frente svg {
    width: 70%;
    height: 70%;
}

/* =========================================
   VERSO (imagem do Pokémon)
========================================= */

.verso{
    background: #f8f8f8;
    transform:rotateY(180deg);
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.3);
}

.verso img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

/* nome do Pokémon */
.verso .pokemon-nome {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    padding: 12px 4px 5px;
    border-radius: 0 0 16px 16px;
    letter-spacing: 0.5px;
}

/* =========================================
   COMBINADA
========================================= */

.carta.combinada{
    outline:6px solid #22c55e;
    box-shadow: 0 0 14px 5px rgba(34,197,94,0.55);
    transform:scale(1.04);
}

.carta.combinada .verso {
    background: #fffbeb;
}

/* =========================================
   BOTÕES
========================================= */

.botoes{
    margin-top:24px;
    display:flex;
    justify-content:center;
    gap:10px;
    flex-wrap:wrap;
}

.botoes button{
    margin:0;
    padding:8px 20px;
    border:none;
    border-radius:14px;
    background:rgba(255,255,255,0.12);
    backdrop-filter:blur(10px);
    color:white;
    font-size:18px;
    font-weight:bold;
    cursor:pointer;
    transition:0.3s;
    border: 1px solid rgba(255,255,255,0.2);
}

.botoes button:hover{
    transform:scale(1.06);
    background:rgba(255,255,255,0.22);
}

/* =========================================
   MOBILE
========================================= */

@media(max-width:700px){

    .titulo-pokemon h1 {
        font-size:24px;
    }

    #info{
        font-size:16px;
    }

    .tabuleiro.fase-1,
    .tabuleiro.fase-2{
        grid-template-columns: repeat(4, 80px);
        gap: 8px;
    }

    .tabuleiro.fase-3{
        grid-template-columns: repeat(7, 44px);
        gap: 6px;
    }

    .botoes button{
        font-size:15px;
        padding:8px 14px;
    }
}