/* Illustrated race games retain live, authoritative board coordinates. */
.race-sprite {
  display: block;
  width: 100%;
  height: 100%;
  background-image: url("/images/race/pawns.webp");
  background-size: 200% 200%;
  background-repeat: no-repeat;
  pointer-events: none;
}
.race-art-0 {
  background-position: 0 0;
}
.race-art-1 {
  background-position: 100% 0;
}
.race-art-2 {
  background-position: 0 100%;
}
.race-art-3 {
  background-position: 100% 100%;
}
.race-player .avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--player-light);
  padding: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.race-player.active .avatar {
  background: var(--player-light);
  box-shadow: 0 0 0 2px var(--player-color);
}
.race-player .player-caption {
  color: var(--player-color);
}
.race-board-frame {
  width: min(100%, 640px);
  margin-inline: auto;
  padding: 15px;
  border: 1px solid #c6b990;
  border-radius: 20px;
  background: #f3e5c8 url("/images/race/garden.webp") center / cover;
  box-shadow: 0 8px 20px #203c3214;
}
.race-board-frame .ludo-board,
.race-board-frame .snakes-board {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 1px solid #a9aa87;
  border-radius: 8px;
}
.ludo-board {
  background: #fff9e9;
  isolation: isolate;
}
.ludo-cell {
  border: 1px solid #cdd0b7;
  background: #fffdf4;
  border-radius: 2px;
}
.ludo-cell.home-lane,
.ludo-cell.start-square {
  background: var(--player-color);
  border-color: #ffffff80;
}
.home-arrow {
  width: 64%;
  height: 64%;
  stroke: #fffdf8;
  stroke-width: 2.2;
  fill: none;
  transform: rotate(var(--arrow-rotation));
  opacity: 0.9;
}
.safe-square > svg {
  width: 68%;
  height: 68%;
  fill: none;
  stroke: var(--player-color);
  stroke-width: 1.8;
}
.safe-square.start-square > svg {
  stroke: #fffdf8;
}
.ludo-base {
  border: 0;
  border-radius: 16%;
  background: var(--player-light);
  box-shadow:
    inset 0 0 0 5px var(--player-color),
    inset 0 0 0 9px #ffffff70;
  isolation: isolate;
  overflow: hidden;
}
.ludo-base::before {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid var(--player-color);
  border-radius: 28%;
  opacity: 0.25;
  z-index: -1;
}
.ludo-base > .home-slot {
  position: absolute;
  width: 26%;
  height: 26%;
  padding: 0;
  border: 1.5px solid var(--player-color);
  border-radius: 50%;
  background: #fffdf8b8;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 2px 4px #203c3212;
}
.home-slot.slot-0 {
  left: 25%;
  top: 25%;
}
.home-slot.slot-1 {
  left: 75%;
  top: 25%;
}
.home-slot.slot-2 {
  left: 25%;
  top: 75%;
}
.home-slot.slot-3 {
  left: 75%;
  top: 75%;
}
.ludo-base > .home-crest {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32%;
  height: 32%;
  padding: 0;
  transform: translate(-50%, -64%);
}
.ludo-base > .home-label {
  position: absolute;
  top: 60%;
  left: 50%;
  max-width: 54%;
  padding: 0 4px;
  transform: translateX(-50%);
  border-radius: 4px;
  color: var(--player-color);
  background: var(--player-light);
  font-size: clamp(8px, 1.2vw, 13px);
  line-height: 1.6;
  font-weight: 750;
  direction: rtl;
}
.ludo-base.unused-base {
  filter: saturate(0.2);
  opacity: 0.55;
  background: var(--paper);
}
.ludo-base.unused-base > .home-crest {
  opacity: 0.45;
}
.ludo-base.unused-base > .home-label {
  font-size: 10px;
}
.race-token {
  width: 8.6%;
  height: auto;
  aspect-ratio: 1;
  min-width: 25px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  filter: drop-shadow(0 2px 1px #203c322b);
}
.race-token .race-sprite {
  position: absolute;
  inset: 0;
  transition: transform 160ms var(--ease);
}
.pawn-number {
  position: absolute;
  bottom: 5%;
  left: 54%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  min-width: 13px;
  height: 13px;
  padding-inline: 2px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--player-color);
  border: 1px solid var(--player-color);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}
