:root {
  color: #17362f;
  font-family: "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  font-synthesis: none;
  --ink: #17362f;
  --ink-soft: rgba(23, 54, 47, 0.7);
  --paper: rgba(250, 249, 244, 0.72);
  --paper-solid: #f8f6ef;
  --jade: #7cae9f;
  --jade-deep: #335f53;
  --gold: #b89550;
  --cinnabar: #a84a39;
}

/* Ask-the-immortal ledger: a restrained round-by-round settlement archive. */
.panel.panel--history {
  position: fixed;
  top: 80px;
  right: clamp(18px, 7vw, 112px);
  bottom: 18px;
  left: clamp(18px, 7vw, 112px);
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: oklch(0.29 0.045 171);
  border: 1px solid oklch(0.52 0.025 87 / 0.4);
  border-radius: 3px;
  background:
    radial-gradient(circle at 12% 16%, oklch(0.37 0.02 83 / 0.055) 0 0.5px, transparent 0.82px) 0 0 / 13px 17px,
    repeating-linear-gradient(96deg, transparent 0 27px, oklch(0.4 0.016 87 / 0.018) 27.5px 28px, transparent 28.5px 54px),
    linear-gradient(112deg, oklch(0.978 0.008 91 / 0.99), oklch(0.958 0.009 87 / 0.988));
  box-shadow: 0 28px 82px oklch(0.23 0.035 169 / 0.24), inset 0 0 0 1px oklch(0.99 0.006 90 / 0.68);
  animation: book-panel-arrive 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.realm.is-history-focused .intro,
.realm.is-history-focused .home-oracle,
.realm.is-history-focused .realm-status {
  opacity: 0;
  pointer-events: none;
}

.realm.is-wallet-focused .intro,
.realm.is-wallet-focused .home-oracle,
.realm.is-wallet-focused .realm-status,
.realm.is-wallet-focused .local-demo {
  opacity: 0;
  pointer-events: none;
}

.panel--history .panel__close {
  top: 22px;
  right: 26px;
  z-index: 5;
}

.history-panel {
  display: grid;
  grid-template-rows: auto 47px minmax(0, 1fr) 52px;
  height: 100%;
  min-height: 0;
}

.history-panel[hidden] { display: none; }

.history-panel__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 24px 78px 20px 42px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14);
}

.history-panel__header p,
.history-panel__header h2 { margin: 0; }
.history-panel__header p { color: var(--cinnabar); font-size: 12px; letter-spacing: 0.2em; }
.panel--history .history-panel__header h2 {
  margin-top: 5px;
  color: oklch(0.28 0.052 170);
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(30px, 3.2vw, 40px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0.12em;
}
.history-panel__header small { color: oklch(0.42 0.025 166 / 0.72); font-size: 12px; }

.history-tabs {
  display: flex;
  align-items: end;
  gap: 30px;
  padding: 0 42px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14);
}
.history-tabs button {
  position: relative;
  height: 46px;
  padding: 0 2px;
  color: oklch(0.42 0.025 166 / 0.62);
  border: 0;
  background: transparent;
  font: 500 14px/1 "Songti SC", serif;
  letter-spacing: 0.08em;
}
.history-tabs button[aria-selected="true"] { color: var(--ink); }
.history-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--cinnabar);
  content: "";
}

.history-panel__content {
  min-height: 0;
  padding: 0 42px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.history-panel__pane,
.history-panel__pane > [data-history-records],
.history-panel__pane > [data-destiny-results] { min-height: 100%; }
.history-panel__pane[hidden] { display: none; }

.history-record { padding: 22px 0 20px; border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14); }
.history-record > header { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 17px; }
.history-record > header div { display: flex; align-items: baseline; gap: 16px; }
.history-record > header strong { font: 500 22px/1.1 "STKaiti", "KaiTi", serif; letter-spacing: 0.08em; }
.history-record > header time { color: oklch(0.43 0.022 166 / 0.64); font-size: 11px; }
.history-record > header b { color: var(--cinnabar); font: 500 14px/1.3 "Songti SC", serif; }
.history-record[data-status="open"] > header b { color: oklch(0.48 0.08 154); }
.history-record dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: 1px solid oklch(0.44 0.035 166 / 0.12); border-width: 1px 0 0 1px; }
.history-record dl div { min-width: 0; padding: 12px 14px; border: 1px solid oklch(0.44 0.035 166 / 0.12); border-width: 0 1px 1px 0; }
.history-record dt { margin-bottom: 5px; color: oklch(0.44 0.022 166 / 0.64); font-size: 10px; letter-spacing: 0.08em; }
.history-record dd { margin: 0; overflow-wrap: anywhere; font: 500 14px/1.35 "Songti SC", serif; }

.history-empty { display: grid; min-height: 100%; place-content: center; justify-items: center; gap: 10px; color: oklch(0.42 0.025 166 / 0.7); text-align: center; }
.history-empty strong {
  color: oklch(0.34 0.04 168 / 0.72);
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.08em;
}
.history-empty span { font-size: 12px; }
.history-empty button { min-height: 40px; margin-top: 6px; padding: 0 20px; color: white; border: 0; background: var(--ink); }

.destiny-round { border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14); }
.destiny-round > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
}
.destiny-round > summary::-webkit-details-marker { display: none; }
.destiny-round > summary > div:first-child { display: flex; align-items: baseline; gap: 16px; }
.destiny-round > summary strong { font: 500 22px/1.1 "STKaiti", "KaiTi", serif; letter-spacing: 0.08em; }
.destiny-round > summary time,
.destiny-round > summary span { color: oklch(0.43 0.022 166 / 0.64); font-size: 11px; }
.destiny-round__summary-meta { display: flex; align-items: center; gap: 12px; }
.destiny-round__toggle {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: oklch(0.43 0.025 166 / 0.62);
  border: 1px solid oklch(0.44 0.035 166 / 0.2);
  border-radius: 50%;
  font-style: normal;
}
.destiny-round__toggle::before { content: "+"; }
.destiny-round[open] .destiny-round__toggle::before { content: "−"; }
.destiny-round[open] > summary { padding-bottom: 15px; }
.destiny-round__table-wrap { padding-bottom: 24px; overflow-x: auto; }
.destiny-round table { width: 100%; min-width: 660px; border-collapse: collapse; table-layout: fixed; }
.destiny-round th,
.destiny-round td { padding: 11px 13px; border: 1px solid oklch(0.44 0.035 166 / 0.12); text-align: left; }
.destiny-round th { color: oklch(0.43 0.022 166 / 0.64); font-size: 10px; font-weight: 400; letter-spacing: 0.08em; }
.destiny-round td { font: 500 13px/1.35 "Songti SC", serif; }
.destiny-round th:nth-child(1), .destiny-round td:nth-child(1) { width: 13%; }
.destiny-round th:nth-child(2), .destiny-round td:nth-child(2) { width: 30%; }
.destiny-round th:nth-child(3), .destiny-round td:nth-child(3) { width: 27%; }
.destiny-round th:nth-child(4), .destiny-round td:nth-child(4) { width: 30%; }
.destiny-round tbody tr:first-child td:first-child { color: var(--cinnabar); }
.destiny-round a { color: var(--ink); text-decoration: none; border-bottom: 1px solid currentColor; }
.destiny-round__verification { color: oklch(0.43 0.022 166 / 0.62); font-size: 11px; }
.destiny-round__pending { display: grid; min-height: 112px; padding-bottom: 24px; place-content: center; gap: 6px; color: oklch(0.43 0.022 166 / 0.62); text-align: center; }
.destiny-round__pending strong { color: var(--ink); font: 500 18px/1.2 "STKaiti", "KaiTi", serif; letter-spacing: 0.08em; }
.destiny-round__pending span { font-size: 11px; }
.history-panel__footer { display: flex; align-items: center; justify-content: flex-end; padding: 0 42px; color: oklch(0.43 0.025 166 / 0.65); border-top: 1px solid oklch(0.44 0.035 166 / 0.14); font-size: 10px; }
.history-panel__footer button { color: inherit; border: 0; border-bottom: 1px solid currentColor; background: transparent; }

@media (max-width: 767px) {
  .mobile-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); padding-right: 4px; padding-left: 4px; }
  .mobile-nav span { font-size: 10px; letter-spacing: 0.02em; }
  .mobile-nav button[data-mobile-route="history"] b { background-image: none; }
  .panel.panel--history {
    position: absolute;
    top: var(--mobile-topbar);
    right: 0;
    bottom: var(--mobile-nav-height);
    left: 0;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: url("./mobile-assets/frame-v1/paper-tile.png") center / 420px auto repeat;
    box-shadow: none;
  }
  .panel--history .panel__close { display: none; }
  .history-panel { grid-template-rows: auto 44px minmax(0, 1fr) 44px; }
  .history-panel__header { padding: 18px 18px 14px; }
  .panel--history .history-panel__header h2 { font-size: 30px; }
  .history-tabs, .history-panel__content, .history-panel__footer { padding-right: 18px; padding-left: 18px; }
  .history-tabs { gap: 24px; }
  .history-record > header { gap: 12px; }
  .history-record > header div { display: grid; gap: 4px; }
  .history-record dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .destiny-round > summary > div:first-child { display: grid; gap: 4px; }
}

