@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap");
* {
  margin: 0;
  padding: 0;
}
 
body {
  font-family: "Roboto", sans-serif;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background-image: url(./img/estrellas.png);
  background-color: #e9c97c;
}

header {
  max-height: 100px;
  min-width: 100%;
  height: 100px;
  background-color: aliceblue;
  z-index: -3;
}

.header-container {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
}

.header-container-logo {
  height: 100%;
  background-color: #fff;
  width: 40%;
}

.header-container-logo img {
  max-height: 100%;
  height: 100%;
}

.header-container-content {
  max-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: start;
  padding: 10px;
}

.header-container-content h1 {
  font-size: 1.5rem;
  font-weight: 900;
  color: rgb(102, 198, 166);
}

.header-container-content p {
  font-size: 0.9rem;
  font-weight: 300;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 70px;
  min-width: 100%;
  z-index: 0;
  max-height: 100px;
}

.footer-container {
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  background-color: aliceblue;
}

.footer-container-content {
  max-height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
  padding: 10px;
}

.footer-container-content img {
  height: 30px;
  margin: 0 10px;
}

.footer-container-social-logos {
  max-height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  padding: 10px;
}

.footer-container-social-logos img {
  height: 100%;
  margin: 0 3px;
  padding: 0;
}

.footer-container-social-logos a {
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  color: #000;
}

.footer-container-social-logos a.contactanos-button {
  font-size: 0.9rem;
  font-weight: 300;
  color: #fff;
  background-color: #5fa3a5;
  padding: 7px 10px;
  border-radius: 8px;
}

main {
  max-width: min-content;
  display: grid;
  pointer-events: none;
  padding: 0;
  margin: 100px 0;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  grid-gap: 10px;
  z-index: -3;
}

