/* v249: staged dice pour. Graphics do not affect scoring or network state. */
#viewDice .dice-pour-stage[hidden] { display: none !important; }
#viewDice .dice-pour-stage {
  position: relative;
  width: 100%;
  height: clamp(225px, 47vw, 285px);
  overflow: hidden;
  isolation: isolate;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: radial-gradient(ellipse at 62% 47%, #64d1ff 0%, #3883ed 42%, #15348d 100%);
  box-shadow: inset 0 2px 14px rgba(255,255,255,.25), 0 8px 20px rgba(27,61,149,.12);
  pointer-events: none;
}
#viewDice .dice-pour-stage::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 72%; height: 62%;
  left: 15%; top: 21%;
  border: 3px solid rgba(218,248,255,.28);
  border-radius: 50%;
  transform: rotate(-28deg);
  box-shadow: 0 0 24px rgba(129,228,255,.37), inset 0 0 18px rgba(158,235,255,.25);
}
#viewDice .dice-pour-illustration {
  position: absolute;
  z-index: 3;
  top: -18%;
  left: 50%;
  width: min(420px, 106%);
  height: 80%;
  object-fit: contain;
  transform: translateX(-50%) rotate(-5deg);
  transform-origin: 52% 35%;
  filter: drop-shadow(0 12px 13px rgba(6,21,92,.23));
  will-change: transform, opacity;
}
#viewDice .dice-pour-stage.is-shaking .dice-pour-illustration {
  animation: diceCupShake249 270ms ease-in-out infinite alternate;
}
#viewDice .dice-pour-stage.is-pouring .dice-pour-illustration {
  animation: diceCupTip249 900ms cubic-bezier(.2,.85,.35,1) both;
}
#viewDice .dice-pour-flights {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
}
#viewDice .dice-pour-die {
  position: absolute;
  top: 39%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(31px, 8vw, 45px);
  height: clamp(31px, 8vw, 45px);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.45);
  will-change: transform, opacity;
}
#viewDice .dice-pour-stage.is-pouring .dice-pour-die {
  animation: diceFlight249 850ms cubic-bezier(.15,.6,.28,1) var(--delay) both;
}
#viewDice .dice-pour-die-face {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  width: 100%; height: 100%;
  padding: 14%;
  box-sizing: border-box;
  border-radius: 9px;
  border: 1px solid #fefefe;
  background: linear-gradient(145deg, #fff 10%, #e3edff 90%);
  box-shadow: 3px 5px 0 #b4c6eb, 5px 11px 10px rgba(9,31,103,.28), inset 2px 2px 1px rgba(255,255,255,.96);
}
#viewDice .dice-pour-pip {
  width: 64%; height: 64%; border-radius: 50%; background: #245de2;
  box-shadow: inset 1px 1px 2px #15388c, 0 1px 0 rgba(255,255,255,.75);
}
#viewDice .dice-pour-caption {
  position: absolute;
  z-index: 5;
  left: 8px; right: 8px; bottom: 9px;
  text-align: center;
  font-weight: 750;
  font-size: 12px;
  letter-spacing: .03em;
  color: #f4fbff;
  text-shadow: 0 1px 6px rgba(4,24,94,.6);
}
#viewDice .dice-pour-stage.is-pouring .dice-pour-caption { color: #f5fdff; }
#viewDice.dice-pour-running #diceBoard .v2-die-card:not(.held) {
  opacity: .24;
  transform: scale(.86);
  transition: opacity .16s ease, transform .16s ease;
}
#viewDice.dice-pour-running #diceBoard .v2-die-card.held {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(28,108,243,.35));
}
@keyframes diceCupShake249 {
  from { transform: translateX(-50%) translate(-6px,3px) rotate(-15deg); }
  to { transform: translateX(-50%) translate(8px,-3px) rotate(12deg); }
}
@keyframes diceCupTip249 {
  0% { transform: translateX(-50%) rotate(-8deg) translateY(-6px); opacity: 1; }
  23% { transform: translateX(-50%) rotate(21deg) translateY(3px); opacity: 1; }
  52% { transform: translateX(-50%) rotate(30deg) translateY(-4px); opacity: 1; }
  80% { transform: translateX(-50%) rotate(7deg) translateY(-20px); opacity: 1; }
  100% { transform: translateX(-50%) rotate(0) translateY(-45px); opacity: 0; }
}
@keyframes diceFlight249 {
  0% { opacity: 0; transform: translate(-50%, -50%) translate(0,0) rotate(-90deg) scale(.35); }
  16% { opacity: 1; transform: translate(-50%, -50%) translate(var(--dx24), 17px) rotate(0deg) scale(.8); }
  53% { opacity: 1; transform: translate(-50%, -50%) translate(var(--dx82), 118px) rotate(var(--spin80)) scale(1.15); }
  72% { opacity: 1; transform: translate(-50%, -50%) translate(var(--dx), 98px) rotate(var(--spin)) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -50%) translate(var(--dx), 121px) rotate(var(--spin)) scale(1); }
}
@media (max-width: 440px) {
  #viewDice .dice-pour-stage { height: 228px; margin-bottom: 9px; }
  #viewDice .dice-pour-illustration { top: -22%; height: 85%; width: 110%; }
  #viewDice .dice-pour-stage.is-pouring .dice-pour-die { animation-name: diceFlightMobile249; }
  @keyframes diceFlightMobile249 {
    0% { opacity: 0; transform: translate(-50%,-50%) rotate(-70deg) scale(.45); }
    16% { opacity: 1; transform: translate(-50%,-50%) translate(var(--dx20),10px) rotate(20deg) scale(.85); }
    50% { opacity: 1; transform: translate(-50%,-50%) translate(var(--dx75),90px) rotate(var(--spin)) scale(1.07); }
    75% { opacity: 1; transform: translate(-50%,-50%) translate(var(--dx),78px) rotate(var(--spin)) scale(.97); }
    100% { opacity: 1; transform: translate(-50%,-50%) translate(var(--dx),100px) rotate(var(--spin)) scale(1); }
  }
}
@media (prefers-reduced-motion: reduce) {
  #viewDice .dice-pour-stage.is-shaking .dice-pour-illustration,
  #viewDice .dice-pour-stage.is-pouring .dice-pour-illustration,
  #viewDice .dice-pour-stage.is-pouring .dice-pour-die { animation: none !important; }
  #viewDice .dice-pour-stage.is-pouring .dice-pour-die {
    opacity: 1; transform: translate(-50%,-50%) translate(var(--dx),90px);
  }
}

