* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;

  background-image: url('../jeu-interactif/images/final-background-tictactoe.jpg');
  background-size: cover;
  background-position: center;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
.hidden {
  display: none !important;
}
#startScreen,
#gameScreen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}
h1 {
  font-family: 'Oswald', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  font-size: 120px;
  margin: 0;
  letter-spacing: 2px;
  text-transform: uppercase;
}
#startBtn {
  padding: 16px 40px;
  font-family: 'Oswald', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 32px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: none;
  border-radius: 10px;
  background: #3a6df0;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
#startBtn:hover {
  background: #2a54c9;
  transform: scale(1.05);
}
#board {
  display: grid;
  grid-template-columns: repeat(3, 150px);
  grid-template-rows: repeat(3, 150px);
  gap: 12px;
  padding: 12px;
  border-radius: 12px;

  background: #ffffff;
}
#board.win-red {
  animation: glowMoveRed 1.4s linear infinite;
  background-size: 300% 300%;
}
#board.win-blue {
  animation: glowMoveBlue 1.4s linear infinite;
  background-size: 300% 300%;
}
@keyframes glowMoveRed {
  0% {
    background-image: linear-gradient(120deg, #ffffff, #ff2b2b, #ffffff, #ff2b2b, #ffffff);
    background-position: 0% 50%;
    box-shadow: 0 0 15px 4px rgba(255, 30, 30, 0.6);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 30px 10px rgba(255, 30, 30, 0.9);
  }
  100% {
    background-position: 0% 50%;
    box-shadow: 0 0 15px 4px rgba(255, 30, 30, 0.6);
  }
}
@keyframes glowMoveBlue {
  0% {
    background-image: linear-gradient(120deg, #ffffff, #2b6bff, #ffffff, #2b6bff, #ffffff);
    background-position: 0% 50%;
    box-shadow: 0 0 15px 4px rgba(43, 107, 255, 0.6);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 30px 10px rgba(43, 107, 255, 0.9);
  }
  100% {
    background-position: 0% 50%;
    box-shadow: 0 0 15px 4px rgba(43, 107, 255, 0.6);
  }
}
.cell {
  border: none;
  border-radius: 8px;
  font-size: 64px;
  font-weight: bold;
  color: #222222;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 150px;
  height: 150px;
  background-image: url('../jeu-interactif/images/background+board-A.jpg');
  background-size: 600%;
  background-position: center;
}
.cell:disabled {
  cursor: default;
}
.cell:not(:disabled):hover {
  filter: brightness(1.15);
  transform: scale(1.03);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.cell img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}
.glove-img {
  animation: gloveSave 1.2s ease-out;
}
@keyframes gloveSave {
  0% {
    transform: scale(1.4) translateX(-15px);
  }
  40% {
    transform: scale(0.85) translateX(8px);
  }
  70% {
    transform: scale(1.05) translateX(-3px);
  }
  100% {
    transform: scale(1) translateX(0);
  }
}
.ball-img {

  animation: ballShrink 0.3s ease-out forwards;
}
@keyframes ballShrink {
  0% {
    transform: scale(2.4);
  }
  100% {

    transform: scale(0.65);
  }
}
#message {
  font-size: 56px;
  font-weight: 600;
  min-height: 60px;
  text-align: center;
  color: #ffffff;
}
#resetBtn {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background: #3a6df0;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
#resetBtn:hover {
  background: #2a54c9;
  transform: scale(1.05);
}

/* Music button */
#musicBtn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
#musicBtn:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.08);
}
