/* Crosslink Small-update 31: combined active dice cup styles; same rule order as Small-update 30. */
/* ===== ORIGINAL dice-cup-roll-v323.css — retained in original CSS cascade order ===== */
/* V323: supplied two-image cup with dice sandwiched between back and front. */
body.board-view .board-wrap > .playbar,
body.board-view .playbar,
body.board-view:not(.classic-mode):not(.pawn-status-hidden) .playbar {
  display:flex!important;justify-content:center!important;align-items:center!important;
  background:transparent!important;background-image:none!important;
  box-shadow:none!important;border:0!important;border-radius:0!important;
  backdrop-filter:none!important;padding:0!important;margin:0!important;
  gap:8px!important;overflow:visible!important;
}
body.board-view .playbar.playbar-empty{display:none!important}
body.board-view .playbar [hidden], body.board-view .dice-cup-stage[hidden],
body.board-view .cup-roll-animation[hidden], body.board-view .playbar #rollBtn[hidden]{display:none!important}
body.board-view .dice-cup-stage{
  position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;
  width:min(310px,100%)!important;height:316px!important;min-height:316px!important;
  padding:0!important;margin:0!important;border:0!important;border-radius:0!important;
  box-shadow:none!important;background:none!important;overflow:visible!important;
}
body.board-view .playbar #rollBtn.roll-cup-button{
  display:flex!important;position:relative!important;align-items:center!important;justify-content:center!important;
  width:258px!important;height:300px!important;min-height:0!important;
  border:0!important;border-radius:0!important;padding:0!important;margin:0!important;
  background:transparent!important;box-shadow:none!important;filter:none!important;
  color:transparent!important;font-size:0!important;text-shadow:none!important;
  line-height:0!important;cursor:pointer!important;opacity:1!important;
}
body.board-view .playbar #rollBtn.roll-cup-button::before,
body.board-view .playbar #rollBtn.roll-cup-button::after{display:none!important;content:none!important}
body.board-view .playbar #rollBtn.roll-cup-button:disabled{opacity:.85!important}
body.board-view .cup-roll-animation{
  position:relative!important;display:flex!important;justify-content:center!important;align-items:center!important;
  width:258px!important;height:300px!important;min-height:300px!important;
  background:none!important;box-shadow:none!important;overflow:visible!important;
}
/* The back, dice and front share an identical 254×300 coordinate space. */
body.board-view .cup-layers{
  position:relative!important;display:block!important;flex:none!important;
  width:254px!important;height:300px!important;overflow:visible!important;
  transform-origin:center 70%!important;
}
body.board-view .cup-layers > img{
  position:absolute!important;left:0!important;top:0!important;
  width:254px!important;height:300px!important;
  max-width:none!important;max-height:none!important;
  object-fit:fill!important;display:block!important;opacity:1!important;
  filter:none!important;border:0!important;box-shadow:none!important;
  transform:none!important;pointer-events:none!important;
}
body.board-view .cup-layers .cup-back-layer{z-index:1!important}
body.board-view .cup-layers .cup-front-layer{z-index:4!important}
body.board-view .cup-roll-animation .roll-cup-ghost{
  position:absolute!important;left:0!important;top:0!important;bottom:auto!important;
  width:254px!important;height:300px!important;max-width:none!important;max-height:none!important;
  transform:none!important;translate:none!important;scale:1!important;
  z-index:4!important;opacity:1!important;visibility:visible!important;
  background:none!important;animation:none!important;
}
body.board-view .cup-motion-layers .dice{
  position:absolute!important;top:32px!important;left:50%!important;bottom:auto!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  gap:12px!important;min-width:0!important;width:max-content!important;
  padding:0!important;margin:0!important;
  z-index:2!important;pointer-events:none!important;
  opacity:0!important;visibility:hidden!important;
  transform:translate(-50%,112px) scale(.7);
  animation:none!important;
}
body.board-view .cup-motion-layers .die{
  display:flex!important;align-items:center!important;justify-content:center!important;
  width:58px!important;height:58px!important;flex:0 0 58px!important;
  font-size:30px!important;border-radius:12px!important;box-sizing:border-box!important;
  background:white!important;box-shadow:0 7px 13px #0005!important;
  rotate:0deg!important;transform:none;animation:none!important;
}
body.board-view .cup-motion-layers .die .dice-svg{width:100%;height:100%}
/* Shake the complete cup (back + front), never expose dice during shake. */
body.board-view .dice-cup-stage[data-state="shake"] .cup-motion-layers{
  animation:none!important;
}
@keyframes v323CupShake{
  0%{transform:translateX(-5px) rotate(-3deg)}
  100%{transform:translateX(5px) rotate(3deg)}
}
/* The dice start INSIDE, masked by infront.png, and move through the rim. */
body.board-view .dice-cup-stage[data-state="roll"] .cup-motion-layers .dice{
  opacity:1!important;visibility:visible!important;
  animation:v323DiceRise var(--cup-dice-duration,1150ms) linear both!important;
}
@keyframes v323DiceRise{
  0%{transform:translate(-50%,112px) scale(.7);opacity:0}
  12%{transform:translate(-50%,93px) scale(.73);opacity:1}
  28%{transform:translate(-50%,65px) scale(.8);opacity:1}
  50%{transform:translate(-50%,10px) scale(.9);opacity:1}
  75%{transform:translate(-50%,-48px) scale(1);opacity:1}
  100%{transform:translate(-50%,-94px) scale(1);opacity:1}
}
body.board-view .dice-cup-stage[data-state="roll"] .cup-motion-layers .die:first-child{
  animation:v323DieSpinA var(--cup-dice-duration,1150ms) ease-out both!important;
}
body.board-view .dice-cup-stage[data-state="roll"] .cup-motion-layers .die:last-child{
  animation:v323DieSpinB var(--cup-dice-duration,1150ms) ease-out both!important;
}
@keyframes v323DieSpinA{0%{transform:rotate(-65deg)}75%{transform:rotate(290deg)}100%{transform:rotate(360deg)}}
@keyframes v323DieSpinB{0%{transform:rotate(75deg)}75%{transform:rotate(-290deg)}100%{transform:rotate(-360deg)}}
/* When the sound finishes, dice freeze just above cup while cup remains. */
body.board-view .dice-cup-stage[data-state="settled"] .cup-motion-layers .dice{
  top:-62px!important;left:50%!important;
  opacity:1!important;visibility:visible!important;
  transform:translateX(-50%)!important;
  animation:none!important;
}
body.board-view .dice-cup-stage[data-state="settled"] .cup-motion-layers .die{
  transform:none!important;animation:none!important;rotate:0deg!important;
}
body.board-view #rollToStartOverlay .rts-roll{display:none!important}
@media(max-width:760px){
  body.board-view .dice-cup-stage{height:288px!important;min-height:288px!important;width:min(290px,100%)!important}
  body.board-view .playbar #rollBtn.roll-cup-button,
  body.board-view .cup-roll-animation{height:276px!important;min-height:276px!important;width:235px!important}
  body.board-view .cup-layers{width:235px!important;height:278px!important}
  body.board-view .cup-layers>img,
  body.board-view .cup-roll-animation .roll-cup-ghost{width:235px!important;height:278px!important}
  body.board-view .cup-motion-layers .die{width:52px!important;height:52px!important;flex-basis:52px!important}
  body.board-view .cup-motion-layers .dice{gap:10px!important}
  body.board-view .dice-cup-stage[data-state="settled"] .cup-motion-layers .dice{top:-55px!important}
}
@media(prefers-reduced-motion:reduce){
  body.board-view .dice-cup-stage[data-state="shake"] .cup-motion-layers{animation:none!important}
  body.board-view .dice-cup-stage[data-state="roll"] .cup-motion-layers .dice{animation:v323GentleRise var(--cup-dice-duration,1150ms) ease-out both!important}
  body.board-view .dice-cup-stage[data-state="roll"] .cup-motion-layers .die{animation:none!important}
  @keyframes v323GentleRise{0%{transform:translate(-50%,112px);opacity:0}100%{transform:translate(-50%,-94px);opacity:1}}
}
/* ===== END dice-cup-roll-v323.css ===== */

