/* Spud & Root: town/bar.html, Ship, Captain and Crew (bar-dice.js).
 * The bar top in dark oak under the lamp, a red leather mat with chalk
 * wells for ship, captain, crew and cargo, a green leather tray the dice
 * land on, a leather cup, ivory dice, and the opponent standing on the bar.
 * --die is set by the script from the room on the bar, and so are the
 * places of the cup, the tray and the opponent. */

.bdice {
  --die: 48px;
  --oak-deep: #3a2214;
  --oak: #5a341c;
  --brass: #d9a441;
  --leather: #7a1f1f;
  --ivory: #fbf1da;
  --chalk: rgba(255, 244, 222, 0.62);
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  /* clear of the engine's buttons above and its captions below */
  padding: 66px 16px 88px;
  box-sizing: border-box;
  font-family: var(--font-body);
  color: var(--ink);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.bdice *,
.bdice *::before,
.bdice *::after {
  box-sizing: border-box;
}
.bdice [hidden] {
  display: none !important;
}

.bdice__frame {
  position: relative;
  width: 100%;
  max-width: 880px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

/* ---------- Scoreline and status ---------- */
.bdice__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bdice__scores {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}
.bdice__score {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 42px;
  padding: 3px 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  background: var(--cream);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s;
}
.bdice__score.is-on {
  background: var(--logo-yellow);
}
.bdice__score--them {
  padding-right: 4px;
}
.bdice__pts {
  min-width: 1.6em;
  padding: 0 6px;
  font-size: 1.25rem;
  line-height: 1.3;
  text-align: center;
  color: var(--white);
  background: var(--ink);
  border-radius: var(--radius-pill);
}
.bdice__pts.is-bump {
  animation: bdice-bump 0.45s var(--ease-spring);
}
@keyframes bdice-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.45); background: #e2382c; }
  100% { transform: scale(1); }
}
.bdice__face {
  width: 34px;
  height: 34px;
  object-fit: contain;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.bdice__mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  color: var(--cream);
  text-align: center;
  text-shadow: 0 2px 0 var(--ink);
}
.bdice__round {
  font-size: 0.78rem;
  color: var(--brass);
}

.bdice__statusrow {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
}
.bdice__status,
.bdice__beat {
  margin: 0;
  padding: 6px 16px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.25;
  background: var(--white);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.bdice__status {
  flex: 0 1 auto;
  min-width: 0;
  min-height: calc(1.25em + 18px);
  text-align: center;
}
.bdice__beat {
  flex: 0 0 auto;
  white-space: nowrap;
  background: var(--logo-yellow);
}
.bdice__beat b {
  font-weight: 700;
}

/* ---------- The bar top ---------- */
.bdice__bar {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border: var(--stroke) solid var(--ink);
  border-radius: 22px;
  box-shadow: 6px 6px 0 var(--ink);
  /* the lamp's pool of light on polished oak, and a faint grain */
  background:
    radial-gradient(ellipse 65% 75% at 50% 0%, rgba(255, 190, 110, 0.26), rgba(255, 190, 110, 0) 70%),
    repeating-linear-gradient(179deg, rgba(0, 0, 0, 0) 0 26px, rgba(0, 0, 0, 0.1) 26px 28px, rgba(0, 0, 0, 0) 28px 61px, rgba(255, 214, 160, 0.06) 61px 63px),
    var(--oak);
}
/* the dice landing: the whole bar takes it */
.bdice__bar.is-hit {
  animation: bdice-thump 0.22s ease-out;
}
@keyframes bdice-thump {
  0% { transform: translateY(0); }
  30% { transform: translateY(3px); }
  100% { transform: translateY(0); }
}
/* the bar's front edge: darker oak with a brass rail */
.bdice__bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: max(14px, calc(var(--die) * 0.3));
  background: var(--oak-deep);
  border-top: 3px solid var(--brass);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* the tray the dice land on: green leather, stitched */
.bdice__tray {
  position: absolute;
  background:
    radial-gradient(ellipse 70% 60% at 50% 35%, rgba(255, 240, 200, 0.12), rgba(255, 240, 200, 0) 70%),
    #2f4b38;
  border: var(--stroke) solid var(--ink);
  border-radius: 18px;
  box-shadow: inset 0 0 0 5px #3c5d46, 4px 4px 0 rgba(20, 11, 6, 0.6);
  pointer-events: none;
}
.bdice__tray::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px dashed rgba(241, 211, 154, 0.55);
  border-radius: 11px;
}

