/* Approved A/B/C mobile frame assembled from the confirmed artwork slices. */
.brand__mobile-slice,
.wallet__mobile-slice {
  display: none;
}

.book-collection-entry {
  display: none;
}

.pool-panel[hidden],
.book-panel[hidden] {
  display: none !important;
}

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

  .topbar {
    grid-template-columns: 1fr auto;
    padding-right: 15px;
    padding-left: 15px;
    border-bottom: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .realm.is-pool-focused .topbar,
  .realm.is-book-focused .topbar {
    border-bottom: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .brand {
    width: 122px;
    min-width: 122px;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }

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

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

  .wallet {
    display: block;
    width: 64px;
    min-width: 64px;
    max-width: none;
    height: 42px;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

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

  .topbar__actions {
    justify-self: end;
    overflow: visible;
  }

  .bell {
    display: none;
  }

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

  .toast {
    z-index: 110;
  }

  .mobile-nav {
    padding: 0 17px env(safe-area-inset-bottom);
    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"] {
    grid-template-rows: 82px 22px;
    height: 104px;
    min-height: 104px;
    padding: 0;
    align-content: start;
    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: 78px;
    height: 78px;
    align-self: start;
    justify-self: center;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    box-shadow: none;
  }

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

  .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 {
    align-self: start;
    margin-top: -1px;
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.08em;
  }

  .panel.panel--pool,
  .panel.panel--book,
  .pool-panel__content,
  .book-panel__content,
  .oracle-experience {
    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;
  }

  .oracle-experience__interior {
    background-image: url("./mobile-assets/frame-v1/scene-oracle.png");
    background-position: center;
    background-size: cover;
  }

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

  .oracle-experience {
    top: 0;
    background: url("./mobile-assets/frame-v1/paper-seamless-v2.png") center / 256px 256px repeat;
  }

  .oracle-experience__interior {
    inset: 0 0 auto;
    width: 100%;
    height: 56vw;
    max-height: 280px;
    border: 0;
    clip-path: none;
    mask-image: none;
    background-image: url("./mobile-assets/frame-v1/scene-oracle.png");
    background-position: center top;
    background-size: cover;
  }

  .oracle-mobile-focus {
    top: 56vw;
    left: 50%;
    width: 112px;
    height: 198px;
    z-index: 1;
    overflow: visible;
    border-radius: 0;
    background: transparent;
    transform: translateX(-50%);
    mask-image: none;
  }

  .oracle-mobile-focus::before {
    display: none;
  }

  .oracle-mobile-focus::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: url("./mobile-assets/frame-v1/oracle-vessel-alpha-v2.png") center / 100% 100% no-repeat;
    content: "";
  }

  .oracle-mobile-focus i {
    display: none;
  }

  .oracle-mobile-title {
    top: 109vw;
    gap: 0;
  }

  .oracle-mobile-title span {
    display: none;
  }

  .oracle-mobile-title strong {
    color: oklch(0.29 0.018 72);
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 43px;
    font-weight: 500;
    letter-spacing: 0.14em;
  }

  .oracle-room__actions {
    top: 123vw;
    width: 235px;
    gap: 0;
  }

  .oracle-room::before {
    position: absolute;
    top: calc(56vw - 55px);
    right: 0;
    left: 0;
    z-index: 0;
    height: 55px;
    background: url("./mobile-assets/frame-v1/oracle-transition-v3.png") center / 100% 100% no-repeat;
    content: "";
    pointer-events: none;
  }

  .oracle-cloud-action,
  .oracle-cloud-action[data-oracle-choice="ten"],
  .oracle-cloud-action[data-oracle-choice="daily"] {
    min-height: 0;
    padding: 0;
    overflow: visible;
    color: transparent;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    box-shadow: none;
  }

  .oracle-cloud-action[data-oracle-choice="ten"] {
    width: 235px;
    height: 107px;
    background-image: url("./mobile-assets/frame-v1/oracle-button-ten-alpha-v2.png");
  }

  .oracle-cloud-action[data-oracle-choice="daily"] {
    width: 235px;
    height: 64px;
    background-image: url("./mobile-assets/frame-v1/oracle-button-daily-alpha-v2.png");
  }

  .oracle-cloud-action strong,
  .oracle-cloud-action small {
    opacity: 0;
  }

  .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;
  }

  /* A / 天命仙池：保留真实数据，将首屏整理成原型中的山水、双池卡与结算条。 */
  .panel.panel--pool,
  .panel.panel--book {
    top: 0;
    background: url("./mobile-assets/frame-v1/paper-seamless-v2.png") center / 256px 256px repeat;
  }

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

  .pool-panel__header {
    isolation: isolate;
    height: 320px;
    padding: calc(var(--mobile-topbar) + 8px) 18px 10px;
    border: 0;
    background: transparent;
  }

  .pool-panel__header::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
      linear-gradient(180deg, oklch(0.9 0.018 165 / 0.12), transparent 52%, oklch(0.966 0.009 88 / 0.18) 76%, oklch(0.966 0.009 88 / 0.96) 100%),
      url("./mobile-assets/frame-v1/scene-pool.png") center top / cover no-repeat;
    content: "";
    filter: saturate(0.84) contrast(1.01) brightness(0.97);
    pointer-events: none;
  }

  .pool-panel__header::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    z-index: 1;
    height: 84px;
    background: url("./mobile-assets/frame-v1/paper-seamless-v2.png") center / 256px 256px repeat;
    content: "";
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgb(0 0 0 / 0.08) 18%, rgb(0 0 0 / 0.54) 62%, rgb(0 0 0) 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgb(0 0 0 / 0.08) 18%, rgb(0 0 0 / 0.54) 62%, rgb(0 0 0) 100%);
  }

  .pool-panel__header > div {
    position: relative;
    z-index: 2;
  }

  .pool-panel__eyebrow {
    display: none;
  }

  .pool-panel__header h2 {
    width: min(268px, 72vw);
    min-height: 61px;
    padding: 8px 24px;
    color: oklch(0.27 0.02 74);
    font-size: 30px;
    letter-spacing: 0.13em;
  }

  .pool-mobile-overview {
    grid-template-rows: repeat(2, minmax(0, 1fr)) 44px;
    gap: 12px;
    min-height: 0;
    padding: 8px 18px 22px;
  }

  .pool-mobile-overview article {
    min-height: 0;
    padding: 18px 47% 18px 25px;
    background: url("./mobile-assets/frame-v1/frame-pool.png") center / 100% 100% no-repeat;
  }

  .pool-mobile-overview article::after {
    position: absolute;
    top: 50%;
    right: 9px;
    display: block;
    width: 56%;
    height: 90%;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 1;
    transform: translateY(-50%);
    content: "";
    pointer-events: none;
  }

  .pool-mobile-overview article:first-child::after {
    background-image: url("./mobile-assets/frame-v1/pool-fortune-illustration-alpha-v1.png");
  }

  .pool-mobile-overview article:nth-child(2)::after {
    background-image: url("./mobile-assets/frame-v1/pool-destiny-illustration-alpha-v1.png");
  }

  .pool-mobile-overview article > span,
  .pool-mobile-overview article > strong {
    position: relative;
    z-index: 2;
  }

  .pool-mobile-overview span {
    color: oklch(0.29 0.025 72);
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 20px;
    font-weight: 600;
  }

  .pool-mobile-overview strong {
    margin-top: 4px;
    color: oklch(0.43 0.13 35);
    font-family: "Songti SC", "STSong", serif;
    font-size: 26px;
    letter-spacing: 0.015em;
  }

  .pool-mobile-overview small {
    display: none;
  }

  .pool-mobile-overview > p {
    width: min(270px, 76vw);
    min-height: 44px;
    margin: 0 auto;
    padding: 0 24px;
    color: oklch(0.29 0.025 72);
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 13px;
    background: url("./mobile-assets/frame-v1/frame-settlement.png") center / 100% 100% no-repeat;
  }

  .pool-mobile-overview > p b {
    font-family: "Songti SC", "STSong", serif;
    font-size: 15px;
  }

  .pool-tabs {
    display: none;
  }

  .pool-panel__content {
    display: none;
  }

  /* C / 梦簿阁：原型首屏的信息层级，旧的五类内容仍可由藏品入口与子导航进入。 */
  .book-panel {
    grid-template-rows: 254px 0 minmax(0, 1fr);
  }

  .book-panel__mobile-hero {
    isolation: isolate;
    height: 254px;
    padding: calc(var(--mobile-topbar) + 6px) 18px 10px;
    border: 0;
    background:
      linear-gradient(180deg, transparent 68%, oklch(0.966 0.009 88 / 0.16) 78%, oklch(0.966 0.009 88 / 0.94) 100%),
      url("./mobile-assets/frame-v1/scene-book.png") center top / cover no-repeat;
  }

  .book-panel__mobile-hero::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    z-index: 1;
    height: 78px;
    background: url("./mobile-assets/frame-v1/paper-seamless-v2.png") center / 256px 256px repeat;
    content: "";
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgb(0 0 0 / 0.08) 18%, rgb(0 0 0 / 0.52) 62%, rgb(0 0 0) 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgb(0 0 0 / 0.08) 18%, rgb(0 0 0 / 0.52) 62%, rgb(0 0 0) 100%);
  }

  .book-panel__mobile-hero > * {
    position: relative;
    z-index: 2;
  }

  .book-panel__mobile-hero span {
    display: none;
  }

  .book-panel__mobile-hero h2 {
    width: min(272px, 74vw);
    min-height: 62px;
    padding: 8px 26px;
    color: oklch(0.27 0.02 74);
    font-size: 30px;
    letter-spacing: 0.13em;
  }

  .book-tabs {
    height: 0;
    min-height: 0;
    padding: 0 16px;
    overflow: hidden;
    visibility: hidden;
    border: 0;
  }

  .book-panel:has(.book-pane:not([data-book-pane="signs"]):not([hidden])) {
    grid-template-rows: 210px 42px minmax(0, 1fr);
  }

  .book-panel:has(.book-pane:not([data-book-pane="signs"]):not([hidden])) .book-panel__mobile-hero {
    height: 210px;
  }

  .book-panel:has(.book-pane:not([data-book-pane="signs"]):not([hidden])) .book-tabs {
    height: 42px;
    min-height: 42px;
    visibility: visible;
    border-bottom: 1px solid oklch(0.5 0.03 82 / 0.18);
  }

  .book-panel:has(.book-pane:not([data-book-pane="signs"]):not([hidden])) .book-tabs button {
    min-height: 40px;
    font-size: 12px;
  }

  .book-panel__content {
    background: url("./mobile-assets/frame-v1/paper-seamless-v2.png") center / 256px 256px repeat;
  }

  .book-pane[data-book-pane="signs"] {
    padding: 14px 18px 26px;
  }

  .book-pane[data-book-pane="signs"] .book-pane__heading {
    min-height: 34px;
    padding: 0 4px 8px;
    align-items: center;
    border: 0;
  }

  .book-pane[data-book-pane="signs"] .book-pane__heading div span,
  .book-pane[data-book-pane="signs"] .book-pane__heading small {
    display: none;
  }

  .book-pane[data-book-pane="signs"] .book-pane__heading strong {
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 17px;
    letter-spacing: 0.12em;
  }

  .book-pane[data-book-pane="signs"] .book-pane__heading strong::before {
    margin-right: 7px;
    color: oklch(0.56 0.09 71);
    content: "◆";
    font-size: 8px;
    vertical-align: middle;
  }

  .book-pane[data-book-pane="signs"] .book-record-list {
    min-height: 0;
    border: 0;
  }

  .book-pane[data-book-pane="signs"] .book-record:first-child {
    min-height: 122px;
    margin: 0 0 34px;
    padding: 17px 18px;
    background: url("./mobile-assets/frame-v1/frame-record.png") center / 100% 100% no-repeat;
  }

  .book-pane[data-book-sign-state="records"] .book-pane__heading strong {
    font-size: 18px;
  }

  .book-pane[data-book-sign-state="records"] .book-record:first-child {
    grid-template-columns: 62px minmax(0, 1fr) 34px;
    gap: 14px;
    min-height: 128px;
    padding: 18px 22px;
  }

  .book-pane[data-book-sign-state="records"] .book-record:first-child .book-record__meta {
    display: grid;
    min-height: 90px;
    padding: 8px 5px;
    place-items: center;
    color: oklch(0.43 0.13 35);
    border: 1px solid oklch(0.56 0.07 69 / 0.48);
    border-radius: 48% 48% 44% 44% / 16% 16% 18% 18%;
    background: oklch(0.965 0.012 88 / 0.72);
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    text-align: center;
  }

  .book-pane[data-book-sign-state="records"] .book-record:first-child .book-record__meta::before {
    max-width: 2em;
    content: attr(data-sign-rank);
    font-size: 22px;
    line-height: 1.35;
    letter-spacing: 0.08em;
  }

  .book-pane[data-book-sign-state="records"] .book-record:first-child .book-record__meta span,
  .book-pane[data-book-sign-state="records"] .book-record:first-child .book-record__meta time,
  .book-pane[data-book-sign-state="records"] .book-record:first-child .book-record__main strong {
    display: none;
  }

  .book-pane[data-book-sign-state="records"] .book-record:first-child .book-record__main p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: oklch(0.29 0.025 72);
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0.08em;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .book-pane[data-book-sign-state="records"] .book-record:first-child .book-record__affordance {
    min-width: 34px;
    min-height: 34px;
  }

  .book-pane[data-book-pane="signs"] .book-record:nth-child(2) {
    position: relative;
  }

  .book-pane[data-book-pane="signs"] .book-record:nth-child(2)::before {
    position: absolute;
    top: -27px;
    left: 3px;
    color: oklch(0.29 0.025 72);
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 14px;
    letter-spacing: 0.12em;
    content: "◆ 近期记录";
  }

  .book-pane[data-book-pane="signs"] .book-record {
    min-height: 58px;
    padding: 9px 4px;
  }

  .book-pane[data-book-pane="signs"] .book-record__main p {
    display: none;
  }

  .book-collection-entry {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 90px;
    margin-top: 16px;
    padding: 15px 62px 15px 20px;
    align-content: end;
    overflow: hidden;
    color: oklch(0.965 0.01 90);
    border: 1px solid oklch(0.55 0.05 72 / 0.42);
    border-radius: 15px;
    background:
      linear-gradient(90deg, oklch(0.27 0.035 164 / 0.26), oklch(0.27 0.035 164 / 0.02)),
      url("./mobile-assets/frame-v1/scene-book.png") center 57% / cover no-repeat;
    text-align: left;
    box-shadow: inset 0 0 0 1px oklch(0.96 0.02 88 / 0.38);
  }

  .book-collection-entry span {
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 18px;
    letter-spacing: 0.12em;
    text-shadow: 0 1px 6px oklch(0.23 0.035 164 / 0.42);
  }

  .book-collection-entry small {
    margin-top: 2px;
    font-size: 10px;
    letter-spacing: 0.08em;
    opacity: 0.88;
  }

  .book-collection-entry i {
    position: absolute;
    right: 17px;
    bottom: 19px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-family: serif;
    font-size: 24px;
    font-style: normal;
  }
}

@media (max-width: 767px) {
  .mobile-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-right: 8px;
    padding-left: 8px;
  }

  .mobile-nav > a {
    display: grid;
    grid-template-rows: 82px 22px;
    min-width: 0;
    height: 104px;
    padding: 0;
    align-content: start;
    gap: 0;
    color: inherit;
    text-decoration: none;
  }

  .mobile-nav button b,
  .mobile-nav button[data-mobile-route="oracle"] b,
  .mobile-nav button[aria-current="page"] b,
  .mobile-nav > a b {
    width: 64px;
    height: 64px;
  }

  .mobile-nav > a b {
    display: grid;
    margin-top: 7px;
    place-items: center;
    color: oklch(0.4 0.04 166);
    border: 1px solid oklch(0.55 0.04 78 / 0.34);
    border-radius: 50%;
    background: oklch(0.94 0.02 88 / 0.82);
  }

  .mobile-nav > a b svg {
    display: block;
    width: 29px;
    height: 29px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.25;
  }

  .mobile-nav span {
    font-size: 14px;
  }
}
