/* Reset some basics */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Press Start 2P', cursive;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #6b6bd8, #2a2a4c);
  color: #fff;
}

/* Wrapper around everything */
.wrapper {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: fadeIn 1s ease-in-out;
}

/* Game info text */
.game-info {
  position: relative;
  top: 0; 
  display: inline-block;
  background: rgba(255, 211, 105, 0.15);
  border: 2px solid #ffd369;
  border-radius: 2rem;
  padding: 1rem 3rem;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: #ffd369;
  text-shadow: 0 0 8px rgba(255, 211, 105, 0.8);
  animation: pulseText 1.5s infinite;
}

/* Tic Tac Toe grid */
.tic-tac-toe {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 12px;
  justify-content: center;
  margin: 0 auto 1.5rem;
  transform: scale(1);
  animation: floatBoard 3s infinite ease-in-out;
}

.box {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;

  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 15px; 

  backdrop-filter: blur(6px);
  transition: all 0.25s ease-in-out;
  color: rgb(223, 117, 205);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Hover & active effect */
.box:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1) rotate(1deg);
  border-color: #ffd369;
  box-shadow: 0 0 15px #ffd369;
}

/* Button style */
.btn, .undo-btn {
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 30px;
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn:hover {
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(255, 75, 43, 0.6);
}

.btn.active {
  animation: glowBtn 1s infinite alternate;
}

/* Winner highlight */
.win {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: #fff;
    font-weight: bold;
    animation: winnerPulse 1s infinite alternate;
    transform: scale(1.1);
    box-shadow: 0 0 20px #43e97b;
}

/* Tie effect */
.tie {
    animation: tieShake 0.6s ease-in-out 0s 3;
    background: rgba(194, 8, 8, 0.689);
}

/* Different colors for players */
.player-x {
  color: #10100f;   /* gold/yellow */
  text-shadow: 0 0 10px rgba(255, 211, 105, 0.8);
}

.player-o {
  color: #eef5f7;   /* aqua/cyan */
  text-shadow: 0 0 10px rgba(77, 210, 255, 0.8);
}

.undo-btn.disabled{
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* ------------------- Animations ------------------- */
@keyframes pulseText {
  0% { text-shadow: 0 0 8px rgba(255,211,105,0.6); }
  50% { text-shadow: 0 0 18px rgba(255,211,105,1); }
  100% { text-shadow: 0 0 8px rgba(255,211,105,0.6); }
}

@keyframes floatBoard {
  0%,100% { transform: scale(1) translateY(0px); }
  50% { transform: scale(1.02) translateY(-8px); }
}

@keyframes glowBtn {
  from { box-shadow: 0 0 5px #ff416c, 0 0 10px #ff4b2b; }
  to { box-shadow: 0 0 15px #ff416c, 0 0 25px #ff4b2b; }
}

@keyframes winnerPulse {
  from { transform: scale(1.05); opacity: 0.9; }
  to { transform: scale(1.2); opacity: 1; }
}

@keyframes tieShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}