/* Chapter I uses the same central copper-and-blue die as chapter II.
   Load last: full-screen reading sheets must not expand this small panel. */
.modal.screen-modal.die-sheet,
html[data-immersion='true'] .modal.screen-modal.die-sheet {
  position: fixed;
  inset: calc((var(--viewport-height, 100dvh) + env(safe-area-inset-top) - env(safe-area-inset-bottom)) / 2) auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(calc(100vw - 24px), 430px);
  max-width: 430px;
  height: auto;
  max-height: calc(var(--viewport-height, 100dvh) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d4af7394;
  border-radius: 12px;
  background: linear-gradient(145deg, #153b3cfa, #08262efa);
  box-shadow: 0 25px 100px #000a;
}
.modal.screen-modal.die-sheet::backdrop {
  background: #031319aa;
  backdrop-filter: blur(5px);
}
/* Keep the scene painting behind the throw, without a second instrument
   window or a second die showing through the translucent backdrop. */
body:has(#overlay.die-sheet[open]) #event-card .reader-panel,
body:has(#overlay.die-sheet[open]) #event-card .screen-pager { visibility: hidden; }
.modal.screen-modal.die-sheet .modal-content,
html[data-immersion='true'] .modal.screen-modal.die-sheet .modal-content {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  max-height: inherit;
  padding: 18px;
  gap: 8px;
  overflow: hidden;
}
.modal.screen-modal.die-sheet .modal-content::before { content: none; }
.modal.screen-modal.die-sheet .overlay-tools {
  min-height: 44px;
  padding: 0;
  background: none;
}
.modal.screen-modal.die-sheet .sheet-head {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
}
.modal.screen-modal.die-sheet .sheet-head h2 {
  margin: 0;
  color: #f5dbac;
  font-size: 25px;
  line-height: 1.12;
  text-align: center;
}
.modal.screen-modal.die-sheet .sheet-head .eyebrow {
  margin-bottom: 5px;
  text-align: center;
}
.modal.screen-modal.die-sheet .sheet-body.die-reveal {
  flex: 0 1 auto;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  gap: 8px;
}
.modal.screen-modal.die-sheet .die-area,
.screen-card[data-activity='die'] .screen-widget .die-area {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  gap: 8px;
  text-align: center;
}
.modal.screen-modal.die-sheet .die,
.screen-card[data-activity='die'] .screen-widget .die {
  display: grid;
  place-items: stretch;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  flex: 0 0 auto;
  width: 110px;
  height: 110px;
  padding: 18px;
  gap: 8px;
  border: 2px solid #735431;
  border-radius: 18px;
  background: linear-gradient(140deg, #f0d9ad, #b9905c);
  box-shadow: inset 3px 3px 4px #fff2cb9c, inset -4px -4px 6px #79562d80, 0 8px 22px #0006;
}
.modal.screen-modal.die-sheet .die i,
.screen-card[data-activity='die'] .screen-widget .die i {
  display: block;
  place-self: stretch;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.modal.screen-modal.die-sheet .die i.pip,
.screen-card[data-activity='die'] .screen-widget .die i.pip {
  border-radius: 50%;
  background: #101010;
  box-shadow: inset 1px 1px 2px #000;
}
.modal.screen-modal.die-sheet .die.rolling,
.screen-card[data-activity='die'] .screen-widget .die.rolling {
  animation: chapter-one-die-spin .16s linear infinite alternate;
}
.modal.screen-modal.die-sheet p.sheet-message {
  max-width: 32ch;
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  color: #fff1d6;
  text-align: center;
}
.modal.screen-modal.die-sheet .sheet-actions {
  display: grid;
  flex: 0 0 auto;
  width: 100%;
  margin: 2px 0 0;
  padding: 0;
  gap: 7px;
}
.modal.screen-modal.die-sheet .sheet-actions > button {
  min-height: 46px;
  margin: 0;
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.25;
}
@keyframes chapter-one-die-spin {
  from { transform: rotate(-13deg) translateY(-3px); }
  to { transform: rotate(17deg) translateY(2px); }
}
@media (max-width: 360px), (max-height: 590px) {
  .modal.screen-modal.die-sheet .modal-content,
  html[data-immersion='true'] .modal.screen-modal.die-sheet .modal-content { padding: 12px; gap: 6px; }
  .modal.screen-modal.die-sheet .sheet-head h2 { font-size: 22px; }
  .modal.screen-modal.die-sheet p.sheet-message { font-size: 15px; }
  .modal.screen-modal.die-sheet .die-area { padding-block: 7px; }
}
@media (orientation: landscape) and (max-height: 430px) {
  .modal.screen-modal.die-sheet .modal-content:has(> .overlay-tools) { display: flex; }
  .modal.screen-modal.die-sheet .sheet-body.die-reveal { flex-direction: row; gap: 14px; }
  .modal.screen-modal.die-sheet .die-area { padding: 4px; }
  .modal.screen-modal.die-sheet .sheet-head .eyebrow { display: none; }
  .modal.screen-modal.die-sheet p.sheet-message { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .modal.screen-modal.die-sheet .die.rolling,
  .screen-card[data-activity='die'] .screen-widget .die.rolling { animation: none; }
}
