:root {
  color-scheme: light;
  --paper: #f1e5d2;
  --ink: #3e291e;
  --muted: #705b48;
  --gold: #b78a42;
  --red: #863c28;
  --wood: #442c21;
  font-family: "Songti SC", "Noto Serif CJK SC", "STSong", serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button,
a,
input,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 3px solid #405d68;
  outline-offset: 4px;
}
::selection {
  background: #cfad78;
  color: #321e14;
}
button {
  color: inherit;
}
.map-top {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 30px;
  right: 30px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  color: #fff4d1;
  text-shadow: 0 2px 6px #261d14;
  font-size: 16px;
}
.direction span {
  font-size: 13px;
  margin-left: 20px;
}
.map-page {
  position: relative;
  max-width: 1800px;
  margin: auto;
}
.map-scroll {
  overflow: auto;
  scrollbar-color: #9e7b52 #e8d7bb;
}
.map-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1672/850;
  min-width: 850px;
  overflow: hidden;
  background: #c7b991;
}
.courtyard-image {
  position: absolute;
  inset: -7% 0 -7%;
  background: url("/public/assets/courtyard-reference.png") center/100% 100%
    no-repeat;
}
.building {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  background: #713a24;
  color: #ffe3a6;
  border: 2px solid #d8ad62;
  box-shadow: 0 3px 10px #3e21187a;
  min-width: 112px;
  min-height: 46px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 19px;
  white-space: nowrap;
  transition:
    filter 0.2s,
    translate 0.2s;
}
.building:hover {
  filter: brightness(1.25);
  translate: 0 -3px;
}
.building.culture {
  font-size: 15px;
  background: #514330;
  min-width: 85px;
  min-height: 44px;
  padding: 6px 10px;
  border-color: #c0a679;
}
.building[data-space="sanqing"] {
  font-size: 18px;
}
.hall-nav {
  display: flex;
  justify-content: center;
  gap: 0;
  background: #e9d6b7;
  border-bottom: 1px solid #d6b98e;
  padding: 7px 20px;
  flex-wrap: wrap;
}
.hall-nav button {
  min-height: 44px;
  padding: 10px 25px;
  border: 0;
  background: none;
  font-size: 15px;
}
.hall-nav button:hover {
  background: #dcc295;
}
.map-caption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 30px;
  font-size: 13px;
  color: var(--muted);
}
.footnote {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 12px;
  color: #735d49;
}
.footnote button {
  border: 0;
  background: none;
  text-decoration: underline;
  color: inherit;
}
.back,
.text-button {
  border: 0;
  background: none;
  padding: 7px 0;
  font-size: 14px;
}
.primary {
  background: #833b29;
  color: #ffedca;
  border: 1px solid #9e6538;
  padding: 17px 24px;
  border-radius: 8px;
  box-shadow: 0 5px 12px #7142222a;
  font-size: 17px;
}
.primary:hover:not(:disabled) {
  background: #6d2f20;
}
.public-choice {
  font:
    12px/1.7 system-ui,
    sans-serif;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  color: #67503c;
  cursor: pointer;
}
.public-choice input {
  accent-color: #813b28;
  min-width: 17px;
  min-height: 17px;
}
.reading {
  margin-top: 30px;
  border-top: 1px solid #c9af87;
  padding-top: 18px;
  font-size: 14px;
  line-height: 1.9;
}
.reading summary {
  cursor: pointer;
}
.reading p {
  color: #66503c;
}
.reading a {
  font-size: 12px;
}
.culture-page {
  min-height: 65vh;
  max-width: 740px;
  padding: 50px 30px;
  margin: auto;
  line-height: 2;
}
.culture-page h1 {
  font-size: 40px;
  font-weight: 500;
}
.culture-page p {
  font-size: 18px;
  margin-bottom: 35px;
}
.culture-page a {
  display: block;
  margin-top: 25px;
}
dialog {
  border: 0;
  border-radius: 14px;
  background: #f7eddb;
  color: var(--ink);
  padding: 30px;
  width: min(470px, calc(100% - 28px));
  max-height: 85dvh;
  box-shadow: 0 20px 80px #2c1b1266;
}
dialog::backdrop {
  background: #23190eb3;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
.dialog-head h2 {
  font-size: 24px;
  font-weight: 500;
  margin: 0;
}
.dialog-head button {
  background: none;
  border: 0;
  font-size: 30px;
  min-width: 44px;
  min-height: 44px;
}
dialog p {
  font: 13px/1.8 system-ui;
  color: #6b5540;
}
dialog form {
  margin-top: 24px;
  display: grid;
  gap: 10px;
}
input[type="email"], #otp {
  width: 100%;
  background: #fff9ed;
  border: 1px solid #a88b64;
  border-radius: 6px;
  padding: 12px;
  color: var(--ink);
  caret-color: #803922;
}
.demo-accounts {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}
.demo-accounts button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border: 1px solid #cfb58b;
  padding: 14px;
  border-radius: 6px;
  background: #eee0c7;
}
.demo-accounts span {
  font: 11px system-ui;
  color: #745f49;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 15px 7px;
  border-bottom: 1px solid #dcc7a5;
}
td:last-child,
th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
th {
  font-weight: 500;
  color: #6c573f;
  font-size: 12px;
}
.empty {
  padding: 30px 0;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 30px);
  border-radius: 8px;
  background: #443020;
  color: #fff1d6;
  padding: 13px 22px;
  font: 14px/1.6 system-ui;
  box-shadow: 0 7px 22px #2b1f1533;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 100;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.boot {
  text-align: center;
  margin: 30vh auto;
}
@media (min-width: 1500px) {
  .map-scene {
    max-height: 850px;
  }
}
@media (max-width: 700px) {
  .map-scene {
    width: 1000px;
    aspect-ratio: 1672/941;
    min-height: 565px;
  }
  .map-top {
    top: 14px;
    left: 18px;
    right: 18px;
    font-size: 14px;
  }
  .direction span {
    display: none;
  }
  .hall-nav {
    padding: 8px 10px;
  }
  .hall-nav button {
    font-size: 13px;
    padding: 8px 13px;
  }
  .map-caption {
    padding: 12px 18px;
    font-size: 11px;
  }
  .map-caption span:first-child {
    display: none;
  }
  .map-caption span:last-child {
    margin: auto;
  }
  .footnote {
    font-size: 9px;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px;
  }
  .back,
  .text-button {
    font-size: 12px;
  }
  .reading {
    margin-top: 24px;
  }
  .public-choice {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Product shell: the courtyard and its plaques are the interface. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.login-section-label {
  margin-top: 16px !important;
  font-size: 12px !important;
}
.demo-accounts button {
  justify-content: center;
}
.demo-accounts strong {
  font-size: 16px;
  font-weight: 500;
}
/* The canvas receives courtyard gestures through the keyboard overlays. */
:root {
  --scene-surface: rgba(0, 0, 0, 0.48);
  --scene-text: #fff1d0;
  --scene-edge: 28px;
  --scene-top: 24px;
  --scene-bottom: 26px;
  --scene-control-size: 46px;
}
html,
body {
  height: 100%;
  overflow: hidden;
}
#game-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #342d23;
}
#game-stage canvas {
  display: block;
  touch-action: none;
}
.courtyard-lettering-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.courtyard-lettering {
  position: absolute;
  display: block;
  overflow: visible;
  pointer-events: none;
  shape-rendering: geometricPrecision;
}
#app {
  position: relative;
  z-index: 2;
  height: 100dvh;
  overflow: auto;
  overscroll-behavior: contain;
}
.on-map #app {
  overflow: clip;
  pointer-events: none;
}
.on-map .boot {
  color: var(--scene-text);
}
.on-map .map-page {
  position: fixed;
  inset: 0;
  max-width: none;
}
.building-access {
  position: absolute;
  inset: 0;
}
.map-access {
  position: absolute;
  translate: -50% -50%;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.map-access:focus-visible {
  outline: 0;
}
.map-access:focus-visible::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 78%;
  translate: -50% -50%;
  width: clamp(18px, 32%, 42px);
  height: clamp(10px, 20%, 22px);
  border: 2px solid var(--scene-text);
  border-radius: 50%;
  box-shadow: 0 1px 4px #24150f;
}