.race-token.movable-token {
  outline: none;
  z-index: 4;
}
.race-token.movable-token::before {
  content: "";
  position: absolute;
  inset: 2%;
  border: 2px solid var(--player-color);
  border-radius: 40%;
  background: #fffdf86b;
  box-shadow: 0 0 0 2px var(--surface);
}
.race-token.movable-token:hover .race-sprite {
  transform: translateY(-3px);
}
.race-token.movable-token:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}
.finish-count {
  width: 22px;
  height: 22px;
  font-size: 12px;
  box-shadow: 0 2px 4px #203c3226;
}
.ludo-choices {
  margin-top: 8px;
}
.ludo-choices .btn {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 2px 12px;
  text-align: start;
  padding: 10px 14px;
  border: 1px solid var(--line);
}
.ludo-choices .btn .race-sprite {
  width: 44px;
  height: 44px;
  grid-row: span 2;
}
.ludo-choices .btn > strong {
  font-size: 14px;
  font-weight: 750;
}
.ludo-choices .btn > span:last-child {
  font-size: 12px;
}
.ludo-frame + .race-board-note {
  max-width: 60ch;
  margin-inline: auto;
}
.dice-panel .game-die {
  filter: drop-shadow(0 3px 2px #203c321a);
}
.dice-panel .game-die rect {
  fill: #fffaf0;
  stroke: #b9aa8b;
  stroke-width: 1.4;
}
.snakes-board {
  background: #fff9e9 url("/images/race/garden.webp") center / cover;
}
.snake-cell {
  border-color: #b8bda180;
  background: #fffdf8c9;
  padding: 0;
}
.snake-cell.alternate {
  background: #e9eddfb8;
}
.snake-cell.ladder-start {
  background: #d8e9c8dd;
}
.snake-cell.snake-start {
  background: #f5dbc5e0;
}
.snake-cell.last-race {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}
.snake-number {
  top: 1px;
  left: 2px;
  right: auto;
  color: #203c32;
  background: #fffdf8e6;
  padding: 1px 3px;
  border-radius: 3px;
  font-size: clamp(9px, 1.1vw, 13px);
  font-weight: 700;
  z-index: 4;
}
.transport-target {
  font-size: clamp(7px, 0.9vw, 10px);
  z-index: 4;
  bottom: 1px;
  right: 1px;
  padding-inline: 2px;
  line-height: 1.5;
  background: #fffdf8ee;
}
.transport-map {
  z-index: 2;
  overflow: visible;
}
.painted-ladder path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ladder-shadow path {
  stroke: #59462f;
  stroke-width: 1.05;
  opacity: 0.23;
}
.ladder-wood path {
  stroke: #9b6b32;
  stroke-width: 0.72;
}
.ladder-grain path {
  stroke: #f4d499;
  stroke-width: 0.2;
}
.painted-snake {
  --snake-fill: #d1783b;
  --snake-edge: #8b482e;
}
.painted-snake.snake-variant-1 {
  --snake-fill: #be5943;
  --snake-edge: #80382c;
}
.painted-snake.snake-variant-2 {
  --snake-fill: #c68735;
  --snake-edge: #85552b;
}
.painted-snake > path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.snake-shadow {
  stroke: #573f2d;
  stroke-width: 2.7;
  opacity: 0.18;
}
.snake-outline {
  stroke: var(--snake-edge);
  stroke-width: 2.3;
}
.snake-body {
  stroke: var(--snake-fill);
  stroke-width: 1.85;
}
.snake-spots {
  stroke: #ffe6a6;
  stroke-width: 0.6;
  stroke-dasharray: 0.15 1.5;
}
.snake-tail {
  stroke: var(--snake-fill);
  stroke-width: 0.7;
}
.snake-face {
  fill: var(--snake-fill);
  stroke: var(--snake-edge);
  stroke-width: 0.22;
}
.snake-muzzle {
  fill: #f5d49f;
}
.snake-eye {
  fill: #fffdf8;
}
.snake-pupil {
  fill: #203c32;
}
.snake-tongue {
  fill: none;
  stroke: #a23830;
  stroke-width: 0.2;
  stroke-linecap: round;
}
.snake-occupants {
  z-index: 5;
  inset: 9px 0 0;
  align-content: center;
  gap: 0;
}
.snake-token {
  position: relative;
  width: 75%;
  height: auto;
  aspect-ratio: 1;
  max-width: 48px;
  border: 0;
  border-radius: 0;
  background: none;
  filter: drop-shadow(0 1px 1px #203c3240);
}
.snake-occupants.occupants-2 .snake-token {
  width: 48%;
}
.snake-occupants.occupants-3 .snake-token,
.snake-occupants.occupants-4 .snake-token {
  width: 42%;
}
.off-board {
  gap: 10px 16px;
  align-items: center;
  flex-wrap: wrap;
  padding-block: 12px;
  margin-top: 8px;
}
.start-player {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.start-player .snake-token {
  width: 36px;
  max-width: none;
  height: 36px;
}
.transport-legend {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.classic-preview .race-board-frame {
  padding: 10px;
  border-radius: 14px;
}
.classic-preview .ludo-board,
.classic-preview .snakes-board {
  border-radius: 5px;
}
.classic-preview .race-token {
  width: 9%;
  height: auto;
  min-width: 0;
}
.classic-preview .ludo-base > .home-slot,
.classic-preview .ludo-base > .home-crest {
  display: block;
}
.classic-preview .ludo-base > .home-label {
  display: none;
}
.classic-preview .pawn-number {
  min-width: 7px;
  height: 7px;
  font-size: 5px;
  border-width: 0.5px;
}
.classic-preview .snake-token {
  width: 78%;
}
.classic-preview .snake-occupants {
  inset: 0;
}
.classic-preview .ludo-base {
  box-shadow: inset 0 0 0 3px var(--player-color);
}
@media (max-width: 720px) {
  .race-board-frame {
    padding: 9px;
    border-radius: 14px;
  }
  .ludo-base {
    box-shadow:
      inset 0 0 0 3px var(--player-color),
      inset 0 0 0 5px #ffffff70;
  }
  .ludo-base > .home-label {
    font-size: 8px;
    padding-inline: 2px;
  }
  .ludo-base.unused-base > .home-label {
    font-size: 7px;
  }
  .race-player .avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }
  .pawn-number {
    min-width: 10px;
    height: 10px;
    font-size: 7px;
    bottom: 2%;
  }
  .race-token.movable-token::before {
    border-width: 1.5px;
  }
  .finish-count {
    width: 15px;
    height: 15px;
    font-size: 9px;
  }
  .ludo-choices {
    gap: 8px;
  }
  .ludo-choices .btn {
    grid-template-columns: 32px 1fr;
    padding: 8px;
    gap: 1px 6px;
  }
  .ludo-choices .btn .race-sprite {
    width: 32px;
    height: 32px;
  }
  .ludo-choices .btn > strong {
    font-size: 12px;
  }
  .ludo-choices .btn > span:last-child {
    font-size: 10px;
  }
  .snake-number {
    padding: 1px 2px;
    font-size: 9px;
  }
  .transport-target {
    font-size: 7px;
    padding-inline: 1px;
  }
  .snake-occupants {
    inset: 7px 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .race-token .race-sprite {
    transition: none;
  }
  .race-token.movable-token:hover .race-sprite {
    transform: none;
  }
}
