.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; }
/* Let short screens scroll instead of shrinking the board and text. */
.mini-ludo.game { height: auto; min-height: calc(100dvh - var(--header-h)); overflow-x: clip; overflow-y: visible; }
.mini-ludo .game-body { overflow: visible; }
.mini-ludo .chat { max-height: calc(100dvh - var(--header-h) - 56px); }
.mini-ludo .mini-main { height: auto; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto; max-width: 1320px; gap: 48px; padding: 32px 40px; align-self: stretch; align-items: center; }
.mini-ludo .mini-stage { height: auto; justify-content: center; }
.lu { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 720px; margin: auto; }
.lu .mg-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; margin: 0; font-size: 14px; }
.lu .mg-head b { font-size: inherit; }
.lu .mg-bar { grid-column: 1 / -1; height: 4px; min-width: 0; background: #ffffff09; }
.lu-turn { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.lu-turn-dot, .lu-color-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lu-color); flex: none; }
.lu-clock { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding: 6px 10px; border-radius: 9px; background: var(--surface); }
.lu-turn.mine { color: var(--accent); }
.lu-board-wrap { flex: none; aspect-ratio: 1; width: min(100%, max(480px, calc(100dvh - var(--header-h) - 225px))); min-width: 0; display: flex; align-items: center; justify-content: center; margin-inline: auto; }
.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: clamp(2px, calc(var(--lu-board-size, 400px) * .009), 6px); padding: clamp(8px, calc(var(--lu-board-size, 300px) * .025), 18px); border-radius: 28px; background: radial-gradient(ellipse at 30% 0%, #fff9, transparent 70%), #f3eee4; border: 1px solid #d9ccb5; box-shadow: 0 20px 60px #0003, inset 0 0 0 5px #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: #e4dccd; box-shadow: inset 0 0 0 1px #baaa8b44; }
.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-cell.lu-effect-landing::before { content: ''; position: absolute; inset: -2px; border: 2px dotted #155d91; border-radius: 30%; pointer-events: none; }
.lu-base { grid-row-end: span 4 !important; grid-column-end: span 4 !important; border: 1px solid var(--lu-color); border-radius: 20px; background: linear-gradient(145deg, #fff8, #fff0), var(--lu-soft); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 8px; gap: clamp(8px, calc(var(--lu-board-size, 400px) * .026), 18px); min-width: 0; }
.lu-base.active { box-shadow: inset 0 0 0 2px var(--lu-color), 0 0 0 3px #fff8; }
.lu-base.empty { opacity: .24; border-style: dashed; background: transparent; }
.lu-empty-mark { width: 32%; aspect-ratio: 1; border: 2px solid var(--lu-color); border-radius: 50%; opacity: .5; }
.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) * .063), 42px)); gap: clamp(8px, calc(var(--lu-board-size, 400px) * .027), 18px); }
.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-board { grid-template-columns: repeat(var(--lu-grid, 11), minmax(0, 1fr)); grid-template-rows: repeat(var(--lu-grid, 11), minmax(0, 1fr)); }
.lu-base { grid-row-end: span var(--lu-arm, 4) !important; grid-column-end: span var(--lu-arm, 4) !important; }
.lu-center { grid-row: var(--lu-center, 6); grid-column: var(--lu-center, 6); }
.lu-hardcore { gap: clamp(1px, calc(var(--lu-board-size, 400px) * .005), 4px); background: radial-gradient(ellipse at 30% 0%, #fff6, transparent 70%), #e9e1d5; border-color: #b79c72; }
.lu-hardcore .lu-cell { font-size: clamp(8px, calc(var(--lu-board-size, 400px) * .021), 14px); }
.lu-hardcore .lu-pawn { font-size: clamp(8px, calc(var(--lu-board-size, 400px) * .02), 13px); border-width: 1px; }
.lu-variant { align-self: center; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.lu-special-boost { --lu-special-bg: #c7e4f7; --lu-special-ink: #155d91; }
.lu-special-back { --lu-special-bg: #eddbff; --lu-special-ink: #7133a3; }
.lu-special-trap { --lu-special-bg: #ffd2cc; --lu-special-ink: #a52c25; }
.lu-special-bonus { --lu-special-bg: #ffe8a5; --lu-special-ink: #865000; }
.lu-cell.lu-special { background: var(--lu-special-bg); color: var(--lu-special-ink); box-shadow: inset 0 0 0 1px currentColor; border-radius: 30%; }
.lu-mode-settings { margin-top: 24px; }
.lu-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lu-mode-options button { display: flex; flex-direction: column; gap: 8px; text-align: left; border: 1px solid var(--line-2); border-radius: 16px; background: var(--bg-soft); color: var(--text); padding: 18px; }
.lu-mode-options button.active { border-color: var(--accent); background: #ffcc4d0c; box-shadow: inset 0 0 0 1px var(--accent); }
.lu-mode-options button:disabled { cursor: default; opacity: 1; }
.lu-mode-options button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.lu-mode-options strong { font: 600 18px var(--font-display); }
.lu-mode-options small, .lu-mode-hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.lu-mode-hint { margin: 14px 0 0; }
.lu-legend { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 20px; }
.lu-legend h2 { font: 600 16px var(--font-display); margin: 0 0 16px; }
.lu-legend > div { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.lu-legend b { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--lu-special-bg); color: var(--lu-special-ink); font-size: 13px; }
.lu-legend strong { display: block; font-size: 12px; }
.lu-legend small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 3px; }
.lu-legend p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 16px 0 0; }
.lu-choice { overflow-wrap: anywhere; }
.lu-sidebar { min-height: 0; display: flex; flex-direction: column; gap: 24px; }
.lu-controls { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) 72px; grid-template-areas: 'command dice' 'actions actions' 'keys keys'; align-items: center; gap: 20px; padding: 26px; border: 1px solid #ffcc4d26; background: radial-gradient(ellipse at 100% 0%, #ffcc4d0a, transparent 70%), var(--surface); border-radius: 24px; box-shadow: 0 12px 32px #0002; }
.lu-dice { grid-area: dice; display: grid; justify-items: center; padding-top: 8px; min-width: 0; }
.lu-dice-stage { --lu-d: 62px; 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 { grid-area: command; min-width: 0; }
.lu-step { display: block; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.lu-command-title { display: block; font: 600 23px/1.15 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: 12px; color: var(--muted); line-height: 1.6; margin: 10px 0 0; }
.lu-actions { grid-area: actions; }
.lu-actions > .btn { width: 100%; min-height: 50px; font-size: 14px; border-radius: 14px; justify-content: space-between; }
.lu-waiting { min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); background: #ffffff03; border: 1px dashed var(--line-2); border-radius: 14px; font-size: 12px; }
.lu-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lu-choice { background: var(--lu-soft); border: 1px solid var(--lu-color); color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px; border-radius: 12px; min-height: 58px; font-size: 11px; }
.lu-choice b { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #fff; background: var(--lu-color); flex: 0 0 25px; }
.lu-choice:hover:not(:disabled) { background: var(--lu-color); color: #fff; }
.lu-choice-long { display: none; }
.lu-choice-short { display: inline; }
.lu-choice:disabled { opacity: .55; cursor: default; }
.lu-key-hint { grid-area: keys; color: var(--faint); font-size: 10px; text-align: center; margin: 0; }
.lu-key-hint > span { padding-inline: 8px; }
.lu-panel { min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 8px; }
.lu-panel h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 600 17px var(--font-display); margin: 12px 14px 16px; }
.lu-panel h2 small { color: var(--faint); font: 400 11px var(--font); }
.lu-panel ol { list-style: none; padding: 0; margin: 0; }
.lu-seat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; position: relative; }
.lu-seat + .lu-seat { margin-top: 4px; }
.lu-seat.active { background: var(--lu-soft); }
.lu-seat .avatar { width: 36px; height: 36px; }
.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: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; margin-top: 5px; }
.lu-color-dot { width: 6px; height: 6px; }
.lu-style-badge { font-size: 15px; color: var(--accent); cursor: help; }
.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-event { min-height: 32px; max-width: 560px; margin: auto; text-align: center; font-size: 12px; line-height: 1.7; color: var(--muted); }
.lu-lobby-style { border-block: 1px solid var(--line); margin: 24px 0; padding: 18px 0; }
.lu-lobby-style summary { cursor: pointer; color: var(--text); font-size: 13px; font-weight: 700; }
.lu-lobby-style summary > span { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin: 8px 0 0 16px; }
.lu-lobby-style .cosmetic-wardrobe { margin-top: 18px; }
.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) 300px; gap: 24px; padding: 24px; }
  .lu-board-wrap { width: min(100%, max(420px, calc(100dvh - var(--header-h) - 225px))); }
  .lu-controls { padding: 22px; grid-template-columns: minmax(0, 1fr) 64px; }
  .lu-command-title { font-size: 21px; }
  .lu-dice-stage { --lu-d: 54px; }
}
/* The board and controls have their own space; mobile scrolls naturally. */
@media (max-width: 760px) {
  .mini-ludo .mini-main { display: flex; flex-direction: column; gap: 20px; padding: 20px 16px max(24px, env(safe-area-inset-bottom)); }
  .mini-ludo .mini-stage { flex: none; height: auto; width: 100%; order: 1; }
  .lu-sidebar { display: contents; }
  .lu-legend { order: 3; width: 100%; }
  .lu-mode-options button { padding: 14px; }
  .lu-panel { order: 0; width: 100%; padding: 6px; border-radius: 20px; }
  .lu-panel h2 { margin: 8px 10px 12px; font-size: 16px; }
  .lu-panel ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .lu-seat { padding: 10px; gap: 8px; min-width: 0; }
  .lu-seat + .lu-seat { margin: 0; }
  .lu-seat .avatar { width: 28px; height: 28px; }
  .lu-seat strong { font-size: 12px; }
  .lu-seat > div > small { font-size: 10px; }
  .lu-seat > b { font-size: 19px; }
  .lu-seat > b small { font-size: 10px; }
  .lu-style-badge { font-size: 12px; }
  .lu { gap: 14px; }
  .lu .mg-head { font-size: 13px; gap: 10px; }
  .lu-clock { font-size: 11px; }
  .lu-controls { order: 2; width: 100%; padding: 22px; border-radius: 20px; gap: 18px; }
  .lu-command-title { font-size: 21px; }
  .lu-key-hint { display: none; }
  .lu-board-wrap { width: 100%; max-width: 520px; }
  .lu-board { border-radius: 22px; }
  .lu-base { border-radius: 14px; gap: 8px; padding: 5px; }
  .lu-base-pawns { gap: 8px; }
  .lu-pawn.legal { outline-offset: 1px; }
  .lu-event { font-size: 11px; min-height: 0; }
}
@media (min-width: 761px) and (max-height: 550px) {
  .mini-ludo .mini-main { grid-template-columns: minmax(0, 1fr) 300px; padding: 20px; gap: 24px; }
  .lu-board-wrap { width: min(100%, max(340px, calc(100dvh - var(--header-h) - 180px))); }
}
@media (prefers-reduced-motion: reduce) { .lu-pawn.legal, .lu-cell.lu-destination::after { animation: none; } .art-ludo, .lu-pawn { transition: none; } }
