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

html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column; /* Align header, main, and footer vertically */
  }

body {
    /* Use a background image */
    background-image: url('/src/wb.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-color: #f0f0f0;
    background-repeat: no-repeat;

    background-color: #f0f0f0; /* Fallback color */
  
  position: relative; /* Ensure pseudo-element is positioned correctly */
  }


  @font-face {
    font-family: 'Effra';
    font-weight: 500; /* Medium weight */
    src: url('/src/Effra_Md.ttf') format('truetype');
  }

  body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1); /* Black with 30% opacity */
    pointer-events: none; /* Prevent overlay from interfering with interactions */
    z-index: -1; /* Ensure overlay is below content */
  }

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    background-color: #000;
    padding: 0 24px;
    width: 100%; /* Ensure header spans full width */
    box-sizing: border-box; /* Include padding in width */

}

header .logo-left, header .logo-right {
    height: 40px; /* Adjust the size of the logos */
}

header nav a{
    width: 20px;
    height: 20px;
    /* padding: 20px; */
    margin-right: 24px;
    font-family: 'Cairo', cursive;
    font-size: 24px;
    text-decoration: none;
    color:white;  

}

header h1 {
    margin-left: 24px;
    font-size: 35px;
    line-height: 42px;
    color: white;
    font-family: 'Cairo', cursive;
    font-size: 24px;
}
body{
   /* background-color: #3A3A3A;*/
    justify-items: center;
}

/* Footer stays at the bottom */
footer {
    background-color: #000;
    text-align: center;
    color: #C4C4C4;
    width: 100%; /* Ensure it spans the full width */
    padding: 20px 0; /* Add padding for spacing */
    box-sizing: border-box;
    position: relative; /* Default behavior */
  }
  
footer ul{
    margin: 0 auto; /* Center the content */
    display: flex; /* Use flexbox for alignment */
    align-items: center;
    justify-content: center;
    list-style-type: none;
    gap: 10px; /* Add space between list items */
    padding: 0;

}

footer ul h3{
    text-decoration: none;
    color: #C4C4C4;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 300;
}

footer ul img {
    margin: 5px;
    margin-top: 10px;
    padding: 5px;
    border-radius: 8px;
}

footer ul a img:hover {
    background-color: teal;
}



.corpo {
    display: grid;
    /*grid-template-columns: 1fr 1fr;*/
    justify-content: center;
    flex: 1; /* Allow this section to expand */
}

#esq {  
    background-color: white;
    justify-content: space-between;
    display: flex;
    flex-direction: column;
    align-items: center;

}

#esq h2 {

    font-family: 'Cairo', sans-serif;
    font-size: 20px;
    margin-top: 24px;

}

#esq a {

    width: min-content;
    height: min-content;
    text-decoration: none;
    color: rgb(50, 50, 50);
    padding: 10px 20px;
    border-radius: 50px;
    border: 3px solid rgb(50, 50, 50);
    margin-bottom: 20vh;
    font-family: 'Cairo', cursive;
    font-weight: 500;
    font-size: 18px;
    
}

#esq a:hover {
    background-color: rgb(50, 50, 50);
    color: white;
}

#esq span {
    padding: 5px;
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 30px;
    background-color: black;
    color: white;
    font-size: 18px;
}

#btn-mudartema, #btn-reiniciar {
    text-align: center;
    text-decoration: none;
    background-color: white;
    color: black;
    border: 2px solid #4CAF50; /* Green */
}

#responsivo {
    display: none;
}








/* Modal container */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100; /* Above all other elements */
  }
  
  /* Modal content */
  .modal-content {
    background: #000; /* Bright yellow background */
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 80%;
    max-width: 400px;
    animation: pop-in 0.5s ease-in-out;
  }
  
  /* Modal content animation */
  @keyframes pop-in {
    0% {
      transform: scale(0.5);
      opacity: 0;
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }
  
  /* Modal heading */
  .modal-content h1 {
    font-size: 2.1em;
    margin-bottom: 30px;
    color: #fff; /* Bright orange for heading */
    font-family: 'Cairo', cursive, sans-serif; /* Child-friendly font */
  }
  
  /* Modal text */
  .modal-content p {
    font-size: 1.6em;
    line-height: 1.5; /* Adjusts line spacing to 1.5 times the font size */
    margin-bottom: 20px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
  }
  
  /* Modal button */
  .modal-content button {
    background: #000; /* Bright green button */
    color: #fff;
    font-size: 1em;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Cairo', cursive, sans-serif;
    transition: background 0.3s ease;
  }
  
  /* Button hover effect */
  .modal-content button:hover {
    background: #cacaca;
  }
  
  /* Responsive styles */
  @media (max-width: 600px) {
    .modal-content {
      width: 90%;
    }
  
    .modal-content h1 {
      font-size: 1.5em;
    }
  
    .modal-content p {
      font-size: 1em;
    }
  }



  #vitoria {
    position: fixed;
    text-align: center;
    color: white;
    font-family: 'Cairo', cursive;
    width: 100%;
    height: 100vh;
    z-index: 5;
    background: rgba(0,0,0,0.6);
    top: 0;
    display: none;
}

#vitoria h1 {
    font-size: 4em;
    font-weight: normal;
}

#vitoria h2 {
    font-size: 2em;
    margin: 1em;
}

#vitoria a {
    text-decoration: none;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    border: 3px solid rgb(50, 50, 50);
    position: absolute;
    bottom: calc(20vh + 50px);
    left: calc(50% - 72px);
    width: fit-content;
}