.scene-control {
  min-width: var(--scene-control-size);
  min-height: var(--scene-control-size);
  display: grid;
  place-items: center;
  padding: 0 16px;
  border: 1px solid #fff2d440;
  border-radius: 6px;
  background: var(--scene-surface);
  color: var(--scene-text);
  text-shadow: 0 1px 4px #18110b;
  box-shadow: 0 3px 12px #20170e33;
}
button.scene-control:hover:not([aria-disabled="true"]),
a.scene-control:hover {
  border-color: #fff2d480;
}
.scene-control:focus-visible {
  outline: 2px solid var(--scene-text);
  outline-offset: 3px;
}
.scene-control svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px #18110b);
}
[data-reload] {
  pointer-events: auto;
}
[data-scene-status] {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.scene-status {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: calc(100% - 40px);
  padding: 16px 20px;
  border-radius: 8px;
  background: #34271d;
  color: var(--scene-text);
  text-align: center;
}
.map-page > .scene-status {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}
.scene-status p {
  margin: 0;
}

.culture-view .culture-page {
  display: grid;
  place-items: center;
  min-height: 100%;
  max-width: none;
  padding: calc(28px + env(safe-area-inset-top)) calc(var(--scene-edge) + env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) calc(var(--scene-edge) + env(safe-area-inset-left));
  background: #21170f70;
}
.culture-sheet {
  width: min(100%, 480px);
  padding: 20px clamp(20px, 5vw, 36px) 32px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 40px #20140f55;
}
.culture-sheet h1 {
  margin: 14px 0 6px;
  font-size: clamp(28px, 6vw, 36px);
}
.culture-sheet p {
  margin: 0 0 16px;
}
.culture-sheet a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  font-size: 14px;
}
.culture-sheet button,
dialog .text-button,
.demo-accounts button {
  min-height: 44px;
}
dialog {
  max-height: min(85dvh, calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  padding: clamp(16px, 5vw, 30px);
  overflow: auto;
  overscroll-behavior: contain;
}
dialog input[type="email"], #otp {
  min-height: 44px;
  font-size: 16px;
}
.dialog-error {
  color: #84321e;
  margin: 0;
}
.dialog-error:not(:empty) {
  margin-top: 12px;
}
.login-actions { display: flex; justify-content: space-between; gap: 16px; }
.account-email { overflow-wrap: anywhere; }
.account-delete { margin-top: 24px; }
.account-delete summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
#otp { letter-spacing: .25em; font-variant-numeric: tabular-nums; }
#toast {
  bottom: calc(24px + env(safe-area-inset-bottom));
}

