/* Estilos gerais */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
      font-family: 'Fredoka One', sans-serif;
    background-color: #5545d2;
}

.fundo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

h1 {
    color: #5545d2;
}

p {
    color: #333;
}

button {
     font-family: 'Poppins', sans-serif;
}

/* ---------- BOTÃO SAIR ---------- */
.sair {
  position: absolute;
  top: 40px;
  right: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  z-index: 10;
  transition: transform 0.3s ease;
  text-shadow:
      1px 1px 0 #5545d2,
     -1px 1px 0 #5545d2,
      1px -1px 0 #5545d2,
     -1px -1px 0 #5545d2,
      0px 1px 0 #5545d2,
      0px -1px 0 #5545d2,
      1px 0px 0 #5545d2,
     -1px 0px 0 #5545d2,
      2px 0px 0 #5545d2,
     -2px 0px 0 #5545d2,
      0px 2px 0 #5545d2,
      0px -2px 0 #5545d2,
      2px 2px 0 #5545d2,
     -2px 2px 0 #5545d2,
      2px -2px 0 #5545d2,
     -2px -2px 0 #5545d2;
}

.sair:hover {
  transform: scale(1.1);
}

.sair img {
  width: 60px;
  height: 60px;
  display: block;
  margin-bottom: 5px;
}

.hidden {
    display: none !important;
}

/* Tela de Setup */
.setup-container {
    text-align: center;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.setup-container p {
  line-height: 2.5; /* aumenta o espaçamento entre linhas */
}



.difficulty-buttons button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 15px 30px;
    margin: 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    font-weight: bold;
}

.difficulty-buttons button.disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

.difficulty-buttons button:hover {
    background-color: #0056b3;
}

/* Tela do Jogo */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-info {
    font-size: 28px;
    margin-bottom: 40px;
    color: #ffffff;   /* deixa o texto branco */
    text-align: center;
    text-shadow:
      1px 1px 0 #5545d2,
     -1px 1px 0 #5545d2,
      1px -1px 0 #5545d2,
     -1px -1px 0 #5545d2,
      0px 1px 0 #5545d2,
      0px -1px 0 #5545d2,
      1px 0px 0 #5545d2,
     -1px 0px 0 #5545d2,
      2px 0px 0 #5545d2,
     -2px 0px 0 #5545d2,
      0px 2px 0 #5545d2,
      0px -2px 0 #5545d2,
      2px 2px 0 #5545d2,
     -2px 2px 0 #5545d2,
      2px -2px 0 #5545d2,
     -2px -2px 0 #5545d2;
}


.memory-game {
    width: 90vw;       /* ocupa quase toda a tela */
    max-width: 800px; /* tamanho máximo em telas grandes */
    display: grid;
    gap: 1rem;
    perspective: 1000px;
}

/* Grid fixo para cada dificuldade */
.easy-grid   { grid-template-columns: repeat(4, 1fr); } /* 4 cartas por linha */
.medium-grid { grid-template-columns: repeat(4, 1fr); } /* ajusta se quiser mais colunas */
.hard-grid   { grid-template-columns: repeat(4, 1fr); } /* idem */

.memory-card {
    width: 100%;
    aspect-ratio: 1 / 1;  /* quadrada sempre */
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    cursor: pointer;
}

.memory-card {
    width: 100%;
    aspect-ratio: 1 / 1; /* garante que seja quadrada */
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    cursor: pointer;
}


.memory-card.flip {
    transform: rotateY(180deg);
}

.front-face,
.back-face {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden; /* Oculta a face de trás */
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.back-face {
    transform: rotateY(180deg);
}

.front-face img {
    width: 85%;
    height: auto;
}

.back-face img {
    width: 80%;
}

/* Modal de Vitória */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
}

.modal-content button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    margin-top: 20px;
    cursor: pointer;
}

@media (max-width: 500px) {
    .easy-grid, .medium-grid, .hard-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
}