/* ---------- Base layout ---------- */
body {
  margin: 0;
  background: #0f0f10;
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 5px;
}

.game-wrapper {
  text-align: center;
  width: 100%;
  max-width: 400px;
}

/* ---------- Title ---------- */
.title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
  margin-bottom: 20px;

  /* Gradient text */
  background: linear-gradient(135deg, #b100ff, #ffb347);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  position: relative;
}

.title::after {
  content: "";
  display: block;
  width: 100%;
  height: 4px;
  margin: 6px auto 0;
  border-radius: 2px;
  background: linear-gradient(135deg, #b100ff, #ffb347);
}

/* ---------- Board container ---------- */
.board-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(5px, 2vw, 12px);
  min-height: 320px;
}

/* ---------- Board squares ---------- */
.board-square {
  width: 100px;
  aspect-ratio: 1/1; /* keeps squares perfect */
  font-size: clamp(1.5rem, 8vw, 3rem);
  font-weight: 900;
  border: 2px solid #6a00ff;
  border-radius: 10px;
  background: #1b1b1d;
  color: #fff4e6;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}

@media (max-width: 430px) {
  .board-square {
    width: 70px;
  }
}

/* X and O colors */
.board-square.X {
  color: #ffb347;
}
.board-square.O {
  color: #79d2ff;
}

/* click/tap effect */
.board-square:active {
  transform: scale(1.1);
}

/* ---------- Buttons (Start / Play Again) ---------- */
.start-game,
.play-again {
  padding: clamp(8px, 2vw, 12px) clamp(15px, 4vw, 25px);
  font-size: clamp(1rem, 4vw, 1.2rem);
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #6a00ff, #b100ff);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 15px;
  transition: transform 0.3s, filter 0.3s;
  display: inline-block;
}

.start-game:hover,
.play-again:hover {
  transform: scale(1.05);
  filter: brightness(1.3);
}

/* ---------- Result container ---------- */
.result-container {
  margin-top: 10px;
  font-size: clamp(1rem, 4vw, 1.5rem);
  color: #fff4e6;
  font-weight: 600;

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Optional subtle hover effect on squares ---------- */
.board-square:hover {
  background: #252528;
  transform: translateY(-2px);
  box-shadow: 0 0 6px #6a00ff;
}
