/* Põhiseaded */
body {
  height: 100vh;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background-image: url("back.jpg");
  background-size: 100vw 100vh;
  background-position: 0px 0px;
  background-repeat: repeat-x;
  animation: move 80s linear infinite;
}

@keyframes move {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -100vw 0;
  }
}


/* Peamine tabeli paigutus */
#mainTable {
  margin-top: 4vh;
}

/* Kaardi stiil */
.card {
  z-index: 100;
  background-color: rgba(213, 233, 199, 0.8);
  border: 3px solid rgba(112, 102, 102, 0.8);
  height: 10vh;
  width: 10vh;
  padding: 20px;
  margin: 2vh;
  font-size: 30px;
  text-align: center;
  border-radius: 1em;
  opacity: 0.9;
  box-shadow: 5px 10px 18px rgba(97, 197, 243, 0.733);
  transition: transform 0.4s ease-in-out, box-shadow 0.3s ease;
  user-select: none; /* disable text/image selection */
  -webkit-user-drag: none; /* disable drag */
}

/* Hover efektid */
.card:hover {
  transform: scale(1.05);
  box-shadow: 10px 20px 30px rgba(97, 197, 243, 0.733);
}

/* Kaardi pildi stiil */
.card img {
  position: relative;
  height: 16vh;
  opacity: 0;
  bottom: 100px;
  transition: opacity 0.5s ease-in-out, bottom 0.5s ease-in-out;
}

/* Kaardi avamine */
.n:hover > .card {
  height: 2vh;
  border-radius: 50%;
  border: 3px solid rgba(66, 73, 4, 0.8);
  top: -20px;
  background-color: yellow;
  transition: 0.3s;
}

/* Kaardi avamine - vaikimisi */
.open {
  height: 2vh;
  border-radius: 50%;
  border: 3px solid rgba(66, 73, 4, 0.8);
  top: -20px;
  background-color: yellow;
}

/* Reveal efekt */
.reveal {
  opacity: 1;
  position: relative;
  height: 100px;
  bottom: 15vh;
  transition: 0.5s;
}

/* Nuputooted */
#newGame, #gameSolver, #mute {
  height: 12vh;
  width: 12vh;
  border-radius: 50%;
  font-size: 2vh;
  font-weight: bold;
  color: rgb(31, 31, 165);
  background-color: yellow;
  border-style: groove;
  border-color: aqua;
  border-width: 2vh;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover efektid nuppudele */
#newGame:hover, #gameSolver:hover, #mute:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

#mute {
  font-size: 4vh;
  border-color: red;
}

/* Teise tabeli stiil */
#tbl2 {
  z-index: 1;
  text-align: center;
}

/* Punktide ja muude info elementide stiil */
#p1points, #p2points, #time, #moves {
  background-color: yellow;
  border-radius: 1vh;
  text-align: center;
  font-weight: bold;
  opacity: 0.8;
  height: 4vh;
}

/* Aliens animaatsioon */
#aliens {
  width: 100px;
  height: 100px;
  position: relative;
  animation-name: example;
  animation-duration: 12s;
  animation-iteration-count: infinite;
  animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes example {
  0% { left: -100px; top: -100px; }
  25% { left: 200px; top: 0px; }
  50% { left: 200px; top: 200px; }
  75% { left: -1200px; top: 200px; }
  100% { left: -100px; top: -100px; }
}

/* AB ja animatsioonid */
#AB {
  z-index: -1;
  transform-origin: 70% 400%;
  height: 62px;
  width: 10vw;
  font-size: 52vh;
  color: yellow;
  font-weight: bold;
  filter: blur(3px);
  position: relative;
  opacity: 0.9;
  top: 10vh;
  right: 50vw;
  animation: AB-spin infinite 30s linear;
  transition: transform 1s ease-in-out, opacity 1s ease-in-out;
}

#AB:hover {
  opacity: 1;
  transform: scale(1.1);
}

.AB {
  animation: AB-spin infinite 10s linear;
}

.BA {
  animation: BA-spin infinite 20s linear;
}

.AA {
  animation: AA-spin infinite 15s linear;
}

.BB {
  animation: BB-spin infinite 30s linear;
}

@keyframes AB-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes BA-spin {
  from { transform: rotate(-180deg); }
  to { transform: rotate(180deg); }
}

@keyframes AA-spin {
  from { transform: rotate(90deg); }
  to { transform: rotate(-270deg); }
}

@keyframes BB-spin {
  from { transform: rotate(-270deg); }
  to { transform: rotate(90deg); }
}

/* Päise stiil */
h1 {
  font-size: large;
}

/* Reageeriv disain - mobiilide ja väikeste ekraanide jaoks */
@media (max-width: 768px) {
  .card {
    height: 12vh;
    width: 12vh;
    font-size: 2.5vh;
  }

  #newGame, #gameSolver, #mute {
    height: 10vh;
    width: 10vh;
    font-size: 2vh;
  }

  #p1points, #p2points, #time, #moves {
    font-size: 2.5vh;
    height: 5vh;
  }

  h1 {
    font-size: 4vh;
  }
}

/* Reageeriv disain mobiilides */
@media (max-width: 480px) {
  .card {
    height: 20vh;
    width: 20vh;
    font-size: 4vh;
  }

  #newGame, #gameSolver, #mute {
    height: 8vh;
    width: 8vh;
    font-size: 2.5vh;
  }

  #p1points, #p2points, #time, #moves {
    font-size: 3vh;
    height: 6vh;
  }

  h1 {
    font-size: 5vh;
  }
}

/* Reageeriv disain landscape orientatsioonis */
@media (max-width: 768px) and (orientation: landscape) {
  .card {
    height: 8vh;
    width: 8vh;
    font-size: 3vh;
  }

  #newGame, #gameSolver, #mute {
    height: 9vh;
    width: 9vh;
    font-size: 3vh;
  }
}

/* Täiendavad muudatused suuremate ekraanide jaoks */
@media (min-width: 1024px) {
  .card {
    height: 8vh;
    width: 8vh;
    font-size: 25px;
  }

  #newGame, #gameSolver, #mute {
    height: 12vh;
    width: 12vh;
  }
}