/* Homepage navigation closeout: stable top tabs, social action and contract footer. */
.realm-tabs {
  pointer-events: auto;
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.realm-tabs__item {
  position: relative;
  display: inline-grid;
  min-width: 88px;
  height: 42px;
  padding: 0 13px;
  place-items: center;
  color: oklch(0.4 0.034 170 / 0.74);
  border: 0;
  background: transparent;
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms cubic-bezier(0.25, 1, 0.5, 1), background 180ms cubic-bezier(0.25, 1, 0.5, 1);
}

.realm-tabs__item::after {
  position: absolute;
  right: 17px;
  bottom: 1px;
  left: 17px;
  height: 1px;
  background: oklch(0.55 0.12 36 / 0.9);
  content: "";
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 180ms cubic-bezier(0.25, 1, 0.5, 1), transform 220ms cubic-bezier(0.25, 1, 0.5, 1);
}

.realm-tabs__item:hover,
.realm-tabs__item:focus-visible,
.realm-tabs__item[aria-current="page"] {
  color: oklch(0.3 0.05 170);
  background: oklch(0.965 0.012 91 / 0.42);
}

.realm-tabs__item[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.social-x {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: oklch(0.35 0.035 170 / 0.86);
  border: 0;
  background: transparent;
  filter: drop-shadow(0 1px 9px oklch(0.99 0.006 90 / 0.95));
  text-decoration: none;
}

.social-x svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: none;
}

.social-x:hover,
.social-x:focus-visible {
  color: oklch(0.26 0.05 170);
  background: oklch(0.96 0.015 90 / 0.48);
}

.social-x[aria-disabled="true"] {
  opacity: 0.5;
}

.realm-status a {
  display: inline-flex;
  min-width: 0;
  height: 100%;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: oklch(0.4 0.03 170 / 0.72);
  text-shadow: 0 1px 8px oklch(0.99 0.006 90 / 0.94);
  font-size: 10px;
  letter-spacing: 0.06em;
  pointer-events: auto;
  text-decoration: none;
}

.realm-status a:hover,
.realm-status a:focus-visible {
  color: oklch(0.29 0.05 170);
}

.realm-status code {
  color: inherit;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.025em;
}

@media (min-width: 768px) {
  .topbar,
  .realm.is-pool-focused .topbar,
  .realm.is-book-focused .topbar {
    z-index: 80;
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto minmax(210px, 1fr);
    align-items: start;
    opacity: 1;
    pointer-events: none;
  }

  .brand,
  .realm-tabs,
  .topbar__actions {
    pointer-events: auto;
  }

  .panel.panel--pool,
  .panel.panel--book {
    z-index: 70;
  }

  .panel.panel--book {
    top: 78px;
  }
}

@media (max-width: 767px) {
  .realm-tabs {
    display: none;
  }

  .social-x {
    width: 40px;
    height: 42px;
  }

  .realm-status {
    padding: 0 4px;
  }

  .realm-status a {
    width: 100%;
    justify-content: center;
    gap: 0;
    padding: 0 4px;
  }

  .realm-status span {
    display: none;
  }

  .realm-status code {
    max-width: 100%;
    overflow: hidden;
    font-size: 8px;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-nav > a {
    display: grid;
    min-width: 0;
    color: inherit;
    place-items: center;
    text-decoration: none;
  }
}

/* Local-only manual test controls. Hidden markup stays inert in normal mode. */
.local-demo {
  position: fixed;
  z-index: 82;
  top: 72px;
  right: 30px;
  width: min(360px, calc(100vw - 60px));
  color: oklch(0.29 0.043 164);
  border: 1px solid oklch(0.52 0.058 160 / 0.34);
  border-radius: 14px;
  background: oklch(0.958 0.018 91 / 0.96);
  box-shadow: 0 14px 38px oklch(0.25 0.035 165 / 0.16);
  font-family: "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
}

.local-demo[hidden] {
  display: none !important;
}

.local-demo__identity {
  display: grid;
  gap: 3px;
  padding: 12px 14px 11px;
}

.local-demo__identity strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.local-demo__identity strong i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: oklch(0.61 0.15 155);
  box-shadow: 0 0 0 4px oklch(0.61 0.15 155 / 0.12);
}

.local-demo__identity span {
  color: oklch(0.43 0.03 164);
  font-size: 11px;
}

.local-demo__identity b {
  font-weight: 600;
}

.local-demo__controls {
  border-top: 1px solid oklch(0.52 0.045 160 / 0.2);
}

.local-demo__controls summary {
  position: relative;
  min-height: 42px;
  padding: 12px 36px 10px 14px;
  color: oklch(0.32 0.045 164);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.local-demo__controls summary::-webkit-details-marker {
  display: none;
}

.local-demo__controls summary::after {
  position: absolute;
  top: 14px;
  right: 15px;
  width: 8px;
  height: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  content: "";
  transform: translateY(1px) rotate(45deg);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.local-demo__controls[open] summary::after {
  transform: translateY(5px) rotate(225deg);
}

.local-demo__controls summary:focus-visible,
.local-demo__actions button:focus-visible {
  outline: 2px solid oklch(0.53 0.105 163);
  outline-offset: 2px;
}

.local-demo__body {
  max-height: min(72vh, 680px);
  padding: 0 14px 14px;
  overflow-y: auto;
}

.local-demo__body > p {
  margin: 0 0 10px;
  color: oklch(0.43 0.026 164);
  font-size: 11px;
  line-height: 1.55;
}

.local-demo__body code {
  color: oklch(0.36 0.055 164);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.local-demo__body dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin: 0 0 12px;
  padding: 10px 0;
  border-top: 1px solid oklch(0.52 0.04 160 / 0.16);
  border-bottom: 1px solid oklch(0.52 0.04 160 / 0.16);
}

.local-demo__body dl div {
  display: grid;
  gap: 3px;
}

.local-demo__body dt {
  color: oklch(0.48 0.025 164);
  font-size: 10px;
}

.local-demo__body dd {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
}

.local-demo__fortune-test {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
}

.local-demo__fortune-test > span {
  color: oklch(0.38 0.04 164);
  font-size: 11px;
  font-weight: 650;
}

.local-demo__fortune-test select {
  min-height: 36px;
  padding: 7px 34px 7px 10px;
  color: oklch(0.3 0.045 164);
  border: 1px solid oklch(0.5 0.05 160 / 0.34);
  border-radius: 8px;
  background: oklch(0.985 0.008 90 / 0.82);
  font: inherit;
  font-size: 12px;
}

.local-demo__fortune-test select:focus-visible {
  outline: 2px solid oklch(0.53 0.105 163);
  outline-offset: 2px;
}

.local-demo__fortune-test small {
  color: oklch(0.47 0.025 164);
  font-size: 10px;
  line-height: 1.45;
}

.local-demo__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.local-demo__actions button {
  min-height: 34px;
  padding: 7px 10px;
  color: oklch(0.32 0.047 164);
  border: 1px solid oklch(0.5 0.05 160 / 0.3);
  border-radius: 8px;
  background: oklch(0.985 0.008 90 / 0.78);
  font: inherit;
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
  transition: background 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.local-demo__actions button:hover {
  border-color: oklch(0.48 0.09 160 / 0.55);
  background: oklch(0.94 0.028 158 / 0.86);
}

.local-demo__actions button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.local-demo__body output {
  display: block;
  min-height: 18px;
  margin-top: 10px;
  color: oklch(0.43 0.035 164);
  font-size: 10px;
  line-height: 1.5;
}

.local-demo__body output[data-state="error"] {
  color: oklch(0.47 0.16 28);
}

.local-demo__body output[data-state="success"] {
  color: oklch(0.42 0.11 155);
}

@media (max-width: 767px) {
  .local-demo {
    z-index: 79;
    top: calc(var(--mobile-topbar) + 8px);
    right: 12px;
    left: 12px;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px oklch(0.25 0.03 165 / 0.14);
  }

  .local-demo__identity {
    padding: 10px 12px 9px;
  }

  .local-demo__controls summary {
    min-height: 40px;
    padding: 11px 34px 9px 12px;
  }

  .local-demo__body {
    max-height: min(46vh, 360px);
    padding: 0 12px 12px;
    overflow-y: auto;
  }

  .local-demo__actions button {
    flex: 1 1 calc(50% - 7px);
    min-height: 38px;
  }
}

.wallet__mobile-mark {
  display: none;
}

/* Approved mobile frame: fixed paper header and three-tab footer, with no decorative transitions. */
@media (max-width: 767px) {
  :root {
    --mobile-topbar: calc(68px + env(safe-area-inset-top));
    --mobile-nav-height: calc(86px + env(safe-area-inset-bottom));
  }

  .dream-entry,
  .realm__particles,
  .realm__mist,
  .realm__light,
  .intro,
  .realm-status,
  .landmark {
    display: none !important;
  }

  .topbar,
  .realm.is-pool-focused .topbar,
  .realm.is-book-focused .topbar {
    z-index: 90;
    height: var(--mobile-topbar);
    padding: env(safe-area-inset-top) 16px 0;
    align-items: center;
    border: 0;
    border-bottom: 1px solid oklch(0.61 0.04 76 / 0.2);
    background:
      radial-gradient(circle at 18% 22%, oklch(0.42 0.025 75 / 0.045) 0 0.45px, transparent 0.8px) 0 0 / 13px 17px,
      oklch(0.968 0.013 86 / 0.98);
    box-shadow: none;
    opacity: 1;
    backdrop-filter: none;
    transition: none;
  }

  .brand {
    width: auto;
    height: 52px;
    min-width: 0;
    gap: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
  }

  .brand__mark {
    display: none;
  }

  .brand__name {
    overflow: visible;
    color: oklch(0.25 0.045 160);
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-overflow: clip;
  }

  .brand::after {
    display: grid;
    width: 14px;
    height: 20px;
    place-items: center;
    margin-left: 6px;
    color: oklch(0.48 0.14 35);
    border: 1px solid currentColor;
    border-radius: 50% 46% 52% 44%;
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 8px;
    line-height: 1;
    content: "梦";
  }

  .topbar__actions {
    gap: 0;
  }

  .bell {
    display: none;
  }

  .wallet {
    display: grid;
    grid-template-columns: 36px 10px;
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    height: 40px;
    min-height: 40px;
    padding: 1px 8px 1px 9px;
    place-items: center;
    color: oklch(0.36 0.055 165);
    border: 1px solid oklch(0.43 0.045 165 / 0.5);
    border-radius: 20px;
    background: oklch(0.965 0.013 86 / 0.84);
    box-shadow: none;
    transition: none;
  }

  .wallet__mobile-mark {
    display: block;
    width: 31px;
    height: 31px;
    fill: oklch(0.56 0.055 78 / 0.3);
    stroke: currentColor;
    stroke-width: 1.25;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .wallet span {
    display: none;
  }

  .wallet i {
    position: static;
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border: 0;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    border-radius: 0;
    background: transparent;
    transform: rotate(45deg);
  }

  .wallet.is-connected i,
  .wallet.is-wrong-network i {
    background: transparent;
  }

  .panel.panel--pool,
  .panel.panel--book {
    top: var(--mobile-topbar);
    bottom: var(--mobile-nav-height);
    animation: none;
    transition: none;
  }

  .mobile-nav {
    z-index: 90;
    grid-template-columns: repeat(3, 1fr);
    height: var(--mobile-nav-height);
    padding: 4px 10px env(safe-area-inset-bottom);
    border-top: 1px solid oklch(0.58 0.04 76 / 0.26);
    background:
      radial-gradient(circle at 12% 18%, oklch(0.4 0.02 80 / 0.045) 0 0.45px, transparent 0.8px) 0 0 / 13px 17px,
      oklch(0.966 0.014 86 / 0.99);
    box-shadow: none;
    backdrop-filter: none;
  }

  .mobile-nav button,
  .mobile-nav button[data-mobile-route="oracle"],
  .mobile-nav button[aria-current="page"] {
    display: grid;
    min-height: 78px;
    padding: 4px 2px 5px;
    place-items: center;
    gap: 1px;
    color: oklch(0.31 0.045 164);
    border: 0;
    background: transparent;
    transform: none;
    transition: none;
  }

  .mobile-nav button[aria-current="page"] {
    color: oklch(0.49 0.14 36);
  }

  .mobile-nav b,
  .mobile-nav button[data-mobile-route="oracle"] b,
  .mobile-nav button[aria-current="page"] b {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
  }

  .mobile-nav button[aria-current="page"] b {
    border-color: oklch(0.5 0.13 36 / 0.7);
    background: oklch(0.94 0.024 82 / 0.58);
  }

  .mobile-nav b svg,
  .mobile-nav button[aria-current="page"] b svg {
    width: 34px;
    height: 34px;
    stroke-width: 1.4;
  }

  .mobile-nav span {
    color: currentColor;
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
  }
}

/* Mobile primary-page elements are enabled only inside the portrait application shell. */
.pool-mobile-overview,
.book-panel__mobile-hero {
  display: none;
}

@media (max-width: 767px) {
  .topbar {
    z-index: 80;
  }

  .realm.is-pool-focused .topbar,
  .realm.is-book-focused .topbar {
    opacity: 1;
    pointer-events: auto;
  }

  .panel.panel--pool,
  .panel.panel--book {
    top: var(--mobile-topbar);
    right: 0;
    bottom: var(--mobile-nav-height);
    left: 0;
    width: auto;
    height: auto;
    padding: 0;
    overflow: hidden;
    color: oklch(0.3 0.045 169);
    border: 0;
    background:
      radial-gradient(circle at 16% 21%, oklch(0.38 0.022 77 / 0.055) 0 0.5px, transparent 0.8px) 0 0 / 13px 17px,
      linear-gradient(112deg, oklch(0.974 0.009 88), oklch(0.95 0.012 82));
    box-shadow: none;
    transform: none;
  }

  .panel--pool .panel__close,
  .panel--book .panel__close {
    display: none;
  }

  .pool-panel {
    display: grid;
    grid-template-rows: 174px auto 48px minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }

  .pool-panel__header {
    position: relative;
    display: grid;
    height: 174px;
    padding: 24px 18px;
    place-items: end center;
    overflow: hidden;
    border-bottom: 1px solid oklch(0.55 0.035 80 / 0.25);
    background:
      linear-gradient(180deg, oklch(0.96 0.01 90 / 0.06), oklch(0.96 0.012 90 / 0.22) 64%, oklch(0.95 0.014 88 / 0.92)),
      url("./scene.webp?v=20260722-entry-webp-v1") 2% 72% / auto 145% no-repeat;
  }

  .pool-panel__header > div:first-child {
    display: grid;
    justify-items: center;
  }

  .pool-panel__eyebrow {
    margin: 0 0 7px;
    padding: 4px 9px;
    color: oklch(0.42 0.08 38);
    background: oklch(0.96 0.014 88 / 0.82);
    font-size: 10px;
  }

  .pool-panel__header h2 {
    margin: 0;
    padding: 8px 24px 9px;
    color: oklch(0.29 0.052 169);
    border: 1px solid oklch(0.56 0.05 72 / 0.38);
    background: oklch(0.965 0.015 88 / 0.94);
    box-shadow: 0 7px 20px oklch(0.3 0.03 166 / 0.1);
    font-size: 29px;
    letter-spacing: 0.15em;
  }

  .pool-panel__header p:last-child,
  .pool-panel__countdown {
    display: none;
  }

  .pool-mobile-overview {
    display: grid;
    gap: 9px;
    padding: 12px 16px 10px;
  }

  .pool-mobile-overview article {
    position: relative;
    display: grid;
    min-height: 84px;
    align-content: center;
    padding: 12px 118px 12px 20px;
    overflow: hidden;
    border: 1px solid oklch(0.55 0.04 78 / 0.32);
    background:
      radial-gradient(circle at 82% 50%, oklch(0.84 0.05 165 / 0.48), transparent 23%),
      oklch(0.965 0.012 88 / 0.82);
  }

  .pool-mobile-overview article::after {
    position: absolute;
    top: 9px;
    right: 14px;
    width: 92px;
    height: 66px;
    border-radius: 50%;
    background:
      radial-gradient(circle at 40% 48%, oklch(0.96 0.015 90 / 0.18), transparent 31%),
      url("./scene.webp?v=20260722-entry-webp-v1") 1% 84% / auto 205% no-repeat;
    opacity: 0.86;
    content: "";
  }

  .pool-mobile-overview article:nth-child(2)::after {
    background-position: 50% 68%;
  }

  .pool-mobile-overview span {
    color: oklch(0.33 0.05 169);
    font-family: "Songti SC", "STSong", serif;
    font-size: 17px;
    letter-spacing: 0.12em;
  }

  .pool-mobile-overview strong {
    margin-top: 2px;
    color: oklch(0.43 0.1 38);
    font-family: ui-monospace, "SFMono-Regular", monospace;
    font-size: 23px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  .pool-mobile-overview small {
    margin-top: 2px;
    color: oklch(0.42 0.025 166 / 0.66);
    font-size: 9px;
  }

  .pool-mobile-overview > p {
    margin: 0;
    color: oklch(0.4 0.03 168 / 0.72);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-align: center;
  }

  .pool-mobile-overview > p b {
    margin-left: 7px;
    color: oklch(0.43 0.1 38);
    font-family: ui-monospace, "SFMono-Regular", monospace;
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  .pool-tabs {
    height: 48px;
    padding: 0 16px;
    border-top: 1px solid oklch(0.5 0.03 82 / 0.14);
    border-bottom: 1px solid oklch(0.5 0.03 82 / 0.18);
  }

  .pool-tabs button {
    min-height: 46px;
    font-size: 13px;
  }

  .pool-panel__content {
    min-height: 0;
    padding: 16px 16px 24px;
    overflow-y: auto;
  }

  .pool-balance {
    display: none;
  }

  .pool-facts {
    border-color: oklch(0.52 0.035 80 / 0.26);
    background: oklch(0.97 0.01 90 / 0.54);
  }

  .pool-note {
    font-size: 11px;
    line-height: 1.65;
  }

  .pool-panel__footer {
    display: none;
  }

  .book-panel {
    display: grid;
    grid-template-rows: 174px 50px minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }

  .book-panel__mobile-hero {
    position: relative;
    display: grid;
    height: 174px;
    align-content: end;
    justify-items: center;
    padding: 0 18px 23px;
    overflow: hidden;
    border-bottom: 1px solid oklch(0.55 0.035 80 / 0.25);
    background:
      linear-gradient(180deg, transparent 34%, oklch(0.96 0.012 88 / 0.94)),
      url("./scene.webp?v=20260722-entry-webp-v1") 94% 25% / auto 138% no-repeat;
  }

  .book-panel__mobile-hero span {
    margin-bottom: 7px;
    color: oklch(0.44 0.085 38);
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 11px;
    letter-spacing: 0.18em;
  }

  .book-panel__mobile-hero h2 {
    margin: 0;
    padding: 8px 28px 9px;
    color: oklch(0.29 0.052 169);
    border: 1px solid oklch(0.56 0.05 72 / 0.38);
    background: oklch(0.965 0.015 88 / 0.94);
    box-shadow: 0 7px 20px oklch(0.3 0.03 166 / 0.1);
    font-family: "Songti SC", "STSong", serif;
    font-size: 29px;
    font-weight: 500;
    letter-spacing: 0.15em;
  }

  .book-tabs {
    display: flex;
    height: 50px;
    gap: 22px;
    padding: 0 16px;
    overflow-x: auto;
    border-bottom: 1px solid oklch(0.5 0.03 82 / 0.18);
  }

  .book-tabs button {
    flex: 0 0 auto;
    min-width: auto;
    min-height: 48px;
    font-size: 13px;
  }

  .book-panel__demo {
    display: none;
  }

  .book-panel__content {
    min-height: 0;
    overflow-y: auto;
    background: oklch(0.965 0.011 88 / 0.72);
  }

  .book-pane {
    min-height: 100%;
    padding: 17px 16px 28px;
  }

  .book-pane__heading {
    align-items: end;
    padding-bottom: 12px;
  }

  .book-pane__heading strong {
    font-size: 20px;
  }

  .book-record-list {
    gap: 0;
    border-top: 1px solid oklch(0.5 0.035 80 / 0.24);
  }

  .book-record {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 82px;
    padding: 13px 4px;
    border-bottom: 1px solid oklch(0.5 0.035 80 / 0.2);
    background: transparent;
  }

  .book-record:first-child {
    min-height: 112px;
    margin: 0 0 9px;
    padding: 16px 10px;
    border: 1px solid oklch(0.55 0.04 78 / 0.3);
    background:
      radial-gradient(circle at 86% 50%, oklch(0.83 0.04 164 / 0.32), transparent 25%),
      oklch(0.97 0.01 90 / 0.58);
  }

  .book-record__meta {
    gap: 4px;
  }

  .book-record__main strong {
    font-size: 15px;
  }

  .book-record__main p {
    -webkit-line-clamp: 2;
    font-size: 11px;
    line-height: 1.55;
  }

  .book-record__affordance {
    min-width: 44px;
    min-height: 44px;
    font-size: 0;
  }

  .book-record__affordance::after {
    font-size: 18px;
  }

  .mobile-nav {
    z-index: 80;
  }

  .mobile-nav button[data-mobile-route="oracle"] {
    transform: none;
  }

  .mobile-nav button[data-mobile-route="oracle"] b,
  .mobile-nav b {
    width: 36px;
    height: 36px;
  }

  .mobile-nav button[aria-current="page"] {
    transform: translateY(-7px);
  }

  .mobile-nav button[aria-current="page"] b {
    width: 46px;
    height: 46px;
    border-color: currentColor;
    background: oklch(0.94 0.025 82);
  }

  .mobile-nav b svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.35;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-nav button[aria-current="page"] b svg {
    width: 30px;
    height: 30px;
  }
}

/* Final dreambook viewport contract: no global scale, each image area owns its fit. */
@media (min-width: 768px) {
  .panel.panel--book {
    top: 72px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    height: auto;
    max-height: none;
  }

  .book-panel {
    grid-template-rows: 48px minmax(0, 1fr);
    height: 100%;
  }

  .book-tabs {
    height: 48px;
    gap: clamp(24px, 3vw, 42px);
    padding-right: 74px;
    padding-left: 38px;
  }

  .book-pane--artifacts,
  .book-pane--workspace {
    height: 100%;
    min-height: 0;
    padding: clamp(12px, 1.7vh, 20px) clamp(22px, 3vw, 46px);
  }

  .artifact-shell,
  .atlas-shell,
  .share-shell {
    height: 100%;
    min-height: 0;
  }

  .artifact-shell__stage,
  .artifact-stage-mount,
  .artifact-equip-stage {
    min-height: 0;
  }

  .artifact-stage-mount {
    height: auto;
  }

  .artifact-equip-stage > img {
    object-fit: contain;
    object-position: center bottom;
  }

  .artifact-equip-stage__background {
    object-fit: cover !important;
  }

  .artifact-atlas-mount {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .artifact-atlas-item {
    min-height: 72px;
  }

  .artifact-atlas-item__visual {
    width: 46px;
    height: 62px;
  }

  .artifact-share-preview {
    padding: clamp(10px, 1.8vh, 18px) clamp(16px, 2.3vw, 28px);
  }

  .book-share-poster {
    width: auto;
    height: 100%;
    max-height: 100%;
  }
}

@media (min-width: 768px) and (max-height: 820px) {
  .panel.panel--book {
    top: 68px;
    bottom: 8px;
  }

  .book-panel {
    grid-template-rows: 44px minmax(0, 1fr);
    height: 100%;
  }

  .book-tabs {
    height: 44px;
  }

  .book-tabs button {
    font-size: 14px;
  }

  .artifact-shell__stage > header,
  .artifact-shell__inventory > header,
  .atlas-shell__categories > header,
  .atlas-shell__content > header,
  .share-shell__settings > header {
    min-height: 58px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* Homepage oracle: the draw choices now live on the arrival scene. */
.home-oracle {
  position: absolute;
  z-index: 24;
  top: 62%;
  left: 50%;
  display: grid;
  justify-items: center;
  width: min(540px, calc(100vw - 48px));
  color: oklch(0.3 0.048 170);
  transform: translate(-50%, -50%);
  transition: opacity 720ms ease, transform 820ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.realm.is-entering .home-oracle {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 9px));
}

.home-oracle__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 2px;
  color: oklch(0.38 0.035 169 / 0.76);
  text-shadow: 0 1px 9px oklch(0.99 0.006 90 / 0.96);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.home-oracle__eyebrow span {
  color: oklch(0.49 0.11 38);
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
  font-weight: 600;
}

.home-oracle__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: center;
  width: 100%;
}

.home-oracle__actions > i {
  width: 1px;
  height: 24px;
  justify-self: center;
  background: linear-gradient(transparent, oklch(0.48 0.07 166 / 0.36), transparent);
}

.home-oracle__action {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 86px;
  padding: 13px 23px 17px;
  place-items: center;
  color: oklch(0.3 0.052 170);
  border: 0;
  background: transparent;
  filter: drop-shadow(0 10px 16px oklch(0.3 0.035 170 / 0.13));
  cursor: pointer;
  isolation: isolate;
  transition: color 160ms ease, filter 220ms ease, transform 220ms cubic-bezier(0.25, 1, 0.5, 1);
}

.home-oracle__action > img {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.96;
  object-fit: fill;
}

.home-oracle__action > span {
  display: grid;
  gap: 5px;
  justify-items: center;
}

.home-oracle__action strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.home-oracle__action small {
  color: oklch(0.39 0.03 169 / 0.72);
  font-size: 10px;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.home-oracle__action--ten strong {
  color: oklch(0.47 0.105 38);
}

.home-oracle__action:hover,
.home-oracle__action:focus-visible {
  color: oklch(0.25 0.06 169);
  filter: drop-shadow(0 13px 20px oklch(0.3 0.04 170 / 0.18));
  outline: none;
  transform: translateY(-3px);
}

.home-oracle__action:focus-visible::after {
  position: absolute;
  inset: 9px 17px 12px;
  border: 1px solid oklch(0.49 0.09 164 / 0.52);
  border-radius: 50%;
  content: "";
}

/* Direct result overlays never reveal or preload the retired oracle interior. */
.oracle-experience.is-direct-entry .oracle-experience__camera,
.oracle-experience.is-direct-entry .oracle-experience__interior,
.oracle-experience.is-direct-entry .oracle-room {
  display: none;
}

/* Dreambook fit: reserve the topbar, then size each visual workspace independently. */
@media (min-width: 768px) {
  .panel.panel--book {
    top: 72px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    height: auto;
    max-height: none;
  }

  .book-panel {
    grid-template-rows: 48px minmax(0, 1fr);
  }

  .book-tabs {
    height: 48px;
    gap: clamp(24px, 3vw, 42px);
    padding-right: 74px;
    padding-left: 38px;
  }

  .book-pane--artifacts,
  .book-pane--workspace {
    height: 100%;
    padding: clamp(12px, 1.7vh, 20px) clamp(22px, 3vw, 46px);
  }

  .artifact-shell,
  .atlas-shell,
  .share-shell {
    height: 100%;
    min-height: 0;
  }

  .artifact-shell__stage,
  .artifact-stage-mount,
  .artifact-equip-stage {
    min-height: 0;
  }

  .artifact-stage-mount {
    height: auto;
  }

  .artifact-equip-stage > img {
    object-fit: contain;
    object-position: center bottom;
  }

  .artifact-equip-stage__background {
    object-fit: cover !important;
  }

  .artifact-atlas-mount {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .artifact-atlas-item {
    min-height: 72px;
  }

  .artifact-atlas-item__visual {
    width: 46px;
    height: 62px;
  }

  .artifact-share-preview {
    padding: clamp(10px, 1.8vh, 18px) clamp(16px, 2.3vw, 28px);
  }

  .book-share-poster {
    width: auto;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
  }
}

@media (min-width: 768px) and (max-height: 820px) {
  .panel.panel--book {
    top: 68px;
    bottom: 8px;
  }

  .book-panel {
    grid-template-rows: 44px minmax(0, 1fr);
    height: 100%;
  }

  .book-tabs {
    height: 44px;
  }

  .book-tabs button {
    font-size: 14px;
  }

  .artifact-shell__stage > header,
  .artifact-shell__inventory > header,
  .atlas-shell__categories > header,
  .atlas-shell__content > header,
  .share-shell__settings > header {
    min-height: 58px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

@media (max-width: 767px) {
  .home-oracle {
    top: 57%;
    width: min(390px, calc(100vw - 20px));
  }

  .home-oracle__eyebrow {
    margin-bottom: 0;
    font-size: 9px;
  }

  .home-oracle__actions {
    grid-template-columns: minmax(0, 1fr) 6px minmax(0, 1fr);
  }

  .home-oracle__actions > i {
    height: 18px;
  }

  .home-oracle__action {
    min-height: 72px;
    padding: 11px 8px 14px;
  }

  .home-oracle__action strong {
    font-size: 18px;
  }

  .home-oracle__action small {
    max-width: 19ch;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
  }

  .realm-status {
    display: none;
  }
}

/* Keep the new shell navigation authoritative after the legacy responsive cascade. */
@media (min-width: 768px) {
  .topbar,
  .realm.is-pool-focused .topbar,
  .realm.is-book-focused .topbar {
    z-index: 80;
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto minmax(210px, 1fr);
    align-items: start;
    opacity: 1;
    pointer-events: none;
  }

  .brand,
  .realm-tabs,
  .topbar__actions {
    pointer-events: auto;
  }

  .panel.panel--pool,
  .panel.panel--book {
    z-index: 70;
  }

  .panel.panel--book {
    top: 78px;
  }
}

@media (max-width: 767px) {
  .realm-tabs {
    display: none;
  }

  .mobile-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-nav > a {
    display: grid;
    min-width: 0;
    color: inherit;
    place-items: center;
    text-decoration: none;
  }
}

/* Approved mobile artwork slices. Keep this final so the sliced frame wins the cascade. */
.brand__mobile-slice,
.wallet__mobile-slice {
  display: none;
}

@media (max-width: 767px) {
  .topbar {
    background: url("./mobile-assets/frame-v1/paper-header.png") center / 100% 100% no-repeat;
  }

  .brand {
    width: 166px;
    min-width: 166px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .brand__mobile-slice {
    display: block;
    width: 158px;
    height: auto;
    object-fit: contain;
  }

  .brand__mark,
  .brand__name,
  .brand::after {
    display: none;
  }

  .wallet {
    width: 72px;
    min-width: 72px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .wallet__mobile-slice {
    display: block;
    width: 72px;
    height: auto;
    object-fit: contain;
  }

  .wallet__mobile-mark,
  .wallet > span,
  .wallet > i {
    display: none;
  }

  .mobile-nav {
    padding-right: 13px;
    padding-left: 13px;
    border-top: 0;
    background: url("./mobile-assets/frame-v1/paper-nav.png") center / 100% 100% no-repeat;
    box-shadow: 0 -8px 22px oklch(0.32 0.03 72 / 0.08);
  }

  .mobile-nav button,
  .mobile-nav button[data-mobile-route="oracle"],
  .mobile-nav button[aria-current="page"] {
    gap: 0;
    transform: none;
  }

  .mobile-nav b,
  .mobile-nav button[data-mobile-route="oracle"] b,
  .mobile-nav button[aria-current="page"] b {
    display: block;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    box-shadow: none;
  }

  .mobile-nav b svg {
    display: none;
  }

  .mobile-nav button[data-mobile-route="pool"] b {
    background-image: url("./mobile-assets/frame-v1/tab-pool-inactive.png");
  }

  .mobile-nav button[data-mobile-route="pool"][aria-current="page"] b {
    background-image: url("./mobile-assets/frame-v1/tab-pool-active.png");
  }

  .mobile-nav button[data-mobile-route="oracle"] b {
    background-image: url("./mobile-assets/frame-v1/tab-oracle-inactive.png");
  }

  .mobile-nav button[data-mobile-route="oracle"][aria-current="page"] b {
    background-image: url("./mobile-assets/frame-v1/tab-oracle-active.png");
  }

  .mobile-nav button[data-mobile-route="book"] b {
    background-image: url("./mobile-assets/frame-v1/tab-book-inactive.png");
  }

  .mobile-nav button[data-mobile-route="book"][aria-current="page"] b {
    background-image: url("./mobile-assets/frame-v1/tab-book-active.png");
  }

  .mobile-nav span {
    margin-top: -5px;
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0.08em;
  }

  .panel.panel--pool,
  .panel.panel--book,
  .pool-panel__content,
  .book-panel__content {
    background: url("./mobile-assets/frame-v1/paper-tile.png") center / 420px auto repeat;
  }

  .pool-panel__header {
    background: url("./mobile-assets/frame-v1/scene-pool.png") center / cover no-repeat;
  }

  .book-panel__mobile-hero {
    background: url("./mobile-assets/frame-v1/scene-book.png") center / cover no-repeat;
  }

  .pool-panel__header h2,
  .book-panel__mobile-hero h2 {
    display: grid;
    width: min(276px, 78vw);
    min-height: 66px;
    margin-right: auto;
    margin-left: auto;
    padding: 9px 26px;
    place-items: center;
    border: 0;
    background: url("./mobile-assets/frame-v1/frame-title.png") center / 100% 100% no-repeat;
    box-shadow: none;
  }

  .pool-mobile-overview article {
    padding: 18px 25px;
    border: 0;
    border-radius: 0;
    background: url("./mobile-assets/frame-v1/frame-pool.png") center / 100% 100% no-repeat;
    box-shadow: none;
  }

  .pool-mobile-overview article::before,
  .pool-mobile-overview article::after {
    display: none;
  }

  .pool-mobile-overview > p {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: url("./mobile-assets/frame-v1/frame-settlement.png") center / 100% 100% no-repeat;
  }

  .book-record:first-child {
    border: 0;
    border-radius: 0;
    background: url("./mobile-assets/frame-v1/frame-record.png") center / 100% 100% no-repeat;
    box-shadow: none;
  }
}

/* Mobile frame lock, intentionally last in the cascade. */
@media (max-width: 767px) {
  :root {
    --mobile-topbar: calc(68px + env(safe-area-inset-top));
    --mobile-nav-height: calc(86px + env(safe-area-inset-bottom));
  }

  .dream-entry,
  .realm__particles,
  .realm__mist,
  .realm__light,
  .intro,
  .realm-status,
  .landmark {
    display: none !important;
  }

  .topbar,
  .realm.is-pool-focused .topbar,
  .realm.is-book-focused .topbar {
    z-index: 90;
    height: var(--mobile-topbar);
    padding: env(safe-area-inset-top) 16px 0;
    align-items: center;
    border: 0;
    border-bottom: 1px solid oklch(0.61 0.04 76 / 0.2);
    background:
      radial-gradient(circle at 18% 22%, oklch(0.42 0.025 75 / 0.045) 0 0.45px, transparent 0.8px) 0 0 / 13px 17px,
      oklch(0.968 0.013 86 / 0.98);
    box-shadow: none;
    opacity: 1;
    backdrop-filter: none;
    transition: none;
  }

  .brand {
    width: auto;
    height: 52px;
    min-width: 0;
    gap: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
  }

  .brand__mark {
    display: none;
  }

  .brand__name {
    overflow: visible;
    color: oklch(0.25 0.045 160);
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-overflow: clip;
  }

  .brand::after {
    display: grid;
    width: 14px;
    height: 20px;
    place-items: center;
    margin-left: 6px;
    color: oklch(0.48 0.14 35);
    border: 1px solid currentColor;
    border-radius: 50% 46% 52% 44%;
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 8px;
    line-height: 1;
    content: "梦";
  }

  .topbar__actions {
    gap: 0;
  }

  .bell {
    display: none;
  }

  .wallet {
    display: grid;
    grid-template-columns: 36px 10px;
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    height: 40px;
    min-height: 40px;
    padding: 1px 8px 1px 9px;
    place-items: center;
    color: oklch(0.36 0.055 165);
    border: 1px solid oklch(0.43 0.045 165 / 0.5);
    border-radius: 20px;
    background: oklch(0.965 0.013 86 / 0.84);
    box-shadow: none;
    transition: none;
  }

  .wallet__mobile-mark {
    display: block;
    width: 31px;
    height: 31px;
    fill: oklch(0.56 0.055 78 / 0.3);
    stroke: currentColor;
    stroke-width: 1.25;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .wallet span {
    display: none;
  }

  .wallet i {
    position: static;
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border: 0;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    border-radius: 0;
    background: transparent;
    transform: rotate(45deg);
  }

  .wallet.is-connected i,
  .wallet.is-wrong-network i {
    background: transparent;
  }

  .panel.panel--pool,
  .panel.panel--book {
    top: var(--mobile-topbar);
    bottom: var(--mobile-nav-height);
    animation: none;
    transition: none;
  }

  .mobile-nav {
    z-index: 90;
    grid-template-columns: repeat(3, 1fr);
    height: var(--mobile-nav-height);
    padding: 4px 10px env(safe-area-inset-bottom);
    border-top: 1px solid oklch(0.58 0.04 76 / 0.26);
    background:
      radial-gradient(circle at 12% 18%, oklch(0.4 0.02 80 / 0.045) 0 0.45px, transparent 0.8px) 0 0 / 13px 17px,
      oklch(0.966 0.014 86 / 0.99);
    box-shadow: none;
    backdrop-filter: none;
  }

  .mobile-nav button,
  .mobile-nav button[data-mobile-route="oracle"],
  .mobile-nav button[aria-current="page"] {
    display: grid;
    min-height: 78px;
    padding: 4px 2px 5px;
    place-items: center;
    gap: 1px;
    color: oklch(0.31 0.045 164);
    border: 0;
    background: transparent;
    transform: none;
    transition: none;
  }

  .mobile-nav button[aria-current="page"] {
    color: oklch(0.49 0.14 36);
  }

  .mobile-nav b,
  .mobile-nav button[data-mobile-route="oracle"] b,
  .mobile-nav button[aria-current="page"] b {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
  }

  .mobile-nav button[aria-current="page"] b {
    border-color: oklch(0.5 0.13 36 / 0.7);
    background: oklch(0.94 0.024 82 / 0.58);
  }

  .mobile-nav b svg,
  .mobile-nav button[aria-current="page"] b svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-nav span {
    color: currentColor;
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 1024px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #e8eeeb;
}

button {
  color: inherit;
  font: inherit;
}

.realm {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 720px;
  isolation: isolate;
  overflow: hidden;
}

.realm__scene,
.realm__scene-canvas {
  position: absolute;
  inset: 0;
  z-index: -4;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1.015);
  filter: saturate(0.96) contrast(1.02);
}

.mobile-realm-scene {
  display: none;
}

.realm__scene,
.realm__scene-canvas {
  transition: opacity 360ms cubic-bezier(0.25, 1, 0.5, 1);
}

.realm__scene-canvas {
  pointer-events: none;
  opacity: 0;
}

.realm__scene-canvas.is-ready {
  opacity: 1;
}

.realm.has-water-scene .realm__scene {
  opacity: 0;
}

.realm__light {
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(246, 249, 247, 0.2) 0, transparent 19%),
    linear-gradient(0deg, rgba(233, 239, 235, 0.28) 0, transparent 25%),
    radial-gradient(circle at 50% 47%, rgba(255, 253, 242, 0.28), transparent 27%);
  animation: realm-light-breathe 6.8s cubic-bezier(0.25, 1, 0.5, 1) infinite alternate;
}

.realm__mist {
  position: absolute;
  inset: -12% -16%;
  z-index: -2;
  pointer-events: none;
  contain: paint;
  will-change: transform, opacity;
}

.realm__mist--far {
  background:
    radial-gradient(ellipse 25% 14% at 8% 55%, rgba(246, 249, 246, 0.64) 0 35%, rgba(151, 190, 179, 0.14) 56%, transparent 74%),
    radial-gradient(ellipse 31% 17% at 38% 46%, rgba(239, 247, 244, 0.58) 0 34%, rgba(135, 178, 166, 0.13) 57%, transparent 75%),
    radial-gradient(ellipse 25% 15% at 69% 57%, rgba(250, 249, 240, 0.54) 0 36%, rgba(183, 176, 143, 0.1) 58%, transparent 76%),
    radial-gradient(ellipse 28% 14% at 94% 42%, rgba(237, 246, 242, 0.6) 0 35%, rgba(141, 184, 172, 0.14) 58%, transparent 74%);
  filter: blur(15px);
  opacity: 0.72;
  transform: translate3d(-2.5%, 0, 0) scale(1.04);
  animation: realm-mist-far 18s cubic-bezier(0.25, 1, 0.5, 1) infinite alternate;
  mask-image: linear-gradient(180deg, transparent 9%, #000 34%, #000 79%, transparent 100%);
}

.realm__mist--near {
  background:
    radial-gradient(ellipse 28% 13% at 5% 78%, rgba(251, 250, 243, 0.74) 0 36%, rgba(167, 194, 184, 0.14) 58%, transparent 73%),
    radial-gradient(ellipse 24% 12% at 31% 70%, rgba(239, 247, 244, 0.66) 0 34%, rgba(134, 179, 166, 0.14) 59%, transparent 74%),
    radial-gradient(ellipse 31% 14% at 63% 76%, rgba(251, 249, 239, 0.7) 0 36%, rgba(185, 171, 135, 0.1) 58%, transparent 74%),
    radial-gradient(ellipse 26% 12% at 96% 66%, rgba(237, 246, 242, 0.68) 0 34%, rgba(139, 183, 171, 0.14) 58%, transparent 74%);
  filter: blur(12px);
  opacity: 0.78;
  transform: translate3d(2.5%, 0.5%, 0) scale(1.06);
  animation: realm-mist-near 13.5s cubic-bezier(0.25, 1, 0.5, 1) infinite alternate;
  mask-image: linear-gradient(180deg, transparent 34%, rgba(0, 0, 0, 0.82) 57%, #000 88%, transparent 100%);
}

.realm__particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(255, 252, 226, var(--alpha));
  box-shadow:
    0 0 5px rgba(255, 251, 220, 0.82),
    0 0 14px rgba(224, 197, 116, 0.44);
  filter: blur(var(--blur));
  opacity: 0;
  will-change: transform, opacity;
  animation: ambient-mote var(--duration) cubic-bezier(0.25, 1, 0.5, 1) var(--delay) infinite;
}

.particle::after {
  position: absolute;
  inset: -3px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.18;
  transform: scale(0.45);
  animation: ambient-glint 2.8s ease-in-out var(--delay) infinite alternate;
  content: "";
}

.particle--gold::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: calc(var(--size) * 2.8);
  background: linear-gradient(180deg, transparent, rgba(255, 239, 178, 0.78), transparent);
  opacity: 0.5;
  transform: translate(-50%, -50%);
  content: "";
}

.particle--gold {
  color: rgba(185, 145, 70, 0.7);
  background: rgba(255, 226, 150, var(--alpha));
  box-shadow: 0 0 6px rgba(255, 236, 181, 0.92), 0 0 18px rgba(188, 145, 67, 0.58);
}

.particle--jade {
  color: rgba(100, 171, 151, 0.62);
  background: rgba(186, 237, 218, var(--alpha));
  box-shadow: 0 0 6px rgba(222, 249, 238, 0.88), 0 0 16px rgba(103, 176, 155, 0.46);
}

.particle--pearl {
  color: rgba(246, 245, 224, 0.66);
}

@keyframes ambient-mote {
  0% { transform: translate3d(0, 12px, 0) scale(0.62); opacity: 0; }
  17% { opacity: calc(var(--alpha) * 0.72); }
  54% { opacity: var(--alpha); }
  84% { opacity: calc(var(--alpha) * 0.58); }
  100% { transform: translate3d(var(--dx), var(--dy), 0) scale(1.12); opacity: 0; }
}

@keyframes ambient-glint {
  from { opacity: 0.08; transform: scale(0.42); }
  to { opacity: 0.34; transform: scale(1.08); }
}

@keyframes realm-light-breathe {
  from { opacity: 0.76; }
  to { opacity: 1; }
}

@keyframes realm-mist-far {
  from { transform: translate3d(-2.5%, 0, 0) scale(1.04); opacity: 0.58; }
  to { transform: translate3d(3.5%, -0.7%, 0) scale(1.08); opacity: 0.78; }
}

@keyframes realm-mist-near {
  from { transform: translate3d(2.5%, 0.5%, 0) scale(1.06); opacity: 0.62; }
  to { transform: translate3d(-3.2%, -0.8%, 0) scale(1.1); opacity: 0.84; }
}

.dream-entry {
  position: absolute;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  color: #273b35;
  background: transparent;
  opacity: 1;
  transition: opacity 760ms cubic-bezier(0.4, 0, 0.2, 1), visibility 760ms linear;
}

.dream-entry::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: 19%;
  background: linear-gradient(180deg, transparent, rgba(244, 241, 233, 0.96) 72%);
  content: "";
  pointer-events: none;
  transition: opacity 800ms ease;
}

.dream-entry[hidden] {
  display: none;
}

.dream-entry__paper,
.dream-entry__ink,
.dream-entry__bottom-cover,
.dream-entry__transition,
.dream-entry__webgl,
.dream-entry__canvas,
.dream-entry__mist {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dream-entry__paper {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 252, 0.9), transparent 44%),
    radial-gradient(circle at 18% 80%, rgba(210, 202, 186, 0.1), transparent 32%),
    linear-gradient(115deg, #f7f4ed, #efebe2 58%, #f6f3ec);
  transition: opacity 900ms ease;
  will-change: mask-image, -webkit-mask-image;
}

.dream-entry__ink {
  z-index: 1;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0;
  transform: scale(1.018);
  filter: saturate(0.84) contrast(0.98);
  animation:
    entry-ink-arrive 850ms ease-out 100ms forwards,
    entry-ink-breathe 4.8s ease-in-out 950ms infinite alternate;
  transition: opacity 1050ms ease, filter 1200ms ease, transform 1700ms ease;
  will-change: mask-image, -webkit-mask-image;
  clip-path: inset(0 0 19% 0);
}

.dream-entry__bottom-cover {
  z-index: 2;
  top: auto;
  height: 28%;
  background: linear-gradient(180deg, transparent, #f4f1e9 28%, #f4f1e9 100%);
  pointer-events: none;
  will-change: mask-image, -webkit-mask-image;
}

.dream-entry__transition {
  z-index: 2;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0;
  transform: scale(1.045);
  filter: blur(4px) saturate(0.75);
  mix-blend-mode: multiply;
  mask-image: radial-gradient(ellipse at 55% 51%, #000 0 22%, rgba(0, 0, 0, 0.9) 38%, transparent 71%);
  transition: opacity 850ms ease, transform 1600ms ease, filter 1100ms ease;
  display: none;
}

.dream-entry__canvas {
  z-index: 3;
  pointer-events: none;
}

.dream-entry__webgl {
  z-index: 3;
  display: none;
  pointer-events: none;
}

.dream-entry__webgl.is-active {
  display: block;
}

.dream-entry__mist {
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 54%, rgba(250, 250, 246, 0.54), transparent 28%),
    radial-gradient(ellipse at 82% 61%, rgba(250, 250, 247, 0.66), transparent 31%),
    linear-gradient(90deg, rgba(249, 249, 246, 0.28), transparent 28%, transparent 72%, rgba(249, 249, 246, 0.3));
  transform: translate3d(-1.5%, 0, 0) scale(1.04);
  animation: entry-mist-drift 5.2s ease-in-out infinite alternate;
  transition: opacity 900ms ease, transform 1400ms ease;
}

.dream-entry__identity {
  position: absolute;
  bottom: 5.5%;
  left: 50%;
  z-index: 6;
  display: grid;
  justify-items: center;
  width: 220px;
  transform: translateX(-50%);
  text-shadow: 0 2px 12px rgba(255, 255, 252, 0.92);
  transition: opacity 460ms ease, transform 760ms ease;
}

.dream-entry__sigil {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  margin-bottom: 8px;
  color: #9f4d3e;
  border: 1px solid rgba(159, 77, 62, 0.66);
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
}

.dream-entry__identity strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
}

.dream-entry__identity small {
  margin-top: 7px;
  color: rgba(39, 59, 53, 0.55);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.dream-entry__progress {
  position: relative;
  width: 116px;
  height: 1px;
  margin-top: 10px;
  overflow: hidden;
  background: rgba(39, 59, 53, 0.13);
}

.dream-entry__progress i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4%;
  background: linear-gradient(90deg, rgba(76, 118, 105, 0.52), rgba(178, 145, 78, 0.76));
  transition: width 250ms ease;
}

.dream-entry__skip {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 7;
  min-width: 52px;
  min-height: 40px;
  padding: 0 10px;
  color: oklch(0.38 0.035 165 / 0.76);
  border: 1px solid oklch(0.48 0.035 165 / 0.24);
  background: oklch(0.96 0.015 88 / 0.72);
  box-shadow: 0 8px 22px oklch(0.3 0.025 165 / 0.08);
  font-size: 12px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.dream-entry__skip:hover,
.dream-entry__skip:focus-visible {
  color: oklch(0.31 0.05 165);
  border-color: oklch(0.48 0.055 165 / 0.48);
  background: oklch(0.975 0.014 88 / 0.94);
  outline: 2px solid oklch(0.52 0.09 38 / 0.52);
  outline-offset: 3px;
}

.dream-entry.is-dissolving .dream-entry__ink {
  opacity: 1;
  transform: scale(1.018);
  filter: blur(0) saturate(0.84);
  animation: none;
  transition: none;
}

.dream-entry.is-dissolving .dream-entry__transition {
  opacity: 0;
}

.dream-entry.is-dissolving::after {
  opacity: 0;
}

.dream-entry.is-dissolving .dream-entry__mist {
  opacity: 0.1;
}

.dream-entry.is-dissolving .dream-entry__identity {
  opacity: 0;
  transform: translate(-50%, 8px);
}

.dream-entry.is-keyframe .dream-entry__identity,
.dream-entry.is-keyframe .dream-entry__skip {
  display: none;
}

.dream-entry.is-revealing .dream-entry__ink {
  opacity: 0;
}

.dream-entry.is-revealing .dream-entry__paper,
.dream-entry.is-revealing::after {
  opacity: 0;
}

.dream-entry.is-revealing .dream-entry__transition {
  opacity: 0.34;
  transform: scale(1);
  filter: blur(3px) saturate(0.7);
}

.dream-entry.is-revealing .dream-entry__mist {
  opacity: 0.38;
  transform: translate3d(2%, 0, 0) scale(1.08);
}

.dream-entry.is-exiting {
  visibility: hidden;
  opacity: 0;
}

@keyframes entry-ink-arrive {
  from { opacity: 0; transform: scale(1.05); filter: blur(5px) saturate(0.6); }
  to { opacity: 1; transform: scale(1.018); filter: blur(0) saturate(0.84); }
}

@keyframes entry-ink-breathe {
  from { transform: scale(1.018) translate3d(0, 0, 0); }
  to { transform: scale(1.035) translate3d(0, -0.45%, 0); }
}

@keyframes entry-mist-drift {
  from { transform: translate3d(-1.5%, 0, 0) scale(1.04); opacity: 0.66; }
  to { transform: translate3d(1.5%, -0.5%, 0) scale(1.07); opacity: 0.88; }
}

.topbar,
.intro,
.landmark,
.realm-status {
  transition: opacity 720ms ease, transform 820ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.realm.is-entering .topbar,
.realm.is-entering .intro,
.realm.is-entering .landmark,
.realm.is-entering .realm-status {
  opacity: 0;
  pointer-events: none;
}

.realm.is-entering .topbar,
.realm.is-entering .intro {
  transform: translateY(-8px);
}

.realm.is-entering .landmark,
.realm.is-entering .realm-status {
  transform: translateY(9px);
}

.realm__scene {
  transition: filter 1800ms ease, transform 2400ms ease;
}

.realm.is-entering .realm__scene {
  transform: scale(1.07);
  filter: blur(11px) saturate(0.68) brightness(1.04);
}

.realm.is-sweeping .realm__scene {
  transform: scale(1.025);
  filter: blur(0.2px) saturate(1.08) contrast(1.035) brightness(1.015);
}

.realm.is-revealed .realm__scene {
  transform: scale(1.015);
  filter: blur(0) saturate(0.96) contrast(1.02);
}

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 78px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(51, 95, 83, 0.14);
  background: linear-gradient(180deg, rgba(248, 249, 245, 0.8), rgba(248, 249, 245, 0.46));
  backdrop-filter: blur(15px) saturate(0.9);
}

.brand,
.sound,
.wallet,
.nav__item {
  border: 0;
  background: none;
  cursor: pointer;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
}

.brand__seal {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff8ef;
  background: var(--cinnabar);
  border: 1px solid rgba(119, 40, 31, 0.4);
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
  box-shadow: inset 0 0 0 3px rgba(255, 246, 224, 0.18);
}

.brand__name {
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
  letter-spacing: 0.12em;
}

.nav {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav__item {
  position: relative;
  height: 100%;
  padding: 0 4px;
  color: rgba(23, 54, 47, 0.62);
  font-size: 15px;
  letter-spacing: 0.12em;
}

.nav__item:hover,
.nav__item.is-active {
  color: var(--ink);
}

.nav__item.is-active::after {
  position: absolute;
  right: 3px;
  bottom: 0;
  left: 3px;
  height: 2px;
  background: var(--cinnabar);
  content: "";
}

.topbar__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound,
.wallet {
  height: 40px;
  border: 1px solid rgba(23, 54, 47, 0.22);
  background: rgba(248, 248, 242, 0.4);
}

.sound {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  font-size: 13px;
}

.sound__icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: "Songti SC", serif;
}

.wallet {
  min-width: 126px;
  padding: 0 18px;
  color: #f7f5ec;
  border-color: rgba(21, 56, 47, 0.72);
  background: rgba(27, 63, 53, 0.9);
  letter-spacing: 0.08em;
}

.intro {
  position: absolute;
  top: 106px;
  left: 42px;
  z-index: 6;
  width: 310px;
  color: rgba(23, 54, 47, 0.82);
  text-shadow: 0 1px 10px rgba(250, 252, 248, 0.8);
}

.intro p,
.intro span {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.16em;
}

.intro strong {
  display: block;
  margin: 9px 0 8px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.intro span {
  color: rgba(23, 54, 47, 0.62);
  letter-spacing: 0.04em;
}

.landmark {
  position: absolute;
  z-index: 5;
  padding: 0;
  border: 0;
  border-radius: 46%;
  outline: none;
  background: transparent;
  cursor: pointer;
}

.landmark--pool {
  top: 28%;
  left: 1.5%;
  width: 29%;
  height: 49%;
}

.landmark--oracle {
  top: 22%;
  left: 31.5%;
  width: 37%;
  height: 50%;
}

.landmark--book {
  top: 13%;
  right: 1.5%;
  width: 29%;
  height: 52%;
}

.landmark__halo {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 211, 0.34), rgba(175, 222, 206, 0.12) 45%, transparent 72%);
  opacity: 0;
  transform: scale(0.86);
  transition: opacity 350ms ease, transform 600ms ease;
}

.landmark__label {
  position: absolute;
  display: grid;
  min-width: 148px;
  padding: 12px 14px 11px;
  border: 1px solid rgba(81, 112, 99, 0.24);
  background: rgba(249, 249, 243, 0.76);
  box-shadow: 0 12px 38px rgba(40, 68, 60, 0.12);
  backdrop-filter: blur(14px);
  opacity: 0.84;
  transition: opacity 250ms ease, transform 350ms ease, border-color 250ms ease;
}

.landmark--pool .landmark__label {
  bottom: 22%;
  left: 12%;
}

.landmark--oracle .landmark__label {
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
}

.landmark--book .landmark__label {
  top: 34%;
  right: 8%;
}

.landmark__label::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 2px;
  background: var(--cinnabar);
  content: "";
}

.landmark__label small,
.landmark__label i {
  color: rgba(23, 54, 47, 0.54);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.12em;
}

.landmark__label strong {
  margin: 3px 0 4px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.landmark:hover .landmark__halo,
.landmark:focus-visible .landmark__halo,
.landmark.is-focused .landmark__halo {
  opacity: 1;
  transform: scale(1);
}

.landmark:hover .landmark__label,
.landmark:focus-visible .landmark__label,
.landmark.is-focused .landmark__label {
  border-color: rgba(168, 74, 57, 0.38);
  opacity: 1;
}

.landmark--pool:hover .landmark__label,
.landmark--book:hover .landmark__label {
  transform: translateY(-5px);
}

.landmark--oracle:hover .landmark__label,
.landmark--oracle.is-focused .landmark__label {
  transform: translate(-50%, -5px);
}

.draw-actions {
  position: absolute;
  bottom: 112px;
  left: 50%;
  z-index: 14;
  display: flex;
  gap: 12px;
  transform: translateX(-50%);
}

.draw {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-width: 210px;
  height: 68px;
  padding: 0 20px 0 14px;
  border: 1px solid rgba(124, 90, 43, 0.32);
  background: rgba(250, 248, 240, 0.83);
  box-shadow: 0 13px 32px rgba(45, 68, 60, 0.16);
  backdrop-filter: blur(16px) saturate(0.92);
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.draw:hover {
  transform: translateY(-3px);
  box-shadow: 0 17px 38px rgba(45, 68, 60, 0.21);
}

.draw--ten {
  color: #f8f3e6;
  border-color: rgba(16, 54, 43, 0.6);
  background: rgba(31, 68, 57, 0.88);
}

.draw__seal {
  display: grid;
  width: 38px;
  height: 38px;
  margin-right: 12px;
  place-items: center;
  border: 1px solid rgba(168, 74, 57, 0.5);
  color: var(--cinnabar);
  font-family: "Songti SC", serif;
  font-size: 19px;
}

.draw--ten .draw__seal {
  color: #e4c886;
  border-color: rgba(228, 200, 134, 0.5);
}

.draw strong,
.draw small {
  display: block;
  text-align: left;
}

.draw strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.draw small {
  margin-top: 3px;
  color: rgba(23, 54, 47, 0.55);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.draw--ten small {
  color: rgba(248, 243, 230, 0.64);
}

.ledger {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr) 0.86fr;
  height: 92px;
  border-top: 1px solid rgba(54, 84, 74, 0.22);
  background: rgba(247, 247, 240, 0.78);
  box-shadow: 0 -16px 45px rgba(61, 83, 74, 0.08);
  backdrop-filter: blur(20px) saturate(0.86);
}

.ledger__item {
  position: relative;
  display: grid;
  align-content: center;
  padding: 0 30px;
  border: 0;
  border-right: 1px solid rgba(54, 84, 74, 0.16);
  background: transparent;
  text-align: left;
}

button.ledger__item {
  cursor: pointer;
}

button.ledger__item:hover {
  background: rgba(255, 255, 250, 0.5);
}

.ledger__item span,
.ledger__item i {
  color: rgba(23, 54, 47, 0.58);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.12em;
}

.ledger__item strong {
  margin: 3px 0 2px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ledger__item strong small {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
}

.ledger__item--time {
  color: #f7f1df;
  border-right: 0;
  background: rgba(152, 113, 48, 0.86);
}

.ledger__item--time span,
.ledger__item--time i {
  color: rgba(255, 248, 225, 0.72);
}

.panel {
  width: min(620px, calc(100vw - 64px));
  padding: 48px;
  color: var(--ink);
  border: 1px solid rgba(51, 95, 83, 0.25);
  background: rgba(248, 247, 240, 0.92);
  box-shadow: 0 30px 100px rgba(24, 44, 38, 0.25);
  backdrop-filter: blur(24px);
}

.panel::backdrop {
  background: rgba(19, 44, 37, 0.18);
  backdrop-filter: blur(5px);
}

.panel__close {
  position: absolute;
  top: 20px;
  right: 22px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(23, 54, 47, 0.2);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.panel__eyebrow {
  margin: 0 0 8px;
  color: var(--cinnabar);
  font-size: 11px;
  letter-spacing: 0.2em;
}

.panel h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 46px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.panel > p:not(.panel__eyebrow) {
  margin: 12px 0 26px;
  color: rgba(23, 54, 47, 0.66);
}

.panel__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(23, 54, 47, 0.14);
  border-bottom: 1px solid rgba(23, 54, 47, 0.14);
}

.panel__metric {
  padding: 18px 16px;
  border-right: 1px solid rgba(23, 54, 47, 0.14);
}

.panel__metric:last-child {
  border-right: 0;
}

.panel__metric span,
.panel__metric strong {
  display: block;
}

.panel__metric span {
  color: rgba(23, 54, 47, 0.55);
  font-size: 11px;
}

.panel__metric strong {
  margin-top: 7px;
  font-family: "Songti SC", serif;
  font-size: 18px;
}

.panel__primary {
  width: 150px;
  height: 44px;
  margin-top: 26px;
  color: #f7f5ec;
  border: 0;
  background: var(--jade-deep);
  cursor: pointer;
}

.toast {
  position: absolute;
  top: 96px;
  left: 50%;
  z-index: 30;
  padding: 10px 17px;
  color: #f7f3e8;
  background: rgba(27, 63, 53, 0.9);
  box-shadow: 0 12px 28px rgba(30, 57, 49, 0.18);
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Confirmed immersive-homepage direction: the scene is the navigation. */
.topbar {
  right: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  height: 68px;
  padding: 17px 30px 0;
  border: 0;
  background: none;
  backdrop-filter: none;
  pointer-events: none;
}

.brand,
.topbar__actions {
  pointer-events: auto;
}

.brand {
  gap: 9px;
  height: 42px;
  padding: 4px 7px 4px 4px;
  text-shadow: 0 1px 14px rgba(248, 251, 246, 0.92);
}

.brand__mark {
  width: 31px;
  height: 31px;
  overflow: visible;
  color: var(--jade-deep);
  filter: drop-shadow(0 2px 10px rgba(248, 251, 246, 0.86));
}

.brand__mark circle {
  fill: rgba(248, 248, 241, 0.45);
  stroke: currentColor;
  stroke-width: 1.15;
}

.brand__mark path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.brand__name {
  font-size: 18px;
  letter-spacing: 0.16em;
}

.topbar__actions {
  gap: 14px;
}

.bell,
.wallet {
  position: relative;
  height: 42px;
  padding: 0;
  color: rgba(23, 54, 47, 0.86);
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 1px 9px rgba(250, 252, 248, 0.95));
}

.bell {
  display: grid;
  width: 42px;
  place-items: center;
}

.bell svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.bell i {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cinnabar);
  box-shadow: 0 0 0 2px rgba(250, 249, 243, 0.72);
}

.bell i[hidden] {
  display: none;
}

.wallet {
  min-width: 96px;
  padding: 0 6px;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.wallet i,
.wallet i::before,
.wallet i::after {
  position: absolute;
  content: "";
}

.wallet i {
  right: 4px;
  bottom: 3px;
  left: 4px;
  height: 6px;
  border-bottom: 1px solid rgba(51, 95, 83, 0.48);
  border-radius: 50%;
}

.wallet i::before,
.wallet i::after {
  bottom: -1px;
  width: 22px;
  height: 5px;
  border-top: 1px solid rgba(51, 95, 83, 0.34);
  border-radius: 50%;
}

.wallet i::before { left: 12px; }
.wallet i::after { right: 12px; }

.intro {
  top: 76px;
  left: 34px;
  width: 390px;
  padding: 0;
  color: oklch(0.32 0.045 170);
  background: none;
  text-shadow: 0 1px 0 oklch(0.99 0.006 90 / 0.96), 0 2px 11px oklch(0.99 0.006 90 / 0.72);
  backdrop-filter: none;
  opacity: 1;
}

.intro::after {
  display: none;
}

.intro p {
  display: block;
  color: oklch(0.43 0.04 170 / 0.9);
  font-weight: 500;
}

.intro p::before {
  display: block;
  width: 18px;
  height: 1px;
  margin: 0 0 10px;
  background: oklch(0.51 0.13 32);
  content: "";
}

.intro strong {
  margin: 0 0 8px;
  color: oklch(0.29 0.05 170);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.intro span {
  display: block;
  width: max-content;
  color: oklch(0.41 0.03 170 / 0.86);
  font-weight: 450;
}

.intro span::after {
  display: none;
}

.landmark__label {
  display: grid;
  min-width: 176px;
  padding: 12px 14px 14px 46px;
  color: oklch(0.31 0.04 170 / 0.98);
  border: 0;
  border-radius: 2px 11px 3px 8px;
  background: oklch(0.96 0.014 92 / 0.88);
  box-shadow: 0 9px 26px oklch(0.31 0.025 170 / 0.14);
  backdrop-filter: blur(5px) saturate(0.78);
  opacity: 0.97;
  writing-mode: horizontal-tb;
  text-align: left;
  white-space: nowrap;
  transition: opacity 240ms ease, transform 420ms ease, text-shadow 240ms ease;
}

.landmark--pool .landmark__label {
  bottom: 29%;
  left: 63%;
}

.landmark--oracle .landmark__label {
  top: 39%;
  left: 10%;
  transform: none;
}

.landmark--book .landmark__label {
  top: 3%;
  right: auto;
  left: 1%;
}

.landmark__label::before {
  position: absolute;
  top: 22px;
  left: 3px;
  width: 32px;
  height: 16px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 16'%3E%3Cg fill='none' stroke='%23a84a39' stroke-width='1.35' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 10h10c-1.8-1-2-3.3-.4-4.7 1.3-1.1 3.2-1 4.4.2C16.7 2.9 19 1 21.9 1c3.2 0 5.8 2.2 6.4 5.1 1.5-1 3.6-.8 4.8.5 1 1.1 1.1 2.6.4 3.7H38'/%3E%3Cpath d='M8 14h17c2.3 0 4.2-.8 5.7-2.3'/%3E%3C/g%3E%3C/svg%3E");
  box-shadow: none;
  transform: translateY(-50%);
}

.landmark__label::after {
  position: absolute;
  right: 7px;
  bottom: 4px;
  left: 42px;
  height: 1px;
  background: linear-gradient(90deg, oklch(0.58 0.105 35 / 0.82), oklch(0.58 0.105 35 / 0.18));
  content: "";
}

.landmark__label strong {
  justify-self: start;
  margin: 0;
  padding: 0;
  color: inherit;
  font-family: "FangSong", "STFangsong", "FangSong_GB2312", serif;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-shadow: 0 1px 0 oklch(0.99 0.006 90 / 0.92);
}

.landmark__label small {
  display: block;
  justify-self: start;
  margin-top: 5px;
  margin-left: 2px;
  padding: 0;
  color: oklch(0.38 0.032 170 / 0.9);
  font-family: "FangSong", "STFangsong", "FangSong_GB2312", serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.landmark__tooltip {
  position: absolute;
  width: max-content;
  max-width: 210px;
  padding: 8px 11px;
  color: rgba(23, 54, 47, 0.76);
  border: 1px solid rgba(91, 118, 106, 0.12);
  background: rgba(249, 250, 245, 0.54);
  box-shadow: 0 10px 26px rgba(44, 70, 61, 0.08);
  backdrop-filter: blur(10px);
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity 200ms ease, transform 260ms ease;
}

.landmark--pool .landmark__tooltip {
  bottom: 21%;
  left: 49%;
}

.landmark--oracle .landmark__tooltip {
  top: 55%;
  left: 12%;
  transform: translateY(5px);
}

.landmark--book .landmark__tooltip {
  top: 22%;
  right: auto;
  left: 0;
}

.landmark:hover .landmark__label,
.landmark:focus-visible .landmark__label,
.landmark.is-focused .landmark__label {
  opacity: 0.96;
  text-shadow: 0 0 18px rgba(255, 249, 204, 0.6);
}

.landmark:hover .landmark__tooltip,
.landmark:focus-visible .landmark__tooltip {
  opacity: 1;
  transform: translateY(0);
}

.landmark--pool:hover .landmark__label,
.landmark--book:hover .landmark__label {
  transform: translateY(-3px);
}

.landmark--oracle:hover .landmark__label,
.landmark--oracle.is-focused .landmark__label {
  transform: translateY(-3px);
}

.landmark--oracle:hover .landmark__tooltip,
.landmark--oracle:focus-visible .landmark__tooltip {
  transform: translateY(0);
}

.realm-status {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  height: 27px;
  pointer-events: none;
}

.realm-status button {
  height: 100%;
  padding: 0 12px;
  color: rgba(23, 54, 47, 0.48);
  border: 0;
  background: none;
  text-shadow: 0 1px 8px rgba(250, 252, 248, 0.94);
  font-size: 10px;
  letter-spacing: 0.08em;
  pointer-events: auto;
  cursor: pointer;
}

.realm-status strong {
  color: rgba(23, 54, 47, 0.7);
  font-family: "Songti SC", serif;
  font-size: 11px;
  font-weight: 600;
}

.realm-status i {
  display: inline-block;
  width: 2px;
  height: 2px;
  margin: 0 9px 3px;
  border-radius: 50%;
  background: currentColor;
}

.panel__actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.panel__choice,
.panel__return {
  min-width: 148px;
  height: 46px;
  border: 1px solid rgba(51, 95, 83, 0.3);
  background: rgba(252, 251, 246, 0.68);
  cursor: pointer;
}

.panel__choice--primary {
  color: #f8f5e9;
  border-color: var(--jade-deep);
  background: var(--jade-deep);
}

.panel__choice strong,
.panel__choice small {
  display: block;
}

.panel__choice strong {
  font-family: "Songti SC", serif;
  font-size: 17px;
  font-weight: 500;
}

.panel__choice small {
  margin-top: 2px;
  color: rgba(23, 54, 47, 0.5);
  font-size: 9px;
}

.panel__choice--primary small {
  color: rgba(248, 245, 233, 0.62);
}

.panel__return {
  width: auto;
  min-width: 0;
  height: auto;
  margin-top: 22px;
  padding: 0;
  color: rgba(23, 54, 47, 0.58);
  border: 0;
  border-bottom: 1px solid rgba(23, 54, 47, 0.24);
  background: none;
  font-size: 11px;
}

/* Product-shell states: wallet, live data and dialog feedback. */
.wallet {
  transition: color 180ms ease, opacity 180ms ease, filter 180ms ease;
}

.wallet.is-connected {
  color: oklch(0.31 0.055 170);
}

.wallet.is-connected::before {
  position: absolute;
  top: 9px;
  left: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: oklch(0.58 0.11 158);
  box-shadow: 0 0 8px oklch(0.68 0.11 158 / 0.65);
  content: "";
}

.wallet.is-wrong-network {
  color: oklch(0.48 0.14 34);
}

.wallet:disabled {
  cursor: wait;
  opacity: 0.56;
}

.panel__status {
  margin: -14px 0 24px !important;
  padding-left: 12px;
  color: rgba(23, 54, 47, 0.68) !important;
  border-left: 2px solid rgba(177, 70, 49, 0.52);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.04em;
}

.panel.is-busy {
  cursor: progress;
}

.panel__choice {
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.panel__choice:hover:not(:disabled) {
  transform: translateY(-1px);
}

.panel__choice:disabled {
  cursor: wait;
  opacity: 0.5;
}

@media (max-width: 680px) {
  .panel {
    width: calc(100vw - 28px);
    padding: 42px 24px 30px;
  }

  .panel h2 {
    font-size: 36px;
  }

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

  .panel__metric {
    border-right: 0;
    border-bottom: 1px solid rgba(23, 54, 47, 0.14);
  }

  .panel__metric:last-child {
    border-bottom: 0;
  }

  .panel__actions {
    flex-direction: column;
  }

  .panel__choice {
    width: 100%;
  }
}

@media (max-height: 800px) {
  .topbar { height: 62px; }
  .intro { top: 76px; }
  .landmark__label { transform: scale(0.92); }
  .landmark--oracle .landmark__label { transform: scale(0.92); transform-origin: top left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile production surface, shaped from the approved B + C interaction direction. */
.mobile-nav {
  display: none;
}

@media (max-width: 767px) {
  :root {
    --mobile-topbar: calc(58px + env(safe-area-inset-top));
    --mobile-nav-height: calc(68px + env(safe-area-inset-bottom));
  }

  html,
  body {
    min-width: 320px;
    min-height: 100%;
    overflow: hidden;
    background: oklch(0.9 0.02 163);
  }

  body {
    min-height: 100svh;
  }

  button {
    touch-action: manipulation;
  }

  .realm {
    width: 100%;
    height: 100svh;
    min-height: 560px;
  }

  .realm__scene-canvas {
    display: none;
  }

  .realm__scene {
    right: auto;
    left: 50%;
    width: 196%;
    max-width: none;
    object-position: 49% 50%;
    transform: translateX(-50%) scale(1.01);
    filter: saturate(0.86) contrast(0.94) brightness(1.04);
  }

  .realm.is-entering .realm__scene {
    transform: translateX(-50%) scale(1.065);
  }

  .realm.is-sweeping .realm__scene {
    transform: translateX(-50%) scale(1.025);
  }

  .realm.is-revealed .realm__scene {
    transform: translateX(-50%) scale(1.01);
  }

  .realm__light {
    background:
      linear-gradient(180deg, oklch(0.98 0.008 90 / 0.56), transparent 24%),
      linear-gradient(0deg, oklch(0.94 0.014 158 / 0.68), transparent 33%),
      radial-gradient(circle at 50% 45%, transparent 0 23%, oklch(0.97 0.012 160 / 0.48) 76%);
  }

  .realm__mist--far {
    opacity: 0.48;
  }

  .realm__mist--near {
    opacity: 0.58;
  }

  .dream-entry__ink {
    right: auto;
    left: 50%;
    width: 282%;
    max-width: none;
    transform: translateX(-50%);
    object-fit: cover;
  }

  .dream-entry__identity {
    right: 18px;
    bottom: max(9%, calc(env(safe-area-inset-bottom) + 38px));
    left: 18px;
  }

  .dream-entry__skip {
    top: max(15px, env(safe-area-inset-top));
    right: 14px;
    min-width: 54px;
    min-height: 44px;
  }

  .topbar {
    right: 0;
    left: 0;
    height: var(--mobile-topbar);
    padding: env(safe-area-inset-top) 12px 6px;
    align-items: end;
    border-bottom: 1px solid oklch(0.46 0.035 166 / 0.13);
    background: oklch(0.975 0.01 91 / 0.92);
    backdrop-filter: blur(12px) saturate(0.86);
  }

  .brand {
    min-width: 0;
    height: 44px;
    padding: 4px;
  }

  .brand__mark {
    width: 30px;
    height: 30px;
  }

  .brand__name {
    overflow: hidden;
    font-size: 16px;
    letter-spacing: 0.13em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar__actions {
    gap: 2px;
  }

  .bell,
  .wallet {
    min-height: 44px;
  }

  .bell {
    width: 44px;
  }

  .wallet {
    min-width: 88px;
    max-width: 112px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .intro {
    top: calc(var(--mobile-topbar) + 16px);
    left: 18px;
    width: min(78%, 310px);
  }

  .intro strong {
    margin-bottom: 6px;
    font-size: 21px;
    line-height: 1.4;
    white-space: normal;
  }

  .intro span {
    max-width: 26em;
    width: auto;
    font-size: 12px;
    line-height: 1.55;
  }

  .landmark {
    border-radius: 0;
  }

  .landmark--pool {
    top: 24%;
    right: 0;
    left: auto;
    width: 58%;
    height: 24%;
  }

  .landmark--oracle {
    top: 36%;
    left: 13%;
    width: 74%;
    height: 29%;
  }

  .landmark--book {
    top: 57%;
    right: auto;
    left: 0;
    width: 61%;
    height: 23%;
  }

  .landmark__halo {
    inset: 2%;
  }

  .landmark__label {
    min-width: 142px;
    padding: 10px 12px 12px 42px;
    border: 1px solid oklch(0.42 0.04 166 / 0.2);
    border-radius: 3px 16px 4px 14px;
    background: oklch(0.97 0.012 91 / 0.86);
    box-shadow: 0 10px 28px oklch(0.3 0.03 166 / 0.13);
    backdrop-filter: blur(6px) saturate(0.82);
  }

  .landmark__label::before {
    top: 20px;
    width: 29px;
    height: 14px;
  }

  .landmark__label::after {
    left: 39px;
  }

  .landmark__label strong {
    font-size: 18px;
    letter-spacing: 0.1em;
  }

  .landmark__label small {
    margin-top: 4px;
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .landmark--pool .landmark__label {
    top: 8%;
    right: 9%;
    bottom: auto;
    left: auto;
  }

  .landmark--oracle .landmark__label {
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
  }

  .landmark--book .landmark__label {
    top: 10%;
    left: 8%;
  }

  .landmark--oracle:hover .landmark__label,
  .landmark--oracle:focus-visible .landmark__label,
  .landmark--oracle.is-focused .landmark__label {
    transform: translateX(-50%);
  }

  .landmark__tooltip {
    display: none;
  }

  .realm-status {
    right: 12px;
    bottom: calc(var(--mobile-nav-height) + 10px);
    left: 12px;
    height: 44px;
    border: 1px solid oklch(0.44 0.035 166 / 0.16);
    border-radius: 11px;
    background: oklch(0.975 0.01 91 / 0.88);
    backdrop-filter: blur(8px);
  }

  .realm-status button {
    width: 100%;
    min-height: 44px;
    font-size: 10px;
  }

  .mobile-nav {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: var(--mobile-nav-height);
    padding: 4px 8px env(safe-area-inset-bottom);
    border-top: 1px solid oklch(0.44 0.035 166 / 0.16);
    background: oklch(0.975 0.01 91 / 0.96);
    backdrop-filter: blur(14px) saturate(0.86);
  }

  .mobile-nav button {
    display: grid;
    min-width: 0;
    min-height: 56px;
    padding: 4px 2px 5px;
    place-items: center;
    gap: 2px;
    color: oklch(0.45 0.025 166);
    border: 0;
    border-radius: 11px;
    background: transparent;
  }

  .mobile-nav button[aria-current="page"] {
    color: var(--ink);
    background: oklch(0.91 0.025 158);
  }

  .mobile-nav b {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 13px;
    font-weight: 500;
  }

  .mobile-nav span {
    font-size: 11px;
    letter-spacing: 0.05em;
  }

  .panel[open] {
    z-index: 50;
  }

  .panel:not(.panel--pool):not(.panel--book):not(.panel--history) {
    position: absolute;
    top: auto;
    right: 12px;
    bottom: calc(var(--mobile-nav-height) + 10px);
    left: 12px;
    width: auto;
    max-height: calc(100svh - var(--mobile-topbar) - var(--mobile-nav-height) - 20px);
    margin: 0;
    padding: 42px 22px 22px;
    overflow-y: auto;
    border-radius: 20px 20px 12px 12px;
  }

  .panel:not(.panel--pool):not(.panel--book):not(.panel--history) h2 {
    font-size: 32px;
  }

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

  .panel__metric {
    border-right: 0;
    border-bottom: 1px solid oklch(0.44 0.035 166 / 0.13);
  }

  .panel__metric:last-child {
    border-bottom: 0;
  }

  .panel.panel--pool,
  .panel.panel--book {
    position: absolute;
    top: 0;
    right: 0;
    bottom: var(--mobile-nav-height);
    left: 0;
    width: auto;
    height: auto;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    transform: none;
    animation: mobile-surface-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .panel--pool .panel__close,
  .panel--book .panel__close {
    top: max(12px, env(safe-area-inset-top));
    right: 14px;
    width: 44px;
    height: 44px;
  }

  .pool-panel {
    display: grid;
    grid-template-rows: auto 52px minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
  }

  .pool-panel__header {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: max(22px, calc(env(safe-area-inset-top) + 16px)) 68px 18px 18px;
  }

  .pool-panel__header h2 {
    font-size: 30px;
  }

  .pool-panel__header p:last-child {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.55;
  }

  .pool-panel__countdown {
    justify-items: start;
  }

  .pool-panel__countdown strong {
    font-size: 21px;
  }

  .pool-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    height: 52px;
    padding: 0 18px;
  }

  .pool-tabs button {
    min-height: 44px;
    font-size: 14px;
  }

  .pool-panel__content {
    min-height: 0;
    padding: 22px 18px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .pool-panel__footer {
    min-height: 48px;
    padding: 8px 18px;
    gap: 14px;
    font-size: 10px;
  }

  .pool-panel__footer button {
    min-width: 72px;
    min-height: 40px;
  }

  .book-panel {
    grid-template-rows: 54px minmax(0, 1fr);
  }

  .book-tabs {
    display: flex;
    height: 54px;
    gap: 24px;
    padding: 0 68px 0 18px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .book-tabs::-webkit-scrollbar {
    display: none;
  }

  .book-tabs button {
    flex: 0 0 auto;
    min-width: 58px;
    min-height: 44px;
    font-size: 14px;
  }

  .book-panel__demo {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: calc(var(--mobile-nav-height) + 9px);
    z-index: 7;
    transform: none;
  }

  .book-panel__content {
    min-height: 0;
  }

  .book-pane {
    min-height: 100%;
    padding: 22px 18px 30px;
  }

  .book-pane__heading {
    padding-bottom: 14px;
  }

  .book-record {
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 15px 0;
  }

  .book-record__date {
    font-size: 10px;
  }

  .drop-record {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .drop-record__artifact-line {
    grid-column: 1;
    margin: 0 0 12px;
  }

  .book-panel__content:has(.book-pane--artifacts:not([hidden])),
  .book-panel__content:has(.book-pane--workspace:not([hidden])) {
    display: block;
    overflow-y: auto;
  }

  .artifact-shell,
  .atlas-shell,
  .share-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .artifact-shell__stage {
    min-height: 440px;
    border-right: 0;
    border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14);
  }

  .artifact-equip-stage {
    min-height: 380px;
  }

  .artifact-equipped-slots {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    grid-template-columns: repeat(4, 1fr);
  }

  .artifact-equipped-slots button {
    grid-template-columns: 1fr;
    min-height: 58px;
    text-align: center;
  }

  .artifact-equipped-slots button strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .artifact-shell__inventory {
    min-height: 310px;
  }

  .atlas-shell__categories {
    display: block;
  }

  .atlas-shell__categories nav {
    display: flex;
    overflow-x: auto;
  }

  .atlas-shell__categories nav button {
    flex: 0 0 auto;
    min-width: 70px;
    min-height: 44px;
  }

  .artifact-atlas-list {
    grid-template-columns: 1fr;
  }

  .share-shell__preview,
  .share-shell__settings {
    min-width: 0;
  }

  .toast {
    top: auto;
    right: 18px;
    bottom: calc(var(--mobile-nav-height) + 12px);
    left: 18px;
    width: auto;
    text-align: center;
    transform: translateY(10px);
  }

  .toast.is-visible {
    transform: translateY(0);
  }

  @keyframes mobile-surface-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 767px) and (max-height: 680px) {
  .intro {
    top: calc(var(--mobile-topbar) + 10px);
  }

  .intro strong {
    font-size: 18px;
  }

  .landmark--pool {
    top: 21%;
  }

  .landmark--oracle {
    top: 34%;
  }

  .landmark--book {
    top: 54%;
  }
}

/* Tianming pool close-up: a compact parchment layer over the preserved realm scene. */
.realm__scene,
.realm__scene-canvas {
  transform-origin: 50% 50%;
  transition:
    opacity 360ms cubic-bezier(0.25, 1, 0.5, 1),
    transform 1050ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 850ms cubic-bezier(0.16, 1, 0.3, 1);
}

.realm.is-pool-focused .realm__scene,
.realm.is-pool-focused .realm__scene-canvas {
  transform-origin: 18% 58%;
  transform: scale(1.16) translate3d(2.2%, 0.6%, 0);
  filter: saturate(1.01) contrast(1.035) brightness(0.98);
}

.realm.is-pool-focused .intro,
.realm.is-pool-focused .landmark,
.realm.is-pool-focused .realm-status {
  opacity: 0;
  pointer-events: none;
}

.realm.is-pool-focused .topbar {
  opacity: 0.34;
  pointer-events: none;
}

.panel.panel--pool {
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  width: min(860px, calc(100vw - 64px));
  max-width: none;
  max-height: min(88vh, 860px);
  margin: 0;
  padding: 0;
  overflow: auto;
  color: oklch(0.3 0.045 169);
  border: 1px solid oklch(0.56 0.025 82 / 0.42);
  border-radius: 3px;
  background:
    radial-gradient(circle at 14% 18%, oklch(0.38 0.022 77 / 0.07) 0 0.55px, transparent 0.85px) 0 0 / 13px 17px,
    radial-gradient(circle at 72% 63%, oklch(0.42 0.018 162 / 0.055) 0 0.45px, transparent 0.8px) 3px 5px / 19px 23px,
    repeating-linear-gradient(97deg, transparent 0 22px, oklch(0.42 0.018 85 / 0.026) 22.5px 23px, transparent 23.5px 47px),
    linear-gradient(112deg, oklch(0.974 0.009 88 / 0.99), oklch(0.952 0.011 82 / 0.985)),
    oklch(0.965 0.009 85);
  box-shadow:
    0 32px 88px oklch(0.24 0.035 168 / 0.25),
    inset 0 0 0 1px oklch(0.985 0.008 88 / 0.72),
    inset 0 0 72px oklch(0.58 0.018 82 / 0.045);
  backdrop-filter: blur(10px) saturate(0.82);
  transform: translate(-50%, -50%);
  animation: pool-panel-arrive 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.panel.panel--pool::backdrop {
  background: oklch(0.25 0.025 170 / 0.08);
  backdrop-filter: none;
}

.panel--pool .panel__close {
  top: 18px;
  right: 20px;
  z-index: 3;
  color: oklch(0.36 0.04 168 / 0.72);
  border-color: oklch(0.48 0.04 168 / 0.24);
  background: oklch(0.97 0.008 100 / 0.56);
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.panel--pool .panel__close:hover,
.panel--pool .panel__close:focus-visible {
  color: oklch(0.3 0.055 168);
  border-color: oklch(0.48 0.055 168 / 0.48);
  background: oklch(0.98 0.008 100 / 0.86);
  transform: rotate(4deg);
}

.panel--pool .panel__close:focus-visible {
  outline: 2px solid oklch(0.51 0.11 38 / 0.64);
  outline-offset: 3px;
}

.pool-panel {
  min-height: 632px;
}

.pool-panel__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 38px;
  align-items: end;
  padding: 44px 84px 30px 48px;
  border-bottom: 1px solid oklch(0.46 0.04 165 / 0.15);
}

.pool-panel__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  color: oklch(0.49 0.12 37);
  font-size: 12.5px;
  letter-spacing: 0.16em;
}

.pool-panel__eyebrow i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.58;
}

.pool-panel__header h2 {
  margin: 0;
  color: oklch(0.3 0.052 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 44px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.pool-panel__header p:last-child {
  max-width: 46ch;
  margin: 10px 0 0;
  color: oklch(0.42 0.025 166 / 0.74);
  font-size: 14px;
  line-height: 1.7;
}

.pool-panel__countdown {
  display: grid;
  justify-items: end;
  min-width: 160px;
  padding-bottom: 2px;
  font-variant-numeric: tabular-nums;
}

.pool-panel__countdown span,
.pool-panel__countdown small {
  color: oklch(0.43 0.028 165 / 0.68);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.pool-panel__countdown strong {
  margin: 3px 0 1px;
  color: oklch(0.34 0.075 166);
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.pool-panel__countdown small {
  color: oklch(0.51 0.1 151);
}

.pool-panel__countdown em {
  margin-top: 5px;
  color: oklch(0.42 0.025 166 / 0.72);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.pool-mobile-overview [data-pool-participants] {
  margin-left: 8px;
  color: inherit;
  font-size: inherit;
}

.pool-tabs {
  display: flex;
  align-items: stretch;
  gap: 38px;
  height: 60px;
  padding: 0 48px;
  border-bottom: 1px solid oklch(0.46 0.04 165 / 0.14);
}

.pool-tabs button {
  position: relative;
  padding: 2px 1px 0;
  color: oklch(0.39 0.025 168 / 0.58);
  border: 0;
  background: none;
  font-size: 16px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 180ms ease;
}

.pool-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: oklch(0.49 0.11 38);
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  content: "";
}

.pool-tabs button:hover,
.pool-tabs button:focus-visible,
.pool-tabs button[aria-selected="true"] {
  color: oklch(0.3 0.055 168);
}

.pool-tabs button[aria-selected="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.pool-tabs button:focus-visible,
.pool-panel button:focus-visible,
.artifact-rates summary:focus-visible {
  outline: 2px solid oklch(0.55 0.08 163 / 0.58);
  outline-offset: 3px;
}

.pool-panel__content {
  min-height: 376px;
  padding: 34px 48px 31px;
}

.pool-pane {
  animation: pool-pane-enter 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pool-balance {
  display: grid;
  gap: 5px;
  padding-bottom: 20px;
  border-bottom: 1px solid oklch(0.46 0.04 165 / 0.14);
}

.pool-balance > span {
  color: oklch(0.39 0.033 167 / 0.7);
  font-size: 14px;
  letter-spacing: 0.12em;
}

.pool-balance > small {
  color: oklch(0.42 0.02 168 / 0.6);
  font-size: 13px;
}

.pool-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border-bottom: 1px solid oklch(0.46 0.04 165 / 0.14);
}

.pool-facts div {
  padding: 19px 18px 19px 0;
}

.pool-facts div + div {
  padding-left: 20px;
  border-left: 1px solid oklch(0.46 0.04 165 / 0.12);
}

.pool-facts dt {
  color: oklch(0.42 0.025 168 / 0.62);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.pool-facts dd {
  margin: 8px 0 0;
  color: oklch(0.31 0.04 168);
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pool-facts dd.is-bnb-estimate {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.pool-facts__usdt {
  color: oklch(0.46 0.075 62 / 0.86);
  font-family: system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.pool-note {
  margin: 20px 0 0;
  color: oklch(0.4 0.024 166 / 0.68);
  font-size: 13px;
  line-height: 1.7;
}

.destiny-ranks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin-top: 17px;
}

.destiny-ranks span {
  color: oklch(0.4 0.028 164 / 0.72);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.destiny-ranks b {
  margin-right: 5px;
  color: oklch(0.48 0.08 72);
  font-weight: 600;
}

.probability-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 13px;
  border-bottom: 1px solid oklch(0.46 0.04 165 / 0.14);
}

.probability-heading div {
  display: grid;
  gap: 3px;
}

.probability-heading span,
.probability-heading small {
  color: oklch(0.41 0.025 167 / 0.62);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.probability-heading strong {
  color: oklch(0.31 0.045 168);
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  font-weight: 600;
}

.drop-rates {
  display: grid;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid oklch(0.46 0.04 165 / 0.14);
}

.drop-rates > div {
  display: grid;
  grid-template-columns: 82px minmax(120px, 1fr) 46px;
  gap: 12px;
  align-items: center;
  color: oklch(0.37 0.035 167 / 0.78);
  font-size: 13px;
}

.drop-rates i {
  position: relative;
  height: 3px;
  overflow: hidden;
  background: oklch(0.62 0.025 160 / 0.2);
}

.drop-rates i::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--rate);
  background: oklch(0.52 0.09 158);
  content: "";
}

.drop-rates strong {
  color: oklch(0.31 0.055 166);
  font-size: 13px;
  font-weight: 650;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sign-rates {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: center;
  padding: 15px 0 12px;
}

.sign-rates p {
  margin: 0;
  color: oklch(0.32 0.04 168);
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
}

.sign-rates p small {
  display: block;
  margin-top: 3px;
  color: oklch(0.42 0.02 166 / 0.58);
  font-family: "PingFang SC", system-ui, sans-serif;
  font-size: 11px;
}

.sign-rates > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.sign-rates span {
  color: oklch(0.39 0.03 165 / 0.72);
  border-left: 1px solid oklch(0.46 0.04 165 / 0.13);
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sign-rates b {
  display: block;
  margin-bottom: 3px;
  color: oklch(0.34 0.04 167);
  font-weight: 550;
}

.artifact-rates {
  border-top: 1px solid oklch(0.46 0.04 165 / 0.12);
  color: oklch(0.39 0.025 166 / 0.68);
  font-size: 12px;
}

.artifact-rates summary {
  width: max-content;
  padding-top: 10px;
  color: oklch(0.42 0.055 160);
  cursor: pointer;
}

.artifact-rates p {
  margin: 7px 0 0;
  line-height: 1.6;
}

.pool-panel__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 52px;
  padding: 0 48px;
  color: oklch(0.42 0.025 166 / 0.55);
  border-top: 1px solid oklch(0.46 0.04 165 / 0.12);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.pool-panel__footer button {
  padding: 3px 0;
  color: oklch(0.39 0.045 165 / 0.74);
  border: 0;
  border-bottom: 1px solid oklch(0.46 0.045 165 / 0.3);
  background: none;
  font-size: 13px;
  cursor: pointer;
}

@keyframes pool-panel-arrive {
  from { opacity: 0; transform: translate3d(-50%, calc(-50% + 20px), 0) scale(0.985); }
  to { opacity: 1; transform: translate3d(-50%, -50%, 0) scale(1); }
}

@keyframes pool-pane-enter {
  from { opacity: 0; transform: translate3d(0, 7px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (max-width: 900px) {
  .realm.is-pool-focused .realm__scene,
  .realm.is-pool-focused .realm__scene-canvas {
    transform-origin: 19% 48%;
    transform: scale(1.1) translate3d(1%, -2%, 0);
  }

  .panel.panel--pool {
    top: auto;
    right: 18px;
    bottom: 18px;
    left: 18px;
    width: auto;
    max-height: 74dvh;
    transform: none;
    animation-name: pool-panel-arrive-mobile;
  }

  .pool-panel__header {
    padding: 27px 62px 19px 26px;
  }

  .pool-panel__header h2 {
    font-size: 31px;
  }

  .pool-tabs,
  .pool-panel__content,
  .pool-panel__footer {
    padding-right: 26px;
    padding-left: 26px;
  }

  @keyframes pool-panel-arrive-mobile {
    from { opacity: 0; transform: translate3d(0, 18px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
}

@media (max-width: 620px) {
  .pool-panel {
    min-height: 0;
  }

  .pool-panel__header {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .pool-panel__countdown {
    justify-items: start;
  }

  .pool-panel__countdown strong {
    font-size: 22px;
  }

  .pool-tabs {
    gap: 22px;
  }

  .pool-balance {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pool-facts {
    grid-template-columns: 1fr;
  }

  .pool-facts div,
  .pool-facts div + div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 10px 0;
    border-left: 0;
    border-bottom: 1px solid oklch(0.46 0.04 165 / 0.1);
  }

  .pool-facts dd {
    margin-top: 0;
  }

  .sign-rates {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .sign-rates > div {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
    overflow-x: auto;
  }
}

/* Dreambook close-up: a near-full parchment archive, still floating above the realm. */
.realm.is-book-focused .realm__scene,
.realm.is-book-focused .realm__scene-canvas {
  transform-origin: 82% 54%;
  transform: scale(1.14) translate3d(-2.4%, 0.3%, 0);
  filter: saturate(0.96) contrast(1.025) brightness(0.97);
}

.realm.is-book-focused .intro,
.realm.is-book-focused .landmark,
.realm.is-book-focused .realm-status {
  opacity: 0;
  pointer-events: none;
}

.realm.is-book-focused .topbar {
  opacity: 0.28;
  pointer-events: none;
}

.panel.panel--book {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  left: 12px;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: oklch(0.29 0.045 171);
  border: 1px solid oklch(0.52 0.025 87 / 0.4);
  border-radius: 3px;
  background:
    radial-gradient(circle at 12% 16%, oklch(0.37 0.02 83 / 0.065) 0 0.5px, transparent 0.82px) 0 0 / 13px 17px,
    radial-gradient(circle at 78% 62%, oklch(0.4 0.018 158 / 0.05) 0 0.42px, transparent 0.78px) 4px 7px / 19px 23px,
    repeating-linear-gradient(96deg, transparent 0 27px, oklch(0.4 0.016 87 / 0.022) 27.5px 28px, transparent 28.5px 54px),
    linear-gradient(112deg, oklch(0.978 0.008 91 / 0.99), oklch(0.958 0.009 87 / 0.988)),
    oklch(0.968 0.008 89);
  box-shadow:
    0 34px 96px oklch(0.23 0.035 169 / 0.27),
    inset 0 0 0 1px oklch(0.99 0.006 90 / 0.7),
    inset 0 0 92px oklch(0.55 0.016 83 / 0.04);
  backdrop-filter: blur(10px) saturate(0.82);
  transform: none;
  animation: book-panel-arrive 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.panel.panel--book::backdrop {
  background: oklch(0.24 0.024 170 / 0.1);
  backdrop-filter: none;
}

.panel--book .panel__close {
  top: 22px;
  right: 28px;
  z-index: 5;
  width: 38px;
  height: 38px;
  color: oklch(0.34 0.04 169 / 0.7);
  border-color: oklch(0.46 0.04 168 / 0.24);
  background: oklch(0.98 0.007 94 / 0.58);
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.panel--book .panel__close:hover,
.panel--book .panel__close:focus-visible {
  color: oklch(0.28 0.055 168);
  border-color: oklch(0.46 0.055 168 / 0.46);
  background: oklch(0.99 0.006 94 / 0.88);
  transform: rotate(4deg);
}

.panel--book .panel__close:focus-visible,
.book-panel button:focus-visible,
.sign-preview button:focus-visible {
  outline: 2px solid oklch(0.52 0.08 161 / 0.58);
  outline-offset: 3px;
}

.book-panel {
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.book-panel[hidden] {
  display: none;
}

.book-panel__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 34px;
  align-items: end;
  padding: 32px 84px 24px 54px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14);
}

.book-panel__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: oklch(0.49 0.115 37);
  font-size: 12.5px;
  letter-spacing: 0.16em;
}

.book-panel__eyebrow i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.58;
}

.book-panel__header h2 {
  margin: 0;
  color: oklch(0.28 0.052 170);
  font-family: "Songti SC", "STSong", serif;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.book-panel__header p:last-child {
  margin: 7px 0 0;
  color: oklch(0.4 0.025 167 / 0.7);
  font-size: 14px;
  line-height: 1.65;
}

.book-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, max-content);
  align-items: stretch;
  gap: 42px;
  height: 52px;
  padding: 0 82px 0 46px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14);
}

.book-panel__demo {
  position: absolute;
  top: 50%;
  right: 54px;
  margin: 0;
  padding: 5px 9px;
  color: oklch(0.43 0.08 38);
  border-radius: 2px;
  background: oklch(0.94 0.025 88 / 0.88);
  font-size: 11px;
  letter-spacing: 0.08em;
  transform: translateY(-50%);
}

.book-panel__demo[hidden] {
  display: none;
}

.book-tabs button {
  position: relative;
  padding: 2px 1px 0;
  color: oklch(0.38 0.025 168 / 0.58);
  border: 0;
  background: none;
  font-size: 16px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 180ms ease;
}

.book-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: oklch(0.49 0.11 38);
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  content: "";
}

.book-tabs button:hover,
.book-tabs button:focus-visible,
.book-tabs button[aria-selected="true"] {
  color: oklch(0.29 0.055 168);
}

.book-tabs button[aria-selected="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.book-panel__content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: oklch(0.43 0.035 165 / 0.34) transparent;
  scrollbar-width: thin;
}

.book-panel__content:has(.book-pane--artifacts:not([hidden])),
.book-panel__content:has(.book-pane--workspace:not([hidden])) {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.book-pane {
  min-height: 100%;
  padding: 27px 54px 34px;
  animation: book-pane-enter 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.book-pane[hidden] {
  display: none;
}

.book-pane__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 15px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14);
}

.book-pane__heading div {
  display: grid;
  gap: 3px;
}

.book-pane__heading span,
.book-pane__heading small {
  color: oklch(0.4 0.025 167 / 0.58);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.book-pane__heading strong {
  color: oklch(0.3 0.045 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  font-weight: 600;
}

.book-record-list {
  min-height: 260px;
}

.book-empty {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 290px;
  color: oklch(0.4 0.025 167 / 0.52);
  text-align: center;
}

.book-empty::before {
  width: 38px;
  height: 38px;
  margin-bottom: 15px;
  border: 1px solid oklch(0.44 0.045 166 / 0.25);
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px oklch(0.94 0.01 89 / 0.7);
  content: "";
}

.book-empty strong {
  color: oklch(0.34 0.04 168 / 0.72);
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.book-empty span {
  margin-top: 7px;
  font-size: 13px;
}

.book-empty button {
  margin-top: 18px;
  padding: 8px 18px;
  color: oklch(0.35 0.06 166);
  border: 1px solid oklch(0.44 0.045 166 / 0.28);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.book-record {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 92px;
  gap: 22px;
  align-items: center;
  min-height: 82px;
  padding: 13px 2px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.13);
}

.book-record__meta {
  display: grid;
  gap: 4px;
}

.book-record__meta span,
.book-record__meta time {
  color: oklch(0.4 0.026 166 / 0.58);
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.05em;
}

.book-record__meta span {
  color: oklch(0.49 0.09 38 / 0.88);
}

.book-record__main {
  min-width: 0;
}

.book-record__main strong {
  display: block;
  overflow: hidden;
  color: oklch(0.3 0.045 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-record__main p {
  margin: 5px 0 0;
  overflow: hidden;
  color: oklch(0.39 0.026 166 / 0.65);
  font-size: 13px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-record__affordance {
  padding: 8px 0;
  color: oklch(0.39 0.055 164 / 0.68);
  border: 0;
  background: transparent;
  font-size: 12px;
  text-align: right;
  cursor: pointer;
}

.book-record__affordance::after {
  display: inline-block;
  margin-left: 7px;
  content: "↗";
}

.drop-record {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 82px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.13);
}

.drop-record__meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-content: center;
  padding-right: 22px;
  border-right: 1px solid oklch(0.44 0.035 166 / 0.12);
}

.drop-record__meta time {
  grid-column: 1 / -1;
  color: oklch(0.4 0.026 166 / 0.56);
  font-size: 12px;
}

.drop-record__meta strong {
  overflow: hidden;
  color: oklch(0.31 0.045 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-record__status {
  align-self: center;
  color: oklch(0.4 0.035 166 / 0.7);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.drop-record dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
}

.drop-record dl div {
  display: grid;
  align-content: center;
  padding: 0 22px;
  border-right: 1px solid oklch(0.44 0.035 166 / 0.1);
}

.drop-record dl div:last-child {
  border-right: 0;
}

.drop-record dt {
  color: oklch(0.4 0.026 166 / 0.56);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.drop-record dd {
  margin: 5px 0 0;
  color: oklch(0.3 0.045 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.drop-record__artifact-line {
  grid-column: 2;
  margin: -10px 22px 13px;
  color: oklch(0.47 0.095 37 / 0.82);
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.book-pane--artifacts {
  padding-top: 24px;
}

.artifact-shell {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(280px, 0.9fr);
  min-height: 430px;
  border: 1px solid oklch(0.44 0.035 166 / 0.17);
  background: oklch(0.975 0.006 91 / 0.38);
}

.artifact-shell__stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  border-right: 1px solid oklch(0.44 0.035 166 / 0.14);
}

.artifact-shell__stage > header,
.artifact-shell__inventory > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 68px;
  padding: 14px 20px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14);
}

.artifact-shell header span,
.artifact-shell header small {
  color: oklch(0.4 0.026 166 / 0.55);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.artifact-shell header h3 {
  margin: 3px 0 0;
  color: oklch(0.29 0.045 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.artifact-stage-mount {
  display: grid;
  grid-template-rows: minmax(235px, 1fr) auto;
  min-height: 0;
}

.artifact-stage-placeholder {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  overflow: hidden;
  color: oklch(0.39 0.028 166 / 0.48);
  background:
    radial-gradient(circle at 50% 46%, transparent 0 82px, oklch(0.51 0.05 163 / 0.12) 83px 84px, transparent 85px),
    linear-gradient(0deg, oklch(0.53 0.04 162 / 0.08), transparent 34%),
    oklch(0.95 0.011 173 / 0.28);
}

.artifact-stage-placeholder::before,
.artifact-stage-placeholder::after {
  position: absolute;
  bottom: 24px;
  width: 34%;
  height: 1px;
  background: oklch(0.48 0.045 164 / 0.16);
  content: "";
}

.artifact-stage-placeholder::before { left: 8%; transform: rotate(7deg); }
.artifact-stage-placeholder::after { right: 8%; transform: rotate(-7deg); }

.artifact-stage-placeholder > span {
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  letter-spacing: 0.16em;
}

.artifact-stage-placeholder > i {
  width: 52px;
  height: 92px;
  margin: 10px 0;
  border: 1px solid oklch(0.47 0.045 165 / 0.24);
  border-radius: 50% 50% 42% 42%;
}

.artifact-stage-placeholder > small {
  font-size: 11px;
  letter-spacing: 0.06em;
}

.artifact-equipped-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  border-top: 1px solid oklch(0.44 0.035 166 / 0.12);
  list-style: none;
}

.artifact-equipped-slots li {
  display: grid;
  gap: 5px;
  padding: 13px 16px;
  border-right: 1px solid oklch(0.44 0.035 166 / 0.1);
}

.artifact-equipped-slots li:last-child {
  border-right: 0;
}

.artifact-equipped-slots span {
  color: oklch(0.4 0.025 166 / 0.54);
  font-size: 11px;
}

.artifact-equipped-slots strong {
  color: oklch(0.34 0.04 168 / 0.66);
  font-size: 13px;
  font-weight: 500;
}

.artifact-shell__inventory {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
}

.artifact-shell__inventory > header {
  align-items: start;
}

.artifact-category-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.13);
}

.artifact-category-tabs span,
.artifact-category-tabs button {
  padding: 12px 4px;
  color: oklch(0.38 0.026 168 / 0.58);
  border-right: 1px solid oklch(0.44 0.035 166 / 0.1);
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  font-size: 11px;
  text-align: center;
  cursor: pointer;
}

.artifact-category-tabs span:last-child,
.artifact-category-tabs button:last-child {
  border-right: 0;
}

.artifact-category-tabs .is-active {
  color: oklch(0.97 0.006 90);
  background: oklch(0.29 0.045 169);
}

.artifact-inventory-mount {
  display: grid;
  justify-items: stretch;
  align-content: start;
  padding: 0;
  overflow: auto;
  color: oklch(0.4 0.026 166 / 0.55);
  text-align: center;
}

.artifact-inventory-mount > .book-empty,
.artifact-atlas-mount > .book-empty {
  align-self: stretch;
  min-height: 100%;
  padding: 28px;
}

.artifact-inventory-mount strong {
  color: oklch(0.33 0.04 168 / 0.72);
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.artifact-inventory-mount p {
  max-width: 20ch;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
}

.artifact-inventory-list {
  width: 100%;
  text-align: left;
}

.artifact-inventory-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.11);
}

.artifact-inventory-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.artifact-inventory-item strong {
  overflow: hidden;
  color: oklch(0.31 0.045 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-inventory-item span,
.artifact-inventory-item small {
  color: oklch(0.4 0.026 166 / 0.58);
  font-size: 11px;
}

.artifact-inventory-item small {
  color: oklch(0.47 0.085 37 / 0.82);
}

.artifact-inventory-item.is-equipped {
  background: oklch(0.93 0.018 82 / 0.5);
}

.book-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 54px;
  color: oklch(0.4 0.025 166 / 0.52);
  border-top: 1px solid oklch(0.44 0.035 166 / 0.12);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.book-panel__footer button {
  padding: 3px 0;
  color: oklch(0.38 0.045 165 / 0.72);
  border: 0;
  border-bottom: 1px solid oklch(0.44 0.045 165 / 0.28);
  background: none;
  font-size: 13px;
  cursor: pointer;
}

@keyframes book-panel-arrive {
  from { opacity: 0; transform: translateY(18px) scale(0.986); }
  to { opacity: 1; transform: none; }
}

@keyframes book-pane-enter {
  from { opacity: 0; transform: translate3d(0, 7px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (max-width: 900px) {
  .realm.is-book-focused .realm__scene,
  .realm.is-book-focused .realm__scene-canvas {
    transform-origin: 78% 50%;
    transform: scale(1.1) translate3d(-1.5%, -1%, 0);
  }

  .panel.panel--book {
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .book-panel__header {
    padding: 27px 68px 20px 32px;
  }

  .book-tabs,
  .book-pane,
  .book-panel__footer {
    padding-right: 32px;
    padding-left: 32px;
  }

  .book-record {
    grid-template-columns: 118px minmax(0, 1fr) 72px;
    gap: 16px;
  }

  .artifact-shell {
    grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr);
  }
}

@media (max-height: 740px) {
  .book-panel {
    grid-template-rows: 48px minmax(0, 1fr);
  }

  .book-tabs {
    height: 48px;
  }

  .book-panel__header {
    padding-top: 20px;
    padding-bottom: 17px;
  }

  .book-panel__header h2 {
    font-size: 34px;
  }

  .book-pane {
    padding-top: 20px;
    padding-bottom: 24px;
  }

}

/* Dress-up workspace transplanted from the approved artifact prototype. */
.artifact-gender-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid oklch(0.44 0.035 166 / 0.2);
}

.artifact-gender-switch button {
  min-width: 66px;
  min-height: 30px;
  padding: 0 10px;
  color: oklch(0.36 0.03 168 / 0.66);
  border: 0;
  border-right: 1px solid oklch(0.44 0.035 166 / 0.16);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.artifact-gender-switch button:last-child {
  border-right: 0;
}

.artifact-gender-switch button[aria-pressed="true"] {
  color: oklch(0.97 0.006 90);
  background: oklch(0.29 0.045 169);
}

.artifact-stage-mount {
  display: block;
  height: 100%;
}

.artifact-equip-stage {
  position: relative;
  container-name: dreambook-equip-stage;
  container-type: size;
  width: 100%;
  height: 100%;
  min-height: 460px;
  margin: 0;
  overflow: hidden;
  background: oklch(0.91 0.018 191);
}

.artifact-equip-stage::after {
  position: absolute;
  z-index: 7;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 48px oklch(0.24 0.03 169 / 0.08);
  content: "";
}

.artifact-equip-stage > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center bottom;
  pointer-events: none;
}

.artifact-equip-stage > img[hidden] {
  display: none;
}

.artifact-equip-stage__background { z-index: 0; }
.artifact-equip-stage__ornament { z-index: 1; }
.artifact-equip-stage__character { z-index: 2; }
.artifact-equip-stage__weapon { z-index: 3; }
.artifact-equip-stage__pet { z-index: 4; }

@container dreambook-equip-stage (min-aspect-ratio: 793 / 496) {
  .artifact-equip-stage > img:not(.artifact-equip-stage__background) {
    object-fit: contain;
  }
}

.artifact-equipped-slots {
  position: absolute;
  z-index: 6;
  top: 14px;
  right: 14px;
  display: grid;
  width: min(224px, 38%);
  margin: 0;
  padding: 0;
  border: 1px solid oklch(0.43 0.035 166 / 0.22);
  background: oklch(0.965 0.009 91 / 0.82);
  box-shadow: 0 10px 34px oklch(0.24 0.035 169 / 0.09);
  backdrop-filter: blur(9px);
}

.artifact-equipped-slots button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 6px 9px;
  color: oklch(0.31 0.04 169);
  border: 0;
  border-bottom: 1px solid oklch(0.43 0.035 166 / 0.14);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.artifact-equipped-slots button:last-child {
  border-bottom: 0;
}

.artifact-equipped-slots button:hover,
.artifact-equipped-slots button.is-selected {
  background: oklch(0.89 0.025 190 / 0.46);
}

.artifact-equipped-slots button.is-selected {
  outline: 1px solid oklch(0.49 0.1 38 / 0.38);
  outline-offset: -1px;
}

.artifact-equipped-slots span,
.artifact-equipped-slots small {
  color: oklch(0.39 0.026 166 / 0.54);
  font-size: 9px;
}

.artifact-equipped-slots strong {
  overflow: hidden;
  color: oklch(0.31 0.04 169 / 0.84);
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-equip-stage__note {
  position: absolute;
  z-index: 6;
  bottom: 14px;
  left: 14px;
  max-width: min(390px, 58%);
  margin: 0;
  padding: 7px 10px;
  color: oklch(0.35 0.035 168 / 0.74);
  border: 1px solid oklch(0.44 0.035 166 / 0.18);
  background: oklch(0.97 0.008 91 / 0.8);
  font-size: 10px;
  line-height: 1.5;
}

.artifact-shell__inventory {
  grid-template-rows: auto auto minmax(92px, 1fr) auto auto;
}

.artifact-shell__inventory > header {
  align-items: center;
}

.artifact-shell__inventory > header small {
  white-space: nowrap;
}

.artifact-inventory-item {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 10px 12px;
  color: inherit;
  border: 0;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.11);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.artifact-inventory-item:hover,
.artifact-inventory-item.is-selected {
  background: oklch(0.93 0.018 174 / 0.55);
}

.artifact-inventory-item.is-selected {
  outline: 1px solid oklch(0.48 0.075 166 / 0.24);
  outline-offset: -1px;
}

.artifact-inventory-item.is-equipped {
  background: oklch(0.94 0.018 82 / 0.52);
}

.artifact-inventory-item__visual {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  color: oklch(0.39 0.04 168 / 0.7);
  border: 1px solid oklch(0.44 0.035 166 / 0.2);
  border-radius: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
  background-position: center;
  background-size: cover;
}

.artifact-inventory-item__visual.is-immortal,
.artifact-inventory-item__visual.is-divine {
  color: oklch(0.48 0.11 37 / 0.86);
  border-color: oklch(0.5 0.09 38 / 0.34);
}

.artifact-inventory-item__visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.artifact-inventory-item__visual img.is-wide-catalog-source {
  transform: scale(1.55);
}

.artifact-inventory-item > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.artifact-selection-summary {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid oklch(0.44 0.035 166 / 0.13);
  background: oklch(0.973 0.008 91 / 0.66);
}

.artifact-selection-summary[hidden] {
  display: none;
}

.artifact-selection-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.artifact-selection-summary strong {
  color: oklch(0.48 0.105 38 / 0.9);
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
  font-weight: 500;
}

.artifact-selection-summary span {
  color: oklch(0.4 0.026 166 / 0.58);
  font-size: 10px;
}

.artifact-selection-summary p {
  margin: 0;
  color: oklch(0.38 0.026 166 / 0.7);
  font-size: 11px;
  line-height: 1.65;
}

.artifact-selection-summary > button {
  justify-self: stretch;
  min-height: 34px;
  color: oklch(0.96 0.007 91);
  border: 1px solid oklch(0.32 0.04 169);
  background: oklch(0.32 0.04 169);
  font-size: 11px;
  cursor: pointer;
}

.artifact-inventory-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  padding: 12px;
  border-top: 1px solid oklch(0.44 0.035 166 / 0.13);
}

.artifact-inventory-actions button {
  min-height: 36px;
  color: oklch(0.33 0.04 168 / 0.78);
  border: 1px solid oklch(0.44 0.035 166 / 0.22);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.artifact-inventory-actions button.is-primary {
  color: oklch(0.97 0.006 91);
  border-color: oklch(0.49 0.12 37);
  background: oklch(0.49 0.12 37);
}

@media (max-width: 900px) {
  .artifact-shell {
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  }

  .artifact-equipped-slots {
    width: min(206px, 42%);
  }
}

/* Dreambook sign detail reuses the finished daily-oracle artwork. */
.sign-preview {
  width: min(340px, calc(100vw - 40px));
  height: auto;
  aspect-ratio: 864 / 1821;
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  color: oklch(0.29 0.045 169);
  border: 1px solid oklch(0.5 0.04 88 / 0.5);
  border-radius: 2px;
  background: oklch(0.97 0.009 91);
  box-shadow: 0 36px 110px oklch(0.2 0.035 170 / 0.38);
}

.sign-preview[open] {
  animation: sign-preview-arrive 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sign-preview::backdrop {
  background: oklch(0.19 0.025 169 / 0.35);
  backdrop-filter: blur(7px) saturate(0.78);
}

.sign-preview__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: oklch(0.33 0.04 168 / 0.7);
  border: 1px solid oklch(0.43 0.045 166 / 0.28);
  border-radius: 50%;
  background: oklch(0.98 0.006 92 / 0.82);
  font-size: 20px;
  cursor: pointer;
}

.sign-preview__card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  padding: 28px 28px 24px;
  overflow: hidden;
  background: oklch(0.96 0.018 220);
}

.sign-preview__art {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sign-preview__art[hidden] {
  display: none;
}

.sign-preview__card::before,
.sign-preview__card::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.sign-preview__card::before {
  inset: 12px;
  border: 1px solid oklch(0.48 0.045 166 / 0.2);
  z-index: 1;
  box-shadow: inset 0 0 42px oklch(0.36 0.045 190 / 0.08);
}

.sign-preview__card::after {
  display: none;
}

.sign-preview__card > header,
.sign-preview__card > footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: oklch(0.4 0.03 166 / 0.62);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.sign-preview__card > header {
  padding: 0 35px 18px 0;
  border-bottom: 1px solid oklch(0.45 0.035 166 / 0.15);
}

.sign-preview__card > header small {
  font-size: 10px;
  font-weight: 400;
}

.sign-preview__body {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: end;
  min-height: 0;
  padding: 42px 8px 34px;
  text-align: center;
}

.sign-preview__body > p:not(.sign-preview__reading) {
  margin: 0 0 7px;
  color: oklch(0.49 0.105 38);
  font-size: 13px;
  letter-spacing: 0.22em;
}

.sign-preview__body > [data-sign-preview-rank][hidden] {
  display: none;
}

.sign-preview__body h2 {
  margin: 0;
  color: oklch(0.28 0.055 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.sign-preview__body blockquote {
  max-width: 18em;
  margin: 16px 0 0;
  color: oklch(0.32 0.04 168 / 0.86);
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.08em;
}

.sign-preview__reading {
  max-width: 27em;
  margin: 12px 0 0;
  color: oklch(0.39 0.025 166 / 0.65);
  font-size: 10px;
  line-height: 1.75;
}

.sign-preview__card > footer {
  padding-top: 16px;
  border-top: 1px solid oklch(0.45 0.035 166 / 0.15);
}

.sign-preview__card > footer b {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: oklch(0.49 0.12 37 / 0.82);
  border: 1px solid currentColor;
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
  font-weight: 500;
}

@keyframes sign-preview-arrive {
  from { opacity: 0; transform: translateY(18px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 520px), (max-height: 680px) {
  .sign-preview {
    width: min(300px, calc(100vw - 24px));
    height: auto;
  }

  .sign-preview__card {
    padding: 27px 26px 23px;
  }

  .sign-preview__body {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .sign-preview__body h2 {
    font-size: 23px;
  }

  .sign-preview__body blockquote {
    margin-top: 16px;
    font-size: 11px;
  }

  .sign-preview__reading {
    margin-top: 13px;
  }
}

/* Dreambook v2: five workspaces, with only a narrow rim of the realm left visible. */
.panel--book .panel__close {
  top: 14px;
  right: 20px;
  width: 40px;
  height: 40px;
}

.book-tabs button {
  font-size: 16px;
}

.book-pane {
  padding: 28px 46px 36px;
}

.book-pane--artifacts,
.book-pane--workspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: auto;
  min-height: 0;
  padding: 20px 46px;
  overflow: hidden;
}

.artifact-shell {
  height: auto;
  min-height: 0;
  grid-template-columns: minmax(0, 2.35fr) minmax(300px, 0.9fr);
}

.artifact-stage-mount {
  grid-template-rows: minmax(420px, 1fr) auto;
}

.atlas-shell,
.share-shell {
  display: grid;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid oklch(0.44 0.035 166 / 0.17);
  background: oklch(0.975 0.006 91 / 0.38);
}

.atlas-shell {
  grid-template-columns: 190px minmax(0, 1fr);
}

.atlas-shell__categories {
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid oklch(0.44 0.035 166 / 0.14);
}

.atlas-shell__categories > header,
.atlas-shell__content > header,
.share-shell__preview > header,
.share-shell__settings > header {
  min-height: 78px;
  padding: 17px 20px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14);
}

.atlas-shell header span,
.atlas-shell header small,
.share-shell header span {
  color: oklch(0.4 0.026 166 / 0.55);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.atlas-shell header h3,
.share-shell header h3 {
  margin: 4px 0 0;
  color: oklch(0.29 0.045 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.atlas-shell__categories nav {
  display: grid;
}

.atlas-shell__categories nav span,
.atlas-shell__categories nav button {
  position: relative;
  padding: 17px 20px;
  color: oklch(0.38 0.026 168 / 0.62);
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.1);
  border-left: 0;
  background: transparent;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.atlas-shell__categories nav span::after,
.atlas-shell__categories nav button::after {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.32;
  transform: translateY(-50%);
  content: "";
}

.atlas-shell__categories nav .is-active {
  color: oklch(0.97 0.006 90);
  background: oklch(0.29 0.045 169);
}

.atlas-shell__content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.atlas-shell__content > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.artifact-atlas-mount {
  display: grid;
  justify-items: stretch;
  align-content: start;
  min-height: 0;
  padding: 12px 28px;
  overflow: auto;
  color: oklch(0.4 0.026 166 / 0.54);
  text-align: center;
  background:
    linear-gradient(oklch(0.47 0.04 164 / 0.07) 1px, transparent 1px) 0 0 / 112px 112px,
    linear-gradient(90deg, oklch(0.47 0.04 164 / 0.07) 1px, transparent 1px) 0 0 / 112px 112px;
}

.artifact-atlas-list {
  width: 100%;
}

.artifact-atlas-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 94px;
  gap: 18px;
  align-items: center;
  min-height: 78px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.12);
  text-align: left;
}

.artifact-atlas-item__visual {
  position: relative;
  width: 50px;
  height: 66px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: oklch(0.38 0.035 168 / 0.56);
  border: 1px solid oklch(0.44 0.035 166 / 0.18);
  background: oklch(0.94 0.012 168 / 0.72);
  background-position: center;
  background-size: cover;
}

.artifact-atlas-item__visual > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.artifact-atlas-item.is-outfit .artifact-atlas-item__visual > img.is-wide-catalog-source {
  transform: scale(1.55);
}

.artifact-atlas-item__visual > i {
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
  font-style: normal;
}

.artifact-atlas-item__visual .artifact-grade {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: auto;
  height: auto;
  padding: 2px 4px;
  color: oklch(0.97 0.006 91);
  border: 0;
  border-radius: 0;
  background: oklch(0.29 0.045 169 / 0.86);
  font-size: 8px;
}

.artifact-atlas-item.is-locked {
  color: oklch(0.4 0.026 166 / 0.52);
}

.artifact-atlas-item.is-locked .artifact-atlas-item__visual {
  background: repeating-linear-gradient(135deg, oklch(0.93 0.008 168) 0 5px, oklch(0.96 0.006 91) 5px 10px);
}

.artifact-grade {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: oklch(0.35 0.04 168 / 0.75);
  border: 1px solid oklch(0.44 0.035 166 / 0.2);
  border-radius: 50%;
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
}

.artifact-grade.is-immortal,
.artifact-grade.is-divine {
  color: oklch(0.48 0.11 37);
  border-color: oklch(0.5 0.09 38 / 0.34);
}

.artifact-atlas-item > div:nth-child(2) {
  min-width: 0;
}

.artifact-atlas-item strong {
  color: oklch(0.3 0.045 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
  font-weight: 600;
}

.artifact-atlas-item p {
  margin: 5px 0 0;
  overflow: hidden;
  color: oklch(0.4 0.026 166 / 0.62);
  font-size: 12px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-atlas-item > div:last-child {
  display: grid;
  gap: 5px;
  text-align: right;
}

.artifact-atlas-item > div:last-child span,
.artifact-atlas-item > div:last-child small {
  color: oklch(0.4 0.026 166 / 0.58);
  font-size: 11px;
}

.artifact-atlas-item > div:last-child small {
  color: oklch(0.47 0.085 37 / 0.8);
}

.artifact-atlas-item__open {
  justify-self: end;
  margin-top: 2px;
  padding: 3px 0;
  color: oklch(0.36 0.06 166 / 0.76);
  border: 0;
  border-bottom: 1px solid oklch(0.46 0.055 166 / 0.28);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.artifact-detail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  min-height: 100%;
  color: oklch(0.3 0.04 169);
  text-align: left;
}

.artifact-detail__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14);
}

.artifact-detail__toolbar > span {
  color: oklch(0.41 0.028 166 / 0.58);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.artifact-detail__back {
  padding: 7px 0;
  color: oklch(0.35 0.055 166 / 0.76);
  border: 0;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.artifact-detail__back::before {
  margin-right: 8px;
  content: "←";
}

.artifact-detail__layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.94fr) minmax(330px, 1.06fr);
  min-height: 500px;
  margin-top: 16px;
  border: 1px solid oklch(0.44 0.035 166 / 0.16);
}

.artifact-detail__art {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, transparent 0 115px, oklch(0.49 0.045 164 / 0.08) 116px 117px, transparent 118px),
    linear-gradient(145deg, oklch(0.956 0.01 173 / 0.52), oklch(0.978 0.008 91 / 0.78));
}

.artifact-detail__art img {
  width: 100%;
  height: 100%;
  max-height: 540px;
  object-fit: contain;
}

.artifact-detail__art figcaption {
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: oklch(0.41 0.028 166 / 0.48);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.artifact-detail__placeholder {
  display: grid;
  justify-items: center;
  gap: 9px;
  color: oklch(0.39 0.03 166 / 0.58);
}

.artifact-detail__placeholder i {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin-bottom: 8px;
  color: oklch(0.49 0.1 38 / 0.74);
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: "Songti SC", "STSong", serif;
  font-size: 31px;
  font-style: normal;
}

.artifact-detail__placeholder strong {
  font-size: 18px;
}

.artifact-detail__placeholder span {
  font-size: 11px;
  letter-spacing: 0.08em;
}

.artifact-detail__copy {
  display: grid;
  align-content: start;
  min-width: 0;
  padding: 34px 34px 28px;
  border-left: 1px solid oklch(0.44 0.035 166 / 0.16);
  background: oklch(0.974 0.008 91 / 0.72);
}

.artifact-detail__copy > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 4px 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14);
}

.artifact-detail__copy > header > span {
  grid-column: 1 / -1;
  color: oklch(0.48 0.1 38 / 0.86);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.artifact-detail__copy h3 {
  margin: 0;
  color: oklch(0.28 0.05 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.07em;
}

.artifact-detail__copy > header small {
  color: oklch(0.4 0.028 166 / 0.58);
  font-size: 10px;
}

.artifact-detail__lede {
  margin: 24px 0 3px;
  color: oklch(0.35 0.045 168 / 0.82);
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
  line-height: 1.65;
}

.artifact-detail__copy > section {
  padding: 19px 0;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.12);
}

.artifact-detail__copy > section > span,
.artifact-detail__copy > footer > span {
  display: block;
  margin-bottom: 7px;
  color: oklch(0.46 0.08 38 / 0.78);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.artifact-detail__copy > section p {
  margin: 0;
  color: oklch(0.37 0.026 166 / 0.74);
  font-size: 12px;
  line-height: 1.8;
}

.artifact-detail__copy dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.artifact-detail__copy dl div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
}

.artifact-detail__copy dt,
.artifact-detail__copy dd {
  font-size: 11px;
}

.artifact-detail__copy dt {
  color: oklch(0.4 0.03 166 / 0.54);
}

.artifact-detail__copy dd {
  margin: 0;
  color: oklch(0.33 0.035 168 / 0.76);
}

.artifact-detail__copy > footer {
  display: grid;
  gap: 3px;
  margin-top: 21px;
}

.artifact-detail__copy > footer > span {
  margin-bottom: 1px;
}

.artifact-detail__copy > footer strong {
  overflow: hidden;
  color: oklch(0.31 0.045 168 / 0.84);
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-detail__copy > footer small {
  color: oklch(0.4 0.026 166 / 0.52);
  font-size: 10px;
}

.artifact-atlas-mount strong,
.artifact-share-preview strong,
.share-actions-mount strong {
  color: oklch(0.33 0.04 168 / 0.72);
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.artifact-atlas-mount p,
.artifact-share-preview p {
  max-width: 34ch;
  margin: 9px 0 0;
  font-size: 12px;
  line-height: 1.7;
}

.share-shell {
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.8fr);
  gap: 24px;
  border: 0;
  background: transparent;
}

.share-shell__preview {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 0;
}

.artifact-share-preview {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 0;
  padding: 36px;
  color: oklch(0.4 0.026 166 / 0.54);
  text-align: center;
  background:
    radial-gradient(circle at 50% 45%, transparent 0 118px, oklch(0.5 0.05 163 / 0.1) 119px 120px, transparent 121px),
    oklch(0.95 0.011 173 / 0.26);
}

.share-shell__settings {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid oklch(0.44 0.035 166 / 0.17);
  background: oklch(0.975 0.006 91 / 0.72);
}

.share-shell__settings dl {
  margin: 0;
}

.share-shell__settings dl div {
  padding: 17px 20px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.1);
}

.share-shell__settings dt {
  color: oklch(0.4 0.026 166 / 0.54);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.share-shell__settings dd {
  margin: 6px 0 0;
  color: oklch(0.32 0.04 168 / 0.76);
  font-size: 13px;
}

.share-actions-mount {
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 6px;
  padding: 30px 22px;
  color: oklch(0.4 0.026 166 / 0.54);
  text-align: center;
}

.share-actions-mount strong {
  font-size: 17px;
}

.share-actions-mount span {
  font-size: 11px;
}

.book-share-poster {
  --share-character-rig-x: -4.45%;
  --share-pet-scale: 1;
  --share-heading-color: oklch(0.29 0.045 169);
  --share-detail-color: oklch(0.35 0.03 168 / 0.7);
  --share-accent-color: oklch(0.49 0.12 37);
  --share-text-shadow: none;
  position: relative;
  align-self: stretch;
  justify-self: center;
  width: auto;
  max-width: 100%;
  height: 100%;
  margin: 0;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  color: oklch(0.29 0.045 169);
  border: 1px solid oklch(0.44 0.035 166 / 0.2);
  background: oklch(0.94 0.012 168);
  box-shadow: 0 18px 48px oklch(0.28 0.03 169 / 0.12);
  isolation: isolate;
}

.book-share-poster[data-text-theme="light"] {
  --share-heading-color: oklch(0.95 0.012 90);
  --share-detail-color: oklch(0.91 0.014 90 / 0.82);
  --share-accent-color: oklch(0.82 0.08 75);
  --share-text-shadow: 0 1px 3px oklch(0.18 0.025 265 / 0.58);
}

.book-share-poster::after {
  position: absolute;
  z-index: 7;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 56px oklch(0.28 0.03 169 / 0.1);
  content: "";
}

.book-share-poster > [data-book-share-layer] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}

.book-share-poster__background {
  z-index: 0;
  object-fit: cover;
}

.book-share-poster__ornament {
  z-index: 1;
  object-fit: contain;
}

.book-share-poster__character {
  z-index: 2;
  object-fit: contain;
  transform: translateX(var(--share-character-rig-x));
}

.book-share-poster__weapon {
  z-index: 3;
  object-fit: contain;
  transform: translateX(var(--share-character-rig-x));
}

.book-share-poster__pet {
  z-index: 4;
  object-fit: contain;
  transform: scale(var(--share-pet-scale));
  transform-origin: 100% 100%;
}

.book-share-poster > [data-book-share-layer][hidden] {
  display: none;
}

.book-share-poster__brand,
.book-share-poster__owner,
.book-share-poster figcaption {
  position: absolute;
  z-index: 6;
}

.book-share-poster__brand {
  top: 20px;
  left: 20px;
  display: grid;
  grid-template-columns: 28px auto;
  gap: 5px;
  align-items: center;
}

.book-share-poster__brand img {
  width: 28px;
  height: 28px;
}

.book-share-poster__brand strong {
  color: var(--share-heading-color);
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-shadow: var(--share-text-shadow);
}

.book-share-poster__owner {
  top: 20px;
  right: 20px;
  width: max-content;
  max-width: 46%;
  text-align: right;
}

.book-share-poster__owner > strong {
  display: block;
  color: var(--share-heading-color);
  font-family: "Songti SC", "STSong", serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-shadow: var(--share-text-shadow);
  white-space: nowrap;
}

.book-share-poster__owner > div {
  display: grid;
  gap: 2px;
  justify-items: start;
  width: calc(100% - 34px);
  margin-top: 5px;
  margin-left: 34px;
  text-align: left;
}

.book-share-poster__owner span {
  color: var(--share-detail-color);
  font-family: "Songti SC", "STSong", serif;
  font-size: 7px;
  letter-spacing: 0.08em;
  max-width: 100%;
  overflow: hidden;
  text-align: left;
  text-overflow: clip;
  text-shadow: var(--share-text-shadow);
  white-space: nowrap;
}

.book-share-poster figcaption {
  right: 20px;
  bottom: 19px;
  left: 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.book-share-poster figcaption p {
  max-width: none;
  margin: 0;
  color: var(--share-heading-color);
  font-family: "Songti SC", "STSong", serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-shadow: var(--share-text-shadow);
}

.book-share-poster figcaption span {
  flex: none;
  color: var(--share-accent-color);
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-shadow: var(--share-text-shadow);
}

.book-share-controls {
  min-height: 0;
  padding: 16px 18px;
  overflow: auto;
  scrollbar-width: thin;
}

.book-share-controls fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.book-share-controls fieldset + fieldset {
  margin-top: 16px;
}

.book-share-artifact-options fieldset:first-child {
  margin-top: 16px;
}

.book-share-options__empty {
  grid-column: 1 / -1;
  min-height: 36px;
  display: grid;
  place-items: center;
  color: oklch(0.4 0.026 166 / 0.54);
  border: 1px dashed oklch(0.44 0.035 166 / 0.18);
  font-size: 10px;
}

.book-share-controls legend {
  margin-bottom: 7px;
  color: oklch(0.4 0.026 166 / 0.56);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.book-share-options {
  display: grid;
  gap: 7px;
}

.book-share-options.is-two {
  grid-template-columns: repeat(2, 1fr);
}

.book-share-options.is-three {
  grid-template-columns: repeat(3, 1fr);
}

.book-share-options button,
.book-share-actions button {
  min-height: 36px;
  color: oklch(0.35 0.03 168 / 0.74);
  border: 1px solid oklch(0.44 0.035 166 / 0.2);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.book-share-options button {
  padding: 7px 6px;
  line-height: 1.3;
}

.book-share-options button small {
  display: block;
  margin-top: 2px;
  color: inherit;
  font-size: 8px;
  letter-spacing: 0.04em;
  opacity: 0.68;
}

.book-share-options button:disabled {
  color: oklch(0.4 0.026 166 / 0.42);
  border-style: dashed;
  background: oklch(0.97 0.006 91 / 0.22);
  cursor: not-allowed;
}

.book-share-options button:disabled:hover,
.book-share-options button:disabled:focus-visible {
  color: oklch(0.4 0.026 166 / 0.42);
  border-color: oklch(0.44 0.035 166 / 0.2);
  background: oklch(0.97 0.006 91 / 0.22);
}

.book-share-options button:hover,
.book-share-options button:focus-visible,
.book-share-options button[aria-pressed="true"] {
  color: oklch(0.97 0.006 91);
  border-color: oklch(0.29 0.045 169);
  background: oklch(0.29 0.045 169);
}

.book-share-actions {
  display: grid;
  gap: 7px;
  padding: 14px 18px 16px;
  border-top: 1px solid oklch(0.44 0.035 166 / 0.12);
}

.book-share-actions button.is-primary {
  color: oklch(0.97 0.006 91);
  border-color: oklch(0.49 0.12 37);
  background: oklch(0.49 0.12 37);
}

.book-share-actions button:disabled {
  cursor: wait;
  opacity: 0.52;
}

.book-share-actions output {
  min-height: 16px;
  color: oklch(0.49 0.1 37 / 0.86);
  font-size: 9px;
  text-align: left;
}

@media (max-width: 900px) {
  .book-tabs {
    gap: 29px;
    padding-right: 70px;
    padding-left: 30px;
  }

  .book-pane {
    padding-right: 30px;
    padding-left: 30px;
  }

  .book-pane--artifacts,
  .book-pane--workspace {
    padding: 18px 30px;
  }

  .artifact-shell {
    grid-template-columns: minmax(0, 1.9fr) minmax(270px, 1fr);
  }

  .share-shell {
    grid-template-columns: minmax(0, 1.5fr) minmax(290px, 1fr);
  }
}

@media (max-height: 740px) {
  .artifact-stage-mount {
    grid-template-rows: minmax(340px, 1fr) auto;
  }
}

/* Dreambook v3: tighter navigation and a portrait-first share preview. */
.book-tabs button {
  font-size: 15px;
}

.panel--book .panel__close {
  top: 7px;
  width: 38px;
  height: 38px;
}

.share-shell__preview {
  grid-template-rows: minmax(0, 1fr);
}

.artifact-share-preview {
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  padding: 18px 28px;
  background: oklch(0.95 0.011 173 / 0.26);
}

.share-preview-frame {
  display: grid;
  justify-items: center;
  align-content: center;
  align-self: stretch;
  justify-self: center;
  height: 100%;
  width: auto;
  max-width: 100%;
  margin: auto;
  aspect-ratio: 3 / 5;
  color: oklch(0.4 0.026 166 / 0.54);
  border: 1px solid oklch(0.44 0.035 166 / 0.15);
  background:
    radial-gradient(circle at 50% 38%, transparent 0 108px, oklch(0.5 0.05 163 / 0.09) 109px 110px, transparent 111px),
    oklch(0.975 0.006 91 / 0.62);
  text-align: center;
}

.share-preview-frame p {
  max-width: 24ch;
}

.share-preview-frame--data {
  position: relative;
  display: block;
  padding: 28px 24px;
  overflow: hidden;
  color: oklch(0.29 0.045 169);
  background:
    radial-gradient(circle at 50% 44%, transparent 0 88px, oklch(0.51 0.05 163 / 0.1) 89px 90px, transparent 91px),
    linear-gradient(158deg, oklch(0.97 0.008 92 / 0.94), oklch(0.94 0.012 168 / 0.58));
  text-align: left;
}

.share-preview-frame--data::before {
  position: absolute;
  right: -22%;
  bottom: 12%;
  width: 75%;
  height: 30%;
  border: 1px solid oklch(0.48 0.04 164 / 0.12);
  border-radius: 50%;
  transform: rotate(-12deg);
  content: "";
}

.share-preview__brand {
  display: block;
  color: oklch(0.48 0.11 37);
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  letter-spacing: 0.14em;
}

.share-preview__identity {
  display: grid;
  gap: 3px;
  margin-top: 42px;
  text-align: right;
}

.share-preview__identity strong {
  color: oklch(0.29 0.045 169);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.share-preview__identity small {
  color: oklch(0.4 0.026 166 / 0.58);
  font-size: 10px;
}

.share-preview__equipment {
  display: grid;
  gap: 5px;
  width: max-content;
  margin: 18px 0 0 auto;
  font-size: 9px;
}

.share-preview__equipment div {
  display: grid;
  grid-template-columns: 28px auto;
  gap: 7px;
}

.share-preview__equipment dt {
  color: oklch(0.4 0.026 166 / 0.5);
}

.share-preview__equipment dd {
  margin: 0;
  color: oklch(0.32 0.04 168 / 0.74);
}

.share-preview__line {
  position: absolute;
  bottom: 26px;
  left: 24px;
  max-width: 18ch;
  margin: 0;
  color: oklch(0.3 0.045 169 / 0.82);
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.share-preview__seal {
  position: absolute;
  right: 24px;
  bottom: 26px;
  color: oklch(0.49 0.12 37);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
}


@media (max-height: 740px) {
  .panel--book .panel__close {
    top: 5px;
  }
}

/* Artifact integration corrections: keep the approved prototype's hierarchy intact. */
.artifact-shell__stage > header,
.artifact-shell__inventory > header {
  min-height: 40px;
  padding: 5px 14px;
  align-items: center;
}

.artifact-shell__stage > header h3 {
  margin: 0;
  font-size: 18px;
}

.artifact-shell__inventory > header > span {
  color: oklch(0.29 0.045 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.artifact-equipped-slots {
  grid-template-columns: 1fr;
  width: min(230px, 34%);
}

.artifact-equipped-slots button {
  min-height: 42px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.artifact-equipped-slots button.is-selected {
  outline: 0;
  box-shadow: inset 2px 0 0 oklch(0.49 0.12 37);
}

.artifact-shell__inventory {
  grid-template-rows: auto auto minmax(92px, 1fr) auto auto;
}

.artifact-selection-summary {
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  margin: 0 12px 12px;
  padding: 12px;
  border: 1px solid oklch(0.44 0.035 166 / 0.16);
}

.artifact-selection-summary > div {
  min-height: 50px;
  padding-right: 12px;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid oklch(0.44 0.035 166 / 0.14);
}

.artifact-selection-summary > p {
  margin: 0;
}

.atlas-shell__categories > header,
.atlas-shell__content > header {
  min-height: 40px;
  padding: 5px 20px;
  align-items: center;
}

.atlas-shell__categories > header h3,
.atlas-shell__content > header h3 {
  margin: 0;
  font-size: 18px;
}

.artifact-detail__layout.codex-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.94fr) minmax(360px, 1.06fr);
  min-height: 500px;
  margin-top: 16px;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.artifact-detail__layout .codex-art {
  width: auto;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  background: #eef0ec;
}

.artifact-detail__layout .codex-art img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.artifact-detail__layout .codex-copy {
  min-width: 0;
  padding: clamp(22px, 3vw, 42px);
  display: flex;
  flex-direction: column;
  border-left: 1px solid oklch(0.44 0.035 166 / 0.16);
  background: #f2eee5;
}

.artifact-detail__layout .codex-copy-heading {
  padding-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.18);
}

.artifact-detail__layout .codex-copy-heading > div > span,
.artifact-detail__layout .codex-copy-heading > div > p,
.artifact-detail__layout .codex-copy-section > span,
.artifact-detail__layout .codex-registry > span {
  color: oklch(0.49 0.12 37);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.artifact-detail__layout .codex-copy-heading h2 {
  margin: 7px 0 4px;
  color: oklch(0.28 0.05 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(34px, 3.5vw, 50px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0;
}

.artifact-detail__layout .codex-copy-heading > div > p {
  margin: 0;
  color: oklch(0.39 0.026 166 / 0.48);
}

.artifact-detail__layout .small-seal {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: oklch(0.49 0.12 37 / 0.86);
  border: 2px solid oklch(0.49 0.12 37 / 0.74);
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
}

.artifact-detail__layout .codex-lede {
  margin: clamp(20px, 3.4vh, 36px) 0 4px;
  color: oklch(0.29 0.045 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(19px, 2vw, 26px);
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.artifact-detail__layout .codex-copy-section {
  padding: clamp(14px, 2.2vh, 24px) 0;
  border-bottom: 1px solid oklch(0.44 0.035 166 / 0.18);
}

.artifact-detail__layout .artifact-meaning p {
  margin: 10px 0 0;
  max-width: 46em;
  color: oklch(0.29 0.045 169);
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  line-height: 1.9;
}

.artifact-detail__layout .artifact-ability dl {
  margin: 9px 0 0;
  display: grid;
  gap: 7px;
}

.artifact-detail__layout .artifact-ability dl div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
}

.artifact-detail__layout .artifact-ability dt,
.artifact-detail__layout .artifact-ability dd {
  font-size: 11px;
}

.artifact-detail__layout .artifact-ability dt {
  color: oklch(0.39 0.026 166 / 0.48);
}

.artifact-detail__layout .artifact-ability dd {
  margin: 0;
  color: oklch(0.29 0.045 169);
}

.artifact-detail__layout .artifact-id {
  margin-top: auto;
  padding-top: clamp(16px, 2.4vh, 26px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 18px;
  align-items: baseline;
}

.artifact-detail__layout .artifact-id strong {
  margin: 0;
  color: oklch(0.29 0.045 169);
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.artifact-detail__layout .artifact-id small {
  grid-column: 2;
  margin-top: 3px;
  color: oklch(0.39 0.026 166 / 0.48);
  font-size: 9px;
}

/* Single height authority for the atlas detail workspace. */
.artifact-atlas-mount.is-detail-view {
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
}

.artifact-atlas-mount.is-detail-view .artifact-detail {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.artifact-atlas-mount.is-detail-view .artifact-detail__layout.codex-card {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
}

.artifact-atlas-mount.is-detail-view .artifact-detail__layout .codex-art {
  align-self: stretch;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: 100%;
  max-height: none;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.artifact-atlas-mount.is-detail-view .artifact-detail__layout .codex-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.artifact-atlas-mount.is-detail-view .artifact-detail__layout .codex-art.is-outfit img.is-wide-catalog-source {
  transform: scale(1.55);
  transform-origin: 50% 48%;
}

.artifact-atlas-mount.is-detail-view .artifact-detail__layout .codex-copy {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

@media (min-width: 768px) {
  .book-pane--artifacts {
    height: 100%;
  }

  .book-pane--artifacts .artifact-shell {
    height: 100%;
    overflow: hidden;
  }

  .book-pane--artifacts .artifact-shell__inventory {
    min-height: 0;
    overflow: hidden;
  }

  .book-pane--artifacts .artifact-inventory-mount {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: oklch(0.43 0.035 165 / 0.34) transparent;
    scrollbar-width: thin;
  }
}

@media (max-width: 1100px) {
  .atlas-shell {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .artifact-atlas-mount {
    padding-right: 16px;
    padding-left: 16px;
  }

  .artifact-detail__layout .codex-copy {
    padding: 22px;
  }
}

@media (max-width: 700px) {
  .artifact-atlas-mount.is-detail-view {
    grid-template-rows: auto;
    align-content: start;
    overflow: auto;
  }

  .artifact-atlas-mount.is-detail-view .artifact-detail {
    width: min(100%, 560px);
    height: auto;
    justify-self: center;
  }

  .artifact-atlas-mount.is-detail-view .artifact-detail__layout.codex-card {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
  }

  .artifact-atlas-mount.is-detail-view .artifact-detail__layout .codex-art {
    justify-self: center;
    width: min(100%, 420px);
    height: auto;
    aspect-ratio: 2 / 3;
  }

  .artifact-atlas-mount.is-detail-view .artifact-detail__layout .codex-copy {
    height: auto;
    min-height: 520px;
    overflow: visible;
    border-top: 1px solid oklch(0.44 0.035 166 / 0.16);
    border-left: 0;
  }
}

/* Keep mobile surface rules last so later desktop workspace refinements cannot reclaim the cascade. */
@media (max-width: 767px) {
  /* Portrait scene compositor, shaped after the approved B direction. */
  .realm__scene,
  .realm__scene-canvas {
    display: none;
  }

  .mobile-realm-scene {
    position: absolute;
    inset: 0 0 var(--mobile-nav-height);
    z-index: -4;
    display: block;
    overflow: hidden;
    background:
      linear-gradient(180deg, oklch(0.965 0.012 89), oklch(0.89 0.025 166) 76%, oklch(0.84 0.035 170));
  }

  .mobile-realm-scene > span {
    position: absolute;
    display: block;
    background-image: url("./scene.webp?v=20260722-entry-webp-v1");
    background-repeat: no-repeat;
    pointer-events: none;
  }

  .mobile-realm-scene__mountains {
    inset: 0 0 42%;
    background-position: 82% 26%;
    background-size: auto 104%;
    filter: saturate(0.78) contrast(0.99) brightness(0.99);
    mask-image: linear-gradient(180deg, #000 0 74%, transparent 100%);
  }

  .mobile-realm-scene__pool {
    top: 23%;
    right: 31%;
    bottom: 28%;
    left: -14%;
    background-position: 0 73%;
    background-size: auto 118%;
    filter: saturate(0.9) contrast(1.02) brightness(0.97);
    mask-image: radial-gradient(ellipse at 42% 55%, #000 0 48%, transparent 76%);
  }

  .mobile-realm-scene__oracle {
    top: 31%;
    right: -35%;
    bottom: -2%;
    left: -35%;
    background-position: 50% 60%;
    background-size: auto 104%;
    filter: saturate(0.86) contrast(1.035) brightness(0.97);
    mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 100%);
  }

  .mobile-realm-scene__veil {
    inset: 0;
    background-image:
      linear-gradient(180deg, oklch(0.98 0.008 90 / 0.16), transparent 17%),
      radial-gradient(ellipse at 50% 45%, transparent 0 32%, oklch(0.96 0.012 156 / 0.22) 78%),
      linear-gradient(0deg, oklch(0.9 0.025 165 / 0.32), transparent 28%);
  }

  .realm__light {
    background:
      linear-gradient(180deg, oklch(0.98 0.008 90 / 0.28), transparent 19%),
      radial-gradient(circle at 50% 52%, transparent 0 30%, oklch(0.96 0.012 160 / 0.22) 80%);
  }

  .realm__mist--far {
    opacity: 0.32;
  }

  .realm__mist--near {
    opacity: 0.42;
  }

  /* The animated image owns scale transforms, so centering must not depend on translateX. */
  .dream-entry__ink {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 50%;
    transform: scale(1.018);
  }

  .dream-entry__identity {
    right: auto;
    left: 50%;
    width: 220px;
    transform: translateX(-50%);
  }

  .topbar {
    height: var(--mobile-topbar);
    padding: env(safe-area-inset-top) 14px 5px;
    border-bottom: 0;
    background: linear-gradient(180deg, oklch(0.975 0.01 91 / 0.92), oklch(0.975 0.01 91 / 0.54) 72%, transparent);
    backdrop-filter: none;
  }

  .brand__name {
    font-family: "Songti SC", "STSong", serif;
    font-size: 19px;
    letter-spacing: 0.15em;
  }

  .bell {
    background: oklch(0.965 0.012 90 / 0.72);
  }

  .wallet {
    min-width: 88px;
    max-width: 104px;
    color: oklch(0.33 0.04 166);
    border-color: oklch(0.42 0.035 166 / 0.38);
    border-radius: 22px;
    background: oklch(0.965 0.012 90 / 0.82);
  }

  .intro {
    display: none;
  }

  .landmark--pool {
    top: 25%;
    right: auto;
    left: 0;
    width: 51%;
    height: 31%;
  }

  .landmark--book {
    top: 19%;
    right: 0;
    left: auto;
    width: 48%;
    height: 35%;
  }

  .landmark--oracle {
    top: 43%;
    left: 18%;
    width: 68%;
    height: 39%;
  }

  .landmark__label {
    display: grid;
    width: 48px;
    min-width: 48px;
    min-height: 116px;
    padding: 24px 8px 14px;
    place-items: center;
    border: 1px solid oklch(0.58 0.04 75 / 0.38);
    border-radius: 12px 12px 16px 16px;
    background:
      linear-gradient(90deg, transparent, oklch(0.91 0.026 83 / 0.42) 48%, transparent),
      oklch(0.965 0.015 88 / 0.93);
    box-shadow: 0 8px 22px oklch(0.32 0.035 166 / 0.13);
    backdrop-filter: none;
    clip-path: polygon(50% 0, 100% 9px, 100% calc(100% - 9px), 50% 100%, 0 calc(100% - 9px), 0 9px);
  }

  .landmark__label::before {
    top: 10px;
    bottom: auto;
    left: 50%;
    width: 7px;
    height: 7px;
    background: var(--cinnabar);
    transform: translateX(-50%) rotate(45deg);
  }

  .landmark__label::after {
    display: none;
  }

  .landmark__label strong {
    margin: 0;
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 17px;
    line-height: 1.12;
    letter-spacing: 0.12em;
    writing-mode: vertical-rl;
  }

  .landmark__label small {
    display: none;
  }

  .landmark--pool .landmark__label {
    top: 12%;
    right: auto;
    bottom: auto;
    left: 16%;
  }

  .landmark--book .landmark__label {
    top: 10%;
    right: 13%;
    left: auto;
  }

  .landmark--oracle .landmark__label {
    top: 42%;
    left: 50%;
    transform: translateX(-50%);
  }

  .realm-status {
    right: 20px;
    bottom: calc(var(--mobile-nav-height) + 1px);
    left: 20px;
    height: 28px;
    border: 0;
    border-radius: 0;
    background: linear-gradient(90deg, transparent, oklch(0.96 0.012 90 / 0.82) 18% 82%, transparent);
    backdrop-filter: none;
  }

  .realm-status button {
    min-height: 28px;
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .mobile-nav {
    grid-template-columns: repeat(3, 1fr);
    height: var(--mobile-nav-height);
    padding: 5px 12px env(safe-area-inset-bottom);
    border-top-color: oklch(0.58 0.035 80 / 0.3);
    background:
      linear-gradient(90deg, transparent, oklch(0.88 0.025 80 / 0.38) 50%, transparent) top / 100% 1px no-repeat,
      oklch(0.965 0.014 88 / 0.97);
    backdrop-filter: none;
  }

  .mobile-nav button[data-mobile-route="home"] {
    display: none;
  }

  .mobile-nav button {
    position: relative;
    min-height: 58px;
    border-radius: 0;
  }

  .mobile-nav button[data-mobile-route="oracle"] {
    transform: translateY(-7px);
  }

  .mobile-nav button[aria-current="page"] {
    color: var(--cinnabar);
    background: transparent;
  }

  .mobile-nav b {
    width: 35px;
    height: 35px;
    border-color: oklch(0.48 0.035 166 / 0.48);
    background: oklch(0.94 0.02 88);
    box-shadow: 0 4px 12px oklch(0.32 0.03 166 / 0.1);
    font-size: 15px;
  }

  .mobile-nav button[data-mobile-route="oracle"] b {
    width: 45px;
    height: 45px;
    border-color: oklch(0.55 0.07 45 / 0.48);
  }

  .mobile-nav span {
    font-family: "Songti SC", "STSong", serif;
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .panel.panel--pool,
  .panel.panel--book {
    position: absolute;
    top: 0;
    right: 0;
    bottom: var(--mobile-nav-height);
    left: 0;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    transform: none;
    animation: mobile-surface-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .panel--pool .panel__close,
  .panel--book .panel__close {
    top: max(12px, env(safe-area-inset-top));
    right: 14px;
    width: 44px;
    height: 44px;
  }

  .pool-panel {
    display: grid;
    grid-template-rows: auto 52px minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
  }

  .pool-panel__header {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: max(22px, calc(env(safe-area-inset-top) + 16px)) 68px 18px 18px;
  }

  .pool-panel__header h2 {
    font-size: 30px;
  }

  .pool-panel__header p:last-child {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.55;
  }

  .pool-panel__countdown {
    justify-items: start;
  }

  .pool-panel__countdown strong {
    font-size: 21px;
  }

  .pool-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    height: 52px;
    padding: 0 18px;
  }

  .pool-tabs button {
    min-height: 44px;
    font-size: 14px;
  }

  .pool-panel__content {
    min-height: 0;
    padding: 22px 18px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .pool-panel__footer {
    min-height: 48px;
    padding: 8px 18px;
    gap: 14px;
    font-size: 10px;
  }

  .book-panel {
    grid-template-rows: 54px minmax(0, 1fr);
  }

  .book-tabs {
    display: flex;
    height: 54px;
    gap: 24px;
    padding: 0 68px 0 18px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .book-tabs button {
    flex: 0 0 auto;
    min-width: 58px;
    min-height: 44px;
    font-size: 14px;
  }

  .book-panel__content:has(.book-pane--artifacts:not([hidden])),
  .book-panel__content:has(.book-pane--workspace:not([hidden])) {
    display: block;
    overflow-y: auto;
  }

  .book-pane {
    min-height: 100%;
    padding: 22px 18px 30px;
  }

  .artifact-shell,
  .atlas-shell,
  .share-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .artifact-shell__stage {
    min-height: 440px;
    border-right: 0;
    border-bottom: 1px solid oklch(0.44 0.035 166 / 0.14);
  }

  .artifact-equip-stage {
    min-height: 380px;
  }

  .artifact-equipped-slots {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    grid-template-columns: repeat(4, 1fr);
  }

  .artifact-equipped-slots button {
    grid-template-columns: 1fr;
    min-height: 58px;
    text-align: center;
  }

  .artifact-shell__inventory {
    min-height: 310px;
  }

  .atlas-shell__categories {
    display: block;
  }

  .atlas-shell__categories nav {
    display: flex;
    overflow-x: auto;
  }

  .artifact-atlas-list {
    grid-template-columns: 1fr;
  }
}

/* Final portrait page-shell cascade, kept last to preserve the approved A/B/C composition. */
@media (max-width: 767px) {
  .topbar,
  .realm.is-pool-focused .topbar,
  .realm.is-book-focused .topbar {
    z-index: 80;
    opacity: 1;
    pointer-events: auto;
  }

  .panel.panel--pool,
  .panel.panel--book {
    top: var(--mobile-topbar);
    right: 0;
    bottom: var(--mobile-nav-height);
    left: 0;
    width: auto;
    height: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    background:
      radial-gradient(circle at 16% 21%, oklch(0.38 0.022 77 / 0.055) 0 0.5px, transparent 0.8px) 0 0 / 13px 17px,
      linear-gradient(112deg, oklch(0.974 0.009 88), oklch(0.95 0.012 82));
    box-shadow: none;
    transform: none;
  }

  .panel--pool .panel__close,
  .panel--book .panel__close {
    display: none;
  }

  .pool-panel {
    grid-template-rows: 174px auto 48px minmax(0, 1fr);
    height: 100%;
  }

  .pool-panel__header {
    grid-template-columns: 1fr;
    height: 174px;
    gap: 0;
    padding: 24px 18px;
    place-items: end center;
  }

  .pool-panel__header h2 {
    padding: 8px 24px 9px;
    font-size: 29px;
  }

  .pool-panel__header p:last-child,
  .pool-panel__countdown,
  .pool-panel__footer,
  .pool-balance {
    display: none;
  }

  .pool-tabs {
    height: 48px;
    padding: 0 16px;
  }

  .pool-tabs button {
    min-height: 46px;
    font-size: 13px;
  }

  .pool-panel__content {
    min-height: 0;
    padding: 16px 16px 24px;
    overflow-y: auto;
  }

  .book-panel {
    grid-template-rows: 174px 50px minmax(0, 1fr);
    height: 100%;
  }

  .book-tabs {
    display: flex;
    height: 50px;
    gap: 22px;
    padding: 0 16px;
  }

  .book-tabs button {
    flex: 0 0 auto;
    min-width: auto;
    min-height: 48px;
    font-size: 13px;
  }

  .book-panel__demo {
    display: none;
  }

  .book-panel__content {
    min-height: 0;
    overflow-y: auto;
    background: oklch(0.965 0.011 88 / 0.72);
  }

  .book-pane {
    min-height: 100%;
    padding: 17px 16px 28px;
  }

  .book-record-list {
    gap: 0;
    border-top: 1px solid oklch(0.5 0.035 80 / 0.24);
  }

  .book-record {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 82px;
    padding: 13px 4px;
    border: 0;
    border-bottom: 1px solid oklch(0.5 0.035 80 / 0.2);
    background: transparent;
  }

  .book-record:first-child {
    min-height: 112px;
    margin: 0 0 9px;
    padding: 16px 10px;
    border: 1px solid oklch(0.55 0.04 78 / 0.3);
    background:
      radial-gradient(circle at 86% 50%, oklch(0.83 0.04 164 / 0.32), transparent 25%),
      oklch(0.97 0.01 90 / 0.58);
  }

  .book-record__main strong {
    font-size: 15px;
  }

  .book-record__main p {
    -webkit-line-clamp: 2;
    font-size: 11px;
    line-height: 1.55;
  }

  .book-record__affordance {
    min-width: 44px;
    min-height: 44px;
    font-size: 0;
  }

  .mobile-nav {
    z-index: 80;
  }

  .mobile-nav button[data-mobile-route="oracle"] {
    transform: none;
  }

  .mobile-nav button[data-mobile-route="oracle"] b,
  .mobile-nav b {
    width: 36px;
    height: 36px;
  }

  .mobile-nav button[aria-current="page"] {
    transform: translateY(-7px);
  }

  .mobile-nav button[aria-current="page"] b {
    width: 46px;
    height: 46px;
    border-color: currentColor;
    background: oklch(0.94 0.025 82);
  }

  .mobile-nav b svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.35;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-nav button[aria-current="page"] b svg {
    width: 30px;
    height: 30px;
  }

  .mobile-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding-right: 4px;
    padding-left: 4px;
  }

  .mobile-nav span {
    font-size: 10px;
    letter-spacing: 0.02em;
  }
}
