:root {
  color-scheme: dark;
  --bg: #101217;
  --panel: rgba(14, 16, 22, 0.82);
  --panel-2: rgba(27, 31, 40, 0.9);
  --line: rgba(245, 241, 232, 0.18);
  --text: #f5f1e8;
  --muted: #bbb3a5;
  --gold: #e7b75f;
  --green: #69c48f;
  --red: #df6d62;
  --blue: #70a9cf;
  --ink: #0c0d10;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(16, 18, 23, 0.92), #101217),
    repeating-linear-gradient(90deg, #151820 0 2px, #111319 2px 4px);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1280px, calc(100vw - 24px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 10px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0 10px;
}

.top-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.2vw, 2.25rem);
  line-height: 1.02;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.3rem, 2vw, 2rem);
  line-height: 1.12;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.25;
}

.start-panel,
.summary-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 24px;
  align-items: stretch;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(36, 42, 51, 0.96), rgba(19, 22, 28, 0.96));
  padding: 26px;
}

.start-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 620px;
}

.start-copy p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.platform-status {
  max-width: 520px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.primary-action,
.secondary-action,
.icon-action {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, filter 160ms ease;
}

.primary-action {
  width: fit-content;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 18px;
  color: var(--ink);
  background: var(--gold);
}

.secondary-action {
  min-height: 38px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(36, 42, 51, 0.94);
  border: 1px solid var(--line);
}

.icon-action {
  min-height: 34px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(12, 13, 16, 0.7);
  border: 1px solid var(--line);
}

.primary-action:hover,
.secondary-action:hover,
.icon-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.save-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 5, 7, 0.72);
  backdrop-filter: blur(5px);
}

.save-gate-card {
  width: min(540px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(36, 42, 51, 0.98), rgba(13, 15, 20, 0.98));
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.save-gate-card h2 {
  margin-bottom: 10px;
}

.save-gate-card p {
  color: var(--muted);
  line-height: 1.55;
}

.save-gate-auth {
  display: grid;
  gap: 12px;
  margin: 16px 0 14px;
}

.save-gate-form-note {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.save-gate-auth label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.save-gate-auth label span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.save-gate-auth small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.save-gate-auth input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 10, 14, 0.78);
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

.save-gate-auth input::placeholder {
  color: rgba(245, 233, 207, 0.42);
}

.save-gate-auth input:focus {
  border-color: rgba(231, 183, 95, 0.72);
  outline: 2px solid rgba(231, 183, 95, 0.22);
  outline-offset: 1px;
}

.save-gate-auth input[aria-invalid="true"] {
  border-color: rgba(214, 74, 63, 0.88);
  outline: 2px solid rgba(214, 74, 63, 0.2);
}

.save-gate-auth em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.35;
}

.save-gate-status {
  min-height: 20px;
  margin: 0;
  color: var(--gold);
  font-size: 0.85rem;
  line-height: 1.35;
}

.save-gate-status.is-error {
  color: #ffd3c9;
}

.save-gate-status.is-success {
  color: #c9f0c3;
}

.save-gate-actions {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.save-gate.is-confirmation .save-gate-auth,
.save-gate.is-confirmation .save-gate-actions {
  display: none;
}

.save-gate-confirmation {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.save-gate-confirmation h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
}

.save-gate-confirmation strong {
  color: var(--gold);
  overflow-wrap: anywhere;
}

.save-gate-confirmation .primary-action {
  justify-self: start;
  margin-top: 4px;
  min-height: 42px;
  padding: 0 16px;
}

.save-gate-actions .primary-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  margin-top: 0;
  padding: 0 16px;
  text-align: center;
  white-space: nowrap;
}

.save-gate-actions .primary-action {
  width: auto;
}

.save-gate-login-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.text-action {
  display: inline-flex;
  align-items: center;
}

.text-action:hover {
  color: var(--text);
}

.text-action:focus-visible {
  outline: 2px solid rgba(231, 183, 95, 0.45);
  outline-offset: 3px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 16px;
}

.legal-links .text-action {
  color: rgba(231, 183, 95, 0.86);
  font-size: 0.86rem;
  text-decoration-thickness: 1px;
}

.summary-legal-links {
  margin-top: 16px;
}

.save-gate-skip {
  justify-self: center;
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  opacity: 0.58;
  text-decoration: none;
}

.save-gate-skip:hover,
.save-gate-skip:focus-visible {
  opacity: 1;
  text-decoration: underline;
}

.start-card {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 34%, rgba(231, 183, 95, 0.2), transparent 34%),
    repeating-linear-gradient(0deg, #20252d 0 16px, #1b2028 16px 32px);
}

.mini-map {
  display: grid;
  gap: 8px;
}

.map-node {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
  font-size: 0.84rem;
}

.map-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #171a20;
  font-size: 0.72rem;
  font-weight: 800;
}

.game-panel {
  display: block;
}

.encounter-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0d11;
}

.scene-frame {
  position: relative;
  height: min(760px, calc(100dvh - 112px));
  min-height: 600px;
  overflow: hidden;
  background: #0b0d11;
}

.scene-background,
.scene-monster {
  position: absolute;
  image-rendering: pixelated;
}

.scene-background {
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-monster {
  left: 50%;
  bottom: min(138px, 19%);
  z-index: 1;
  width: min(43%, 440px);
  max-width: 64%;
  height: min(54%, 420px);
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.scene-frame.has-boss .scene-monster {
  width: min(52%, 540px);
  height: min(62%, 500px);
}

.scene-monster.is-defeated {
  transform-origin: center bottom;
  filter:
    grayscale(0.24)
    saturate(0.72)
    brightness(0.82)
    drop-shadow(0 10px 10px rgba(0, 0, 0, 0.5));
  opacity: 0.9;
}

.scene-monster.is-defeated-fallback {
  transform: translateX(-50%) scaleY(0.48) rotate(-4deg);
}

.scene-monster.is-defeated-sprite {
  transform: translateX(-50%);
}

.scene-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(6, 8, 12, 0.68), rgba(6, 8, 12, 0) 28%, rgba(6, 8, 12, 0.72)),
    radial-gradient(circle at 50% 44%, transparent 0 44%, rgba(0, 0, 0, 0.45) 78%);
  pointer-events: none;
}

.effect-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.world-event-banner {
  position: absolute;
  top: 42%;
  left: 50%;
  z-index: 6;
  transform: translate(-50%, -50%) scale(0.92);
  border: 2px solid rgba(231, 183, 95, 0.74);
  background:
    linear-gradient(90deg, transparent, rgba(10, 9, 7, 0.86) 18% 82%, transparent),
    rgba(9, 8, 7, 0.74);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48), inset 0 0 0 1px rgba(255, 231, 169, 0.18);
  color: #ffe6ad;
  padding: 10px 24px;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

.world-event-banner.is-showing {
  animation: worldEventPop 1400ms ease both;
}

@media (max-width: 760px) {
  .world-event-banner {
    top: 36%;
    max-width: calc(100% - 36px);
    padding: 8px 16px;
    font-size: 1.08rem;
    white-space: normal;
  }
}

.scene-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 0.8fr) minmax(130px, 0.8fr) auto;
  gap: 8px;
  align-items: start;
}

.hud-bar,
.loot-hud,
.room-chip,
.enemy-hud,
.inventory-popover,
.dialogue-panel {
  border: 1px solid rgba(245, 241, 232, 0.12);
  border-radius: var(--radius);
  background: rgba(8, 10, 14, 0.42);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(6px);
}

.hud-bar {
  min-width: 0;
  padding: 8px 10px;
}

.hud-bar span,
.enemy-hud small,
.room-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.hud-bar strong,
.enemy-hud strong,
.room-chip strong {
  display: block;
  margin-top: 3px;
  font-size: 0.9rem;
}

.meter {
  position: relative;
  width: 100%;
  height: 7px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(245, 241, 232, 0.18);
}

.meter i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  transition: width 220ms ease;
}

.meter.xp i {
  background: var(--blue);
}

.meter.mastery i {
  background: var(--green);
}

.meter.monster i {
  background: var(--red);
}

.loot-hud {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-height: 52px;
  padding: 8px;
}

.loot-strip {
  display: flex;
  gap: 6px;
}

.loot-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(231, 183, 95, 0.55);
  border-radius: 6px;
  color: var(--gold);
  background: rgba(12, 13, 16, 0.74);
  font-size: 0.72rem;
  font-weight: 900;
}

.menu-action {
  min-width: 62px;
}

.site-dialog {
  position: fixed;
  inset: 0;
  z-index: 53;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 5, 7, 0.7);
  backdrop-filter: blur(5px);
}

.site-dialog-card {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(36, 42, 51, 0.98), rgba(13, 15, 20, 0.98));
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
}

.site-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 10, 14, 0.78);
  color: var(--gold);
  padding: 0 12px;
  font-weight: 900;
  cursor: pointer;
}

.site-dialog-view h2 {
  max-width: calc(100% - 92px);
  margin-bottom: 12px;
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
}

.dungeon-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.dungeon-menu-grid section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 10, 14, 0.48);
  padding: 12px;
}

.dungeon-menu-grid span,
.dungeon-menu-grid small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.dungeon-menu-grid strong {
  display: block;
  margin: 5px 0;
  color: var(--text);
  font-size: 1rem;
}

.legal-view {
  display: grid;
  gap: 10px;
}

