*{
  box-sizing: border-box;
  margin: 0px;
  padding: 0px;
  font-family: 'Verdana', sans-serif;
}

.title {
  color: darkred;
  text-align: center;
  margin: auto;
  display: none;
}

body {
  background-image: url(Graphics/BG3.png);
  background-color: rgb(246, 226, 226);
  background-attachment: fixed;
  background-size: cover;
}

#gameTitle {
  display: flex;
  width: 30em;
  height: auto;
  justify-content: center;
  align-items: center;
  margin: 0 auto;;
  padding: 0.9em 0.8em;
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
  animation-delay: 0.8;
  border: none;
  border-radius: 0.3em;
  opacity: 0.3;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* RULES DROP DOWN */

/*.dropdown {
  display:flex;
  justify-content: center;
  position:fixed;
  align-items: center;
  cursor: pointer;
}

.dropdown span {
  display: inline-block;
  padding: 8px 16px;
  border: 2px solid #ccc;
  border-radius: 4px;
  transition: all 0.2s ease-in-out;
}

.dropdown:hover span {
  background-color: #f4f4f4;
}
  
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0%;
  width: 240px;
  max-width: 240px;
  max-height: fit-content;
  background-color: #c2c2c2;
  border-radius: 8px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  padding: 12px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.2s ease-in-out;
  z-index: 1;
}
  
.dropdown:hover .dropdown-content {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
  
.dropdown-item {
  display: block;
  padding: 8px 0;
  font-size: 16px;
  color: #555;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}
  
.dropdown-item:hover {
  color: #333;
}*/


.tic-tac-toe {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.row {
  display: flex;
}

.reset-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  animation: fadeIn 1s ease-in forwards;
  animation-delay: 0.8;
}

.reset-button {
  display: block;
  padding: 0.6em 1em;
  border: none;
  border-radius: 0.3em;
  background-color: white;
  color: rgb(87, 16, 16);
  font-size: 1.5em;
  font-weight: 550;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.reset-button:hover {
  background-color: #851e1e;
  color: #ffffff;
  cursor: pointer;
}

.button {
  display: block;
  text-align: center;
  padding: 0.6em 1em;
  border: none;
  border-radius: 0.3em;
  background-color: white;
  color: rgb(87, 16, 16);
  font-size: 1.5em;
  font-weight: 550;
  text-decoration: none;
}

.button:hover {
  background-color: #851e1e;
  color: #ffffff;
  cursor: pointer;
}

.square {
  width: 100px;
  height: 100px;
  background-color: #cab8b8;
  margin: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
  transition: background-color 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
}

.square::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.square:hover{
  background-color: #850505;
  transform: scale(1.1);
}

.square:hover::before {
  opacity: 1;
}
 
.player1:hover{
  background-color: rgba(77, 77, 77, 0);
} 
.player2:hover {
  background-color: rgba(0, 0, 0, 0);
}

.square::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 150%;
  height: 150%;
  background-image: url("Graphics/bloodswipe.png");
  background-size: cover;
  background-position: center;
  transform: translateX(-100%);
  z-index: 2;
  opacity: 0;
  transition: transform 0.6s ease-in-out;
}
.square.player1 {
  background-image: url('Graphics/X.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  
}

.square.player2 {
  background-image: url('Graphics/O.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
}

.square.player1::after,
.square.player2::after {
  opacity: 1;
}

.square.player1::after {
  animation: move-right 0.3s ease-in-out forwards;
}

.square.player2::after {
  animation: move-left 0.3s ease-in-out forwards;
}

@keyframes player1 {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

@keyframes player2 {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

@keyframes move-right {
  0% {
    transform: translate(-100%, -100%) scale(2);
  }
  100% {
    transform: translate(15%, 50%) scale(2);
  }
}

@keyframes move-left {
  0% {
    transform: translate(-100%, -100%) scale(2);
  }
  100% {
    transform: translate(15%, 50%) scale(2);
  }
}

@keyframes slide-in {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  100% {
    transform: translateY(-60%);
    opacity: 1;
  }
}

.game-over-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 41.5%;
  transform: translate(-50%, -50%);
  background-color: whitesmoke;
  background-image: url(Graphics/BG5.png);
  background-size: cover;
  width: 250px;
  height: 400px;
  padding: 20px;
  box-shadow: 0px 0px 10px rgba(59, 6, 6, 0.5);
  border-radius: 20px;
  text-align: center;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
}

#gameTitleGO {
  width: 15em;
  height: auto;
  padding: 0.9em 0.8em;
  animation: fadeIn 1s ease-in forwards;
  animation-delay: 0.8;
  border: none;
}

.game-over-animation {
  animation-name: slide-in;
  animation-duration: 0.8s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}

.hidden {
  display: none;
  pointer-events: none;
  transition: opacity 0.8s ease-out;
}

.hidden.show {
  display: flex;
  pointer-events: auto;
}
.game-over-box {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-over-text {
  font-size: 1.5em;
  font-weight: 550;
  margin: 0;
}

.result-text {
  font-size: 1em;
  margin: 10px 5px;
}

.play-again-button {
  display: block;
  text-align: center;
  padding: 0.6em 1em;
  margin: 1.5em;
  border: none;
  border-radius: 0.3em;
  background-color: white;
  color: rgb(87, 16, 16);
  font-size: 1em;
  font-weight: 550;
  text-decoration: none;
  transition: all 0.2s ease-in-out;

}

.play-again-button:hover{

  background-color: #851e1e;
  border: #333;
  color: #ffffff;
  cursor: pointer;
}

/*----Media Queries----*/

/* Tablet View */
@media screen and (max-width:1030px) {
  html, body {
    max-width: 100%;
    overflow-y: hidden;
  }

  #gameTitle{
    width: 25em;
    height: auto;
  }
    
  .button, .reset-button {
    font-size: 1.2em;
  }

  .square {
    width: 80px;
    height: 80px;
  }

  .game-over-container{
    width: 200px;
    height: 350px;
  }

  #gameTitleGO{
    width: 13em;
  }

  .game-over-text{
    font-size: 1.3em;
  }

  .result-text, .play-again-button {
    font-size: 0.9em;
  }
}

/* Mobile View */
@media screen and (max-width:660px) {
  html, body {
    max-width: 100%;
    overflow-y: hidden;
  }

  #gameTitle{
    width: 20em;
    height: auto;
  }
    
  .button, .reset-button {
    font-size: 1em;
  }

  .square {
    width: 70px;
    height: 70px;
  }

  .game-over-container{
    width: 170px;
    height: 320px;
    left: 35%;
  }

  #gameTitleGO{
    width: 10em;
  }

  .game-over-text{
    font-size: 1em;
  }

  .result-text, .play-again-button {
    font-size: 0.6em;
  }
}
