.sl-board {
  position: relative;
  width: min(720px, 100%);
  max-width: 720px;
  gap: 0;
  border: 8px solid #765441;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 0 #422d27, 0 24px 44px #061d2566, inset 0 0 0 3px #e5c995;
  background: #efe5c9;
}
.sl-cell {
  border: 1px solid #54736b47;
  border-radius: 0 !important;
  background: #f4eddb;
  color: #214842;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0;
  font-size: clamp(8px, 1.4vw, 12px);
  font-weight: 900;
  overflow: visible;
}
.sl-number {
  position: absolute;
  z-index: 7;
  top: 0;
  left: 0;
  min-width: 1.4em;
  padding: 2px 3px;
  border-radius: 0 0 6px 0;
  background: #fffdf2;
  color: #193933;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  box-shadow: 1px 1px 0 #183a3155;
}
.sl-cell:nth-child(4n + 2), .sl-cell:nth-child(4n + 3) { background: #e2ebd9; }
.sl-cell.snake { background: #f4ddd3; }
.sl-cell.ladder { background: #e0f0d4; }
.sl-cell.snake::after, .sl-cell.ladder::after { content: none; }
.sl-cell[data-num="100"] { background: #e5b860; }
.sl-cell.snake .sl-number { border-bottom: 2px solid #b65745; }
.sl-cell.snake .sl-number {
  top: auto;
  right: 0;
  bottom: 0;
  left: auto;
  border-radius: 6px 0 0 0;
}
.sl-cell.ladder .sl-number { border-bottom: 2px solid #438c63; }
.sl-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(1px 2px 1px #071d2755);
  z-index: 3;
}
.sl-art-ladder { transform-box: fill-box; transform-origin: center; }
.sl-art-ladder.is-near { animation: sl-wobble .85s ease-in-out infinite alternate; filter: drop-shadow(0 0 9px #f1f5bd); }
.sl-art-snake.is-near { filter: drop-shadow(0 0 7px #f4e2a8); }
.sl-art-snake.is-near .sl-art-tail { animation: sl-tail var(--tail-time, .8s) ease-in-out infinite alternate; }
.sl-art-snake.is-near .sl-art-tongue { animation: sl-tongue var(--tongue-time, .45s) ease-in-out infinite alternate; }
@keyframes sl-wobble { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
@keyframes sl-tail { from { transform: rotate(-5deg); } to { transform: rotate(7deg); } }
@keyframes sl-tongue { from { transform: scale(.55) rotate(-9deg); opacity: .65; } to { transform: scale(1.15) rotate(9deg); opacity: 1; } }
.sl-tokens { position: absolute; z-index: 8; top: 60%; left: 60%; transform: translate(-50%, -50%); display: grid; grid-template-columns: repeat(2, min-content); place-items: center; gap: 1px; }
.sl-cell:nth-child(10n) .sl-tokens { left: 54%; }
.sl-cell:has(.sl-token:nth-child(2)) .sl-tokens { top: 50%; left: 50%; }
.sl-cell:nth-child(n + 91) .sl-tokens { top: 50%; }
.sl-cell:nth-child(n + 91) .board-token-number { bottom: -1px; }
.sl-token, .sl-roster-icon {
  width: clamp(22px, 6vw, 36px);
  height: clamp(22px, 6vw, 36px);
  border-radius: 50%;
  border: 2px solid #fff8dc;
  display: grid;
  place-items: center;
  flex: none;
  position: relative;
  background: radial-gradient(circle at 25% 20%, #ffffffaa, transparent 50%), var(--piece-color);
  box-shadow: 0 3px 0 #24372f, 0 5px 8px #102c2abb;
}
.sl-token { width: clamp(24px, 7vw, 46px); height: clamp(24px, 7vw, 46px); }
.sl-roster-icon { width: 41px; height: 41px; }
.board-token-icon { width: 69%; height: 69%; fill: #fff9e9; stroke: #1b3040; stroke-width: 1.5; filter: drop-shadow(0 1px 1px #11202588); }
.sl-token .board-token-icon { width: 78%; height: 78%; }
.board-token-number {
  position: absolute;
  right: -4px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #fff;
  background: #223c43;
  color: #fff;
  font: 900 9px/1 system-ui;
}
.sl-tokens:has(.sl-token:nth-child(2)) .sl-token { width: clamp(12px, 4vw, 30px); height: clamp(12px, 4vw, 30px); }
.sl-board .board-traveler {
  position: absolute;
  left: 0; top: 0;
  z-index: 9;
  pointer-events: none;
}
.sl-board .board-traveler[data-motion="snake"] { z-index: 2; }
.sl-player-label { font-weight: 900; overflow: hidden; text-overflow: ellipsis; max-width: 120px; white-space: nowrap; }
.sl-vibe .sl-player { display: grid; grid-template-columns: 41px auto; gap: 1px 10px; align-items: center; min-width: 150px; }
.sl-vibe .sl-roster-icon { grid-row: span 2; }
.sl-vibe .sl-ppos { color: #c8e6d9; font-size: .75rem; }
.sl-vibe .game-stage {
  background: radial-gradient(circle at 30% 10%, #a3d5a950, transparent 55%), #102e30 !important;
  padding: clamp(12px, 3vw, 28px) !important;
  border: 4px solid #579183;
  box-shadow: inset 0 0 40px #0006, 0 20px 40px #0004;
}
.sl-vibe .sl-player, .sl-vibe .sl-status { color: #f1ffeb !important; }
.sl-vibe .sl-player { background: #153e40; }

.ld-board-deluxe {
  width: min(710px, 100%);
  aspect-ratio: 1;
  display: grid;
  grid-template: repeat(15, minmax(0, 1fr)) / repeat(15, minmax(0, 1fr));
  gap: 1px;
  align-items: stretch;
  justify-items: stretch;
  padding: 5px;
  background: #b88e60;
  border: 9px solid #4b322d;
  border-radius: 20px;
  box-shadow: 0 8px 0 #291c1a, 0 24px 40px #170d1266, inset 0 0 0 3px #f6dda7;
  position: relative;
  margin: 0 auto;
}
.ld-home-yard {
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr 1fr;
  align-items: center;
  justify-items: center;
  padding: 8%;
  border: 3px solid color-mix(in srgb, var(--piece-color) 65%, #433027);
  background: radial-gradient(circle at 50% 80%, #fffef1 0 36%, transparent 37%),
    color-mix(in srgb, var(--piece-color) 28%, #f2dcb5);
  border-radius: 16%;
  box-shadow: inset 0 0 0 5px #fff8e5, inset 0 0 22px #0003, 0 2px 4px #0005;
}
.ld-unused-yard { filter: grayscale(.85); opacity: .7; }
.ld-active-yard {
  border-color: #fff9d7;
  box-shadow: inset 0 0 0 5px #fff8e5, inset 0 0 22px #0003,
    0 0 0 4px var(--piece-color), 0 0 24px 9px var(--piece-color);
  animation: ld-yard-glow 1.3s ease-in-out infinite alternate;
}
@keyframes ld-yard-glow {
  to { box-shadow: inset 0 0 0 5px #fff8e5, inset 0 0 22px #0003,
    0 0 0 6px #fff9d7, 0 0 38px 15px var(--piece-color); }
}
.ld-home-yard .ld-yard-label {
  grid-column: span 2;
  font-size: clamp(.55rem, 1.2vw, .85rem);
  color: #243039;
  font-weight: 950;
  letter-spacing: .08em;
}
.ld-square {
  z-index: 2;
  min-width: 0;
  min-height: 0;
  border: 1px solid #544a4038;
  border-radius: 3px;
  background: linear-gradient(145deg, #fffaec, #e9dfc8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ld-safe-square { background: #f9e7a9; }
.ld-start-square { background: color-mix(in srgb, var(--piece-color) 78%, white); }
.ld-lane-square { background: color-mix(in srgb, var(--piece-color) 64%, #fff7df); }
.ld-star { position: absolute; color: #806e52; font-size: clamp(.6rem, 2vw, 1.5rem); opacity: .65; }
.ld-finish-square {
  background: conic-gradient(#60baf0 0 25%, #56cf9a 25% 50%, #f2be59 50% 75%, #ff6558 75%);
  color: #fff;
  text-shadow: 0 1px 3px #222;
  font-size: clamp(.8rem, 2vw, 1.7rem);
}
.ld-piece, .ld-roster-icon {
  width: clamp(30px, 4.2vw, 42px);
  height: clamp(30px, 4.2vw, 42px);
  border-radius: 50%;
  border: 3px solid #fff8dc;
  background: radial-gradient(circle at 26% 18%, #ffffffb3, transparent 48%), var(--piece-color);
  box-shadow: 0 3px 0 #17232d88, 0 6px 8px #0008;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 3;
  padding: 0;
}
.ld-roster-icon { width: 44px; height: 44px; flex: none; }
.ld-square .ld-piece { width: 92%; height: 92%; box-shadow: 0 2px 3px #0009; }
.ld-square:has(.ld-piece:nth-of-type(2)) .ld-piece { width: 47%; height: 47%; border-width: 1px; }
.ld-square:has(.ld-piece:nth-of-type(2)) .board-token-number { display: none; }
.ld-board-deluxe .board-traveler { position: absolute; left: 0; top: 0; z-index: 8; pointer-events: none; }
.ld-piece:disabled { cursor: default; }
.ld-piece-ready { animation: piece-glow .8s ease-in-out infinite alternate; cursor: pointer; }
.ld-piece-ready:hover { transform: translateY(-3px) scale(1.13); }
@keyframes piece-glow { to { box-shadow: 0 0 0 4px #fff, 0 0 17px var(--piece-color); } }
.ld-vibe .game-stage {
  background: radial-gradient(circle at center, #937347, #382b29) !important;
  border: 5px solid #98683f;
  padding: clamp(12px, 3vw, 28px) !important;
  box-shadow: 0 20px 35px #0005, inset 0 0 30px #0006;
}
.ld-vibe .ld-player { color: #fff8e9; background: #493328; border: 2px solid var(--piece-color); }
.ld-vibe .ld-player { display: grid; grid-template-columns: 44px auto; gap: 1px 10px; align-items: center; min-width: 160px; }
.ld-vibe .ld-roster-icon { grid-row: span 2; }
.ld-vibe .ld-player-name { font-weight: 900; overflow: hidden; text-overflow: ellipsis; max-width: 120px; white-space: nowrap; }
.ld-vibe .ld-pfin { font-size: .75rem; color: #e4d7bb; }
.ld-vibe .ld-status { color: #fff8e9; }

.arcade-die-arena {
  position: relative;
  display: block;
  width: 172px;
  height: 100px;
  margin: 0 auto;
  overflow: hidden;
  border: 3px solid #917756;
  border-radius: 16px;
  background: radial-gradient(ellipse, #217266, #143c3f);
  box-shadow: inset 0 3px 15px #0008, 0 4px 0 #523f33;
  perspective: 700px;
}
.arcade-die-arena--pair { width: 210px; }
.arcade-die {
  --die-size: 41px;
  position: absolute;
  top: 0;
  left: 0;
  width: var(--die-size);
  height: var(--die-size);
  color: #111827;
  transform: translate3d(65px, 29px, 0);
  transform-style: preserve-3d;
}
.arcade-die-cube { position: absolute; inset: 0; transform-style: preserve-3d; }
.arcade-die-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  place-items: center;
  border: 2px solid #17212f;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 3px 3px 2px #ffffff, 0 4px 10px #0005;
  backface-visibility: hidden;
}
.arcade-die-face-1 { transform: translateZ(calc(var(--die-size) / 2)); }
.arcade-die-face-2 { transform: rotateY(90deg) translateZ(calc(var(--die-size) / 2)); }
.arcade-die-face-3 { transform: rotateX(90deg) translateZ(calc(var(--die-size) / 2)); }
.arcade-die-face-4 { transform: rotateX(-90deg) translateZ(calc(var(--die-size) / 2)); }
.arcade-die-face-5 { transform: rotateY(-90deg) translateZ(calc(var(--die-size) / 2)); }
.arcade-die-face-6 { transform: rotateY(180deg) translateZ(calc(var(--die-size) / 2)); }
.arcade-pip { width: 49%; aspect-ratio: 1; border-radius: 50%; background: #17212f; box-shadow: inset 0 1px 2px #fff8; }
.arcade-pip-hidden { visibility: hidden; }
.arcade-die.is-settled { animation: die-landing .22s ease-out; }
@keyframes die-landing { 50% { filter: brightness(1.22); } }
.arcade-roll-label { display: block; margin-top: 8px; }
.sl-roll-btn, .ld-roll-btn { background: transparent; border: 0; padding: 0; color: #fff; }
.sl-roll-btn:hover:not(:disabled), .ld-roll-btn:hover:not(:disabled) { transform: translateY(-3px); }
.sl-roll-btn:disabled, .ld-roll-btn:disabled { opacity: .72; }
@media (max-width: 560px) {
  .sl-board, .ld-board-deluxe { width: min(100%, 440px); }
  .sl-board { border-width: 4px; }
  .sl-number { padding: 1px 2px; }
  .sl-roster-icon { width: 36px; height: 36px; }
  .sl-vibe .sl-player { grid-template-columns: 36px auto; min-width: 132px; }
  .sl-tokens:has(.sl-token:nth-child(2)) .board-token-number { width: 11px; height: 11px; font-size: 8px; }
  .ld-board-deluxe { border-width: 5px; padding: 2px; }
  .ld-home-yard { padding: 3%; border-width: 2px; }
  .ld-piece { width: 31px; height: 31px; border-width: 2px; }
  .ld-roster-icon { width: 36px; height: 36px; border-width: 2px; }
  .ld-vibe .ld-player { grid-template-columns: 36px auto; min-width: 138px; }
  .sl-vibe .game-stage, .ld-vibe .game-stage { padding: 8px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .ld-piece-ready, .ld-active-yard, .arcade-die.is-settled, .sl-art-ladder.is-near,
  .sl-art-snake.is-near .sl-art-tail, .sl-art-snake.is-near .sl-art-tongue { animation: none; }
}
