body { gap: 16px; }

/* scoreboard chips (labels adapt to the mode in game.js) */
#score {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* mode button group (copied from connect-four conventions) */
#mode {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.mode-btn {
  padding: 8px 18px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}
.mode-btn:hover { opacity: 1; background: var(--surface-3); }
.mode-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}

/* ---------- the 10x10 board ---------- */
#board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  width: min(92vw, 520px);
  aspect-ratio: 1 / 1;
  background: var(--blue-board);
  padding: 8px;
  border-radius: 14px;
  box-shadow: 0 10px 40px var(--shadow);
  border-bottom: 6px solid var(--blue-board-dark);
}

.sq {
  position: relative;
  background: var(--surface);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  font-size: clamp(0.5rem, 1.6vw, 0.72rem);
  line-height: 1.05;
}
/* alternate tint so the boustrophedon path is easy to read */
.sq.alt { background: var(--surface-2); }
.sq.ladder { background: var(--green); color: #fff; }
.sq.snake { background: var(--red); color: #fff; }
.sq.goal { background: var(--accent); color: var(--accent-text); }

.sq .num {
  font-weight: 700;
  opacity: 0.8;
  padding: 2px 0 0;
}
.sq .mark {
  font-size: clamp(0.7rem, 2.2vw, 1.05rem);
  line-height: 1;
}
.sq .dest {
  font-size: clamp(0.42rem, 1.3vw, 0.6rem);
  font-weight: 700;
  opacity: 0.95;
}

/* player tokens sitting in a square */
.sq .tokens {
  position: absolute;
  inset: auto 0 1px 0;
  display: flex;
  gap: 1px;
  justify-content: center;
  font-size: clamp(0.7rem, 2.4vw, 1.1rem);
  line-height: 1;
  pointer-events: none;
}
.sq.hop { animation: hop 0.35s ease; }
@keyframes hop {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); filter: brightness(1.25); }
  100% { transform: scale(1); }
}

/* ---------- die + roll controls ---------- */
#controls {
  display: flex;
  align-items: center;
  gap: 14px;
}
#die {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 14px var(--shadow);
  user-select: none;
}
#die.rolling { animation: shake 0.45s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-3px) rotate(-8deg); }
  40% { transform: translateX(3px) rotate(8deg); }
  60% { transform: translateX(-2px) rotate(-5deg); }
  80% { transform: translateX(2px) rotate(5deg); }
}
#roll:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 420px) {
  #board { gap: 2px; padding: 5px; }
  .sq { border-radius: 3px; }
}