/* ===== ORIGINAL dice-cup-roll-v324.css — retained in original CSS cascade order ===== */
/* Crosslink V324: stronger cup shaking; faster dice; more board clearance. */
/* Leave extra space between the board and cup on wider displays. */
@media(min-width:761px){
 body.board-view .board-wrap>.playbar,
 body.board-view .playbar,
 body.board-view:not(.classic-mode):not(.pawn-status-hidden) .playbar{
  transform:translateX(42px) !important;
 }
}
@media(max-width:760px){
 body.board-view .board-wrap>.playbar,
 body.board-view .playbar,
 body.board-view:not(.classic-mode):not(.pawn-status-hidden) .playbar{
  margin-top:22px !important;
 }
}
/* Shake the entire layered cup; both the felt backing and front face move together. */
body.board-view #diceCupStage[data-state="shake"] #cupRollAnimation .cup-motion-layers{
 animation:none!important;
 transform-origin:50% 72% !important;
 will-change:transform;
}
@keyframes v324CupShake{
 0%{transform:translate(-8px,-2px) rotate(-4deg)}
 100%{transform:translate(8px,2px) rotate(4deg)}
}
/* Complete several tumbles while ascending, without changing the recording duration. */
body.board-view #diceCupStage[data-state="roll"] .cup-motion-layers .die:first-child{
 animation:v324FastDieA 270ms linear infinite !important;
}
body.board-view #diceCupStage[data-state="roll"] .cup-motion-layers .die:last-child{
 animation:v324FastDieB 240ms linear infinite !important;
}
@keyframes v324FastDieA{from{transform:rotate(-28deg)}to{transform:rotate(332deg)}}
@keyframes v324FastDieB{from{transform:rotate(36deg)}to{transform:rotate(-324deg)}}
/* Preserve the V323 back -> dice -> front order and keep the dice fixed after rolling. */
body.board-view #diceCupStage[data-state="settled"] .cup-motion-layers .die{
 animation:none !important;transform:none !important;
}
@media(prefers-reduced-motion:reduce){
 body.board-view #diceCupStage[data-state="roll"] .cup-motion-layers .die{animation:none !important}
 body.board-view #diceCupStage[data-state="shake"] #cupRollAnimation .cup-motion-layers{animation:none !important}
}
/* ===== END dice-cup-roll-v324.css ===== */

