/* Board Game Styles */
#board-game-view {
  display: none;
  /* Hidden by default */
  min-height: 80vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#board-game-view.active {
  display: block;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.board-container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.tile {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.2);
  z-index: 2;
}

.tile.corner {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.5);
}

.tile.player-here {
  box-shadow: 0 0 15px #0d6efd;
  border-color: #0d6efd;
}

.tile-icon {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

/* Center of the board */
.board-center {
  grid-column: 2 / 6;
  grid-row: 2 / 6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 20px;
}

.game-controls {
  text-align: center;
  margin-top: 20px;
}

#dice-display {
  font-size: 3rem;
  margin: 10px;
  display: inline-block;
  animation: bounce 0.5s infinite alternate paused;
}

#dice-display.rolling {
  animation-play-state: running;
}

@keyframes bounce {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-10px);
  }
}

.player-token {
  width: 20px;
  height: 20px;
  background-color: #0d6efd;
  border-radius: 50%;
  border: 2px solid #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px #0d6efd;
  transition: all 0.5s ease-in-out;
  z-index: 10;
}

/* Question Modal Overlay */
.game-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.game-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.game-modal {
  background: #222;
  border: 1px solid #444;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  color: #fff;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.modal-header h3 {
  margin-top: 0;
  color: #0d6efd;
}

.modal-options button {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  text-align: left;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 5px;
  transition: background 0.2s;
}

.modal-options button:hover {
  background: #444;
}

.modal-options button.correct {
  background: #198754;
  border-color: #198754;
}

.modal-options button.wrong {
  background: #dc3545;
  border-color: #dc3545;
}

.score-panel {
  display: flex;
  gap: 20px;
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.score-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 20px;
}



/* --- Matching Game --- */
.matching-container {
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.matching-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.matching-item {
  padding: 15px;
  background: #444;
  border: 2px solid #555;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.matching-item:hover {
  background: #555;
}

.matching-item.selected {
  border-color: #0d6efd;
  background: #0d6efd20;
  box-shadow: 0 0 10px rgba(13, 110, 253, 0.3);
}

.matching-item.matched {
  border-color: #198754;
  background: #19875420;
  opacity: 0.6;
  pointer-events: none;
}

.matching-item.shake {
  animation: shake 0.5s;
  border-color: #dc3545;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  50% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-5px);
  }

  100% {
    transform: translateX(0);
  }
}