.legal-back {
  justify-self: start;
  margin-bottom: 4px;
}

.legal-body {
  display: grid;
  gap: 12px;
  color: rgba(245, 241, 232, 0.86);
  line-height: 1.55;
}

.legal-body p,
.legal-body ul {
  margin: 0;
}

.legal-body ul {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  color: var(--muted);
}

.room-chip {
  position: absolute;
  top: 76px;
  left: 12px;
  z-index: 4;
  min-width: 134px;
  padding: 8px 10px;
}

.enemy-hud {
  position: absolute;
  top: 76px;
  right: 12px;
  z-index: 4;
  width: 230px;
  padding: 9px 10px;
}

.enemy-hud span {
  display: block;
  font-weight: 900;
}

.dice-tray {
  position: absolute;
  right: 18px;
  bottom: 232px;
  z-index: 5;
  display: grid;
  gap: 6px;
  min-height: 44px;
}

.roll-card {
  display: grid;
  grid-template-columns: 44px minmax(104px, auto);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 10, 14, 0.78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  padding: 7px;
}

.die {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid #f8e4b3;
  border-radius: 8px;
  color: var(--ink);
  background: #f7d886;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
  font-weight: 900;
}

.roll-formula {
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.1;
  white-space: nowrap;
}

.roll-formula strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
}

.roll-formula b {
  color: var(--gold);
}

.roll-card.is-success .roll-formula strong {
  color: var(--green);
}

.roll-card.is-fail .roll-formula strong {
  color: var(--red);
}

.die.is-rolling {
  animation: roll 520ms ease-in-out;
}

.dialogue-panel {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(190px, 0.58fr) minmax(0, 1.42fr);
  gap: 8px;
  padding: 8px 10px;
  border-color: rgba(245, 241, 232, 0.08);
  background: linear-gradient(180deg, rgba(7, 9, 13, 0.42), rgba(7, 9, 13, 0.2));
  box-shadow: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.82);
}

.dialogue-panel.is-dm-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.dialogue-panel.is-narration-step {
  grid-template-columns: minmax(0, 1fr);
}

.dialogue-panel.is-dm-collapsed .dm-box {
  display: none;
}

.dialogue-panel.is-narration-step .question-window {
  display: none;
}

.dialogue-panel.is-dm-collapsed .result-panel {
  grid-column: 1;
}

.dm-box {
  position: relative;
  min-width: 0;
  padding: 3px 2px;
}

.dm-box #dmNarration {
  margin-bottom: 0;
  color: rgba(245, 241, 232, 0.82);
  font-size: 0.94rem;
  line-height: 1.34;
}

.question-window {
  min-width: 0;
}

.dm-continue-action {
  display: inline-grid;
  grid-template-columns: auto 28px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(231, 183, 95, 0.7);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(50, 35, 19, 0.92), rgba(15, 10, 6, 0.94));
  color: #f9df9f;
  cursor: pointer;
  font-weight: 900;
  padding: 0 12px;
}

.dm-continue-action:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.dm-arrow {
  position: relative;
  display: block;
  width: 28px;
  height: 16px;
}

.dm-arrow::before,
.dm-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  background: #f5d17f;
}

.dm-arrow::before {
  left: 0;
  width: 24px;
  height: 3px;
  transform: translateY(-50%);
  box-shadow: 0 0 8px rgba(245, 209, 127, 0.45);
}

.dm-arrow::after {
  right: 1px;
  width: 12px;
  height: 12px;
  border-top: 3px solid #f5d17f;
  border-right: 3px solid #f5d17f;
  background: transparent;
  transform: translateY(-50%) rotate(45deg);
}

.question-card,
.result-panel {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(6, 8, 12, 0.22);
  padding: 7px 8px;
}

.question-label {
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.question-card h3 {
  margin-bottom: 7px;
  font-size: 1.18rem;
  line-height: 1.2;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.answer-button {
  min-height: 42px;
  border: 1px solid rgba(245, 241, 232, 0.14);
  border-radius: 6px;
  color: var(--text);
  background: rgba(11, 14, 19, 0.5);
  cursor: pointer;
  text-align: left;
  padding: 7px 9px;
  font-size: 1rem;
  line-height: 1.16;
  backdrop-filter: blur(2px);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.answer-button:hover {
  border-color: var(--gold);
  background: rgba(16, 19, 26, 0.68);
  transform: translateY(-1px);
}

.answer-button.is-correct {
  border-color: var(--green);
  background: rgba(105, 196, 143, 0.24);
}

.answer-button.is-wrong {
  border-color: var(--red);
  background: rgba(223, 109, 98, 0.24);
}

.answer-button.is-monster-pick {
  box-shadow: inset 0 0 0 1px rgba(231, 183, 95, 0.45), 0 0 18px rgba(231, 183, 95, 0.16);
}

.answer-button:disabled {
  cursor: default;
  transform: none;
}

.question-card.is-resolved {
  padding: 6px 8px;
}

.question-card.is-resolved .question-label,
.question-card.is-resolved .answers {
  display: none;
}

.question-card.is-resolved h3 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 1.28rem;
  line-height: 1.22;
}

.question-card h3.has-inline-feedback strong {
  font-weight: 900;
}

.question-card h3.has-inline-feedback strong.is-correct {
  color: var(--green);
}

.question-card h3.has-inline-feedback strong.is-wrong {
  color: var(--red);
}

.result-panel {
  display: grid;
  grid-column: 2;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.9fr) auto;
  align-items: start;
  gap: 8px;
  margin-top: 6px;
}

.result-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.38;
}

.answer-sentence {
  margin-top: 7px;
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.28;
}

.answer-sentence strong {
  font-weight: 900;
}

.answer-sentence strong.is-correct {
  color: var(--green);
}

.answer-sentence strong.is-wrong {
  color: var(--red);
}

.enemy-turn {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  border-left: 2px solid rgba(231, 183, 95, 0.55);
  padding-left: 8px;
}

.enemy-turn span {
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.enemy-turn strong {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.15;
}

.enemy-turn small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.explanation {
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.explanation strong {
  color: var(--gold);
}

.inventory-popover {
  position: absolute;
  top: 76px;
  right: 12px;
  z-index: 6;
  width: 250px;
  padding: 12px;
}

.inventory-popover ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.scene-frame.hit .scene-monster {
  animation: monsterHitShake 520ms cubic-bezier(0.2, 0.8, 0.24, 1);
}

.scene-frame.hit .effect-layer::before {
  content: "";
  position: absolute;
  inset: 16% 22% 30%;
  background:
    linear-gradient(135deg, transparent 42%, rgba(245, 241, 232, 0.92) 47%, transparent 52%),
    radial-gradient(circle at 52% 52%, rgba(231, 183, 95, 0.36), transparent 36%);
  animation: slash 460ms ease;
}

.scene-frame.miss .effect-layer::before,
.scene-frame.damage .effect-layer::before {
  content: "";
  position: absolute;
  inset: 10% 5% 20%;
  background:
    linear-gradient(112deg, transparent 0 39%, rgba(255, 235, 222, 0.82) 40% 41.5%, rgba(118, 11, 13, 0.58) 42.5% 44%, transparent 45%),
    linear-gradient(72deg, transparent 0 52%, rgba(255, 235, 222, 0.64) 53% 54%, rgba(118, 11, 13, 0.5) 55% 56%, transparent 57%);
  mix-blend-mode: screen;
  animation: scratchFlash 560ms ease forwards;
}

.scene-frame.miss .effect-layer::after,
.scene-frame.damage .effect-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, transparent 0 42%, rgba(223, 109, 98, 0.24) 72%),
    rgba(223, 109, 98, 0.2);
  animation: fadeOut 520ms ease forwards;
}

.scene-frame.reward .effect-layer::before {
  content: "";
  position: absolute;
  inset: 18% 22%;
  border: 2px solid rgba(231, 183, 95, 0.8);
  box-shadow: 0 0 44px rgba(231, 183, 95, 0.34);
  animation: pulse 760ms ease;
}

.summary-panel {
  display: block;
  min-height: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.summary-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 14px;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.summary-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
}

.level-paywall {
  display: grid;
  gap: 14px;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 14, 19, 0.66);
  padding: 20px;
}

.level-paywall h3 {
  margin-bottom: 10px;
  font-size: clamp(1.55rem, 3vw, 2.55rem);
  line-height: 0.98;
}

.level-paywall p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.48;
}

.paywall-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
  gap: 20px;
  align-items: center;
}

.trial-badge {
  display: grid;
  gap: 3px;
  min-height: 150px;
  border: 1px solid rgba(231, 183, 95, 0.4);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 0%, rgba(231, 183, 95, 0.26), transparent 58%),
    rgba(10, 12, 16, 0.72);
  color: var(--text);
  padding: 18px;
  text-align: center;
  align-content: center;
}

.trial-badge span {
  color: var(--gold);
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.9;
}

.trial-badge strong {
  font-size: 0.95rem;
  text-transform: uppercase;
}

.trial-badge small {
  color: var(--muted);
  font-weight: 700;
}

.paywall-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.paywall-benefits li {
  display: grid;
  gap: 6px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 10, 14, 0.52);
  padding: 14px;
}

.paywall-benefits strong {
  color: var(--text);
}

