:root {
  --bg1: var(--background, #f8f9fa);
  --bg2: var(--background-dark, #e9ecef);
  --bg3: var(--background-alt, #dee2e6);
  --accent1: var(--primary, #2487ce);
  --accent2: var(--secondary, #00c6ff);
  --text: var(--text, #222);
  --muted: var(--text-muted, rgba(34, 34, 34, 0.7));
}

/**/
.game-status-wrap {
  align-items: center;
  border-radius: 15px;
  background: #e9ecef;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
}

.player-status {
  text-align: center;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

#start-cell {
  display: flex;
  gap: 6px;
  min-height: 60px;
}

/* Board */
.board-wrap {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

.board {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 16px;
  background: var(--bg2, #e9ecef);
  border: 1px solid var(--accent1, rgba(36, 135, 206, 0.1333333333));
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 680px) {
  .board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 440px) {
  .board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.cell {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 6px;
  background: linear-gradient(180deg, var(--bg1, #f8f9fa), var(--bg2, #e9ecef));
  border: 1px dashed var(--accent1, rgba(36, 135, 206, 0.2));
  overflow: hidden;
}

.cell.finish {
  outline: 2px solid var(--secondary, #f59f00);
}

.cell .index {
  font-size: 11px;
  color: var(--muted);
}

/* Pawns */
.pawns {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.pawn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  display: grid;
  place-items: center;
}

/* Controls */
.controls {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.roll-button:hover,
.reset-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px var(--accent2, rgba(0, 198, 255, 0.3333333333));
}

.roll-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Dice */
@keyframes appAnimateFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}
.viewport {
  perspective: 800px;
  display: grid;
  place-items: center;
}

.dice-wrapper {
  display: inline-block;
  animation: appAnimateFloat 3s ease-in-out infinite;
  transform-style: preserve-3d;
}

.dice {
  position: relative;
  width: 120px;
  height: 120px;
  transform-style: preserve-3d;
  transition: transform 1s ease-out;
  cursor: pointer;
}

.face {
  position: absolute;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(145deg, rgba(135, 206, 250, 0.8), rgba(70, 130, 180, 0.8));
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 30px rgba(135, 206, 250, 0.6);
  -webkit-backdrop-filter: blur(5px);
          backdrop-filter: blur(5px);
  font-size: 48px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
  font-weight: bold;
}

/* Faces positioning */
.f1 {
  transform: rotateX(90deg) translateZ(60px);
}

.f2 {
  transform: translateZ(60px);
}

.f3 {
  transform: rotateY(90deg) translateZ(60px);
}

.f4 {
  transform: rotateY(180deg) translateZ(60px);
}

.f5 {
  transform: rotateY(-90deg) translateZ(60px);
}

.f6 {
  transform: rotateX(-90deg) translateZ(60px);
}

/* Hover tilt */
.dice:hover {
  transform: translateY(-5px) rotateX(15deg) rotateY(15deg);
}

/* Glow when active face is highlighted */
.face.active {
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.9);
  color: rgba(255, 255, 255, 0.6666666667);
}

.floating {
  animation: float 3s ease-in-out infinite;
}

/* Modal / Question */
.modal-content {
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border: 1px solid var(--accent1, rgba(36, 135, 206, 0.1333333333));
  color: var(--text);
}

.modal-header {
  border-bottom: 1px solid var(--accent1, rgba(36, 135, 206, 0.0666666667));
  position: relative;
}

.modal-title {
  color: var(--accent1);
  font-weight: 800;
}

/* Timer */
@keyframes appAnimateTimerPulse {
  from {
    transform: translateY(-50%) scale(1);
  }
  to {
    transform: translateY(-50%) scale(1.1);
  }
}
@keyframes appAnimateTimerShake {
  from {
    transform: translateY(-50%) scale(1) rotate(-3deg);
  }
  to {
    transform: translateY(-50%) scale(1.15) rotate(3deg);
  }
}
.timer-display {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 15px var(--accent1, rgba(36, 135, 206, 0.2666666667));
  animation: appAnimateTimerPulse 1.5s ease-in-out infinite alternate;
}

.timer-warning {
  background: linear-gradient(135deg, #ff4444, #ff8800) !important;
  animation: appAnimateTimerShake 0.3s ease-in-out infinite alternate !important;
}

/* Answer badges */
.answer-badge {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 20px;
  background: var(--bg3, #dee2e6);
  color: var(--text, #222);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.answer-badge:hover {
  background: var(--bg2, #e9ecef);
}

.answer-badge.selected {
  background: linear-gradient(135deg, var(--accent2), var(--accent1));
  color: #fff;
  font-weight: bold;
  box-shadow: 0 0 10px var(--accent2, rgba(0, 198, 255, 0.4));
}

.question-text {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

/* Buttons */
.btn-gradient {
  background: linear-gradient(45deg, var(--accent1), var(--accent2));
  border: none;
  color: white;
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px var(--accent1, rgba(36, 135, 206, 0.2));
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent2, rgba(0, 198, 255, 0.3333333333));
}

.btn-gradient:disabled {
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}