:root {
  --cell-size: 100px;
  --mark-size: calc(var(--cell-size) * .9);
  --bg-color: #1a1a1a;
  --board-color: #2d2d2d;
  --x-color: #00fff7;
  --circle-color: #9655d7;
  --glow-x: 0 0 10px #00fff7, 0 0 20px #00fff7;
  --glow-o: 0 0 10px #9655d7, 0 0 20px #9655d7;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  font-family: 'Poppins', sans-serif;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

h1.glow {
    font-size: 3rem;
    text-shadow: 0 0 10px rgba(150, 85, 215, 0.7), 0 0 20px rgba(150, 85, 215, 0.5);
    margin: 0;
}

.status {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#player-turn {
    font-weight: bold;
    color: var(--x-color);
}

.board {
  display: grid;
  justify-content: center;
  align-content: center;
  justify-items: center;
  align-items: center;
  grid-template-columns: repeat(3, auto);
  gap: 10px;
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background-color: var(--board-color);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.cell:hover {
    transform: scale(1.02);
    background-color: #3d3d3d;
}

.cell.x,
.cell.circle {
  cursor: not-allowed;
}

.cell.x::before,
.cell.x::after,
.cell.circle::before {
  background-color: transparent;
}

/* X Mark */
.cell.x::before,
.cell.x::after {
  content: '';
  position: absolute;
  width: calc(var(--mark-size) * .15);
  height: var(--mark-size);
  background-color: var(--x-color);
  box-shadow: var(--glow-x);
  border-radius: 5px;
}

.cell.x::before {
  transform: rotate(45deg);
}

.cell.x::after {
  transform: rotate(-45deg);
}

/* Circle Mark */
.cell.circle::before {
  content: '';
  position: absolute;
  width: calc(var(--mark-size) * .8);
  height: calc(var(--mark-size) * .8);
  border-radius: 50%;
  border: calc(var(--mark-size) * .15) solid var(--circle-color);
  box-shadow: var(--glow-o), inset var(--glow-o);
}

/* Winning Message Overlay */
.winning-message {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, .9);
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 5rem;
  flex-direction: column;
  z-index: 10;
}

.winning-message button {
  font-size: 2rem;
  background-color: white;
  border: 1px solid black;
  padding: .25em .5em;
  cursor: pointer;
  border-radius: 5px;
  margin-top: 20px;
  transition: all 0.2s;
}

.winning-message button:hover {
  background-color: black;
  color: white;
  border-color: white;
}

.winning-message.show {
  display: flex;
}

#restartButton {
    padding: 10px 20px;
    font-size: 1.2rem;
    background-color: #6a25eb;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 0 10px rgba(106, 37, 235, 0.5);
}

#restartButton:hover {
    background-color: #551dbd;
}
