/* ═══ Ludo (منچ) — board, pawns, die ══════════════════════════════════════════════════════════════════════ */

.board-wrapper:has(.ld-wrap) { align-items: stretch; }
.ld-wrap { width: 100%; max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; }

.ld-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.ld-chip { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 8px; border-radius: 14px; border: 1px solid var(--nx-border, rgba(255, 255, 255, 0.12));
  border-inline-start: 4px solid var(--seat-colour, #888); background: var(--nx-surface-2, rgba(10, 14, 22, 0.9)); min-width: 0; }
.ld-chip::after { content: ''; position: absolute; inset: -3px; border-radius: 17px; border: 2px solid #ffd54f; box-shadow: 0 0 16px rgba(255, 213, 79, 0.5); opacity: 0; transition: opacity 180ms ease-out; pointer-events: none; }
.ld-chip-active::after { opacity: 1; }
.ld-chip-name { font-weight: 700; font-size: 13px; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-chip-home { display: flex; gap: 3px; }
.ld-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--seat-colour, #888); background: transparent; }
.ld-dot-on { background: var(--seat-colour, #888); }
.ld-timer { font-size: 12px; font-weight: 800; color: #ffd54f; min-width: 0; }
.ld-timer:empty { display: none; }

.ld-board { width: 100%; max-width: min(560px, max(300px, calc(100dvh - 330px))); } /* on a short laptop screen the board gives way, so the players, board and die all fit */
.ld-svg { display: block; width: 100%; height: auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.ld-frame { fill: #f3efe6; stroke: #1b2236; stroke-width: 1.2; }
.ld-quad { opacity: 0.92; }
.ld-quad-in { fill: #f3efe6; }
.ld-spot { opacity: 0.35; }
.ld-sq { fill: #fffdf7; stroke: #1b2236; stroke-width: 0.35; }
.ld-start { stroke: #1b2236; }
.ld-homecol { opacity: 0.9; }
.ld-tri { stroke: #1b2236; stroke-width: 0.4; }
.ld-star { pointer-events: none; }
:root[data-theme='dark'] .ld-frame, :root:not([data-theme='light']) .ld-frame { fill: #ece7da; }

.ld-pawns { pointer-events: all; }
.ld-pawn { cursor: default; transition: opacity 150ms; will-change: transform; }
.ld-hit { fill: transparent; }
.ld-shadow { fill: rgba(0, 0, 0, 0.28); }
.ld-pawn-disc { stroke: #fff; stroke-width: 0.9; }
.ld-pawn-dot { fill: rgba(255, 255, 255, 0.55); }
.ld-ring { fill: none; stroke: #ffd54f; stroke-width: 1.1; opacity: 0; transform-box: fill-box; transform-origin: center; pointer-events: none; }
.ld-legal { cursor: pointer; }
.ld-legal .ld-ring { opacity: 1; animation: ld-pulse 0.9s ease-in-out infinite; }
.ld-legal .ld-pawn-body { animation: ld-hop 0.9s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
.ld-pawn:focus-visible { outline: none; }
.ld-pawn:focus-visible .ld-ring { opacity: 1; stroke: #fff; }
@keyframes ld-pulse { 50% { transform: scale(1.18); opacity: 0.55; } }
@keyframes ld-hop { 50% { transform: translateY(-1.4px); } }
@media (hover: hover) { .ld-legal:hover .ld-pawn-disc { stroke: #ffd54f; } }

.ld-banner { font-weight: 700; min-height: 22px; text-align: center; direction: auto; padding: 0 8px; }
.ld-dock { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 76px; }
.ld-dock-off { display: none; }
.ld-die { background: none; border: 0; padding: 0; cursor: default; border-radius: 14px; line-height: 0; }
.ld-die .ld-idle { opacity: 0.45; }
.ld-die svg { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); }
.ld-die-ready { cursor: pointer; animation: ld-ready 1.2s ease-in-out infinite; }
.ld-die:disabled { opacity: 0.9; }
.ld-rolling svg { animation: ld-spin 0.45s linear; }
@keyframes ld-ready { 50% { transform: translateY(-4px); } }
@keyframes ld-spin { to { transform: rotate(360deg) scale(1.1); } }
.ld-roll { min-height: 46px; padding: 0 22px; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 560px) {
  .ld-chip { padding: 4px 8px 4px 6px; gap: 6px; }
  .ld-chip-name { font-size: 12px; max-width: 76px; }
  .ld-dock { min-height: 70px; }
}
@media (prefers-reduced-motion: reduce) { .ld-legal .ld-ring, .ld-legal .ld-pawn-body, .ld-die-ready, .ld-rolling svg { animation: none; } }