/* the mat: deep red leather with chalk lines */
.bdice__mat {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px 6px;
  background: var(--leather);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 4px 4px 0 var(--ink), inset 0 0 0 3px #8e2a28;
  z-index: 1;
}
.bdice__crew {
  display: flex;
  align-items: flex-start;
  gap: inherit;
}
/* a phone held upright: the cargo on its own row */
.bdice.is-stacked .bdice__mat {
  flex-direction: column;
  align-items: center;
  row-gap: 4px;
}
.bdice.is-stacked .bdice__slot--cargo {
  margin-left: 0;
}
.bdice__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bdice__wells {
  display: flex;
  gap: 6px;
  padding: 0 4px;
  border: 2px dashed var(--chalk);
  border-radius: 12px;
}
.bdice__slot--cargo {
  margin-left: 4px;
}
.bdice__well {
  position: relative;
  display: block;
  width: calc(var(--die) + 12px);
  height: calc(var(--die) + 12px);
  border: 2px dashed var(--chalk);
  border-radius: 12px;
}
.bdice__wells .bdice__well {
  width: calc(var(--die) + 6px);
  height: calc(var(--die) + 8px);
  border: 0;
}
/* a die just come in: the well lights up */
.bdice__well.is-hit,
.bdice__wells.is-hit {
  animation: bdice-well 0.6s ease-out;
}
@keyframes bdice-well {
  0% { box-shadow: 0 0 0 0 rgba(255, 222, 0, 0.9); background-color: rgba(255, 222, 0, 0.35); }
  100% { box-shadow: 0 0 0 14px rgba(255, 222, 0, 0); background-color: rgba(255, 222, 0, 0); }
}
/* the number the well is waiting for, in chalk */
.bdice__well[data-need]::before {
  content: attr(data-need);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: calc(var(--die) * 0.55);
  color: rgba(255, 244, 222, 0.22);
}
.bdice__well.is-next {
  border-color: var(--logo-yellow);
}
.bdice__well.is-next::before {
  color: rgba(255, 222, 0, 0.75);
}
.bdice__well.is-full::before {
  content: none;
}
.bdice__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: max(11px, calc(var(--die) * 0.25));
  line-height: 1.2;
  color: var(--cream);
  white-space: nowrap;
}
.bdice__label b {
  display: inline-block;
  min-width: 1.4em;
  color: var(--logo-yellow);
}

/* the opponent, standing on the bar; the script sets the place and the pose */
.bdice__opp {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.bdice__opp img {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: inherit;
  animation: bdice-breathe 2.8s ease-in-out infinite;
}
.bdice--pepper .bdice__opp img {
  animation: bdice-bob 0.9s ease-in-out infinite;
}
@keyframes bdice-breathe {
  50% { transform: scaleY(1.018); }
}
@keyframes bdice-bob {
  50% { transform: translateY(-3px) scaleY(1.02); }
}
/* their turn: leaning to the cup */
.bdice__opp.is-up,
.bdice__opp.is-shake {
  transform: translateX(-4%) rotate(-6deg);
}
.bdice__opp.is-shake img {
  animation: bdice-jig 0.16s linear infinite;
}
.bdice--pepper .bdice__opp.is-shake img {
  animation: bdice-hopjig 0.32s ease-in-out infinite;
}
@keyframes bdice-jig {
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}
@keyframes bdice-hopjig {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-12%) rotate(-5deg); }
  50% { transform: translateY(0) rotate(0); }
  75% { transform: translateY(-8%) rotate(5deg); }
}
.bdice__opp.is-hop img,
.bdice__opp.is-cheer img {
  animation: bdice-hop 0.5s cubic-bezier(0.3, 0.7, 0.4, 1);
}
.bdice__opp.is-cheer img {
  animation-iteration-count: 3;
}
@keyframes bdice-hop {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  15% { transform: translateY(0) scale(1.08, 0.9); }
  45% { transform: translateY(-22%) scale(0.95, 1.06); }
  80% { transform: translateY(0) scale(1.05, 0.94); }
}
.bdice__opp.is-nod img {
  animation: bdice-nod 0.6s ease-in-out;
}
@keyframes bdice-nod {
  30% { transform: scaleY(0.94); }
  60% { transform: scaleY(1.01); }
}
.bdice__opp.is-wow img {
  animation: bdice-wow 0.45s ease-out;
}
@keyframes bdice-wow {
  30% { transform: translateY(-8%) rotate(4deg); }
}
.bdice__opp.is-slump {
  transform: translateY(3%) rotate(9deg) scale(1, 0.94);
}
.bdice__opp.is-slump img {
  animation: none;
}

