/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: hidden;
  background-color: #2d23be;
  background-image: url('./Group 1.svg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  font-family: 'Orbitron', sans-serif;
  color: #00ff00;
}

/* Heading */
h1 {
  text-align: center;
  font-size: 10vw;
  margin: 1rem auto;
  padding: 0.5rem 1rem;
  color: #00ff00;
  background-color: #111;
  border: 9px solid #00ff00;
  text-shadow: 0 0 1px #0a64ff, 0 0 10px #00ff00, 0 1px #00ff00;
  width: fit-content;
}

/* Message */
.message {
  text-align: center;
  margin: 1rem;
  font-size: 4.5vw;
}

/* Player indicators */
#X, #O {
  color: #00ff00;
  font-size: 6vw;
  text-shadow: 0 0 10px #f68f08, 0 0 20px #00ff00;
}

/* Game grid */
#grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem auto;
  width: 90vw;
  max-width: 500px;
}

/* Boxes */
.box {
  background-color: #000;
  color: #00ff00;
  font-size: 2.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 5px solid #00ff00;
  aspect-ratio: 1/1;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.box:hover {
  background-color: #000;
  box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.8rem;
}

/* Menu buttons */
#menu {
  margin: 2rem auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 90vw;
  max-width: 300px;
}

.reset {
  color: #000;
  font-size: 5vw;
  border-radius: 20px;
  background-color: #00ff00;
  border: none;
  padding: 1rem;
  transition: background-color 0.3s, color 0.3s;
  width: 100%;
}

.reset:hover {
  background-color: #ff0000;
  color: #00ff00;
  cursor: pointer;
}

.hide {
  display: none;
}

/* Glow effect for winning boxes */
.winner {
  animation: glow 1s infinite alternate;
}

@keyframes glow {
  from {
    background-color: #00ff00;
    box-shadow: 0 0 10px #00ff00;
  }
  to {
    background-color: #00cc00;
    box-shadow: 0 0 20px #00ff00;
  }
}

/* Game board positioning */
.board {
  position: relative;
}

.strike {
  position: absolute;
  height: 4px;
  background-color: rgb(0, 229, 255);
  z-index: 500;
  transform-origin: 0 50%;
  animation: drawLine 0.3s ease-out forwards;
}

@keyframes drawLine {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Winner popup */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: #111;
  color: #00ff00;
  padding: 30px 50px;
  border-radius: 12px;
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 0 20px #00ff00;
  animation: popupAnim 0.6s forwards ease-out;
  font-family: 'Orbitron', sans-serif, 'Segoe UI Emoji', 'Noto Color Emoji';
  z-index: 1000;
}

@keyframes popupAnim {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* Icons */
.icon {
  width: 50%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

/* ---------------------------
   Responsive Design for Tablets and Desktops
--------------------------- */
@media (min-width: 768px) {
  h1 {
    font-size: 3rem;
  }

  .message {
    font-size: 1.5rem;
  }

  #X, #O {
    font-size: 2.5rem;
  }

  .reset {
    font-size: 1.2rem;
    padding: 1rem 2rem;
  }

  .popup {
    font-size: 2.5rem;
  }

  .icon {
    width: 25%;
  }
}