@media (max-width: 700px) {
  :root {
    --scene-edge: 16px;
    --scene-top: 16px;
    --scene-bottom: 16px;
  }
}

.in-hall {
  --hall-top: calc(var(--scene-top) + env(safe-area-inset-top));
  --hall-right: calc(var(--scene-edge) + env(safe-area-inset-right));
  --hall-bottom: calc(var(--scene-bottom) + env(safe-area-inset-bottom));
  --hall-left: calc(var(--scene-edge) + env(safe-area-inset-left));
  --scene-surface: #0009;
  --hall-background: #261a14;
}
.in-hall #app {
  overflow: clip;
}
.hall-page,
.sanctuary {
  position: absolute;
  inset: 0;
  background: var(--hall-background);
}
.hall-page {
  color: var(--scene-text);
}
.sanctuary {
  touch-action: pan-y;
}
.in-hall #game-stage {
  position: absolute;
  background: var(--hall-background);
  pointer-events: none;
}

.hall-hud {
  position: absolute;
  inset: var(--hall-top) var(--hall-right) auto var(--hall-left);
  display: flex;
  align-items: start;
  pointer-events: none;
}
.hall-ui {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  white-space: nowrap;
}
.hall-art {
  flex: none;
  inline-size: 42px;
  block-size: 42px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px #180e08);
  transition: filter 240ms ease;
}
.hall-ui:hover:not(:disabled) .hall-art,
.hall-ui:focus-visible .hall-art {
  filter: brightness(1.2) drop-shadow(0 2px 3px #31180d);
}
.hall-page {
  --hall-text-shadow: 0 1px 2px #160c07, 0 2px 5px #160c07, 0 2px 9px #160c07;
  --deity-half-width: min(26vw, 19dvh);
  text-shadow: var(--hall-text-shadow);
}
.hall-page button:focus-visible {
  outline: 2px solid #ffdf9f;
  outline-offset: 2px;
  border-radius: 5px;
}
.hall-back,
.hall-floor {
  font-size: 14px;
  pointer-events: auto;
}
.hall-heading {
  position: absolute;
  inset: 1px 84px auto;
  text-align: center;
}
.hall-heading h1 {
  display: inline-block;
  margin: 0;
  font-size: clamp(26px, 4.1vw, 42px);
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.15;
}
.hall-heading h1:focus-visible {
  outline: 2px solid var(--scene-text);
  outline-offset: 5px;
  border-radius: 2px;
}
.hall-heading p {
  margin: 6px 0 0;
  color: #f4dfbf;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.12em;
}
.hall-floor {
  position: absolute;
  inset: calc(var(--hall-top) + 48px) auto auto var(--hall-left);
}
.hall-floor .hall-art,
.culture-floor .hall-art {
  inline-size: 32px;
  block-size: 32px;
}
.hall-floor .hall-art {
  rotate: -90deg;
}
.culture-back .hall-art {
  inline-size: 34px;
  block-size: 34px;
}
.culture-floor {
  display: flex;
  width: max-content;
}
.culture-floor .hall-art {
  rotate: 90deg;
}
.hall-switch {
  position: absolute;
  inset-block-start: 44%;
  translate: 0 -50%;
}
.hall-prev {
  inset-inline-start: var(--hall-left);
}
.hall-next {
  inset-inline-end: var(--hall-right);
}
.hall-next .hall-art {
  scale: -1 1;
}
.hall-switch:disabled {
  opacity: 0.32;
}

.hall-offer {
  position: absolute;
  inset-block-start: 68%;
  inset-inline-start: 50%;
  inline-size: min(58vw, clamp(112px, 19dvh, 215px));
  block-size: calc(14% + 54px);
  translate: -50% 0;
}
.hall-offer[hidden],
.deity-inspect[hidden],
.hall-recent[hidden] {
  display: none;
}
.hall-offer-label {
  position: absolute;
  inset: auto auto 0 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 48px;
  padding-inline: 4px;
  text-align: start;
  transition: color 550ms ease, filter 550ms ease;
}
.hall-offer-label > .hall-art {
  inline-size: 40px;
  block-size: 40px;
}
.reduce-scene-motion .hall-offer-label,
.reduce-scene-motion .hall-art {
  transition-duration: 0s;
}
.hall-offer.is-active .hall-offer-label {
  color: #ffe6ae;
  filter: drop-shadow(0 2px 5px #eab47352);
}
.hall-page .hall-offer:focus-visible {
  outline: none;
}
.hall-offer:focus-visible .hall-offer-label {
  outline: 2px solid #ffdf9f;
  outline-offset: 2px;
  border-radius: 5px;
}
.hall-offer:disabled {
  opacity: 1;
}
.hall-offer:disabled .hall-offer-label {
  color: #dec9a6;
}
#hall-offer-action,
#hall-quota {
  display: block;
}
#hall-offer-action {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: .08em;
}
.quota-icons {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-block-start: 1px;
  color: #f8e3bc;
  font: 11px/1.1 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.quota-stick .hall-art {
  display: block;
  inline-size: 13px;
  block-size: 16px;
}
.quota-stick.is-spent .hall-art {
  opacity: .4;
  filter: grayscale(.85) brightness(.72) drop-shadow(0 1px 1px #180e08);
}
.quota-icons > :last-child {
  margin-inline-start: 3px;
}

.altar-hud {
  position: absolute;
  inset: calc(60% + 3px) 0 auto;
  display: grid;
  justify-items: center;
  pointer-events: none;
}
.hall-statistic {
  min-block-size: 40px;
  display: grid;
  align-content: center;
  color: #fff1d0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.hall-statistic:has(.hall-rank) {
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.2vw, 16px);
}
.hall-stat-value {
  display: flex;
  align-items: center;
  gap: 4px;
}
.hall-stat-value .hall-art {
  inline-size: 28px;
  block-size: 32px;
}
.hall-stat-value p {
  margin: 0;
  white-space: nowrap;
}
.hall-stat-value strong {
  margin-inline-start: 4px;
  font-size: 14px;
}
.hall-statistic progress {
  display: block;
  inline-size: 100%;
  block-size: 5px;
  overflow: hidden;
  appearance: none;
  border: 1px solid #bd9153;
  border-radius: 2px;
  box-shadow: 0 1px 2px #160c07;
  background: #2a190d;
}
.hall-statistic progress::-webkit-progress-bar {
  background: transparent;
}
.hall-statistic progress::-webkit-progress-value {
  background: #e9be83;
}
.hall-statistic progress::-moz-progress-bar {
  background: #e9be83;
}
.hall-rank {
  pointer-events: auto;
  gap: 2px;
  font-size: 12px;
}
.hall-rank .hall-art {
  inline-size: 34px;
  block-size: 36px;
}
.hall-deities {
  position: fixed;
  inset: auto auto var(--hall-bottom) 50%;
  display: flex;
  translate: -50% 0;
}
.hall-deities button {
  pointer-events: auto;
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  border: 0;
  background: none;
}
.hall-deities button::before {
  content: "";
  inline-size: 8px;
  block-size: 8px;
  border: 1px solid #d2aa70;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #ba8a53, #5c3821 68%);
  box-shadow: 0 1px 3px #160d08;
}
.hall-deities button[aria-pressed="true"]::before,
.hall-deities button:hover::before {
  background: radial-gradient(circle at 38% 29%, #fff0b3, #b5773a 75%);
  box-shadow: 0 1px 3px #160d08, 0 0 8px #f6bf6b85;
}

.deity-inspect {
  position: absolute;
  inset: 21% auto 40% 50%;
  inline-size: calc(var(--deity-half-width) * 2);
  padding: 0;
  border: 0;
  background: none;
  translate: -50% 0;
}
.hall-recent {
  --feed-row-size: 31px;
  position: absolute;
  inset: auto auto max(19%, calc(var(--hall-bottom) + 58px)) var(--hall-left);
  display: flex;
  flex-direction: column;
  inline-size: min(27vw, 264px);
  block-size: calc(var(--feed-row-size) * 4);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #a97b50 #27190f55;
  color: #f8e5c1;
  font-size: 13px;
}
.hall-recent ol {
  flex: none;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}
.hall-recent li {
  display: grid;
  grid-template-columns: 2.9em minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  block-size: var(--feed-row-size);
  padding-inline: 6px;
  background: linear-gradient(90deg, #1e130bc9, #1e130b48 90%, transparent);
}
.hall-recent time {
  color: #e1bc88;
  font-variant-numeric: tabular-nums;
}
.recent-name,
.recent-action {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-name {
  color: #ffe1a4;
}
.in-hall #toast {
  inset-block: calc(var(--hall-top) + 78px) auto;
  width: max-content;
  max-width: calc(100% - var(--hall-left) - var(--hall-right));
  background: #000c;
}

@media (max-width: 700px) {
  .deity-inspect {
    inset-block-start: 28%;
  }
  .hall-recent {
    --feed-row-size: 34px;
    inline-size: max(96px, calc(32vw - var(--hall-left) - 4px));
    block-size: calc(var(--feed-row-size) * 2);
    font-size: 11px;
  }
  .hall-recent li {
    grid-template-columns: 2.65em minmax(0, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 0 3px;
    padding-inline: 3px;
  }
  .recent-action {
    grid-column: 1 / -1;
  }
}
@media (orientation: portrait) and (max-height: 600px) {
  .in-hall {
    --scene-bottom: 4px;
  }
  .hall-offer {
    block-size: min(calc(14% + 48px), calc(32% - var(--hall-bottom) - var(--scene-control-size) - 4px));
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .hall-recent {
    inset-block-end: calc(var(--hall-bottom) + 98px);
    block-size: calc(var(--feed-row-size) * 2);
  }
}

#experience-controls {
  position: fixed;
  z-index: 4;
  inset: auto calc(var(--scene-edge) + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) auto;
  display: flex;
  gap: 6px;
}
#experience-controls .hall-art {
  inline-size: 44px;
  block-size: 44px;
}
.deity-inspect:hover {
  cursor: zoom-in;
}

.scroll-dialog {
  --scroll-ink: #402718;
  --scroll-rule: #946638;
  width: min(560px, calc(100vw - 36px));
  max-height: min(84dvh, calc(100dvh - 28px));
  padding: clamp(18px, 5vw, 34px);
  border: 1px solid #5a341c;
  border-block: 8px solid #653818;
  border-radius: 4px;
  color: var(--scroll-ink);
  background:
    linear-gradient(90deg, #b47d49a0, #dfc09533 9%, transparent 32%, #b47d4920 85%, #b47d497a),
    #f0dfb8;
  box-shadow:
    inset 0 0 0 4px #e8c98e, inset 0 0 0 5px #9e7546,
    inset 0 0 26px #a56e3f48, 0 18px 55px #1009059c;
}
.scroll-dialog[open] {
  animation: open-scroll 200ms ease-out;
}
@keyframes open-scroll {
  from { opacity: 0; transform: translateY(6px); }
}
.scroll-dialog .dialog-head {
  border-block-end: 1px solid #94663888;
  padding-block-end: 6px;
}
.scroll-dialog .dialog-head h2 {
  color: #452717;
  font-size: clamp(19px, 4vw, 27px);
}
.scroll-dialog .scroll-close {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #682f20;
  inline-size: 44px;
  block-size: 44px;
  font-size: 28px;
  line-height: 1;
}
.paper-action {
  min-block-size: 44px;
  padding: 5px 13px;
  border: 1px solid #8f6138;
  border-radius: 3px;
  color: #542b1d;
  background: #e9cca0;
}
.scroll-dialog .dialog-head button:focus-visible,
.scroll-dialog button:focus-visible,
.deity-scroll:focus-visible {
  outline: 2px solid #8c4a24;
  outline-offset: 2px;
}
.scroll-subtitle {
  margin: 12px 0 5px;
  font-size: 14px;
  font-weight: 500;
  color: #642e1e;
}
.rank-entries {
  max-block-size: clamp(112px, calc(84dvh - 220px), 365px);
  overflow: auto;
  scrollbar-width: thin;
}
.rank-entries td,
.rank-entries th {
  padding: 7px 5px;
  border-color: #94663855;
  overflow-wrap: anywhere;
}
.rank-entries th:first-child,
.rank-entries td:first-child {
  inline-size: 18%;
}
.rank-current {
  background: #9f683023;
}
.rank-own {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
  margin-block-start: 13px;
  padding-block-start: 10px;
  border-block-start: 1px solid var(--scroll-rule);
}
.rank-own h3 {
  margin: 0 0 4px;
  color: #642e1e;
  font-size: 13px;
  font-weight: 500;
}
.rank-own strong {
  font-size: 18px;
}
.rank-own-score {
  display: grid;
  text-align: end;
  gap: 4px;
  font-size: 13px;
}
.rank-own .public-choice {
  flex-basis: 100%;
}
.rank-empty {
  margin-block: 12px;
}
#deity-details {
  width: min(680px, calc(100vw - 24px));
  padding: 18px clamp(14px, 4vw, 32px) 12px;
}
.deity-scroll {
  writing-mode: vertical-rl;
  text-orientation: upright;
  height: min(420px, 70dvh);
  width: 100%;
  padding: 12px 27px 8px 6px;
  overflow: auto hidden;
  overscroll-behavior: contain;
  touch-action: pan-x;
  scrollbar-color: #976d3e #e4cca3;
  scrollbar-width: thin;
}
.deity-scroll h2 {
  font-size: clamp(22px, 4.5vw, 30px);
  font-weight: 600;
  letter-spacing: .18em;
  color: #752f24;
  margin: 0 0 0 .7em;
  padding-inline: .25em;
  border-inline-start: 1px solid #a56b40;
}
.deity-scroll p {
  color: var(--scroll-ink);
  font: inherit;
  font-size: clamp(16px, 3.8vw, 19px);
  line-height: 1.9;
  letter-spacing: .045em;
  text-indent: 2em;
  margin: 0 0 0 .5em;
  line-break: strict;
}
.deity-close {
  position: absolute;
  inset: 12px 8px auto auto;
}
.deity-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  column-gap: 12px;
  padding-block-start: 8px;
  border-block-start: 1px solid #94663886;
  font-size: 12px;
}
.deity-footer summary {
  cursor: pointer;
}
.deity-footer ul {
  margin: 6px 0 0;
  padding-inline-start: 18px;
}
.deity-footer li + li {
  margin-block-start: 5px;
}
.deity-footer .public-choice {
  margin: 0;
}
.fellow-current,
.scroll-settings > * {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  border-block-end: 1px solid #94663855;
}
.fellow-current {
  padding-block: 10px;
}
.scroll-settings select {
  min-height: 38px;
  color: inherit;
  background: #f1deb7;
  border: 1px solid #a67b50;
  border-radius: 3px;
  font: inherit;
}
.scroll-settings input {
  inline-size: 19px;
  block-size: 19px;
  accent-color: #784027;
}
.scroll-settings .settings-time {
  color: #654a32;
}
@media (max-width: 480px) {
  .hall-deities {
    inset-inline-start: var(--hall-left);
    translate: none;
  }
  .hall-rank {
    min-block-size: 40px;
  }
  .hall-statistic:has(.hall-rank) {
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-dialog[open] { animation: none; }
}
.reduce-scene-motion .scroll-dialog[open] { animation: none; }