/* the cup: brown leather, stitched rim; the script slides it from end to end
   and tips it; held, it shakes */
.bdice__cup {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  z-index: 3;
  touch-action: none;
}
.bdice__cupin {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 90%;
}
.bdice__cup svg {
  display: block;
  width: 100%;
  height: 100%;
}
.bdice__cup[aria-disabled="true"] {
  cursor: default;
}
@media (hover: hover) {
  .bdice__cup.is-ready:hover .bdice__cupin {
    transform: translateY(-3px) rotate(-3deg);
  }
  .bdice__btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--ink);
  }
}
.bdice__cup.is-ready .bdice__cupin {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.bdice__cupin.is-shaking {
  animation: bdice-shake 0.12s linear infinite;
}
@keyframes bdice-shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-3px, -5px) rotate(-8deg); }
  75% { transform: translate(3px, -2px) rotate(8deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* the dice: ivory, rounded, ink outline, black pips */
.bdice__die {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--die);
  height: var(--die);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: calc(var(--die) * 0.12);
  background: var(--ivory);
  border: max(2px, calc(var(--die) * 0.05)) solid var(--ink);
  border-radius: 24%;
  box-shadow: max(2px, calc(var(--die) * 0.05)) max(2px, calc(var(--die) * 0.05)) 0 var(--ink);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  will-change: transform;
}
.bdice__pip {
  align-self: center;
  justify-self: center;
  width: 62%;
  height: 62%;
  background: #1b1718;
  border-radius: 50%;
  visibility: hidden;
}

/* the first go: a finger on the cup, and what to do in words beside it */
.bdice__hint {
  position: absolute;
  z-index: 5;
  width: 0;
  height: 0;
  pointer-events: none;
}
/* (pointing down from above, so none of it hangs below the bar's edge) */
.bdice__finger {
  position: absolute;
  left: -21px;
  top: -65px;
  width: 42px;
  height: 65px;
  transform-origin: 50% 100%;
  animation: bdice-press 1.6s ease-in-out infinite;
}
.bdice__finger svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(180deg);
}
.bdice__finger::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 3px solid #fff;
  border-radius: 50%;
  opacity: 0;
  animation: bdice-ring 1.6s ease-out infinite;
}
@keyframes bdice-press {
  0%, 100% { transform: translate(10px, -26px); opacity: 0; }
  20% { transform: translate(0, -6px); opacity: 1; }
  30%, 70% { transform: translate(0, 0) scale(0.94); opacity: 1; }
  85% { transform: translate(0, -10px); opacity: 0.9; }
}
@keyframes bdice-ring {
  0%, 28% { transform: scale(0.6); opacity: 0; }
  32% { opacity: 1; }
  60% { transform: scale(2.2); opacity: 0; }
  100% { opacity: 0; }
}
.bdice__hinttext {
  position: absolute;
  left: var(--text-left, 60px);
  top: 0;
  width: max-content;
  max-width: min(11em, var(--text-w, 11em));
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: max(15px, calc(var(--die) * 0.3));
  line-height: 1.2;
  color: var(--white);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
}