.paywall-benefits span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.paywall-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.paywall-plan {
  display: grid;
  gap: 6px;
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(30, 34, 43, 0.92);
  color: var(--text);
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.paywall-plan.is-featured {
  border-color: rgba(231, 183, 95, 0.72);
  box-shadow: 0 0 0 1px rgba(231, 183, 95, 0.18);
}

.paywall-plan span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.paywall-plan strong {
  color: var(--gold);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  line-height: 1;
}

.paywall-plan small {
  color: var(--muted);
  font-weight: 700;
}

.paywall-plan:disabled {
  cursor: default;
  opacity: 0.74;
}

.paywall-thanks {
  max-width: 760px;
}

.paywall-terms {
  margin-top: 12px;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.82rem;
}

.creator-chat-button,
.creator-chat-status {
  position: fixed;
  z-index: 45;
}

.creator-chat-button {
  top: 50%;
  right: 0;
  left: auto;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-height: 150px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: rgba(17, 20, 27, 0.94);
  color: var(--gold);
  padding: 12px 8px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
}

.creator-chat-button span {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.creator-chat-status {
  top: calc(50% + 92px);
  right: 62px;
  bottom: auto;
  width: min(330px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 14, 19, 0.96);
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

.creator-chat-panel {
  position: fixed;
  top: 50%;
  right: 62px;
  bottom: auto;
  transform: translateY(-50%);
  z-index: 46;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(420px, calc(100vw - 36px));
  height: min(480px, calc(100dvh - 220px));
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 14, 19, 0.98);
  overflow: hidden;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.56);
}

.creator-chat-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(17, 20, 27, 0.96);
}

.creator-chat-panel-head .eyebrow {
  margin-bottom: 2px;
}

.creator-chat-panel-head strong {
  display: block;
  color: var(--text);
}

.creator-chat-close {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 8, 11, 0.86);
  color: var(--gold);
  padding: 7px 10px;
  font-weight: 800;
  cursor: pointer;
}

.creator-chat-panel iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0f1218;
}

.ornate-ui #cw-bubble-holder {
  display: none !important;
}

.ornate-ui #cw-widget-holder.woot-widget-holder:not(.woot--hide) {
  top: 50% !important;
  right: 62px !important;
  bottom: auto !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  z-index: 46 !important;
  width: min(420px, calc(100vw - 36px)) !important;
  height: min(480px, calc(100dvh - 220px)) !important;
  min-height: 360px !important;
  border: 2px solid #6c522f !important;
  border-radius: 0 !important;
  background: rgba(19, 14, 9, 0.96) !important;
  box-shadow: inset 0 0 0 2px rgba(226, 186, 106, 0.14), 0 20px 70px rgba(0, 0, 0, 0.56) !important;
}

.ornate-ui #cw-widget-holder.woot-widget-holder iframe {
  background: #ffffff;
}

.death-details {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}

.death-spotlight {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.death-spotlight div,
.death-columns section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 14, 19, 0.58);
  padding: 13px;
}

.death-spotlight span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.death-spotlight strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
}

.death-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.death-columns h3 {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 1rem;
}

.death-columns ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.42;
}

.is-hidden {
  display: none !important;
}

@keyframes roll {
  0% { transform: rotate(0deg) scale(1); }
  35% { transform: rotate(18deg) scale(1.12); }
  70% { transform: rotate(-14deg) scale(0.96); }
  100% { transform: rotate(0deg) scale(1); }
}

@keyframes slash {
  from { opacity: 0; transform: translateX(-18%) scaleX(0.2); }
  30% { opacity: 1; }
  to { opacity: 0; transform: translateX(18%) scaleX(1); }
}

@keyframes monsterHitShake {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
  16% { transform: translateX(calc(-50% - 10px)) translateY(2px) rotate(-2deg); }
  32% { transform: translateX(calc(-50% + 9px)) translateY(-1px) rotate(2deg); }
  48% { transform: translateX(calc(-50% - 7px)) translateY(1px) rotate(-1deg); }
  64% { transform: translateX(calc(-50% + 5px)) translateY(0) rotate(1deg); }
  82% { transform: translateX(calc(-50% - 2px)) translateY(0) rotate(0deg); }
}

@keyframes scratchFlash {
  0% { opacity: 0; transform: translateX(-8%) scaleX(0.82); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translateX(5%) scaleX(1.02); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes worldEventPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.82); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(0.96); }
}

@keyframes startHeroDrift {
  from { transform: scale(1.04) translate3d(-6px, -2px, 0); }
  to { transform: scale(1.07) translate3d(10px, 5px, 0); }
}

@keyframes pulse {
  from { opacity: 0; transform: scale(0.82); }
  35% { opacity: 1; }
  to { opacity: 0; transform: scale(1.08); }
}