#viewDice .dice-roll-screenreader { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* v251: The six animated dice become the permanent, touch-friendly tabletop. */
#viewDice .dice-pour-stage {
  pointer-events: auto;
  height: clamp(286px, 55vw, 330px);
  touch-action: manipulation;
}
#viewDice .dice-pour-illustration { pointer-events: none; height: 65%; top: -16%; }
#viewDice .dice-pour-flights {
  z-index: 6;
  left: 9px; right: 9px;
  top: auto; bottom: 28px;
  height: 144px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  grid-template-rows: repeat(2, minmax(0,1fr));
  align-items: center; justify-items: center;
  gap: 10px 7px;
  pointer-events: auto;
}
#viewDice .dice-pour-die {
  position: relative; top: auto; left: auto;
  width: min(58px, 16vw); height: min(58px, 16vw);
  display: grid; place-items: center;
  opacity: 1;
  transform: none;
  border: 0; padding: 0; margin: 0;
  background: none;
  overflow: visible;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: filter .16s ease, scale .16s ease;
}
#viewDice .dice-pour-die:disabled { cursor: default; }
#viewDice .dice-pour-die:focus-visible {
  outline: 3px solid #e0f2ff;
  outline-offset: 6px;
  border-radius: 12px;
}
#viewDice .dice-pour-die .dice-pour-die-face {
  border-radius: 12px;
  border: 2px solid #fff;
  box-shadow: 2px 4px 0 #b4c6eb, 5px 8px 12px rgba(9,31,103,.28), inset 2px 2px 1px #fff;
}
#viewDice .dice-pour-die.held { filter: drop-shadow(0 0 7px #a1eeff); }
#viewDice .dice-pour-die.held .dice-pour-die-face {
  border: 4px solid #ffce3f;
  background: linear-gradient(135deg,#fffdeb 0%,#ffefd3 100%);
}
#viewDice .dice-pour-die.held::after {
  content: "✓";
  position: absolute;
  z-index: 2;
  top: -10px; right: -10px;
  display: grid; place-items: center;
  width: 23px; height: 23px;
  color: #153271; background: #ffda5d;
  border: 2px solid #fff; border-radius: 50%;
  font-size: 14px; font-weight: 950;
  box-shadow: 0 2px 5px rgba(15,30,75,.25);
}
#viewDice .dice-pour-die.pending-die { opacity: 0; pointer-events: none; }
#viewDice .dice-pour-stage.is-shaking .dice-pour-die.held { opacity: 1; }
#viewDice .dice-pour-stage.is-pouring .dice-pour-die.is-flying {
  animation: diceFlightToTable251 950ms cubic-bezier(.18,.58,.29,1) var(--delay) both;
}
@keyframes diceFlightToTable251 {
  0% { transform: translate(var(--fly-x),var(--fly-y)) rotate(var(--spin)) scale(.46); opacity: 0; }
  15% { opacity: 1; }
  60% { transform: translate(var(--fly-x20),-18px) rotate(35deg) scale(1.13); opacity: 1; }
  79% { transform: translate(0,7px) rotate(-12deg) scale(.94); opacity: 1; }
  100% { transform: translate(0,0) rotate(0) scale(1); opacity: 1; }
}
#viewDice .v2-dice-board.dice-board-hidden { display: none !important; }
#viewDice .dice-pour-caption { bottom: 5px; }
#viewDice .dice-roll-controls {
  margin: -3px 0 12px; display: flex;
  align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
