/* ==============================
   GLOBAL RESET
============================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==============================
   BODY
============================== */
body {
  min-height: 100vh;
  background: radial-gradient(circle at center, #2a2a2a 0%, grey 70%);
  position: relative;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue",
               Arial, sans-serif;

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


/* ==============================
   TITLE
============================== */
h1 {
  margin-top: 30px;
  margin-bottom: 20px;
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: 1px;
}

/* ==============================
   MODE BUTTONS
============================== */
.menu {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

button {
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #2c7be5, #1a5fd0);
  color: white;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
}

button:active {
  transform: translateY(0);
}

/* ==============================
   BOARD WRAPPER
============================== */
/* Center entire game area */
.board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

/* Board centered properly */
#board {
  width: 420px;
  height: 420px;
  margin: 20px auto;
  border-radius: 14px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);

  touch-action: none;     /* 🔥 KEY FIX */
  overscroll-behavior: contain; /* prevent page bounce */
}

/* ==============================
   CAPTURED PIECES
============================== */
.captured-row {
  display: flex;
  gap: 6px;
  min-height: 32px;
  align-items: center;
  margin: 6px 0;
}

.captured-piece {
  width: 28px;
  opacity: 0.85;
}

/* ==============================
   STATUS TEXT
============================== */
.status {
  font-size: 20px;
  font-weight: 600;
  margin-top: 12px;
  min-height: 28px;
}

/* ==============================
   LAST MOVE HIGHLIGHT
============================== */
.highlight-last-move {
  box-shadow: inset 0 0 0 4px rgba(255, 215, 0, 0.8);
}

/* ==============================
   CHECK HIGHLIGHT
============================== */
.in-check {
  box-shadow: inset 0 0 0 4px red;
}

/* ==============================
   PROMOTION MODAL OVERLAY
============================== */
#promotionModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

#promotionModal.hidden {
  display: none;
}

/* ==============================
   PROMOTION CARD
============================== */
.promotion-content {
  background: #ffffff;
  padding: 28px 36px;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0,0,0,0.45);
  animation: fadeInScale 0.25s ease;
}

.promotion-content h3 {
  color: #222;
  font-size: 22px;
  margin-bottom: 22px;
  font-weight: 600;
}

/* ==============================
   PROMOTION PIECES
============================== */
#promotionPieces {
  display: flex;
  gap: 26px;
  justify-content: center;
}

#promotionPieces img {
  width: 70px;
  padding: 12px;
  border-radius: 14px;
  background: #f3f3f3;
  cursor: pointer;
  transition: all 0.2s ease;
}

#promotionPieces img:hover {
  transform: translateY(-5px) scale(1.1);
  background: #e6e6e6;
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}

#promotionPieces img:active {
  transform: scale(0.95);
}

/* ==============================
   MODAL ANIMATION
============================== */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==============================
   RESPONSIVE
============================== */
@media (max-width: 500px) {
  #board {
    width: 90vw;
    height: 90vw;
  }

  h1 {
    font-size: 1.8rem;
  }

  .status {
    font-size: 18px;
  }
}

#hockeyGame {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

#hockeyCanvas {
  width: 90vw;
  height: 65vh;              /* 🔥 taller board */
  max-width: 400px;
  max-height: 650px;

  background: #0b6623;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);

  touch-action: none;
}

#scoreBoard {
  margin-top: 10px;
  font-size: 24px;
  font-weight: bold;
}

/* Board */
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 90px);
  gap: 12px;
  padding: 15px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

/* Cells */
.ttt-cell {
  width: 90px;
  height: 90px;
  background: rgba(0,0,0,0.6);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Hover effect */
.ttt-cell:hover {
  transform: scale(1.08);
  background: rgba(255,255,255,0.1);
}

/* X style */
.ttt-x {
  color: #00ccff;
  text-shadow: 0 0 12px #00ccff;
}

/* O style */
.ttt-o {
  color: #ff4444;
  text-shadow: 0 0 12px #ff4444;
}

/* Winning cells */
.ttt-win {
  background: linear-gradient(45deg, #00ffcc, #00ccff);
  color: black !important;
  transform: scale(1.1);
}

/* Button */
.ttt-btn {
  margin-top: 20px;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(45deg, #00ccff, #0099ff);
  color: white;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0,204,255,0.6);
}