/* 🔥 Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 🎯 Theme Variables */
:root {
  --bg-gradient: linear-gradient(135deg, #0f172a, #1e293b, #020617);
  --card-bg: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);

  --primary: #38bdf8;
  --primary-dark: #0ea5e9;

  --text: #e2e8f0;
  --muted: #94a3b8;
}

/* 🌌 Body */
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;

  background: var(--bg-gradient);
  padding: 12px;
}

/* 🧊 Container */
.container {
  width: 100%;
  max-width: 420px;
  padding: 22px;
  border-radius: 20px;
  text-align: center;

  background: var(--card-bg);
  backdrop-filter: blur(16px);

  border: 1px solid var(--border);

  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.6),
    inset 0 0 25px rgba(255, 255, 255, 0.05);
}

/* 🧠 Heading */
.heading {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: 1px;
}

/* 👤 Players */
.players {
  display: flex;
  gap: 1rem;
  margin-bottom: 18px;
  justify-content: center;
}

#p1Display,
#p2Display {
  padding: clamp(0.5rem, 6vw, 1rem);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 1rem;
  font-weight: 500;
  color: var(--text);
  font-size: clamp(0.85rem, 2vw, 1rem);
  transition: 0.25s;

  &:hover {
    cursor: pointer;
    color: var(--primary);
    background-color: rgba(255, 255, 255, 0.08);
  }
}

/* 🎮 Grid */
.gameContainer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

/* 🔲 Boxes */
.box {
  aspect-ratio: 1/1;
  border-radius: 14px;
  border: none;

  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: bold;
  color: var(--text);

  background: linear-gradient(145deg, #1e293b, #020617);

  box-shadow:
    4px 4px 12px rgba(0, 0, 0, 0.7),
    -2px -2px 6px rgba(255, 255, 255, 0.04);

  cursor: pointer;
  transition: all 0.25s ease;
}

/* Hover */
.box:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.05);
  background: linear-gradient(145deg, #334155, #1e293b);
}

/* Click feel */
.box:active:not(:disabled) {
  transform: scale(0.95);
}

/* Played */
.box:disabled {
  background: #020617;
  opacity: 0.85;
  cursor: not-allowed;
}

/* 🏆 Winner Box */
.winingBox {
  display: none;
  margin-bottom: 18px;
  animation: fadeIn 0.3s ease;
}

.winingMassage {
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--primary);
  font-weight: 600;
  white-space: pre-line;
  margin-bottom: 12px;
}

/* 🔘 Buttons */
.reset,
.newGame {
  padding: 10px 18px;
  border-radius: 12px;
  border: none;

  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: 500;

  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: white;

  cursor: pointer;
  transition: 0.25s;
}

/* Hover */
.reset:hover,
.newGame:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

/* Center Reset Button */
#hideBox {
  display: block;
  margin: 15px auto 0;
}

/* ✨ Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 📱 Mobile */
@media (max-width: 480px) {
  .container {
    padding: 18px;
  }

  .gameContainer {
    gap: 10px;
  }

  .players {
    flex-direction: column;
  }
}

/* 📱 Tablet */
@media (min-width: 768px) {
  .container {
    max-width: 480px;
  }
}

/* 💻 Large */
@media (min-width: 1200px) {
  .container {
    max-width: 520px;
  }
}