/* ===== ORIGINAL dice-cup-roll-v326.css — retained in original CSS cascade order ===== */
/* Crosslink V326: visible active player's cup, no legacy Roll button. */
body.board-view .playbar:not(.playbar-empty) .dice-cup-stage[data-state="ready"]{display:flex!important;visibility:visible!important;opacity:1!important}
body.board-view .playbar .dice-cup-stage[data-state="ready"] #rollBtn.roll-cup-button:not([hidden]){display:flex!important;visibility:visible!important;opacity:1!important;background:transparent!important}
body.board-view .playbar .dice-cup-stage[data-state="ready"] .cup-ready-layers,
body.board-view .playbar .dice-cup-stage[data-state="ready"] .cup-ready-layers>img{display:block!important;visibility:visible!important;opacity:1!important}
body.board-view.opening-roll-overlay-active .playbar .dice-cup-stage[data-state="ready"] #rollBtn.roll-cup-button:not([hidden]){display:flex!important}
body.board-view .dice-cup-stage[data-state="shake"] .cup-motion-layers {animation:none!important}
@media(prefers-reduced-motion:reduce){body.board-view .dice-cup-stage[data-state="shake"] .cup-motion-layers{animation:none!important}}
/* ===== END dice-cup-roll-v326.css ===== */

/* ===== ORIGINAL dice-cup-roll-v327.css — retained in original CSS cascade order ===== */
/* V327: the READY player cup is the SAME three-layer composite as the working rolling cup. */
body.board-view .playbar.cup-ready-visible,
body.board-view.game-inactive .playbar.cup-ready-visible {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
body.board-view #diceCupStage[data-state="ready"] {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
body.board-view #diceCupStage[data-state="ready"] #cupRollAnimation {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: none !important;
}
body.board-view #diceCupStage[data-state="ready"] .cup-motion-layers,
body.board-view #diceCupStage[data-state="ready"] .cup-motion-layers > img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
body.board-view #diceCupStage[data-state="ready"] .cup-motion-layers .dice {
  visibility: hidden !important;
  opacity: 0 !important;
  animation: none !important;
}
/* Button retains the original human/online roll handler, keyboard focus and hit area;
   visible cup image is provided by the animation composite underneath it. */
body.board-view #diceCupStage[data-state="ready"] #rollBtn.roll-cup-button:not([hidden]) {
  position: absolute !important;
  display: block !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  background: transparent !important;
  z-index: 20 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}