#viewDice .dice-roll-controls[hidden],
#viewDice .dice-score-options[hidden] { display: none !important; }
#viewDice .dice-roll-controls .dice-hold-hint {
  color: #395172; font-size: 13px; font-weight: 650; flex: 1 1 170px;
}
#viewDice .dice-roll-controls button {
  padding: 11px 14px; min-height: 43px;
  border-radius: 12px;
  background: #e9effc; color: #2147a2; font-weight: 800;
}
#viewDice .dice-score-options {
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid #cdddf5; border-radius: 16px;
  background: #f7faff;
}
#viewDice .dice-score-heading {
  display: flex; justify-content: space-between; gap: 8px;
  align-items: center; margin-bottom: 12px; color: #1d396c;
}
#viewDice .dice-score-heading h3 { margin: 0; font-size: 1rem; }
#viewDice .dice-score-list { display: grid; gap: 8px; max-height: 310px; overflow-y: auto; }
#viewDice .dice-score-option {
  width: 100%; display: flex;
  justify-content: space-between; align-items: center;
  min-height: 46px; padding: 10px 12px;
  border: 1px solid #d4e0f6; border-radius: 11px;
  color: #1e3866; background: white;
  text-align: left;
}
#viewDice .dice-score-option.is-best {
  border-color: #2d5ce2; box-shadow: 0 0 0 1px rgba(45,92,226,.15);
}
#viewDice .dice-score-option strong { color: #2754c9; }
@media (max-width: 440px) {
  #viewDice .dice-pour-stage { height: 302px; }
  #viewDice .dice-pour-illustration { top: -14%; height: 64%; width: 112%; }
  #viewDice .dice-pour-flights { bottom: 24px; height: 148px; }
  #viewDice .dice-pour-stage.is-pouring .dice-pour-die.is-flying { animation-name: diceFlightToTable251; }
}
@media (prefers-reduced-motion: reduce) {
  #viewDice .dice-pour-stage.is-pouring .dice-pour-die.is-flying {
    animation: none !important; opacity: 1; transform: none;
  }
}

#viewDice .dice-pour-stage.is-pouring .dice-pour-die:not(.is-flying) { animation: none !important; }
