/* Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap");

/* GLOBAL RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* BODY */
body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at top left, #0f0c29, #302b63, #24243e);
  color: #fff;
  overflow: hidden;
}

/* CONTAINER */
.container {
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 30px 20px;
  border-radius: 20px;
  backdrop-filter: blur(15px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
  width: 320px;
  position: relative;
}

/* TITLE */
.title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #00ffe0;
  text-shadow: 0 0 10px #00ffe0, 0 0 20px #00ffe0;
  margin-bottom: 25px;
  letter-spacing: 1.5px;
  animation: neonGlow 1.5s infinite alternate;
}

@keyframes neonGlow {
  0% {
    text-shadow: 0 0 5px #00ffe0, 0 0 15px #00ffe0;
  }
  100% {
    text-shadow: 0 0 20px #00ffe0, 0 0 40px #00ffe0;
  }
}

/* GAME BOARD */
.game-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 75px);
  grid-template-rows: repeat(3, 75px);
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

/* CELLS */
.cell {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  font-weight: 700;
  cursor: pointer;
  color: #00ffe0;
  box-shadow: 0 5px 15px rgba(0, 255, 224, 0.25);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

/* CELL HOVER */
.cell:hover {
  transform: scale(1.08) rotate(2deg);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 20px #00ffe0, 0 0 40px #00ffe0;
}

/* X/O ANIMATION */
.cell.x {
  color: #ff4b2b;
  animation: pop 0.3s ease forwards;
}
.cell.o {
  color: #1fa2ff;
  animation: pop 0.3s ease forwards;
}

@keyframes pop {
  0% {
    transform: scale(0);
  }
  60% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* INFO SECTION */
.info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

#status {
  font-size: 1rem;
  font-weight: 700;
  color: #ffeb3b;
  text-shadow: 0 0 6px #ffeb3b, 0 0 12px #ffeb3b;
}

/* RESTART BUTTON */
#restartBtn {
  padding: 8px 20px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(45deg, #ff416c, #ff4b2b, #ff8c42);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(255, 75, 43, 0.5);
  transition: all 0.3s ease;
}

#restartBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(255, 75, 43, 0.7);
}

/* WINNING LINE */
.winning-line {
  position: absolute;
  background: linear-gradient(90deg, #00ff6a, #00ffe0, #00ff6a);
  height: 5px;
  border-radius: 5px;
  box-shadow: 0 0 12px #00ff6a, 0 0 20px #00ffe0;
  z-index: 50;
  transform-origin: left center;
  transition: all 0.4s ease;
  pointer-events: none;
}

/* WINNING CELLS HIGHLIGHT */
.cell.win {
  animation: winGlow 1s infinite alternate;
  color: #00ff6a !important;
}

@keyframes winGlow {
  0% {
    text-shadow: 0 0 5px #00ff6a, 0 0 10px #00ff6a;
  }
  100% {
    text-shadow: 0 0 15px #00ff6a, 0 0 30px #00ffe0;
  }
}

/* RESPONSIVE */
@media (max-width: 400px) {
  .container {
    width: 95%;
    padding: 20px;
  }
  .game-board {
    grid-template-columns: repeat(3, 60px);
    grid-template-rows: repeat(3, 60px);
    gap: 8px;
  }
  .cell {
    font-size: 1.6rem;
  }
  #restartBtn {
    font-size: 0.85rem;
    padding: 6px 18px;
  }
  .title {
    font-size: 1.5rem;
  }
}