#vitoria a:hover {
    background-color: #f95a5a;
    color: white;
}

#vitoria p {
    color: black;
}

#vitoria #container {


    background-image: url('/src/wb.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-color: #f0f0f0;
    background-repeat: no-repeat;


    /*background: #0fcf88;*/
    padding: 50px;
    width: 80%;
    height: 60vh;
    border-radius: 20px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 20vh;
}


@media (max-width: 900px){

  /*.jogo {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      justify-content: center;
  }*/

  .corpo {
      justify-content: center;
  }

  footer {
      height: auto;
  }

  #dir {
      display: none;
  }
}







@media (max-width: 700px) {

  #esq {
      display: none;
  }

  #responsivo {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background-color: white;
      font-family: 'Cairo', sans-serif;
      font-size: 12px;
      text-align: center;
  }

  #responsivo span {
      padding: 5px;
      padding-left: 8px;
      padding-right: 8px;
      border-radius: 30px;
      background-color: black;
      color: white;
      font-size: 15px;
  }

  #responsivo h2 {
      margin: 5px;
      margin-left: 24px;
  }

  #responsivo a {
      
      background-color: black;
      text-decoration: none;
      color: white;
      font-family: 'Cairo', cursive;
      font-weight: lighter;
      font-size: 18px;
      padding: 10px;
      margin: 5px;
      margin-right: 24px;
      border-radius: 10px;

  }

  .jogo {
      margin: 0px 10vw 0px 10vw;
  }

 
 

}

@media (max-width: 550px) {

  header nav a {

      display: none;

  }

  .jogo {
      padding: 10px;

  }



  .jogo .card img {
      width:80px; 
      height:80px;
  }

  #vitoria #container {
      width: 100%;
      border-top-left-radius: 0;
      border-bottom-right-radius: 0;
      font-size: 3.2vw;
  }

  #vitoria a {
      left: calc(50% - 14.2vw);
  }

}

@media (max-width: 280px) {
  .jogo .card img {
      width:70px; 
      height:70px;
  }

}

.jogo .card {
  /*padding: 30px;*/
  /*margin: 15px;*/
  margin-left: 5px;
  margin-right: 5px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13vw;
  height: 16vh;
  /*border-radius: 30px 0px 30px 0px;*/

  position: relative; /* Ensure child elements are positioned within this */
  overflow: hidden; /* Enforce rounded corners */
  user-select: none;
}


/* Card setup for animation */
.card {
  transform: scale(0); /* Start invisible and small */
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease; /* Reduced duration */
  overflow: hidden;
}

/* Apply animation */
.card.magical-appear {
  transform: scale(1); /* Grow to full size */
  opacity: 1; /* Fade in */
}




/* Default layout: Always 4 columns */
.jogo {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns */
  grid-template-rows: auto; /* Rows adjust automatically */
  gap: 10px; /* Spacing between cards */
  justify-content: center; /* Center the grid */
}



/* Adjust card size for very small screens */
@media (max-width: 600px) {
  .jogo .card {
    width: 22vw; /* Adjust width to fit 4 columns */
    height: 30vw; /* Adjust height to keep proportional cards */
  }
  .jogo{

    gap: 1px;
  }
}

@media (max-width: 400px) {
  .jogo .card {
    width: 22vw; /* Slightly larger for very narrow screens */
    height: 32vw; /* Adjust height proportionally */
  }

  .jogo{

    gap: 1px;
  }
}






/* Default layout: Always 4 columns */
.jogo {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns */
  grid-template-rows: auto; /* Rows adjust automatically */
  /*gap: 10px; /* Spacing between cards */
}

/* Wide screens: 4 rows, 6 columns */
@media (min-width: 600px) {
  .jogo {
    grid-template-columns: repeat(6, 1fr); /* 6 columns */
    grid-template-rows: repeat(4, auto); /* 4 rows */
    margin-top: 20px;
  }
}





.jogo .card img {
  width: 100%; /* Make the image fill the card width */
  height: 100%; /* Make the image fill the card height */
  object-fit: cover; /* Ensure the image scales proportionally */
  border-radius: inherit; /* Match the card's border-radius */

  
}


#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.0); /* Optional semi-transparent background */
  z-index: 10; /* Ensure it's above the cards */
  pointer-events: all; /* Block all pointer events */
}

#overlay.hidden {
  display: none; /* Hide the overlay when not needed */
}

.jogo .card,
.jogo .virado {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.5s;
}

.jogo .card {
  background-color: #ffffff;
  box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}



.card:active {
  transform: scale(0.97);
  transition: transform 0.2s;
}

.card.flip {
  transform: rotateY(180deg);
}


/* novas */

.frente,
.verso {
  width: 100%; /* Fully cover the card */
    height: 100%;
  /*padding: 15px;*/
  position: absolute;
  object-fit: cover; /* Ensure the image scales proportionally */
  border-radius: inherit; /* Inherit the card's round corners */
  backface-visibility: hidden;
}


/* Initial state: Back face visible */
.frente {
  transform: rotateY(180deg); /* Front face starts hidden (facing down) */
}

.verso {
  transform: rotateY(0deg); /* Back face starts visible */
}

/* Flipped state: Front face visible, back face hidden */
.card.flip .frente {
  transform: rotateY(0deg); /* Front face rotates to face up */
}

.card.flip .verso {
  transform: rotateY(180deg); /* Back face rotates to face down */
}