/* Same surfaces, spacing and controls as the catalog. Shadow separates a modal task. */
html.random-game-open { overflow: hidden; }
.finder-actions:has(.random-game-trigger) { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.catalog-top:has(.random-game-trigger) { flex-wrap: wrap; gap: var(--space-4); }
.catalog-top > .random-game-trigger { margin-left: auto; }
.random-game-dialog {
  width: min(26rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: var(--space-6);
  border: 0;
  border-radius: var(--radius-4);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-overlay);
  overflow: auto;
  overscroll-behavior: contain;
}
.random-game-dialog::backdrop { background: var(--color-scrim); }
.random-game-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.random-game-heading h2 { margin: 0; font-size: 1.5rem; line-height: 1.25; }
.random-game-heading .icon-button { flex-shrink: 0; }
.random-game-stage { margin-top: var(--space-3); min-height: 24rem; display: grid; place-items: center; }
.random-game-stage:has(.game-card) { min-height: 0; }
.random-game-toss { display: grid; place-items: center; min-height: 17.5rem; width: 100%; }
.random-game-toss[hidden], .random-game-dialog [hidden] { display: none; }
/* Representative red sampled from the existing mascot body; separate from UI accent. */
.random-game-toss canvas { --dice-mascot-red: #e6282c; display: block; width: min(100%, 20rem); height: auto; aspect-ratio: 8 / 7; }
.random-game-result { width: 100%; min-width: 0; }
.random-game-result .game-card { width: 100%; cursor: pointer; }
.random-game-result .game-card-body { min-height: 0; }
.random-game-status { margin: var(--space-4) 0; font-size: .875rem; line-height: 1.45; }
.random-game-status.sr-only { margin: 0; }
.random-game-status.sr-only + .random-game-actions { margin-top: var(--space-4); }
.random-game-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.random-game-actions > * { flex: 1 1 auto; justify-content: center; }
.random-game-trigger:active, .random-game-actions button:active { background: var(--color-surface-hover); }
@media (max-width: 760px) {
  .random-game-dialog { padding: var(--space-4); }
  .catalog-top > .random-game-trigger { margin-left: 0; }
}
@media (max-height: 620px) and (min-width: 761px) {
  .random-game-stage { min-height: 20rem; }
}
@media (prefers-reduced-motion: reduce) {
  .random-game-toss { display: none; }
}
@media (prefers-contrast: more) {
  .random-game-dialog { outline: 2px solid var(--color-text); }
}