/* words that pop up over a well, or over the bar */
.bdice__pop {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, -100%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: max(16px, calc(var(--die) * 0.38));
  line-height: 1;
  white-space: nowrap;
  color: var(--logo-yellow);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  pointer-events: none;
  animation: bdice-rise 1.2s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
.bdice__pop--cargo {
  font-size: max(24px, calc(var(--die) * 0.62));
  color: var(--white);
}
@keyframes bdice-rise {
  0% { transform: translate(-50%, -60%) scale(0.5); opacity: 0; }
  15% { transform: translate(-50%, -100%) scale(1.12); opacity: 1; }
  30% { transform: translate(-50%, -110%) scale(1); }
  75% { opacity: 1; }
  100% { transform: translate(-50%, -180%); opacity: 0; }
}

/* the round's result, over the open bar */
.bdice__banner {
  position: absolute;
  left: 50%;
  top: 60%;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 8px 20px;
  transform: translate(-50%, -50%);
  text-align: center;
  background: var(--cream);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  animation: bdice-pop 0.3s var(--ease-spring);
  pointer-events: none;
}
.bdice__banner.is-you {
  background: var(--logo-yellow);
}
.bdice__banner b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
}
.bdice__banner span {
  font-family: var(--font-display);
  font-size: 0.95rem;
}
@keyframes bdice-pop {
  from { transform: translate(-50%, -50%) scale(0.85); }
  to { transform: translate(-50%, -50%) scale(1); }
}

/* ---------- Buttons ---------- */
.bdice__controls {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
}
.bdice__btn {
  min-height: 50px;
  min-width: 120px;
  padding: 10px 24px;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  background: var(--white);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.15s, opacity 0.15s;
}
.bdice__btn--roll,
.bdice__btn--again {
  background: var(--logo-yellow);
}
.bdice__btn--help {
  min-width: 50px;
  width: 50px;
  padding: 0;
  font-size: 1.3rem;
}
.bdice__btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}
/* not now: a muted card colour, still focusable so focus doesn't jump */
.bdice__btn[aria-disabled="true"] {
  color: #776b66;
  background: #cbbfa9;
  cursor: default;
  transform: none;
  box-shadow: var(--shadow-sm);
}
.bdice__btn:focus-visible,
.bdice__cup:focus-visible {
  outline: 3px solid var(--logo-yellow);
  outline-offset: 4px;
}
.bdice__btn--roll:focus-visible,
.bdice__btn--again:focus-visible {
  outline-color: var(--white);
}

