.stemPage .stemTableHero {
  margin: 0 0 1rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #80679b;
  border-radius: 1rem;
  background: radial-gradient(ellipse at 90% 10%, #4b315b 0, transparent 55%), #211b2d;
  color: #f4eafd;
}
.stemTableHero h1 { margin: .35rem 0; }
.stemTableHero p { margin-bottom: 0; }
.stemTableHero .eyebrow { color: #debbf6; }
.stemPage .stemLobbyBuilder { margin-top: 1rem; }
.stemPage .stemTableControls, .stemPage .stemDiceControls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(110px, 100%), 1fr));
  gap: .6rem;
  align-items: end;
}
.stemPage .stemTableControls { grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr)); }
.stemTableControls + button { margin-top: .6rem; }
.stemTableControls label, .stemDiceControls label { margin: 0; }
.stemTableControls select, .stemDiceControls input, .stemDiceControls select { width: 100%; }
.stemTableControls [hidden], .stemPage [hidden] { display: none; }
.stemPage .stemPendingDice { margin-block: .75rem; }
.stemPage .stemPendingDice:empty { display: none; }
body:has(dialog[open], .appDialogLayer:not([hidden])) .stemChatBubble { visibility: hidden; }
.stemDiceResult {
  display: grid;
  gap: .45rem;
  padding: .65rem .75rem;
  margin-block: .5rem;
  border: 1px solid #81639b;
  border-radius: .65rem;
  color: #f7eeff;
  background: #271d34;
}
.stemDiceSummary { display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.stemDiceSummary strong { text-transform: capitalize; }
.stemDiceTotal { color: #f5ddaf; font-size: 1.35rem; font-weight: 700; }
.stemDiceFaces { display: flex; flex-wrap: wrap; gap: .45rem; }
.stemDie {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  color: #1b1025;
  background: linear-gradient(145deg, #f0cefa, #ae81d2);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  clip-path: polygon(50% 0, 97% 25%, 97% 75%, 50% 100%, 3% 75%, 3% 25%);
}
.stemDie-4 { clip-path: polygon(50% 0, 100% 89%, 0 89%); padding-top: .45rem; box-sizing: border-box; }
.stemDie-6 { clip-path: inset(3% round 17%); }
.stemDie-8 { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.stemDie-100 { clip-path: circle(48%); }
.stemDieDiscarded { background: #877590; color: #19131e; }
.stemDieReveal { animation: stemDieReveal .32s ease-out both; }
@keyframes stemDieReveal { from { transform: translateY(-.45rem) rotate(-35deg) scale(.78); opacity: .5; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stemDieReveal { animation: none; } }
.stemDiceFormula { color: #e0cfe9; font-variant-numeric: tabular-nums; }
.stemDiceHistory { list-style: none; padding: 0; max-height: 24rem; overflow: auto; }
.stemDiceHistory > li { margin-top: .6rem; }
.stemDiceTray[open] > summary { margin-bottom: .75rem; }
.stemPartyVitals { color: #dcc7e9; font-size: .82rem; }
.stemTableArt { margin-block: .75rem; }
.stemTableArt img { width: 100%; max-height: 25rem; object-fit: contain; border-radius: .5rem; }
.stemTableArt figcaption { margin-top: .45rem; overflow-wrap: anywhere; }
.stemTableArt figure { margin: 0; }
@media (max-width: 480px) {
  .stemPage { padding: .7rem; }
  .stemPage .stemPanel { padding: .8rem; }
  .stemTableControls button, .stemDiceControls button { min-height: 44px; }
}