body.board-view #diceCupStage[data-state="ready"] #rollBtn.roll-cup-button:focus-visible {
  opacity: 1 !important;
  outline: 3px solid #ffd43b !important;
  outline-offset: 2px !important;
}
/* The opening-roll overlay no longer suppresses the player's cup on phones. */
body.board-view.opening-roll-overlay-active #diceCupStage[data-state="ready"] #rollBtn.roll-cup-button:not([hidden]) {
  display: block !important;
}
/* The rolling sequence and settled-dice layout from V323-V326 remain untouched. */
/* ===== END dice-cup-roll-v327.css ===== */

/* ===== ORIGINAL dice-cup-roll-v328.css — retained in original CSS cascade order ===== */
/* V328: ready, shaking, rolling, settled cup MUST share one mobile/desktop centre. */
body.board-view #diceCupStage{
 position:relative!important;
 display:flex!important;
 align-items:center!important;
 justify-content:center!important;
 box-sizing:border-box!important;
}
body.board-view #diceCupStage[hidden]{display:none!important;}
/* Keep the visible composite at identical x/y coordinates through state changes.
   Previous CSS used an in-flow animation while the clickable overlay was absolute,
   causing mobile layout changes as the button hid during a roll. */
body.board-view #diceCupStage #cupRollAnimation{
 position:absolute!important;
 display:flex!important;
 align-items:center!important;
 justify-content:center!important;
 left:50%!important;
 top:50%!important;
 right:auto!important;
 bottom:auto!important;
 margin:0!important;
 padding:0!important;
 transform:translate(-50%,-50%)!important;
 translate:none!important;
 box-sizing:border-box!important;
}
body.board-view #diceCupStage #cupRollAnimation[hidden]{display:none!important;}
body.board-view #diceCupStage .cup-motion-layers{
 margin:0!important;
 flex:0 0 auto!important;
}
/* Click target covers the same centered bounds, but never moves the artwork. */
body.board-view #diceCupStage[data-state="ready"] #rollBtn.roll-cup-button:not([hidden]){
 position:absolute!important;
 inset:0!important;
 width:100%!important;
 height:100%!important;
 margin:0!important;
 transform:none!important;
 translate:none!important;
}
body.board-view #diceCupStage[data-state="ready"] #rollBtn.roll-cup-button:hover:not(:disabled){
 transform:none!important;
}
@media(max-width:760px){
 body.board-view #diceCupStage #cupRollAnimation{
  left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;
 }
}

/* Small-update 25: Reserve the same dice-control footprint between rolls.
   Previous .playbar-empty {display:none} collapsed the board layout whenever
   a player missed a turn because both spaces were theirs. */
body.board-view:not(.game-inactive) .board-wrap > .playbar,
body.board-view:not(.game-inactive) .playbar {
  min-height:316px!important;
  box-sizing:border-box!important;
}
body.board-view:not(.game-inactive) .playbar.playbar-empty {
  display:flex!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
/* Small-update 44: the contact shadow is a stationary projected ellipse.
   Anchor near the cup's actual base (inside the stage), not past the bottom
   where the parent playbar clips it. Its direction matches piece shadows. */
body.board-view #diceCupStage .cup-static-shadow {
 position:absolute!important;
 left:50%!important;top:calc(50% + 109px)!important;
 width:165px!important;height:38px!important;
 border-radius:50%!important;
 background:rgba(0,0,0,var(--cl-cup-shadow-opacity,.2))!important;
 filter:blur(var(--cl-cup-shadow-blur,7px))!important;
 transform:translate(calc(-50% + var(--cl-cup-shadow-distance,9px)),var(--cl-cup-shadow-distance,9px))!important;
 margin:0!important;padding:0!important;box-shadow:none!important;
 pointer-events:none!important;z-index:1!important;
 visibility:visible!important;opacity:1!important;
 animation:none!important;transition:none!important;
}
body.board-view #diceCupStage #cupRollAnimation,
body.board-view #diceCupStage #rollBtn {z-index:2!important;}
body.board-view #diceCupStage .cup-motion-layers > img.cup-front-layer {
 filter:none!important;
}
/* V28: each die has a soft elliptical cast shadow below its body.
   Remove the box shadow that hugs the die corners and makes rotating gaps.
   Face SVG rotates, but this separate cast shadow never rotates. */