@media (max-width: 980px) {
  .start-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
  }

  .scene-frame {
    height: calc(100dvh - 84px);
    min-height: 0;
  }

  .scene-hud {
    grid-template-columns: minmax(82px, 1fr) minmax(82px, 1fr) minmax(88px, 1fr) auto;
  }

  .loot-hud {
    grid-column: auto;
    justify-content: flex-end;
  }

  .room-chip,
  .enemy-hud {
    top: 72px;
  }

  .dialogue-panel {
    grid-template-columns: 1fr;
    max-height: min(330px, 43dvh);
    overflow: auto;
  }

  .scene-monster {
    bottom: min(280px, 34%);
    width: min(58%, 420px);
    height: min(46%, 380px);
  }

  .result-panel {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .explanation {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 10px, 1280px);
    padding: 4px 0 6px;
  }

  .topbar {
    min-height: 38px;
    padding: 2px 0 5px;
  }

  .topbar .eyebrow,
  .top-note {
    display: none;
  }

  h1 {
    font-size: 1.05rem;
  }

  .start-panel,
  .summary-panel {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .legal-links {
    gap: 6px 12px;
    margin-top: 12px;
  }

  .site-dialog {
    padding: 10px;
  }

  .site-dialog-card {
    max-height: calc(100dvh - 20px);
    padding: 18px;
  }

  .site-dialog-close {
    top: 10px;
    right: 10px;
    min-height: 30px;
    padding: 0 10px;
  }

  .site-dialog-view h2 {
    max-width: calc(100% - 76px);
    font-size: 1.35rem;
  }

  .menu-actions {
    gap: 8px;
  }

  .dungeon-menu-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .scene-frame {
    height: calc(100dvh - 50px);
    min-height: 0;
  }

  .scene-hud {
    top: 7px;
    left: 7px;
    right: 7px;
    grid-template-columns: minmax(72px, 1fr) minmax(72px, 1fr) minmax(78px, 1fr) auto;
    gap: 4px;
  }

  .hud-bar {
    padding: 5px 6px;
  }

  .hud-bar span,
  .enemy-hud small,
  .room-chip span {
    font-size: 0.6rem;
  }

  .hud-bar strong,
  .enemy-hud strong,
  .room-chip strong {
    font-size: 0.72rem;
  }

  .meter {
    height: 5px;
    margin-top: 4px;
  }

  .loot-hud {
    grid-column: auto;
    min-height: 37px;
    padding: 4px;
    gap: 4px;
    flex-wrap: wrap;
  }

  .icon-action {
    min-height: 28px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .menu-action {
    min-width: 48px;
    padding: 0 7px;
  }

  .loot-icon {
    width: 26px;
    height: 26px;
    font-size: 0.64rem;
  }

  .room-chip {
    top: 55px;
    left: 7px;
    min-width: 105px;
    padding: 5px 7px;
  }

  .enemy-hud,
  .inventory-popover {
    top: 55px;
    right: 7px;
    width: min(178px, calc(100% - 126px));
    padding: 6px 7px;
  }

  .inventory-popover {
    left: auto;
    width: 210px;
  }

  .dialogue-panel {
    left: 6px;
    right: 6px;
    bottom: 6px;
    max-height: 43dvh;
    padding: 6px;
    gap: 6px;
  }

  .scene-monster {
    bottom: calc(43dvh + 12px);
    width: min(76%, 300px);
    height: 32dvh;
  }

  .scene-frame.has-boss .scene-monster {
    width: min(86%, 340px);
    height: 36dvh;
  }

  .dm-box #dmNarration {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.86rem;
    line-height: 1.26;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .question-card,
  .result-panel {
    padding: 6px;
  }

  .question-label {
    margin-bottom: 3px;
    font-size: 0.63rem;
  }

  h3 {
    margin-bottom: 6px;
    font-size: 0.82rem;
  }

  .question-card h3 {
    margin-bottom: 6px;
    font-size: 1.1rem;
    line-height: 1.16;
  }

  .answers {
    gap: 5px;
  }

  .answer-button {
    min-height: 40px;
    padding: 6px 7px;
    font-size: 1rem;
    line-height: 1.12;
  }

  .result-panel {
    gap: 7px;
    margin-top: 6px;
  }

  .result-panel p {
    font-size: 0.9rem;
    line-height: 1.28;
  }

  .answer-sentence {
    margin-top: 5px;
    font-size: 0.98rem;
    line-height: 1.2;
  }

  .enemy-turn {
    margin-top: 5px;
    padding-left: 7px;
  }

  .enemy-turn strong {
    font-size: 0.82rem;
  }

  .enemy-turn small {
    font-size: 0.72rem;
  }

  .secondary-action {
    min-height: 34px;
    font-size: 0.84rem;
  }

  .dice-tray {
    right: 10px;
    bottom: calc(43dvh + 18px);
  }

  .roll-card {
    grid-template-columns: 34px minmax(82px, auto);
    gap: 6px;
    padding: 5px;
  }

  .die {
    width: 34px;
    height: 34px;
    font-size: 0.82rem;
  }

  .roll-formula {
    font-size: 0.62rem;
  }

  .roll-formula strong {
    font-size: 0.9rem;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .death-spotlight,
  .death-columns {
    grid-template-columns: 1fr;
  }
}

/* Alternative ornate RPG interface. The game logic still controls the same DOM ids. */
.ornate-ui {
  --parchment: #b79a6b;
  --parchment-light: #d0b988;
  --parchment-dark: #785b32;
  --ornate-ink: #1a1008;
  --ornate-gold: #d7ad63;
  --ornate-red: #b62e29;
  --ornate-red-bright: #f05a45;
  --ornate-frame: #4b3218;
  background: #050505;
  font-family: Georgia, "Times New Roman", serif;
}

.ornate-ui .app-shell {
  width: 100%;
  min-height: 100dvh;
  padding: 0;
}

.ornate-ui .topbar {
  display: none;
}

.ornate-ui .start-panel,
.ornate-ui .summary-panel {
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
}

.ornate-ui .summary-panel {
  background:
    radial-gradient(circle at 50% 30%, rgba(215, 173, 99, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(6, 6, 7, 0.78), rgba(6, 6, 7, 0.94)),
    repeating-linear-gradient(90deg, #17120d 0 18px, #110e0a 18px 36px);
}

.ornate-ui .death-spotlight div,
.ornate-ui .death-columns section {
  border-color: rgba(215, 173, 99, 0.34);
  border-radius: 0;
  background: rgba(8, 7, 5, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 231, 176, 0.06);
}

.ornate-ui .death-spotlight span,
.ornate-ui .death-columns h3 {
  color: #d7ad63;
}

.ornate-ui .death-spotlight strong {
  color: #fff2c9;
}

.ornate-ui .death-columns ul {
  color: #d4c4a8;
}

.ornate-ui .start-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: minmax(320px, 0.95fr) minmax(250px, 380px);
  gap: clamp(24px, 7vw, 120px);
  align-items: center;
  padding: clamp(24px, 4.8vw, 78px);
  background: #040302;
}

.ornate-ui .start-panel::before,
.ornate-ui .start-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ornate-ui .start-panel::before {
  z-index: 0;
  inset: -3%;
  background-color: #040302;
  background-image: url("../../assets/start-screen-dungeon-hero.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: saturate(0.98) contrast(1.08) brightness(0.82);
  transform: scale(1.04) translate3d(-6px, -2px, 0);
  animation: startHeroDrift 18s ease-in-out infinite alternate;
}

@supports (background-image: image-set(url("../../assets/start-screen-dungeon-hero-768.avif") type("image/avif") 1x)) {
  .ornate-ui .start-panel::before {
    background-image: image-set(
      url("../../assets/start-screen-dungeon-hero-768.avif") type("image/avif") 1x,
      url("../../assets/start-screen-dungeon-hero-768.webp") type("image/webp") 1x,
      url("../../assets/start-screen-dungeon-hero-1536.avif") type("image/avif") 2x,
      url("../../assets/start-screen-dungeon-hero-1536.webp") type("image/webp") 2x
    );
  }
}

@media (min-width: 900px) {
  @supports (background-image: image-set(url("../../assets/start-screen-dungeon-hero-1536.avif") type("image/avif") 1x)) {
    .ornate-ui .start-panel::before {
      background-image: image-set(
        url("../../assets/start-screen-dungeon-hero-1536.avif") type("image/avif") 1x,
        url("../../assets/start-screen-dungeon-hero-1536.webp") type("image/webp") 1x
      );
    }
  }
}

.ornate-ui .start-panel::after {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.58) 25%, rgba(0, 0, 0, 0.14) 52%, rgba(0, 0, 0, 0.58) 77%, rgba(0, 0, 0, 0.92) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.04) 34%, rgba(0, 0, 0, 0.72) 100%),
    repeating-linear-gradient(0deg, rgba(255, 236, 192, 0.035) 0 1px, transparent 1px 6px);
}

.ornate-ui .start-copy,
.ornate-ui .start-card {
  position: relative;
  z-index: 2;
}

.ornate-ui .start-copy {
  max-width: 680px;
  color: #fff2d2;
  text-shadow: 0 3px 5px rgba(0, 0, 0, 0.85), 0 0 18px rgba(0, 0, 0, 0.75);
}

.ornate-ui .start-copy .eyebrow {
  color: #eacb8c;
  font-size: clamp(0.86rem, 1.1vw, 1rem);
}

.ornate-ui .start-copy h2 {
  max-width: 740px;
  margin: 0 0 12px;
  color: #fff6d7;
  font-size: clamp(2.4rem, 4.25vw, 5rem);
  line-height: 0.98;
}

.ornate-ui .start-copy p {
  max-width: 590px;
  color: #f0ddbb;
  font-size: clamp(1.04rem, 1.35vw, 1.22rem);
  line-height: 1.46;
}

.ornate-ui .landing-steps {
  min-height: clamp(220px, 38vh, 360px);
  display: grid;
  align-items: end;
}

.ornate-ui .landing-step {
  display: none;
}

.ornate-ui .landing-step.is-active {
  display: block;
}

.ornate-ui .landing-progress {
  display: flex;
  gap: 10px;
  margin-top: clamp(12px, 2.4vh, 24px);
}

.ornate-ui .landing-dot {
  width: 34px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(240, 221, 187, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.ornate-ui .landing-dot.is-active {
  background: #f2c66e;
}

.ornate-ui .start-copy .primary-action {
  min-height: 46px;
  margin-top: 16px;
  border: 1px solid rgba(234, 203, 140, 0.68);
  border-radius: 0;
  background: linear-gradient(180deg, #2f2214, #140d08);
  color: #fff2c9;
  box-shadow: inset 0 0 0 1px rgba(255, 239, 190, 0.1), 0 10px 24px rgba(0, 0, 0, 0.44);
  font-size: 1rem;
  letter-spacing: 0;
}

.ornate-ui .start-actions {
  margin-top: clamp(10px, 2.2vh, 16px);
}

.ornate-ui .start-actions .primary-action,
.ornate-ui .start-actions .secondary-action {
  margin-top: 0;
}

.ornate-ui .platform-status {
  color: #d9c29b;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.75);
}

.ornate-ui .save-gate {
  background: rgba(2, 2, 3, 0.72);
}

.ornate-ui .save-gate-card {
  border: 2px solid #5f421f;
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(208, 185, 136, 0.98), rgba(183, 154, 107, 0.98)),
    var(--parchment);
  color: var(--ornate-ink);
  box-shadow: inset 0 0 0 2px rgba(255, 239, 190, 0.22), 0 24px 80px rgba(0, 0, 0, 0.58);
}

.ornate-ui .save-gate-card p {
  color: #382511;
}

.ornate-ui .save-gate-form-note,
.ornate-ui .save-gate-auth label,
.ornate-ui .save-gate-confirmation h3 {
  color: #1d1208;
}

.ornate-ui .save-gate-auth small,
.ornate-ui .save-gate-auth em,
.ornate-ui .save-gate-login-row {
  color: #5b3f22;
}

.ornate-ui .save-gate-skip {
  color: #6d5436;
}

.ornate-ui .save-gate-auth input {
  border-color: #6e4b25;
  background: rgba(24, 20, 14, 0.88);
  color: #fff5d8;
}

.ornate-ui .save-gate-auth input::placeholder {
  color: rgba(255, 245, 216, 0.46);
}

.ornate-ui .save-gate-status {
  color: #5a2c12;
}

.ornate-ui .save-gate-status.is-error {
  color: #7c1712;
}

.ornate-ui .save-gate-status.is-success {
  color: #22511c;
}

.ornate-ui .save-gate-confirmation strong {
  color: #5a2c12;
}

.ornate-ui .text-action {
  color: #3d230c;
}

.ornate-ui .text-action:hover {
  color: #7c1712;
}

.ornate-ui .start-copy .legal-links .text-action,
.ornate-ui .summary-panel .legal-links .text-action {
  color: #e8c476;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.78);
}

.ornate-ui .landing-legal-links {
  position: fixed;
  left: 16px;
  bottom: 12px;
  z-index: 3;
  margin: 0;
  gap: 10px;
}

.ornate-ui .landing-legal-links .text-action {
  color: rgba(232, 196, 118, 0.52);
  font-size: 0.72rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.ornate-ui .start-copy .legal-links .text-action:hover,
.ornate-ui .summary-panel .legal-links .text-action:hover {
  color: #fff0b8;
}

.ornate-ui .start-card {
  justify-self: end;
  width: min(100%, 380px);
  min-height: min(70dvh, 640px);
  border: 1px solid rgba(215, 173, 99, 0.33);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(16, 18, 22, 0.82), rgba(8, 9, 11, 0.68)),
    repeating-linear-gradient(0deg, rgba(255, 242, 204, 0.04) 0 17px, rgba(0, 0, 0, 0.12) 17px 34px);
  box-shadow: inset 0 0 0 1px rgba(255, 231, 176, 0.06), 0 20px 48px rgba(0, 0, 0, 0.5);
}

.ornate-ui .encounter-card {
  border: 0;
  border-radius: 0;
}

.ornate-ui .scene-frame {
  height: 100dvh;
  min-height: 620px;
  border-radius: 0;
}

.ornate-ui .scene-background {
  filter: saturate(0.95) contrast(1.06) brightness(0.82);
}

.ornate-ui .scene-vignette {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0) 24%, rgba(0, 0, 0, 0.72)),
    radial-gradient(circle at 50% 44%, transparent 0 46%, rgba(0, 0, 0, 0.62) 80%);
}

.ornate-ui .scene-hud {
  top: 24px;
  left: 34px;
  right: 34px;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 146px;
  grid-template-rows: repeat(3, auto);
  gap: 8px 14px;
  pointer-events: none;
}

.ornate-ui .hud-bar,
.ornate-ui .loot-hud,
.ornate-ui .room-chip,
.ornate-ui .enemy-hud,
.ornate-ui .inventory-popover,
.ornate-ui .dialogue-panel {
  backdrop-filter: none;
}

.ornate-ui .hud-bar {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 70px;
  grid-template-rows: 20px auto;
  align-items: center;
  gap: 2px 8px;
  width: 292px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  color: #f2e4c7;
  text-shadow: 0 2px 3px #000, 0 0 8px rgba(0, 0, 0, 0.82);
}

.ornate-ui .hero-hud {
  grid-column: 1;
  grid-row: 1;
}

.ornate-ui .xp-hud {
  grid-column: 1;
  grid-row: 2;
  transform: scale(0.88);
  transform-origin: left top;
}

.ornate-ui .mastery-hud {
  grid-column: 1;
  grid-row: 3;
  transform: scale(0.88);
  transform-origin: left top;
}

.ornate-ui .hud-bar span {
  grid-column: 2;
  grid-row: 1;
  display: inline;
  color: #fff2ce;
  font-size: 1rem;
  font-weight: 900;
}

.ornate-ui .hud-bar strong {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  color: #fff5d9;
  font-size: 1rem;
  text-align: left;
}

.ornate-ui .hud-icon {
  position: relative;
  grid-column: 1;
  grid-row: 1 / 3;
  display: block;
  width: 30px;
  height: 30px;
  align-self: center;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.9));
}

