.tile-ludo .game-tile-art { background: radial-gradient(ellipse at 50% 100%, #ffc93c22, transparent 75%), var(--bg-soft); display: grid; place-items: center; }
.art-ludo { width: 142px; height: 142px; transform: rotate(-8deg); filter: drop-shadow(0 12px 10px #0004); transition: transform .25s; }
.tile-ludo:hover .art-ludo { transform: rotate(0deg) scale(1.04); }
.plan-dot.g-ludo { background: #f5c456; }
.plan-order li.g-ludo span { background: #f5c45633; color: #f5c456; }
.lu-red { --lu-color: #e75c60; --lu-soft: #e75c6022; }
.lu-blue { --lu-color: #4c92db; --lu-soft: #4c92db22; }
.lu-yellow { --lu-color: #e5b33d; --lu-soft: #e5b33d22; }
.lu-green { --lu-color: #39a97c; --lu-soft: #39a97c22; }
/* Keep the board and primary actions in the viewport, including short laptop screens. */
.mini-ludo.game { min-height: 0; }
.mini-ludo .game-body { overflow: hidden; }
.mini-ludo .mini-main { height: 100%; min-height: 0; grid-template-columns: minmax(0, 1fr) 310px; grid-template-rows: minmax(0, 1fr); gap: 20px; padding: 16px 20px; align-self: stretch; align-items: stretch; }
.mini-ludo .mini-stage { min-height: 0; height: 100%; justify-content: stretch; }
.lu { display: flex; flex-direction: column; height: 100%; min-height: 0; width: 100%; }
.lu .mg-head { flex: none; min-height: 26px; margin: 0 0 10px; }
.lu-turn.mine { color: var(--accent); }
.lu-board-wrap { flex: 1; min-height: 0; min-width: 0; display: flex; align-items: center; justify-content: center; }
.lu-board { width: var(--lu-board-size, 300px); height: var(--lu-board-size, 300px); flex: none; display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); grid-template-rows: repeat(11, minmax(0, 1fr)); gap: 3px; padding: clamp(6px, calc(var(--lu-board-size, 300px) * .024), 16px); border-radius: 24px; background: radial-gradient(ellipse at 30% 0%, #fff9, transparent 65%), #f3eddf; border: 3px solid #d3c4a7; box-shadow: 0 12px 30px #0003, inset 0 0 0 2px #fffc; }
.lu-cell { display: grid; place-items: center; min-width: 0; min-height: 0; border-radius: 50%; position: relative; color: #b0a48b; font-size: clamp(12px, 2vw, 22px); font-weight: 700; }
.lu-cell.lu-track { background: #e1d8c6; box-shadow: inset 0 0 0 1px #baaa8b66, inset 0 -2px 3px #9e8c5d11; }
.lu-cell.lu-start { background: var(--lu-soft); box-shadow: inset 0 0 0 2px var(--lu-color); color: var(--lu-color); }
.lu-cell.lu-lane { background: var(--lu-color); color: #fff9; box-shadow: inset 0 -2px 0 #0002; }
.lu-cell.lu-destination::after { content: ''; position: absolute; inset: 1px; border: 2px dashed #756146; border-radius: 50%; pointer-events: none; animation: lu-target 1.8s ease-in-out infinite; }
.lu-cell.lu-can-capture::after { border-color: #d84545; box-shadow: 0 0 0 3px #d8454522; }
.lu-base { grid-row-end: span 4 !important; grid-column-end: span 4 !important; border: 2px solid var(--lu-color); border-radius: 16px; background: linear-gradient(145deg, #fff6, #fff0), var(--lu-soft); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 6px; gap: 8px; min-width: 0; }
.lu-base.active { box-shadow: 0 0 0 2px #665439, inset 0 0 0 2px #fff8; }
.lu-base.empty { opacity: .4; }
.lu-base-label { max-width: 100%; text-align: center; color: #443d31; font-size: clamp(10px, calc(var(--lu-board-size, 300px) * .023), 14px); }
.lu-base-label strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-base-label small { display: block; font-size: .8em; opacity: .8; margin-top: 2px; }
.lu-base-pawns { display: grid; grid-template-columns: repeat(2, clamp(20px, calc(var(--lu-board-size, 300px) * .061), 36px)); gap: 7px; }
.lu-pawn, .lu-base-ghost { display: grid; place-items: center; width: 100%; aspect-ratio: 1; min-width: 0; border-radius: 50%; font: 700 clamp(10px, calc(var(--lu-board-size, 450px) * .025), 15px) var(--font-display); }
.lu-pawn { border: 2px solid #fff; background: radial-gradient(circle at 33% 22%, #ffffff88, transparent 60%), var(--lu-color); color: #fff; box-shadow: inset 0 -4px 0 #0002, 0 3px 4px #0003; padding: 0; position: relative; z-index: 1; transition: filter .15s; }
.lu-pawn:disabled { cursor: default; opacity: 1; }
.lu-pawn.legal { cursor: pointer; outline: 2px solid #443d31; outline-offset: 2px; animation: lu-glow 1.2s ease-in-out infinite; }
.lu-pawn.legal:hover { filter: brightness(1.15); }
.lu-pawn:focus-visible, .lu-choice:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.lu-pawn.finished { background: #fff9; border-color: var(--lu-color); color: var(--lu-color); box-shadow: none; }
.lu-base-ghost { border: 2px dashed var(--lu-color); color: var(--lu-color); opacity: .25; }
.lu-center { grid-row: 6; grid-column: 6; display: grid; place-items: center; font-size: 24px; color: #98835d; }
.lu-sidebar { min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.lu-controls { flex: none; display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; column-gap: 14px; padding: 18px 14px 12px; border: 1px solid #ffcc4d33; background: radial-gradient(ellipse at 0% 0%, #ffcc4d0a, transparent 70%), var(--surface); border-radius: 18px; box-shadow: 0 8px 24px #0002; }
.lu-dice { display: grid; justify-items: center; gap: 10px; min-width: 0; }
.lu-dice small { color: var(--muted); font-size: 10px; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-dice-stage { --lu-d: 54px; width: var(--lu-d); height: var(--lu-d); position: relative; perspective: 450px; overflow: visible; }
.lu-cube { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transform: rotateX(var(--lu-rot-x)) rotateY(var(--lu-rot-y)); }
.lu-cube-face { position: absolute; inset: 0; backface-visibility: hidden; }
.lu-cube-face .die { --d: var(--lu-d); width: 100%; height: 100%; box-shadow: inset 0 -3px 0 #0002; border: 1px solid #dfd3b6; border-radius: 10px; background: linear-gradient(145deg, #fffef9, #ebe3d3); }
.lu-cube-face.front { transform: translateZ(calc(var(--lu-d) / 2)); }
.lu-cube-face.back { transform: rotateY(180deg) translateZ(calc(var(--lu-d) / 2)); }
.lu-cube-face.right { transform: rotateY(90deg) translateZ(calc(var(--lu-d) / 2)); }
.lu-cube-face.left { transform: rotateY(-90deg) translateZ(calc(var(--lu-d) / 2)); }
.lu-cube-face.top { transform: rotateX(90deg) translateZ(calc(var(--lu-d) / 2)); }
.lu-cube-face.bottom { transform: rotateX(-90deg) translateZ(calc(var(--lu-d) / 2)); }
.lu-dice-shadow { position: absolute; bottom: -6px; left: 8%; width: 84%; height: 12px; border-radius: 50%; background: #0006; filter: blur(5px); }
.lu-dice-stage.unrolled .lu-cube { transform: rotateX(-15deg) rotateY(20deg); }
.lu-command { min-width: 0; }
.lu-step { display: block; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.lu-command-title { display: block; font: 600 17px var(--font-display); }
.lu-roll-wait { display: none; }
.lu-is-rolling .lu-roll-wait { display: inline; }
.lu-is-rolling .lu-command-ready, .lu-is-rolling .lu-event-result { display: none; }
.lu-is-rolling .lu-command p { visibility: hidden; }
.lu-command p { font-size: 11px; color: var(--muted); line-height: 1.4; margin: 6px 0 10px; }
.lu-command > .btn { width: 100%; min-height: 44px; font-size: 13px; padding: 0 8px; }
.lu-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.lu-choice { background: var(--lu-soft); border: 1px solid var(--lu-color); color: var(--text); display: flex; align-items: center; gap: 6px; padding: 7px; border-radius: 10px; min-height: 44px; text-align: left; font-size: 11px; }
.lu-choice b { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: #fff; background: var(--lu-color); flex: 0 0 23px; }
.lu-choice:hover:not(:disabled) { background: var(--lu-color); color: #fff; }
.lu-choice-short { display: none; }
.lu-choice:disabled { opacity: .55; cursor: default; }
.lu-key-hint { grid-column: 1 / -1; color: var(--faint); font-size: 10px; text-align: center; margin: 12px 0 0; }
.lu-panel { min-height: 0; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; scrollbar-width: thin; }
.lu-panel h2 { font: 600 20px var(--font-display); margin: 16px 16px 4px; }
.lu-panel > p { color: var(--muted); font-size: 12px; margin: 0 16px 12px; }
.lu-panel ol { list-style: none; padding: 0; margin: 0; }
.lu-seat { display: flex; align-items: center; gap: 9px; padding: 12px 16px; border-top: 1px solid var(--line); position: relative; }
.lu-seat.active { background: var(--lu-soft); box-shadow: inset 3px 0 var(--lu-color); }
.lu-seat .avatar { width: 32px; height: 32px; }
.lu-seat > div { flex: 1; min-width: 0; }
.lu-seat strong { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-seat em { color: var(--muted); font-style: normal; font-size: 10px; }
.lu-seat small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.lu-seat > b { color: var(--lu-color); font: 600 22px var(--font-display); white-space: nowrap; }
.lu-seat > b small { display: inline; font-size: 12px; }
.lu-progress { display: flex; gap: 5px; margin-top: 6px; }
.lu-progress i { width: 14px; height: 14px; border: 1px solid var(--lu-color); border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; color: #fff; }
.lu-progress .done { background: var(--lu-color); }
.lu-event { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--text); }
.lu-tips { margin: 0 12px 12px; padding: 12px; border-radius: 12px; background: var(--bg-soft); font-size: 11px; line-height: 1.5; }
.lu-tips strong { color: var(--accent); }
.lu-tips p { color: var(--muted); margin: 6px 0; }
.lu-tips small { color: var(--faint); }
.lu-flight { position: fixed; top: 0; left: 0; z-index: 26; pointer-events: none; margin: 0; font-size: 14px; will-change: transform; }
.lu-impact { position: fixed; width: 48px; height: 48px; border: 3px solid var(--lu-color); border-radius: 50%; pointer-events: none; z-index: 25; box-shadow: 0 0 14px var(--lu-color); }
.lu-impact.home { border-style: dashed; }
@keyframes lu-glow { 50% { outline-color: #443d3177; box-shadow: inset 0 -4px 0 #0002, 0 0 12px #fff8; } }
@keyframes lu-target { 50% { opacity: .4; } }
@media (max-width: 1100px) { .mini-ludo .mini-main { grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; padding: 12px; } }
/* In portrait, the roster is a compact header and actions remain below the board. */
@media (max-width: 760px) and (orientation: portrait) {
  .mini-ludo .mini-main { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px max(8px, env(safe-area-inset-bottom)); }
  .mini-ludo .mini-stage { flex: 1; height: auto; min-height: 0; order: 1; }
  .lu-sidebar { display: contents; }
  .lu-panel { order: 0; flex: none; overflow: visible; border-radius: 12px; }
  .lu-panel > h2, .lu-panel > p, .lu-panel .lu-event, .lu-panel .lu-tips { display: none; }
  .lu-panel ol { display: grid; grid-template-columns: repeat(var(--lu-seats), minmax(0, 1fr)); }
  .lu-seat { border: 0; padding: 8px; gap: 6px; min-width: 0; }
  .lu-seat:not(:first-child) { border-left: 1px solid var(--line); }
  .lu-seat .avatar { width: 22px; height: 22px; }
  .lu-seat strong { font-size: 10px; }
  .lu-seat strong em, .lu-seat > div > small, .lu-progress { display: none; }
  .lu-seat > b { font-size: 16px; }
  .lu-seat > b small { font-size: 9px; }
  .lu .mg-head { margin-bottom: 6px; min-height: 23px; font-size: 12px; }
  .lu-controls { order: 2; padding: 12px; border-radius: 14px; grid-template-columns: 58px minmax(0, 1fr); column-gap: 12px; }
  .lu-dice-stage { --lu-d: 44px; }
  .lu-dice { gap: 6px; }
  .lu-command-title { font-size: 16px; }
  .lu-command p { margin: 4px 0 7px; font-size: 10px; }
  .lu-step { display: none; }
  .lu-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .lu-choice { padding: 5px; gap: 3px; justify-content: center; font-size: 10px; }
  .lu-choice b { width: 19px; height: 19px; flex-basis: 19px; }
  .lu-choice-long { display: none; }
  .lu-choice-short { display: inline; }
  .lu-key-hint { display: none; }
  .lu-board { gap: 2px; border-radius: 16px; }
  .lu-base { border-radius: 10px; gap: 5px; padding: 4px; }
  .lu-base-pawns { gap: 5px; }
  .lu-pawn.legal { outline-offset: 0; }
}
@media (max-width: 420px) and (orientation: portrait) { .lu-seat { padding: 7px 5px; gap: 4px; } .lu-seat .avatar { display: none; } }
@media (max-height: 550px) and (orientation: landscape) {
  .mini-ludo .mini-main { grid-template-columns: minmax(0, 1fr) 285px; padding: 8px 12px; gap: 10px; }
  .lu .mg-head { margin-bottom: 4px; min-height: 20px; font-size: 11px; }
  .lu-controls { padding: 12px; }
  .lu-command p { font-size: 10px; margin: 4px 0 6px; }
  .lu-key-hint, .lu-tips, .lu-panel > h2, .lu-panel > p, .lu-progress { display: none; }
  .lu-seat { padding: 8px 12px; }
  .lu-panel { flex: 1; }
  .lu-base-label small { display: none; }
  .lu-base-pawns { gap: 4px; grid-template-columns: repeat(2, clamp(15px, calc(var(--lu-board-size, 200px) * .065), 30px)); }
  .lu-base { gap: 4px; padding: 2px; }
  .lu-board { gap: 2px; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { .lu-pawn.legal, .lu-cell.lu-destination::after { animation: none; } .art-ludo, .lu-pawn { transition: none; } }