/* How to play: above the buttons (beside them on landscape phones) */
.bdice__help {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 9;
  width: min(400px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 12px 16px;
  font-size: 0.95rem;
  line-height: 1.4;
  background: var(--cream);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.bdice__help p {
  margin: 0 0 6px;
}
.bdice__help .bdice__helptitle {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.bdice__help p:last-child {
  margin: 0;
}

/* ---------- Match over: a card along the bottom, over the buttons ---------- */
.bdice__card {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 96px;
  width: min(420px, calc(100% - 24px));
  padding: 14px 16px 16px;
  text-align: center;
  background: var(--cream);
  border: var(--stroke) solid var(--ink);
  border-radius: 20px;
  box-shadow: 6px 6px 0 var(--ink);
  transform: translateX(-50%);
  animation: bdice-card 0.4s var(--ease-spring);
}
.bdice__card.is-win {
  background: #fff6c4;
}
@keyframes bdice-card {
  from { translate: 0 40px; opacity: 0; }
  to { translate: 0 0; opacity: 1; }
}
.bdice__cardtitle {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.15;
}
.bdice__cardscore {
  margin: 4px 0 12px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--ink-soft);
}
.bdice__cardbtns {
  display: flex;
  gap: 10px;
}
.bdice__cardbtns .bdice__btn {
  min-width: 0;
}
.bdice__cardbtns .bdice__btn--again {
  flex: 1 1 auto;
}

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  /* room at the bottom for the engine's captions */
  .bdice {
    padding: 66px 12px 96px;
  }
  .bdice__frame {
    gap: 8px;
  }
  .bdice__score {
    min-height: 38px;
    padding: 2px 10px;
    font-size: 0.95rem;
  }
  .bdice__score--them {
    padding-right: 3px;
  }
  .bdice__face {
    width: 30px;
    height: 30px;
  }
  .bdice__mid {
    font-size: 0.8rem;
  }
  .bdice__status,
  .bdice__beat {
    padding: 5px 12px;
    font-size: 0.9rem;
  }
  .bdice__btn {
    min-height: 48px;
    min-width: 104px;
    padding: 8px 18px;
  }
  .bdice__btn--help {
    min-width: 48px;
    width: 48px;
  }
  .bdice__mat {
    gap: 5px;
    padding: 6px 7px 4px;
  }
  .bdice__well {
    width: calc(var(--die) + 10px);
    height: calc(var(--die) + 10px);
    border-radius: 10px;
  }
  .bdice__wells {
    gap: 4px;
    padding: 0 3px;
  }
  .bdice__wells .bdice__well {
    width: calc(var(--die) + 4px);
    height: calc(var(--die) + 6px);
  }
  .bdice__slot--cargo {
    margin-left: 2px;
  }
  .bdice__card {
    bottom: 104px;
  }
}
@media (max-width: 360px) {
  .bdice {
    padding-bottom: 108px;
  }
  .bdice__mid > span:first-child {
    display: none;
  }
  .bdice__btn {
    min-width: 0;
    padding: 8px 14px;
  }
  .bdice__card {
    bottom: 112px;
  }
}

/* Landscape phones: scoreline and status side by side, the buttons in a
   column beside the bar */
@media (max-height: 520px) and (orientation: landscape) {
  .bdice {
    padding: 64px 16px 64px;
  }
  .bdice__frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px 12px;
  }
  .bdice__head {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .bdice__scores {
    flex: 0 1 auto;
    gap: 10px;
  }
  .bdice__score {
    min-height: 36px;
    padding: 2px 10px;
    font-size: 0.9rem;
    box-shadow: 3px 3px 0 var(--ink);
  }
  .bdice__face {
    width: 28px;
    height: 28px;
  }
  .bdice__mid {
    font-size: 0.78rem;
  }
  .bdice__statusrow {
    flex: 0 1 auto;
    justify-content: flex-end;
  }
  .bdice__status,
  .bdice__beat {
    padding: 4px 12px;
    font-size: 0.88rem;
    box-shadow: 3px 3px 0 var(--ink);
  }
  .bdice__bar {
    grid-column: 1;
    grid-row: 2;
  }
  .bdice__controls {
    grid-column: 2;
    grid-row: 2;
    flex-direction: column;
    justify-content: flex-start;
    padding: 2px 4px 0 0;
  }
  .bdice__btn {
    min-height: 44px;
    min-width: 116px;
    padding: 6px 14px;
  }
  .bdice__btn--help {
    min-width: 44px;
    width: 44px;
  }
  .bdice__help {
    left: auto;
    right: calc(100% + 14px);
    bottom: auto;
    top: 0;
    width: min(380px, 62vw);
    transform: none;
  }
  .bdice__card {
    bottom: 10px;
  }
}

/* opts.reduceMotion (and the system setting): nothing shakes, bobs or pops;
   the poses still change, at once */
.bdice.is-reduced .bdice__cupin.is-shaking,
.bdice.is-reduced .bdice__banner,
.bdice.is-reduced .bdice__card,
.bdice.is-reduced .bdice__opp img,
.bdice.is-reduced .bdice__bar.is-hit,
.bdice.is-reduced .bdice__pts.is-bump,
.bdice.is-reduced .bdice__well.is-hit,
.bdice.is-reduced .bdice__finger,
.bdice.is-reduced .bdice__finger::before {
  animation: none;
}
.bdice.is-reduced .bdice__opp {
  transition: none;
}
.bdice.is-reduced .bdice__pop {
  animation: bdice-fade 1.2s steps(1, end) forwards;
}
@keyframes bdice-fade {
  0% { transform: translate(-50%, -110%); opacity: 1; }
  100% { transform: translate(-50%, -110%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bdice__cupin.is-shaking,
  .bdice__banner,
  .bdice__card,
  .bdice__opp img,
  .bdice__bar.is-hit,
  .bdice__pts.is-bump,
  .bdice__finger,
  .bdice__finger::before {
    animation: none;
  }
}