body.board-view #diceCupStage .cup-motion-layers .die {
 position:relative!important;
 box-shadow:none!important;
 filter:none!important;
 isolation:isolate!important;
 overflow:visible!important;
}
body.board-view #diceCupStage .cup-motion-layers .die::before {
 content:""!important;
 position:absolute!important;
 z-index:0!important;
 left:12%!important;
 bottom:-8px!important;
 width:76%!important;
 height:15px!important;
 background:var(--cl-cup-shadow-colour,rgba(0,0,0,.2))!important;
 border-radius:50%!important;
 filter:blur(var(--cl-cup-shadow-blur,7px))!important;
 transform:translate3d(0,0,0)!important;
 animation:none!important;
 pointer-events:none!important;
}
body.board-view #diceCupStage .cup-motion-layers .die .dice-svg {
 position:relative!important;
 z-index:1!important;
 filter:none!important;
 box-shadow:none!important;
}
@media(max-width:760px){
 body.board-view:not(.game-inactive) .board-wrap > .playbar,
 body.board-view:not(.game-inactive) .playbar {min-height:288px!important;}
}

/* Small-update 27 — Shadow is on the non-rotating die shell.
   Rotate only the SVG face; never animate the die element carrying its shadow. */
body.board-view #diceCupStage[data-state="roll"] .cup-motion-layers .die,
body.board-view #diceCupStage[data-state="roll"] .cup-motion-layers .die:first-child,
body.board-view #diceCupStage[data-state="roll"] .cup-motion-layers .die:last-child {
 animation:none!important;
 transform:none!important;
 rotate:none!important;
 background:transparent!important;
}
body.board-view #diceCupStage .cup-motion-layers .die .dice-svg {
 display:block!important;
 width:100%!important;height:100%!important;
 overflow:visible!important;
 transform-origin:50% 50%!important;
}
body.board-view #diceCupStage[data-state="roll"] .cup-motion-layers .die:first-child .dice-svg {
 animation:v324FastDieA 270ms linear infinite!important;
}
body.board-view #diceCupStage[data-state="roll"] .cup-motion-layers .die:last-child .dice-svg {
 animation:v324FastDieB 240ms linear infinite!important;
}
body.board-view #diceCupStage[data-state="settled"] .cup-motion-layers .die .dice-svg,
body.board-view #diceCupStage[data-state="ready"] .cup-motion-layers .die .dice-svg {
 animation:none!important;transform:none!important;
}
@media(max-width:760px){
body.board-view #diceCupStage .cup-static-shadow {top:calc(50% + 109px)!important;width:150px!important;height:32px!important;}
}
@media(prefers-reduced-motion:reduce){
 body.board-view #diceCupStage[data-state="roll"] .cup-motion-layers .die .dice-svg {animation:none!important;}
}
/* ===== END dice-cup-roll-v328.css ===== */

/* Small-update 41: predictable, touchable opening roll on mobile.
   Overrides legacy portrait CSS only for the nested cup. */
body.board-view #rollToStartOverlay .rts-roll-now {
  background:#ffcf38!important;color:#201800!important;border:2px solid #d6a500!important;
  font-weight:900!important;min-height:48px!important;min-width:132px!important;
  touch-action:manipulation!important;pointer-events:auto!important;
}
body.board-view #diceCupStage[data-state="ready"] #rollBtn.roll-cup-button:not([hidden]) {
  pointer-events:auto!important;z-index:30!important;touch-action:manipulation!important;
}
body.board-view #diceCupStage #cupRollAnimation {pointer-events:none!important;}
@media(max-width:600px){
 body.board-view #diceCupStage {width:210px!important;height:260px!important;min-height:260px!important;max-width:100%!important;}
 body.board-view #diceCupStage #cupRollAnimation {width:202px!important;height:242px!important;min-height:242px!important;}
 body.board-view #diceCupStage .cup-layers {width:200px!important;height:236px!important;}
 body.board-view #diceCupStage .cup-layers>img,
 body.board-view #diceCupStage .cup-roll-animation .roll-cup-ghost {width:200px!important;height:236px!important;}
 body.board-view #diceCupStage .cup-static-shadow {top:calc(50% + 83px)!important;width:120px!important;height:29px!important;}
 body.board-view #diceCupStage .cup-motion-layers .die {width:44px!important;height:44px!important;flex-basis:44px!important;}
 body.board-view .playbar,body.board-view:not(.classic-mode):not(.pawn-status-hidden) .playbar {min-height:270px!important;}
}