.background-opacity {
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.background-opacity-1,
.background-opacity-2,
.background-opacity-3,
.background-opacity-4,
.background-opacity-5,
.background-opacity-6,
.background-opacity-7,
.background-opacity-8 {
  opacity: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: -5;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.flip-card {
  position: relative;
  color: white;
  width: 150px;
  height: 150px;
  border-radius: 5px;
  cursor: pointer;
  background-color: transparent;
  animation: cardAnimation 0.3s ease-in-out forwards;
  animation-delay: var(--delay);
  opacity: 0;
}

/* When page start fade in the cards */
@keyframes cardAnimation {
  0% {
    transform: scale(0.9);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card-back,
.flip-card-front {
  position: absolute;
  width: 100%;
  height: 100%;
}

.flip-card-back img,
.flip-card-front img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 100%;
  height: auto;
  pointer-events: none;
}

.flip-card-back {
  transform: rotateY(180deg);
  backface-visibility: hidden;
  overflow: hidden;
}

.flip-card-front {
  /* invert the y like if it was a mirror */
  transform: rotateY(0deg);
}

.flip-card-back img {
  width: 95%;
}

.please-turn-card {
  margin: 0;
  position: fixed;
  display: none;
  transform: scale(0.5);
  top: 0;
  left: 0;
  z-index: 10;
}

.alert {
  position: relative;
  top: 10;
  left: 0;
  width: auto;
  height: auto;
  padding: 10px;
  margin: 10px;
  line-height: 1.8;
  border-radius: 5px;
  font-family: sans-serif;
  font-weight: 400;
}

.alertText {
  display: table;
  margin: 0 auto;
  text-align: center;
  font-size: 16px;
}

.error {
  
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 90%;
  height: 50%;
  background-color: #e7ce77;
  border-radius: 10px;
  border: 10px solid #ffc95d;
  z-index: 20;
  pointer-events: none;
}

.modal-intro {
  width: 300px;
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}

.button {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Inter", sans-serif;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 20px;
  opacity: 1;
}

.button:hover {
  opacity: 0.8;
}



.label-dice {
  padding: 14px 16px;
  background: #ff9900;
  box-shadow: 0px 6px 0px #a86500;
  animation: changeOrder 6s infinite linear;
  user-select: none;
  position: fixed;
  top: 63%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 15px;
  font-size: 16px;
}

/* Animation for changing order */

@keyframes changeOrder {
  from {
    z-index: 6;
  }
  to {
    z-index: 1;
  }
}

.main-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  align-items: center;
  justify-content: center;
  width: 60%;
  height: fit-content;
  background-color: #e7ce77;
  border-radius: 10px;
  border: 10px solid #ffc95d;
  z-index: 20;
}

.couple-finded-modal {
  display: flex;
  opacity: 0;
  z-index: -1;
}

.couple-finded-modal .continuar-button {
  padding: 14px 16px;
  background: #ff9900;
  box-shadow: 0px 6px 0px #a86500;
  animation: changeOrder 6s infinite linear;
  user-select: none;
  width: fit-content;
  height: 10px;
  font-size: 12px;
  padding: 10px 3px;
}

.you-won-card {
  flex-direction: column;
  display: none;
}

.you-won-card .top-container {
  display: flex;
  flex-direction: row;
  justify-content: left;
  width: 100%;
  max-height: 250px;
  height: 100%;
}

.you-won-card .left-container {
  max-height: inherit;
}
.couple-finded-modal .left-container {
  width: 60%;
  max-height: inherit;
  height: 100%;
}

.you-won-card .top-container .left-container img {
  max-height: inherit;
  height: 100%;
  pointer-events: none;
}

/* .you-won-card .top-container .left-container img, */
.couple-finded-modal .left-container img:nth-of-type(1) {
  width: 100%;
  pointer-events: none;
}

.couple-finded-modal .left-container img:not(:nth-of-type(1)) {
  position: absolute;
  pointer-events: none;
}

.couple-finded-modal .left-container img.maria {
  width: 15%;
  bottom: 5%;
  left: 1%;
}

.couple-finded-modal .left-container img.jose {
  width: 10%;
  bottom: 15%;
  left: 3%;
}

.couple-finded-modal .left-container img.jesus {
  width: 15%;
  bottom: 3%;
  left: 15%;
}

.couple-finded-modal .left-container img.melchor {
  width: 18%;
  bottom: 8%;
  left: 28%;
}

.couple-finded-modal .left-container img.gaspar {
  width: 12%;
  bottom: 16%;
  left: 24%;
}

.couple-finded-modal .left-container img.baltazar {
  width: 12%;
  bottom: 20%;
  left: 14%;
}

.couple-finded-modal .left-container img.pastor {
  width: 11%;
  bottom: 14%;
  left: 41.5%;
}

.couple-finded-modal .left-container img.mula-buey {
  width: 12.5%;
  bottom: 0%;
  left: 47.5%;
}

.you-won-card .right-container,
.couple-finded-modal .right-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-image: url(./img/estrellas.png);
  background-color: #e9c97c;
  background-repeat: no-repeat;
  background-size: cover;
  text-align: center;
}

.couple-finded-modal .right-container {
  width: 40%;
}

.you-won-card .right-container img {
  width: 130px;
}

.you-won-card .right-container h2,
.couple-finded-modal .right-container h2 {
  font-size: 1.5rem;
  font-weight: 900;
  color: #d7162f;
  margin: 0 50px;
}

.you-won-card .right-container p,
.couple-finded-modal .right-container p {
  font-size: 0.8rem;
  font-weight: 300;
  color: #000;
  padding: 0;
  text-align: center;
  margin: 10px 20px;
}

.you-won-card .bottom-container {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
  width: 100%;
  color: #fff;
  background-color: #075048;
  padding: 10px 0;
}

.you-won-card .bottom-container p {
  font-size: 1.2rem;
  font-weight: normal;
  margin: 0;
  padding: 0;
  text-align: center;
  margin: 0 7px;
}

.you-won-card .bottom-container a img {
  width: 35px;
  height: 35px;
}

.you-won-card-button {
  background: #d7162f;
  color: #fff;
  box-shadow: 0px 6px 0px #880e1e;
  width: 120px;
  height: 10px;
  font-size: 12px;
  padding: 10px 3px;
}

.you-won-card a,
.couple-finded-modal a {
  text-decoration: none;
}

/* responsive */

/* screens larger than 1440 auto bigg cards and footer and header */

@media screen and (max-width: 1440px) {
  main {
    grid-gap: 5px;
  }
  .flip-card {
    width: 130px;
    height: 130px;
  }
  .you-won-card h1 {
    font-size: 1.5rem;
  }

  .header-container .header-container-logo {
    height: 100%;
  }

  .header-container-content h1 {
    font-size: 1.5rem;
  }

  .header-container-content p {
    font-size: 0.9rem;
  }

  .footer-container-content img {
    height: 30px;
  }

  .footer-container-social-logos img {
    height: 100%;
  }
}

@media screen and (max-width: 1024px) {
  main {
    grid-gap: 5px;
    margin: 50px 0 100px 0;
  }
  .flip-card {
    width: 100px;
    height: 100px;
  }
  .you-won-card h1 {
    font-size: 1.5rem;
  }

  header {
    height: 80px;
  }

  .header-container .header-container-logo {
    width: 500px;
  }
  .header-container .header-container-logo img {
    width: 100%;
  }

  .header-container-content h1 {
    font-size: 1.4rem;
  }

  .header-container-content p {
    font-size: 0.7rem;
  }

  .footer-container-content img {
    height: 30px;
  }

  .footer-container-social-logos img {
    height: 100%;
  }

  .you-won-card .right-container h2 {
    font-size: 1.2rem;
  }

  .you-won-card .right-container p {
    font-size: 0.7rem;
  }

  .you-won-card .bottom-container p {
    font-size: 1rem;
  }

  .you-won-card .bottom-container a img {
    width: 30px;
    height: 30px;
  }

  .you-won-card .right-container img {
    width: 100px;
  }

  .you-won-card .right-container a {
    font-size: 0.7rem;
    padding: 5px 8px;
  }

  .you-won-card .left-container {
    width: 40%;
  }

}

@media screen and (max-width: 768px) {
  .flip-card {
    width: 100px;
    height: 100px;
  }
  

  header {
    max-width: 100vw;
    height: 60px;
  }

  .header-container-content h1 {
    font-size: 1rem;
  }

  .header-container-content p {
    font-size: 0.5rem;
  }

  .footer-container-content img {
    height: 20px;
  }

  footer p {
    font-size: 0.6rem;
  }

  .main-modal {
    width: 90%;
  }
}

@media screen and (max-width: 480px) {
  main {
    grid-gap: 5px;
  }
  .flip-card {
    width: 80px;
    height: 80px;
  }

  .header-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .header-container .header-container-logo {
    width: 20%;
  }

  .header-container-content {
    width: 100%;
    padding: 0;
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .header-container-content h1 {
    font-size: 0.8rem;
  }

  .header-container-content p {
    font-size: 0.4rem;
  }

  footer {
    height: 50px;
    max-width: 100vw;
  }

  .footer-container-social-logos a{
    height: 20px;
  }

  a.contactanos-button {
    padding: 0;
    width: fit-content;
    height: 8px;
  }

  .contactanos-button p {
    font-size: 0.5rem;
  }

  .footer-container-content img {
    height: 20px;
  }

  .footer-container-content {
      flex-direction: column;
      justify-content: center;
      align-items: start;
  }

  .couple-finded-modal .right-container h2 {
    font-size: 1rem;
    margin: 0;
  }

  .couple-finded-modal .right-container p {
    font-size: 0.5rem;
  }

  .couple-finded-modal .button {
    font-size: 0.5rem;
    padding: 5px 10px;
  }

  .you-won-card .right-container {
    width: 40%;
  }

  .you-won-card .right-container h2 {
    font-size: 0.8rem;
  }

  .you-won-card .right-container p {
    font-size: 0.4rem;
  }

  .you-won-card .bottom-container p {
    font-size: 0.6rem;
  }

  .you-won-card .bottom-container a img {
    width: 20px;
    height: 20px;
  }

  .you-won-card .right-container img {
    width: 80px;
  }

  .you-won-card .right-container a {
    font-size: 0.5rem;
    padding: 4px 3px;
    width: fit-content;
  }

  .you-won-card .top-container {
    max-height: 200px;
  }

  .you-won-card .left-container {
    width: 60%;
  }

  .you-won-card .left-container img {
    width: 100%;
  }
}

@media screen and (max-width: 320px) {
  main {
    grid-gap: 5px;
  }
  .flip-card {
    width: 60px;
    height: 60px;
  }

  .header-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .header-container .header-container-logo {
    width: 20%;
  }

  .header-container-content {
    width: 100%;
    padding: 0;
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .header-container-content h1 {
    font-size: 0.8rem;
  }

  .header-container-content p {
    font-size: 0.4rem;
  }

  footer {
    height: 50px;
    max-width: 100vw;
  }

  .footer-container-social-logos a{
    height: 20px;
  }

  a.contactanos-button {
    padding: 0;
    width: fit-content;
    height: 8px;
  }

  .contactanos-button p {
    font-size: 0.5rem;
  }

  .footer-container-content img {
    height: 20px;
  }

  .footer-container-content {
      flex-direction: column;
      justify-content: center;
      align-items: start;
  }

  .you-won-card {
    row-gap: 20px;
  }

  .you-won-card .top-container {
    flex-direction: column;
    max-height: fit-content;
    row-gap: 10px;
  }

  .you-won-card .left-container {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .you-won-card .left-container img {
    width: 100%;
  }

  .you-won-card .right-container {
    width: 100%;
  }
}

@media screen and (max-width: 280px) {
  main {
    grid-gap: 5px;
  }
  .flip-card {
    width: 50px;
    height: 50px;
  }
  .you-won-card {
    width: 90%;
    height: 50%;
  }

  .header-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .header-container .header-container-logo {
    width: 20%;
  }

  .header-container-content {
    width: 100%;
    padding: 0;
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .header-container-content h1 {
    font-size: 0.8rem;
  }

  .header-container-content p {
    font-size: 0.4rem;
  }

  footer {
    height: 50px;
    max-width: 100vw;
  }

  .footer-container-social-logos a{
    height: 20px;
  }

  a.contactanos-button {
    padding: 0;
    width: fit-content;
    height: 8px;
  }

  .contactanos-button p {
    font-size: 0.5rem;
  }

  .footer-container-content img {
    height: 20px;
  }

  .footer-container-content {
      flex-direction: column;
      justify-content: center;
      align-items: start;
  }

  .please-turn-card .error p{
    font-size: 0.8rem;
  }
}