/* Snakes & Ladders: hand-drawn 10x10 notebook grid, doodled ladders & snakes, compact roller bar. */
.lad {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lad-board {
  position: relative;
  width: min(100%, 360px, 53dvh);
  aspect-ratio: 420 / 438;
  margin-inline: auto;
}
.lad-board > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.lad-cell-alt {
  fill: color-mix(in srgb, var(--game) 7%, transparent);
}
.lad-cell-win {
  fill: color-mix(in srgb, var(--c-gold, #d9a41f) 24%, transparent);
  stroke: var(--c-gold, #d9a41f);
  stroke-width: 1.6;
  stroke-dasharray: 4 3;
}
.lad-grid {
  fill: none;
  stroke: var(--pencil);
  stroke-width: 1.35;
  stroke-linecap: round;
  opacity: .72;
}
.lad-num {
  font-family: var(--font-hand, sans-serif);
  font-size: 9.5px;
  fill: var(--pencil);
  opacity: .82;
  user-select: none;
}
.lad-num.win {
  font-weight: 700;
  fill: var(--ink);
  opacity: 1;
}
.lad-star {
  fill: color-mix(in srgb, var(--c-gold, #d9a41f) 45%, var(--paper));
  stroke: var(--c-brown, #a46a3f);
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.lad-start-label {
  font-family: var(--font-hand, sans-serif);
  font-size: 11px;
  fill: var(--pencil);
  opacity: .85;
  user-select: none;
}

/* Ladders: warm wood pencil */
.lad-rail {
  fill: none;
  stroke: var(--c-brown, #a46a3f);
  stroke-width: 2.6;
  stroke-linecap: round;
}
.lad-rung {
  fill: none;
  stroke: var(--c-orange, #ee8a3a);
  stroke-width: 2.1;
  stroke-linecap: round;
}

/* Snakes: green pen with dark outline & red forked tongue */
.lad-snake-outline {
  fill: none;
  stroke: var(--paper);
  stroke-width: 6.4;
  stroke-linecap: round;
  opacity: .78;
}
.lad-snake-body {
  fill: none;
  stroke: var(--game, var(--c-green));
  stroke-width: 3.6;
  stroke-linecap: round;
}
.lad-snake-head {
  fill: var(--game, var(--c-green));
  stroke: var(--ink);
  stroke-width: 1.3;
}
.lad-snake-eye {
  fill: var(--paper);
}
.lad-snake-tongue {
  fill: none;
  stroke: var(--red);
  stroke-width: 1.3;
  stroke-linecap: round;
}

/* Player tokens */
.lad-tok {
  color: var(--ink);
}
.lad-tok.p1 {
  color: var(--red);
}
.lad-tok-ring {
  fill: var(--paper);
  stroke: currentColor;
  stroke-width: 2.8;
}
.lad-tok.active .lad-tok-ring {
  stroke-width: 3.4;
}
.lad-tok-dot {
  fill: currentColor;
}
.lad-tok-x {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

/* Compact control bar below the board */
.lad-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(100%, 360px);
  padding: 2px 4px;
}

.lad-die {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  width: 52px;
  height: 52px;
  flex: none;
  cursor: pointer;
  touch-action: manipulation;
}
.lad-die:disabled {
  cursor: default;
  opacity: .75;
}
.lad-die svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.lad-die-box {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lad-pip {
  fill: color-mix(in srgb, var(--game) 72%, var(--ink));
}
.lad-die-mark {
  fill: var(--pencil);
  font-family: var(--font-title);
  font-size: 56px;
  font-weight: 700;
}
.lad-die.rolling {
  animation: lad-roll 340ms var(--ease-pen, ease-out) both;
}
@keyframes lad-roll {
  0% { transform: rotate(0deg) translateY(0) scale(1); }
  40% { transform: rotate(190deg) translateY(-9px) scale(1.08); }
  100% { transform: rotate(360deg) translateY(0) scale(1); }
}

.lad-roll {
  flex: 1;
  max-width: 150px;
  min-height: 44px;
}

.lad-pos {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.lad-sq {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-bottom: 2px solid transparent;
  color: var(--ink);
}
.lad-sq.p1 {
  color: var(--red);
}
.lad-sq.active {
  border-bottom-color: currentColor;
}
.lad-sq i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: color-mix(in srgb, currentColor 25%, var(--paper));
}
.lad-sq b {
  font-family: var(--font-title);
  font-size: 24px;
  line-height: 1;
  min-width: 24px;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .lad-die.rolling { animation: none; }
}
