* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  text-align: center;
  background-color: #1a1a1a; /* Dark Background */
  font-family: "Segoe UI", sans-serif; /* Preserved Font */
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

main {
  /* Ensures the main container is centered */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

h1 {
  margin-bottom: 2rem;
  font-size: 3rem;
  font-weight: bold;
  color: #f3f4f6;
  text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.game {
  height: 60vmin;
  width: 60vmin;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5vmin;
  margin-bottom: 2rem; /* Spacing between grid and reset button */
}

.box {
  height: 18vmin;
  width: 18vmin;
  border: none;
  border-radius: 1rem;
  font-size: 8vmin;
  background-color: #2d2d2d; /* Dark Box Color */
  color: #e0e0e0;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  
  /* NO transform/scale here - keeps shape fixed */
  transition: background-color 0.2s ease, color 0.2s ease; 
}

.box:hover {
  background-color: #3d3d3d; /* Lighten slightly on hover */
}

/* Distinct Colors for X and O */
.box.x-mark {
  color: #ff6b6b; /* Soft Red */
}

.box.o-mark {
  color: #4ecdc4; /* Soft Teal */
}

#reset-btn,
#new-btn {
  width: 140px;
  height: 50px;
  border: none;
  border-radius: 50px; /* Fully rounded pill shape */
  
  /* NEW COLOR: Vibrant Violet */
  background-color: #8b5cf6; 
  
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  
  /* Centering */
  display: block;
  margin: 0 auto; 
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4); /* Glow effect */
}

#reset-btn:hover,
#new-btn:hover {
  background-color: #7c3aed; /* Darker Violet on hover */
}

#reset-btn:active,
#new-btn:active {
  transform: translateY(2px); /* Slight press effect */
}

#msg {
  color: #ffffff;
  font-size: 3rem;
  font-weight: bold;
}

.msg-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(20, 20, 20, 0.95);
  padding: 3rem 4rem;
  border-radius: 1rem;
  border: 1px solid #333;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  z-index: 10;
}

.hide {
  display: none;
}

/* --- FOOTER & TOAST --- */
      footer {
        margin-top: 50px;
        text-align: center;
        font-size: 13px;
        color: var(--text-secondary);
        opacity: 0.8;
      }

      footer a {
        color: inherit;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s;
      }

      footer a:hover {
        color: #3b82f6;
      }