.ornate-ui .hp-icon::before,
.ornate-ui .hp-icon::after {
  content: "";
  position: absolute;
  background: linear-gradient(135deg, #f06a4e, #9d211f 72%);
}

.ornate-ui .hp-icon::before {
  left: 7px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  transform: rotate(45deg);
  box-shadow: inset 2px 2px 0 rgba(255, 225, 170, 0.28);
}

.ornate-ui .hp-icon::after {
  left: 5px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 10px 0 0 #c63b31;
}

.ornate-ui .xp-icon {
  border: 2px solid #8b642e;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, #fff0a9 0 10%, transparent 11%),
    radial-gradient(circle, #d8a34d, #6f491d 72%);
}

.ornate-ui .xp-icon::after {
  content: "XP";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #271605;
  font-size: 0.56rem;
  font-weight: 900;
}

.ornate-ui .mastery-icon {
  border: 2px solid #90703d;
  border-radius: 5px;
  background:
    linear-gradient(45deg, transparent 0 22%, rgba(255, 239, 178, 0.54) 23% 28%, transparent 29%),
    radial-gradient(circle at 50% 45%, #c8a15f, #473019 76%);
  transform: rotate(45deg) scale(0.82);
}

.ornate-ui .meter {
  grid-column: 2 / 4;
  grid-row: 2;
  height: 12px;
  margin: 0;
  overflow: hidden;
  border: 2px solid #1a1109;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%),
    #090806;
  box-shadow:
    0 0 0 1px #6f4b20,
    0 2px 0 #000,
    inset 0 1px 3px rgba(0, 0, 0, 0.92);
}

.ornate-ui .hero-hud .meter {
  height: 16px;
}

.ornate-ui .meter::before {
  content: "";
  position: absolute;
  inset: 3px 4px auto;
  z-index: 2;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 236, 204, 0.48);
  pointer-events: none;
}

.ornate-ui .meter i {
  position: relative;
  border-radius: 2px;
  background:
    radial-gradient(circle at 18% 35%, rgba(255, 236, 207, 0.56), transparent 8%),
    linear-gradient(180deg, var(--ornate-red-bright), var(--ornate-red) 44%, #661615);
  box-shadow:
    inset 0 2px 0 rgba(255, 224, 190, 0.25),
    inset 0 -3px 5px rgba(38, 0, 0, 0.58),
    0 0 10px rgba(198, 44, 38, 0.42);
}

.ornate-ui .meter.xp i {
  background: linear-gradient(180deg, #f2d078, #9c6a26 60%, #4b2e12);
  box-shadow: inset 0 2px 0 rgba(255, 244, 195, 0.32), 0 0 8px rgba(215, 173, 99, 0.28);
}

.ornate-ui .meter.mastery i {
  background: linear-gradient(180deg, #90d39a, #3b8f57 58%, #194c2c);
  box-shadow: inset 0 2px 0 rgba(221, 255, 223, 0.28), 0 0 8px rgba(75, 168, 99, 0.26);
}

.ornate-ui .loot-hud {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: grid;
  grid-template-columns: auto;
  justify-items: center;
  min-width: 130px;
  min-height: 78px;
  border: 1px solid rgba(215, 173, 99, 0.38);
  border-radius: 0;
  background: rgba(5, 5, 5, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 231, 176, 0.08), 0 12px 28px rgba(0, 0, 0, 0.44);
  padding: 10px 12px;
  pointer-events: auto;
}

.ornate-ui .loot-strip {
  min-height: 0;
  gap: 5px;
}

.ornate-ui .loot-icon {
  width: 25px;
  height: 25px;
  border-radius: 2px;
  border-color: rgba(215, 173, 99, 0.68);
  background: rgba(27, 18, 10, 0.82);
  color: #f4d189;
  font-size: 0.62rem;
}

.ornate-ui .icon-action {
  display: grid;
  grid-template-columns: 34px auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f5e7ca;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 900;
  text-shadow: 0 2px 3px #000;
}

.ornate-ui .menu-action {
  grid-template-columns: auto;
  justify-content: center;
  min-width: 72px;
  padding: 0 12px;
}

.ornate-ui .bag-icon {
  position: relative;
  display: block;
  width: 28px;
  height: 25px;
  border: 2px solid #3b2814;
  border-radius: 4px 4px 6px 6px;
  background:
    linear-gradient(90deg, transparent 42%, rgba(48, 29, 12, 0.42) 43% 57%, transparent 58%),
    linear-gradient(180deg, #9e7946, #4f3117);
  box-shadow: inset 2px 2px 0 rgba(255, 229, 170, 0.24), 0 4px 0 rgba(0, 0, 0, 0.32);
}

.ornate-ui .bag-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -9px;
  width: 11px;
  height: 11px;
  border: 2px solid #3b2814;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.ornate-ui .room-chip {
  top: 196px;
  left: 38px;
  min-width: 128px;
  border-color: rgba(215, 173, 99, 0.24);
  border-radius: 0;
  background: rgba(3, 3, 4, 0.42);
  padding: 7px 10px;
  color: #f2e4c7;
  text-shadow: 0 2px 4px #000;
}

.ornate-ui .room-chip span,
.ornate-ui .room-chip strong {
  font-size: 0.78rem;
}

.ornate-ui .enemy-hud {
  top: 116px;
  right: 34px;
  width: 250px;
  border-color: rgba(215, 173, 99, 0.32);
  border-radius: 0;
  background: rgba(5, 5, 5, 0.52);
  color: #f2e4c7;
}

.ornate-ui .enemy-hud .meter {
  height: 10px;
  margin-top: 5px;
}

.ornate-ui .dice-tray {
  right: 42px;
  bottom: 246px;
}

.ornate-ui .roll-card {
  grid-template-columns: 46px minmax(112px, auto);
  border-color: rgba(215, 173, 99, 0.45);
  border-radius: 0;
  background: rgba(5, 5, 5, 0.62);
}

.ornate-ui .die {
  border-color: #6f4b20;
  border-radius: 3px;
  background: linear-gradient(180deg, #f2d184, #8b5b22);
  color: #160d05;
}

.ornate-ui .dialogue-panel {
  left: 50%;
  right: auto;
  bottom: 28px;
  width: min(950px, calc(100% - 58px));
  max-height: 54dvh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ornate-ink);
  padding: 0;
  text-shadow: none;
  transform: translateX(-50%);
}

.ornate-ui .dialogue-panel::before,
.ornate-ui .dialogue-panel::after {
  content: none;
}

.ornate-ui .dm-box,
.ornate-ui .question-window {
  border: 3px double var(--ornate-frame);
  border-radius: 4px;
  background:
    radial-gradient(circle at 7% 14%, rgba(255, 244, 199, 0.23), transparent 13%),
    radial-gradient(circle at 92% 88%, rgba(90, 62, 28, 0.2), transparent 17%),
    linear-gradient(180deg, var(--parchment-light), var(--parchment) 54%, #a58152);
  box-shadow:
    0 0 0 1px rgba(255, 230, 172, 0.5),
    0 16px 38px rgba(0, 0, 0, 0.56),
    inset 0 0 0 2px rgba(54, 36, 17, 0.42),
    inset 0 0 44px rgba(74, 47, 19, 0.24);
  color: var(--ornate-ink);
  text-shadow: none;
}

.ornate-ui .question-window {
  justify-self: center;
  width: 100%;
  max-width: 100%;
  padding: 20px 42px 24px;
}

.ornate-ui .dm-box {
  position: relative;
  justify-self: center;
  width: min(820px, calc(100% - 82px));
  min-height: 68px;
  padding: 16px 30px 16px 108px;
}

.ornate-ui .dm-box::before {
  content: "";
  position: absolute;
  left: 0;
  top: -8px;
  width: 82px;
  height: 82px;
  border: 3px solid #3e2a14;
  border-radius: 2px;
  background:
    radial-gradient(circle at 40% 45%, #f3c96d 0 3%, transparent 4%),
    radial-gradient(circle at 60% 45%, #f3c96d 0 3%, transparent 4%),
    radial-gradient(circle at 50% 54%, #0a0908 0 34%, transparent 35%),
    linear-gradient(135deg, #3c362f, #080808 72%);
  box-shadow:
    inset 0 0 0 2px rgba(215, 173, 99, 0.22),
    0 8px 18px rgba(0, 0, 0, 0.34);
}

.ornate-ui .dm-box .eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  border: 1px solid #4b3218;
  background: #241609;
  color: #f2d28d;
  padding: 5px 16px;
  font-size: 0.88rem;
}

.ornate-ui .dm-box #dmNarration {
  color: #23160b;
  font-size: 1.18rem;
  line-height: 1.34;
}

.ornate-ui .dialogue-panel.is-narration-step {
  width: min(780px, calc(100% - 64px));
  max-height: 42dvh;
}

.ornate-ui .dialogue-panel.is-narration-step .dm-box {
  width: 100%;
  min-height: 126px;
  padding: 22px 118px 22px 112px;
}

.ornate-ui .dialogue-panel.is-narration-step .dm-box #dmNarration {
  font-size: 1.34rem;
  line-height: 1.34;
}

.ornate-ui .dm-continue-action {
  position: absolute;
  top: 50%;
  right: 22px;
  min-width: 76px;
  min-height: 50px;
  border: 2px solid #5f421f;
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(215, 173, 99, 0.16), transparent 30%),
    linear-gradient(180deg, #2c2115, #120d08);
  color: #f5d99f;
  box-shadow:
    inset 0 0 0 1px rgba(255, 231, 176, 0.12),
    0 3px 0 #080604,
    0 10px 24px rgba(0, 0, 0, 0.32);
  padding: 0 12px;
  text-shadow: 0 2px 3px #000;
  transform: translateY(-50%);
}

.ornate-ui .dm-continue-action span {
  display: none;
}

.ornate-ui .dm-continue-action:hover {
  transform: translateY(calc(-50% - 1px));
}

.ornate-ui .question-card,
.ornate-ui .result-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ornate-ink);
  padding: 0;
}

.ornate-ui .question-card::before {
  content: "";
  display: block;
  width: min(78%, 650px);
  height: 1px;
  margin: 0 auto 13px;
  background: linear-gradient(90deg, transparent, rgba(75, 50, 24, 0.58), transparent);
}

.ornate-ui .question-label {
  margin-bottom: 8px;
  color: #7e251e;
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
}

.ornate-ui .question-card h3 {
  margin-bottom: 14px;
  color: #120a04;
  font-size: 1.48rem;
  line-height: 1.18;
  text-align: center;
}

.ornate-ui .answers {
  gap: 10px 14px;
  margin: 0 auto;
  max-width: 760px;
}

.ornate-ui .answer-button {
  min-height: 50px;
  border: 2px solid #6b4720;
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(215, 173, 99, 0.16), transparent 18%),
    linear-gradient(180deg, #252522, #111312);
  box-shadow:
    inset 0 0 0 1px rgba(255, 233, 176, 0.14),
    0 3px 0 #090806;
  color: #f6e7c8;
  padding: 8px 16px 8px 58px;
  font-size: 1.08rem;
  font-weight: 900;
  position: relative;
}

.ornate-ui .answer-button::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 28px;
  height: 28px;
  border: 2px solid #a77935;
  background: #21150a;
  transform: translateY(-50%) rotate(45deg);
}

.ornate-ui .answer-button:hover {
  border-color: #d7ad63;
  background:
    linear-gradient(90deg, rgba(215, 173, 99, 0.25), transparent 18%),
    linear-gradient(180deg, #30302c, #171816);
}

.ornate-ui .answer-button.is-correct {
  border-color: #66b96f;
  background: linear-gradient(180deg, #1f3d27, #101b13);
}

.ornate-ui .answer-button.is-wrong {
  border-color: #b62e29;
  background: linear-gradient(180deg, #4b1d19, #1d0e0c);
}

.ornate-ui .question-card.is-resolved {
  padding: 0;
}

.ornate-ui .question-card.is-resolved h3 {
  color: #120a04;
  font-size: 1.42rem;
  text-align: center;
}

.ornate-ui .question-card h3.has-inline-feedback strong.is-correct {
  color: #178047;
}

.ornate-ui .question-card h3.has-inline-feedback strong.is-wrong {
  color: #9c1e18;
}

.ornate-ui .result-panel {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.72fr) auto;
  align-items: stretch;
  gap: 14px;
  margin-top: 2px;
}

.ornate-ui .result-panel .eyebrow {
  color: #7e251e;
}

.ornate-ui .result-panel h3 {
  color: #130a04;
  font-size: 1.18rem;
}

.ornate-ui .result-panel p {
  color: #2a1a0d;
  font-size: 1rem;
}

.ornate-ui .answer-sentence {
  color: #190e07;
  font-size: 1.08rem;
}

.ornate-ui .enemy-turn {
  border-left-color: rgba(75, 50, 24, 0.58);
}

.ornate-ui .enemy-turn span {
  color: #7e251e;
}

.ornate-ui .enemy-turn strong,
.ornate-ui .enemy-turn small,
.ornate-ui .explanation p {
  color: #2a1a0d;
}

.ornate-ui .explanation {
  border-left-color: rgba(75, 50, 24, 0.34);
}

.ornate-ui .explanation strong {
  color: #5e3617;
}

.ornate-ui .secondary-action,
.ornate-ui .primary-action {
  border: 2px solid #5f421f;
  border-radius: 2px;
  background: linear-gradient(180deg, #2c2115, #120d08);
  color: #f4d79b;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 176, 0.12), 0 3px 0 #080604;
}

.ornate-ui .level-paywall {
  border: 2px solid #6c522f;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(241, 213, 151, 0.98), rgba(166, 117, 54, 0.98)),
    #ceb071;
  color: #1c1209;
  box-shadow: inset 0 0 0 2px rgba(68, 43, 20, 0.28), 0 12px 34px rgba(0, 0, 0, 0.32);
}

.ornate-ui .level-paywall .eyebrow {
  color: #6d3713;
  text-shadow: none;
}

.ornate-ui .level-paywall h3,
.ornate-ui .level-paywall p {
  color: #1c1209;
}

.ornate-ui .trial-badge {
  border: 2px solid #5f421f;
  border-radius: 2px;
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 216, 137, 0.35), transparent 58%),
    linear-gradient(180deg, #2c2115, #120d08);
  color: #f4d79b;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 176, 0.12), 0 4px 0 #080604;
}

.ornate-ui .trial-badge span,
.ornate-ui .trial-badge strong {
  color: #f5d889;
}

.ornate-ui .trial-badge small {
  color: #d8bd87;
}

.ornate-ui .paywall-benefits li {
  border: 2px solid rgba(95, 66, 31, 0.74);
  border-radius: 2px;
  background: rgba(255, 244, 210, 0.24);
}

.ornate-ui .paywall-benefits strong,
.ornate-ui .paywall-benefits span {
  color: #1c1209;
}

.ornate-ui .paywall-plan {
  border: 2px solid #5f421f;
  border-radius: 2px;
  background: linear-gradient(180deg, #2c2115, #120d08);
  color: #f4d79b;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 176, 0.12), 0 3px 0 #080604;
}

.ornate-ui .paywall-plan.is-featured {
  border-color: #a77a34;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 176, 0.2), 0 3px 0 #080604, 0 0 22px rgba(164, 109, 30, 0.25);
}

.ornate-ui .paywall-plan span,
.ornate-ui .paywall-plan small {
  color: #d8bd87;
}

.ornate-ui .paywall-plan strong {
  color: #f5d889;
}

.ornate-ui .paywall-terms {
  color: rgba(28, 18, 9, 0.76);
}

.ornate-ui .site-dialog {
  background: rgba(3, 3, 4, 0.72);
  backdrop-filter: blur(4px);
}

.ornate-ui .site-dialog-card {
  width: min(720px, 100%);
  border: 2px solid #5f421f;
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(208, 185, 136, 0.98), rgba(183, 154, 107, 0.98)),
    var(--parchment);
  color: var(--ornate-ink);
  box-shadow: inset 0 0 0 2px rgba(255, 239, 190, 0.22), 0 24px 80px rgba(0, 0, 0, 0.62);
}

.ornate-ui .site-dialog-close,
.ornate-ui .site-dialog-card .secondary-action {
  border: 2px solid #5f421f;
  border-radius: 2px;
  background: linear-gradient(180deg, #2c2115, #120d08);
  color: #f4d79b;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 176, 0.12), 0 3px 0 #080604;
}

.ornate-ui .site-dialog-card .eyebrow,
.ornate-ui .site-dialog-view h2,
.ornate-ui .legal-body,
.ornate-ui .legal-body ul {
  color: #1d1208;
}

.ornate-ui .site-dialog-card .text-action {
  color: #3d230c;
}

.ornate-ui .site-dialog-card .text-action:hover {
  color: #7c1712;
}

.ornate-ui .dungeon-menu-grid section {
  border: 2px solid rgba(95, 66, 31, 0.74);
  border-radius: 2px;
  background: rgba(28, 19, 10, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 239, 190, 0.16);
}

.ornate-ui .dungeon-menu-grid span,
.ornate-ui .dungeon-menu-grid small {
  color: #5b3f22;
}

.ornate-ui .dungeon-menu-grid strong {
  color: #1d1208;
}

.ornate-ui .creator-chat-button {
  border: 2px solid #5f421f;
  border-right: 0;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(180deg, #2c2115, #120d08);
  color: #f4d79b;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 176, 0.12), 0 3px 0 #080604, 0 14px 36px rgba(0, 0, 0, 0.34);
}

.ornate-ui .creator-chat-status {
  border: 2px solid #6c522f;
  border-radius: 0;
  background: rgba(19, 14, 9, 0.96);
  color: #f2e4c7;
}

.ornate-ui .creator-chat-panel {
  top: 50% !important;
  right: 62px !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  width: min(420px, calc(100vw - 36px)) !important;
  height: min(480px, calc(100dvh - 220px)) !important;
  min-height: 360px !important;
  border: 2px solid #6c522f !important;
  border-radius: 0 !important;
  background: rgba(19, 14, 9, 0.96) !important;
  box-shadow: inset 0 0 0 2px rgba(226, 186, 106, 0.14), 0 20px 70px rgba(0, 0, 0, 0.56) !important;
}

.ornate-ui .creator-chat-panel-head {
  background: linear-gradient(180deg, rgba(44, 33, 21, 0.98), rgba(18, 13, 8, 0.98));
  border-bottom: 2px solid #6c522f;
}

.ornate-ui .creator-chat-close {
  border: 2px solid #5f421f;
  border-radius: 2px;
  background: linear-gradient(180deg, #2c2115, #120d08);
  color: #f4d79b;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 176, 0.12), 0 2px 0 #080604;
}

.ornate-ui .inventory-popover {
  top: 112px;
  right: 34px;
  border-color: rgba(215, 173, 99, 0.42);
  border-radius: 0;
  background: rgba(7, 6, 5, 0.9);
  color: #f2e4c7;
}

.ornate-ui .inventory-popover ul {
  color: #d4c4a8;
}

.ornate-ui .scene-monster {
  bottom: clamp(220px, 30dvh, 310px);
  width: min(68%, 720px);
  max-width: 82%;
  height: min(64%, 600px);
  object-position: center bottom;
}

.ornate-ui .scene-frame.has-boss .scene-monster {
  width: min(76%, 800px);
  height: min(72%, 680px);
}

@media (min-width: 981px) {
  .ornate-ui .dialogue-panel {
    bottom: 14px;
    width: min(1360px, calc(100% - 72px));
    max-height: 40dvh;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
    padding: 0;
  }

  .ornate-ui .dialogue-panel.is-dm-collapsed {
    width: min(1180px, calc(100% - 72px));
  }

  .ornate-ui .dm-box {
    width: min(1220px, calc(100% - 140px));
    min-height: 68px;
    padding: 10px 24px 10px 82px;
  }

  .ornate-ui .question-window {
    width: fit-content;
    min-width: min(780px, 100%);
    max-width: min(1160px, 100%);
    padding: 14px 28px 16px;
  }

  .ornate-ui .dm-box::before {
    top: 8px;
    left: 12px;
    width: 54px;
    height: 54px;
  }

  .ornate-ui .dm-box .eyebrow {
    margin-bottom: 6px;
    padding: 4px 12px;
    font-size: 0.82rem;
  }

  .ornate-ui .dm-box #dmNarration {
    display: -webkit-box;
    overflow: hidden;
    font-size: 1.08rem;
    line-height: 1.2;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .ornate-ui .dialogue-panel.is-narration-step {
    width: min(780px, calc(100% - 72px));
  }

  .ornate-ui .dialogue-panel.is-narration-step .dm-box {
    width: 100%;
    min-height: 126px;
    padding: 22px 118px 22px 92px;
  }

  .ornate-ui .dialogue-panel.is-narration-step .dm-box::before {
    top: 20px;
    width: 58px;
    height: 58px;
  }

  .ornate-ui .dialogue-panel.is-narration-step .dm-box #dmNarration {
    display: block;
    overflow: visible;
    font-size: 1.32rem;
    line-height: 1.32;
    -webkit-line-clamp: unset;
  }

  .ornate-ui .question-card::before {
    width: min(78%, 680px);
    margin-bottom: 9px;
  }

  .ornate-ui .question-label {
    margin-bottom: 5px;
    font-size: 0.82rem;
  }

  .ornate-ui .question-card h3 {
    margin-bottom: 10px;
    font-size: 1.34rem;
    line-height: 1.14;
  }

  .ornate-ui .answers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 10px;
    max-width: 920px;
  }

  .ornate-ui .answer-button {
    flex: 0 1 auto;
    min-width: 150px;
    max-width: 230px;
    min-height: 36px;
    padding: 6px 14px 6px 38px;
    font-size: 0.94rem;
    line-height: 1.08;
  }

  .ornate-ui .answer-button::before {
    left: 12px;
    width: 19px;
    height: 19px;
  }

  .ornate-ui .result-panel.has-no-explanation {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ornate-ui .result-panel.has-no-explanation .secondary-action {
    grid-column: 2;
    align-self: center;
    min-width: 180px;
  }

  .ornate-ui .result-panel .secondary-action {
    align-self: end;
    min-width: 150px;
    min-height: 42px;
    padding: 0 18px;
  }
}

@media (max-width: 980px) {
  .ornate-ui .start-panel {
    grid-template-columns: 1fr;
    align-content: end;
    gap: 18px;
    padding: clamp(18px, 4vw, 42px);
  }

  .ornate-ui .start-copy {
    max-width: 720px;
    padding-top: min(28dvh, 220px);
  }

  .ornate-ui .start-copy h2 {
    font-size: clamp(2.3rem, 7vw, 4rem);
  }

  .ornate-ui .start-card {
    justify-self: stretch;
    width: 100%;
    min-height: 170px;
  }

  .ornate-ui .scene-frame {
    height: 100dvh;
    min-height: 0;
  }

  .ornate-ui .scene-hud {
    top: 14px;
    left: 16px;
    right: 16px;
    grid-template-columns: 248px minmax(0, 1fr) 120px;
  }

  .ornate-ui .hud-bar {
    width: 248px;
    grid-template-columns: 30px minmax(0, 1fr) 58px;
  }

  .ornate-ui .dialogue-panel {
    bottom: 14px;
    width: min(900px, calc(100% - 24px));
    max-height: 52dvh;
    gap: 8px;
    padding: 0;
  }

  .ornate-ui .dialogue-panel.is-dm-collapsed {
    max-height: 42dvh;
  }

  .ornate-ui .dialogue-panel.is-narration-step {
    width: min(760px, calc(100% - 24px));
    max-height: 44dvh;
  }

  .ornate-ui .dm-box {
    width: min(760px, calc(100% - 34px));
    padding: 12px 20px 12px 78px;
  }

  .ornate-ui .dm-box #dmNarration {
    font-size: 1rem;
    line-height: 1.22;
  }

  .ornate-ui .dialogue-panel.is-narration-step .dm-box {
    width: 100%;
    min-height: 118px;
    padding: 16px 94px 16px 78px;
  }

  .ornate-ui .dialogue-panel.is-narration-step .dm-box #dmNarration {
    display: block;
    overflow: visible;
    font-size: 1.16rem;
    line-height: 1.28;
    -webkit-line-clamp: unset;
  }

  .ornate-ui .dialogue-panel.is-narration-step .dm-continue-action {
    right: 16px;
    min-width: 66px;
    min-height: 46px;
  }

  .ornate-ui .question-window {
    padding: 18px 28px 20px;
  }

  .ornate-ui .scene-monster {
    bottom: calc(48dvh + 20px);
    width: min(72%, 520px);
    height: min(50%, 460px);
  }

  .ornate-ui .dice-tray {
    bottom: calc(48dvh + 28px);
  }

  .ornate-ui .scene-frame.is-combat-question-only .dice-tray {
    bottom: calc(36dvh + 24px);
  }
}

@media (max-width: 620px) {
  .ornate-ui .app-shell {
    width: 100%;
    padding: 0;
  }

  .ornate-ui .start-panel {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    gap: 12px;
    padding: 16px;
  }

  .ornate-ui .start-copy {
    width: min(100%, 340px);
    max-width: calc(100vw - 32px);
    padding-top: min(31dvh, 205px);
  }

  .ornate-ui .start-copy h2 {
    max-width: 100%;
    margin-bottom: 9px;
    overflow-wrap: break-word;
    font-size: clamp(1.76rem, 9.2vw, 2.42rem);
    line-height: 1.04;
    text-wrap: balance;
  }

  .ornate-ui .start-copy p {
    max-width: 100%;
    overflow-wrap: break-word;
    font-size: 1rem;
    line-height: 1.34;
  }

  .ornate-ui .landing-steps {
    min-height: clamp(220px, 38vh, 315px);
  }

  .ornate-ui .start-copy .primary-action {
    min-height: 44px;
    margin-top: 10px;
    padding: 0 16px;
  }

  .ornate-ui .start-card {
    display: none;
  }

  .ornate-ui .landing-legal-links {
    left: 16px;
    bottom: 10px;
  }

  @media (max-height: 720px) {
    .ornate-ui .start-copy {
      padding-top: min(18dvh, 118px);
    }

    .ornate-ui .landing-steps {
      min-height: 190px;
    }

    .ornate-ui .start-copy h2 {
      font-size: clamp(1.56rem, 8vw, 2rem);
    }

    .ornate-ui .start-copy p {
      font-size: 0.94rem;
      line-height: 1.28;
    }
  }

  .ornate-ui .scene-frame {
    height: 100dvh;
    min-height: 0;
  }

  .ornate-ui .scene-hud {
    top: 8px;
    left: 8px;
    right: 8px;
    grid-template-columns: minmax(0, 1fr) 86px;
    grid-template-rows: repeat(3, auto);
    gap: 3px 7px;
  }

  .ornate-ui .hud-bar {
    width: min(194px, calc(100vw - 112px));
    grid-template-columns: 24px minmax(0, 1fr) 48px;
    grid-template-rows: 16px auto;
    gap: 1px 5px;
  }

  .ornate-ui .xp-hud,
  .ornate-ui .mastery-hud {
    transform: scale(0.9);
  }

  .ornate-ui .hud-icon {
    width: 23px;
    height: 23px;
  }

  .ornate-ui .hp-icon::before {
    left: 6px;
    top: 8px;
    width: 13px;
    height: 13px;
  }

  .ornate-ui .hp-icon::after {
    left: 4px;
    top: 5px;
    width: 8px;
    height: 8px;
    box-shadow: 8px 0 0 #c63b31;
  }

  .ornate-ui .hud-bar span,
  .ornate-ui .hud-bar strong {
    font-size: 0.76rem;
  }

  .ornate-ui .hero-hud .meter {
    height: 12px;
  }

  .ornate-ui .meter {
    height: 8px;
    border-width: 1px;
  }

  .ornate-ui .loot-hud {
    grid-column: 2;
    grid-row: 1 / span 2;
    flex-direction: column;
    min-width: 82px;
    min-height: 58px;
    padding: 6px;
  }

  .ornate-ui .icon-action {
    grid-template-columns: 24px auto;
    gap: 5px;
    min-height: 30px;
    font-size: 0.82rem;
  }

  .ornate-ui .menu-action {
    grid-template-columns: auto;
    min-width: 58px;
    min-height: 26px;
    padding: 0 6px;
    font-size: 0.74rem;
  }

  .ornate-ui .bag-icon {
    width: 22px;
    height: 20px;
  }

  .ornate-ui .bag-icon::before {
    left: 5px;
    top: -7px;
    width: 9px;
    height: 9px;
  }

  .ornate-ui .loot-icon {
    width: 21px;
    height: 21px;
    font-size: 0.56rem;
  }

  .ornate-ui .room-chip {
    top: 104px;
    left: 8px;
    min-width: 94px;
    padding: 4px 6px;
  }

  .ornate-ui .room-chip span,
  .ornate-ui .room-chip strong {
    font-size: 0.62rem;
  }

  .ornate-ui .enemy-hud,
  .ornate-ui .inventory-popover {
    top: 74px;
    right: 8px;
    width: min(172px, calc(100% - 116px));
    padding: 6px 7px;
  }

  .ornate-ui .inventory-popover {
    width: 210px;
  }

  .ornate-ui .enemy-hud span,
  .ornate-ui .enemy-hud strong {
    font-size: 0.72rem;
  }

  .ornate-ui .dialogue-panel {
    bottom: 7px;
    width: calc(100% - 14px);
    max-height: 49dvh;
    overflow: auto;
    gap: 6px;
    padding: 0;
  }

  .ornate-ui .dialogue-panel.is-dm-collapsed {
    max-height: 40dvh;
  }

  .ornate-ui .dialogue-panel.is-narration-step {
    width: calc(100% - 14px);
    max-height: 42dvh;
  }

  .ornate-ui .dialogue-panel::before,
  .ornate-ui .dialogue-panel::after {
    width: 34px;
    height: 34px;
  }

  .ornate-ui .dm-box {
    width: 100%;
    min-height: 44px;
    padding: 10px 10px 10px 54px;
  }

  .ornate-ui .dialogue-panel.is-narration-step .dm-box {
    min-height: 148px;
    padding: 12px 12px 62px 58px;
  }

  .ornate-ui .question-window {
    width: 100%;
    padding: 12px;
  }

  .ornate-ui .dm-box::before {
    top: 0;
    width: 42px;
    height: 42px;
    border-width: 2px;
  }

  .ornate-ui .dm-box .eyebrow {
    margin-bottom: 5px;
    padding: 3px 8px;
    font-size: 0.62rem;
  }

  .ornate-ui .dm-box #dmNarration {
    display: -webkit-box;
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .ornate-ui .dialogue-panel.is-narration-step .dm-box #dmNarration {
    display: block;
    overflow: visible;
    font-size: 1.08rem;
    line-height: 1.22;
    -webkit-line-clamp: unset;
  }

  .ornate-ui .dialogue-panel.is-narration-step .dm-continue-action {
    top: auto;
    right: 12px;
    bottom: 12px;
    min-width: 62px;
    min-height: 38px;
    transform: none;
  }

  .ornate-ui .dialogue-panel.is-narration-step .dm-continue-action:hover {
    transform: translateY(-1px);
  }

  .ornate-ui .question-card::before {
    margin-bottom: 7px;
  }

  .ornate-ui .question-label {
    margin-bottom: 5px;
    font-size: 0.76rem;
  }

  .ornate-ui .question-card h3 {
    margin-bottom: 8px;
    font-size: 1.08rem;
    line-height: 1.12;
  }

  .ornate-ui .answers {
    gap: 6px;
  }

  .ornate-ui .answer-button {
    min-height: 38px;
    padding: 5px 8px 5px 40px;
    font-size: 0.94rem;
    line-height: 1.08;
  }

  .ornate-ui .answer-button::before {
    left: 12px;
    width: 20px;
    height: 20px;
  }

  .ornate-ui .question-card.is-resolved h3 {
    font-size: 1.08rem;
    line-height: 1.18;
  }

  .ornate-ui .result-panel {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .ornate-ui .result-panel h3 {
    font-size: 1rem;
  }

  .ornate-ui .result-panel p,
  .ornate-ui .answer-sentence {
    font-size: 0.9rem;
    line-height: 1.18;
  }

  .ornate-ui .explanation {
    border-left: 0;
    border-top: 1px solid rgba(75, 50, 24, 0.34);
    padding: 7px 0 0;
  }

  .ornate-ui .secondary-action {
    min-height: 34px;
    font-size: 0.8rem;
  }

  .ornate-ui .scene-monster {
    bottom: calc(49dvh + 12px);
    width: min(88%, 360px);
    height: 36dvh;
  }

  .ornate-ui .scene-frame.has-boss .scene-monster {
    width: min(94%, 400px);
    height: 39dvh;
  }

  .ornate-ui .dice-tray {
    right: 9px;
    bottom: calc(49dvh + 18px);
  }

  .ornate-ui .scene-frame.is-combat-question-only .dice-tray {
    bottom: calc(38dvh + 14px);
  }

  .ornate-ui .roll-card {
    grid-template-columns: 32px minmax(78px, auto);
    padding: 5px;
  }

  .ornate-ui .die {
    width: 32px;
    height: 32px;
  }

  .ornate-ui .roll-formula {
    font-size: 0.58rem;
  }
}

@media (max-width: 760px) {
  .paywall-header,
  .paywall-benefits,
  .paywall-plans {
    grid-template-columns: 1fr;
  }

  .trial-badge {
    min-height: 118px;
  }

  .paywall-benefits li {
    min-height: auto;
  }

  .paywall-plan {
    min-height: 104px;
  }

  .creator-chat-button {
    top: 48%;
    width: 42px;
    min-height: 116px;
    padding: 9px 6px;
    font-size: 0.78rem;
  }

  .creator-chat-status {
    top: calc(48% + 76px);
    right: 50px;
    bottom: auto;
    width: min(280px, calc(100vw - 66px));
  }

  .creator-chat-panel,
  .ornate-ui .creator-chat-panel {
    inset: auto 54px auto 8px !important;
    top: 40% !important;
    transform: translateY(-50%) !important;
    width: auto !important;
    height: min(420px, calc(100dvh - 300px)) !important;
    min-height: 0 !important;
  }

  .ornate-ui #cw-widget-holder.woot-widget-holder:not(.woot--hide) {
    inset: auto 54px auto 8px !important;
    top: 40% !important;
    transform: translateY(-50%) !important;
    width: auto !important;
    height: min(420px, calc(100dvh - 300px)) !important;
    min-height: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ornate-ui .start-panel::before {
    animation: none;
  }
}
