/* =========================================================
   BASE E LAYOUT PRINCIPAL
========================================================= */
html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(270deg, #fce8a6, #eeccae, #f69c64);
    background-size: 800% 800%;
    animation: gradientMove 4s ease infinite;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 100%;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* =========================================================
   TIPOGRAFIA
========================================================= */
h1 {
    text-transform: uppercase;
    color: #4a3a1a;
    font-size: 2.8rem;
    font-family: 'Caprasimo', serif;
    font-weight: 400;
    margin: 5px;
}

h2 {
    color: #191102;
    font-size: 1.6rem;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    margin: 5px;
}

p {
    font-family: 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    color: #4a3a1a;
}

/* =========================================================
   CONTAINER GERAL
========================================================= */
.container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 1024px;
    width: 95%;
    overflow: hidden;
}

/* =========================================================
   FORMULÁRIO INICIAL
========================================================= */
.form-section {
    flex: 1;
    padding: 20px;
    text-align: left;
}

.form-section h1 {
    color: #6a4b13;
    margin-bottom: 15px;
}

.form-section p {
    margin-bottom: 5px;
    color: #4a3a1a;
}

.form-section input {
    width: 95%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #c2a66d;
    border-radius: 8px;
    font-size: 16px;
}

.form-section button {
    background: #c2a66d;
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    animation: pulse 1.5s infinite;
}

.form-section button:hover {
    background: #a98a50;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(194, 166, 109, 0.7);
    }

    70% {
        transform: scale(1.08);
        box-shadow: 0 0 15px 10px rgba(194, 166, 109, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(194, 166, 109, 0);
    }
}

/* =========================================================
   SEÇÃO DE IMAGEM (INÍCIO)
========================================================= */
.image-section {
    flex: 1;
    min-height: 400px;
    background: url("imagens/hero.png") center/cover no-repeat;
    border-radius: 0 12px 12px 0;
    margin-right: 10px;
}

/* =========================================================
   TABULEIRO DO JOGO
========================================================= */
#jogo {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 10px;
    text-align: center;
}

/* =========================================================
   CARTAS DO JOGO — FIXAÇÃO DE TAMANHO E ALINHAMENTO
========================================================= */
.carta {
    margin: 5px;
    box-sizing: border-box;
    transition: transform 0.4s ease;
}

.carta-inner {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}

.carta.virada .carta-inner,
.carta.encontrada .carta-inner {
    transform: rotateY(180deg);
}

/* Faces das cartas — mesmo tamanho sempre */
.carta-front,
.carta-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    border: 3px solid #c2a66d;
    backface-visibility: hidden;
    box-sizing: border-box;
}

/* Cartas já encontradas — mantém proporção, só muda opacidade */
.carta.encontrada {
    pointer-events: none;
}

.carta.encontrada .carta-inner {
    opacity: 0.9;
    filter: brightness(1.05);
    transform: rotateY(180deg);
}


#tabuleiro {
    display: grid;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 60%;
    margin: 0 auto;
    gap: 0px;
    box-sizing: border-box;
}

#tabuleiro img,
#tabuleiro .card {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

/* =========================================================
   TERMOS E CONDIÇÕES
========================================================= */
.termos-texto {
    font-size: 0.7rem;
    color: #555;
    max-width: 500px;
    text-align: left;
    margin-top: 10px;
    line-height: 1.3;
}

.termos-texto a {
    color: #704214;
    text-decoration: underline;
}

/* =========================================================
   BOTÃO PRINCIPAL
========================================================= */
#btnComecar {
    margin-top: 15px;
    background-color: #b48a3d;
    color: white;
    border: none;
    padding: 10px 25px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#btnComecar:hover {
    background-color: #a17830;
}

/* =========================================================
   RODAPÉ
========================================================= */
.footer {
    width: 100%;
    color: #4a3a1a;
    text-align: center;
    padding: 20px 0px;
    font-size: 0.8rem;
    margin-top: 10px;
}

.footer p {
    font-size: 0.8rem;
}

.footer img {
    max-height: 50px;
    display: block;
    margin: 0 auto 10px auto;
}

/* =========================================================
   RESPONSIVIDADE
========================================================= */

/* Desktop */
@media (min-width: 1024px) {
    #tabuleiro {
        grid-template-columns: repeat(6, minmax(140px, 1fr));
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1023px) {
    #tabuleiro {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    h1 {
            font-size: 1.4rem;
    }

     h2 {
            font-size: 1.2rem;
    }
    #tabuleiro {
       grid-template-columns: repeat(4, 1fr);
        gap: 0px;
        padding: 5px;
        max-width: 100%;
    }

    .container {
        flex-direction: column;
    }

    .image-section {
        min-height: 200px;
        width: 100%;
        margin-right: 0;
        border-radius: 0 0 12px;
    }
}

.btn-ranking {
    background-color: #007bff; /* azul principal */
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    margin-top: 25px;
  }
  
  .btn-ranking:hover {
    background-color: #0056b3; /* azul mais escuro ao passar o mouse */
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px);
  }
  
  .btn-ranking:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
  }
