/* Loaded last: viewport contracts for the final homepage and dreambook shell. */
.home-oracle {
  top: 78%;
  width: min(920px, calc(100vw - 48px));
}

.home-oracle__actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.6vw, 22px);
}

.home-oracle__actions > i {
  display: none;
}

.home-oracle__action {
  display: grid;
  grid-template-rows: auto minmax(16px, auto);
  min-height: 0;
  padding: 0;
  gap: 0;
  filter: none;
  opacity: 0.94;
  transform-origin: 50% 65%;
  transition: opacity 180ms ease-out, filter 180ms ease-out, transform 180ms ease-out;
}

.home-oracle__action > img {
  position: relative;
  z-index: 0;
  inset: auto;
  display: block;
  width: 100%;
  height: auto;
  opacity: 1;
  object-fit: contain;
  pointer-events: none;
}

.home-oracle__action > span {
  min-height: 16px;
  margin-top: -8px;
}

.home-oracle__action strong {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.home-oracle__action small {
  color: oklch(0.34 0.028 169 / 0.78);
  font-size: 10px;
  letter-spacing: 0.035em;
  text-shadow: 0 1px 7px oklch(0.98 0.008 92 / 0.95);
}

.home-oracle__action:hover,
.home-oracle__action:focus-visible {
  filter: contrast(1.045) brightness(0.99);
  opacity: 1;
  transform: none;
}

.home-oracle__action:active {
  filter: contrast(1.06) brightness(0.965);
  opacity: 1;
  transform: translateY(1px);
}

.home-oracle__action:focus-visible {
  outline: 2px solid oklch(0.49 0.09 164 / 0.52);
  outline-offset: 3px;
  border-radius: 18px;
}

.home-oracle__action:focus-visible::after {
  content: none;
}

.dream-mark {
  --dream-mark-progress: 0%;
  width: min(760px, calc(100% - 72px));
  margin-top: 3px;
  color: oklch(0.29 0.045 169 / 0.88);
  text-shadow: 0 1px 2px oklch(0.97 0.008 92 / 0.9);
}

.dream-mark__summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 0 1px;
}

.dream-mark__summary p {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}

.dream-mark__summary span {
  color: oklch(0.47 0.1 38);
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.dream-mark__summary strong {
  color: oklch(0.28 0.048 170);
  font: 500 13px/1.2 "Songti SC", "STSong", serif;
  letter-spacing: 0.06em;
}

.dream-mark__summary small {
  overflow: hidden;
  color: oklch(0.32 0.03 169 / 0.78);
  font-size: 10px;
  letter-spacing: 0.035em;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dream-mark__rail {
  position: relative;
  height: 25px;
  margin: 3px 4px 0;
}

.dream-mark__rail::before,
.dream-mark__fill {
  position: absolute;
  top: 6px;
  left: 0;
  height: 1.5px;
  content: "";
}

.dream-mark__rail::before {
  right: 0;
  background: oklch(0.34 0.04 168 / 0.36);
}

.dream-mark__fill {
  width: var(--dream-mark-progress);
  background: oklch(0.46 0.105 38 / 0.84);
  box-shadow: 0 0 6px oklch(0.6 0.075 45 / 0.28);
  transition: width 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dream-mark__stop {
  position: absolute;
  top: 0;
  left: var(--stop);
  display: grid;
  justify-items: center;
  color: oklch(0.33 0.03 168 / 0.72);
  font-size: 8.5px;
  transform: translateX(-50%);
}

.dream-mark__stop b {
  width: 8px;
  height: 8px;
  border: 1px solid oklch(0.39 0.04 168 / 0.55);
  border-radius: 50%;
  background: oklch(0.93 0.016 91 / 0.96);
  box-shadow: 0 0 0 2px oklch(0.97 0.01 91 / 0.76);
}

.dream-mark__stop em {
  margin-top: 4px;
  font-style: normal;
  line-height: 1;
}

.dream-mark__stop.is-reached {
  color: oklch(0.34 0.08 38 / 0.96);
}

.dream-mark__stop.is-reached b {
  border-color: oklch(0.42 0.12 38 / 0.94);
  background: oklch(0.52 0.13 43 / 0.96);
}

.dream-mark[data-state="disconnected"],
.dream-mark[data-state="wrong-network"],
.dream-mark[data-state="loading"],
.dream-mark[data-state="error"] {
  opacity: 0.8;
}

.oracle-experience.is-direct-entry {
  background:
    linear-gradient(oklch(0.97 0.008 174 / 0.5), oklch(0.94 0.014 181 / 0.62)),
    url("./scene.webp?v=20260722-entry-webp-v1") center / cover no-repeat;
}

.oracle-experience.is-direct-entry.is-daily-result .oracle-daily,
.oracle-experience.is-direct-entry .oracle-ten {
  background: transparent;
}

.oracle-ten__grid.is-summary {
  grid-template-columns: repeat(4, clamp(78px, 11vh, 112px));
  justify-content: center;
  align-items: start;
  max-width: 640px;
  max-height: min(72vh, 650px);
  padding: 4px 12px 6px;
  overflow-x: visible;
  overflow-y: auto;
  gap: clamp(7px, 1.2vh, 12px) clamp(10px, 1.4vw, 18px);
}

.oracle-experience.is-fifty-open .oracle-ten__panel {
  width: min(720px, calc(100vw - 72px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  gap: clamp(6px, 1.1vh, 12px);
}

.oracle-ten__grid.is-summary .oracle-ten-card {
  grid-template-rows: auto minmax(24px, auto);
}

.oracle-ten__grid.is-summary .oracle-ten-card__shell {
  aspect-ratio: 378 / 800;
}

.oracle-ten__grid.is-summary .oracle-ten-card__reward {
  inset: 12% 8% 25%;
}

.oracle-ten__grid.is-summary.is-pending {
  grid-template-columns: repeat(5, clamp(62px, 9vh, 88px));
  max-width: 620px;
  max-height: none;
  padding: 8px 12px;
  overflow: visible;
  gap: clamp(8px, 1.4vw, 18px);
}

.oracle-ten__grid.is-summary.is-pending .oracle-ten-card__caption strong {
  color: oklch(0.4 0.035 170 / 0.76);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.oracle-experience.is-ten-breathing .oracle-ten__grid.is-summary.is-pending .oracle-ten-card__shell {
  animation: oracle-five-dream-breathe 1800ms cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i) * 90ms) infinite alternate;
}

@keyframes oracle-five-dream-breathe {
  from { transform: translateY(2px) scale(0.985); }
  to { transform: translateY(-4px) scale(1.01); }
}

.oracle-ten-card__count {
  position: absolute;
  top: 7%;
  right: 7%;
  z-index: 6;
  display: grid;
  min-width: 32px;
  min-height: 32px;
  padding: 4px;
  place-items: center;
  color: oklch(0.97 0.01 91);
  border: 1px solid oklch(0.9 0.035 80 / 0.72);
  border-radius: 50%;
  background: oklch(0.46 0.11 38 / 0.92);
  box-shadow: 0 5px 14px oklch(0.28 0.04 38 / 0.24);
  font: 600 12px/1 ui-monospace, "SFMono-Regular", monospace;
  font-style: normal;
}

.oracle-ten-card__count[hidden] {
  display: none;
}

@media (min-width: 768px) {
  .topbar,
  .realm.is-pool-focused .topbar,
  .realm.is-book-focused .topbar {
    height: 55px;
    padding-top: 6px;
  }

  .panel.panel--book {
    top: 58px;
    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 (max-width: 767px) {
  .home-oracle {
    top: 67%;
    width: min(390px, calc(100vw - 20px));
  }

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

  .home-oracle__action--fifty {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 3px);
    margin-top: -8px;
  }

  .home-oracle__action > span {
    margin-top: -5px;
  }

  .home-oracle__action small {
    max-width: 22ch;
    font-size: 8px;
  }

  .dream-mark {
    width: calc(100% - 32px);
    margin-top: -2px;
  }

  .dream-mark__summary {
    gap: 10px;
  }

  .dream-mark__summary span,
  .dream-mark__summary strong {
    font-size: 10px;
  }

  .dream-mark__summary small {
    max-width: 58%;
    font-size: 8px;
  }

  .dream-mark__rail {
    margin-right: 1px;
    margin-left: 1px;
  }

  .dream-mark__stop {
    font-size: 7px;
  }

  .oracle-experience.is-direct-entry {
    background:
      linear-gradient(oklch(0.97 0.008 174 / 0.48), oklch(0.94 0.014 181 / 0.62)),
      url("./scene.webp?v=20260722-entry-webp-v1") center / auto 100% no-repeat;
  }

  .oracle-ten__grid.is-summary {
    grid-template-columns: repeat(4, clamp(64px, 20vw, 84px));
    max-height: calc(100dvh - 150px);
    padding-inline: 4px;
    gap: 5px;
  }

  .oracle-experience.is-fifty-open .oracle-ten__panel {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 24px);
  }

  .oracle-ten__grid.is-summary.is-pending {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    max-height: none;
  }

  .oracle-ten__grid.is-summary .oracle-ten-card {
    grid-template-rows: auto minmax(30px, auto);
  }

  .oracle-ten-card__count {
    min-width: 23px;
    min-height: 23px;
    font-size: 9px;
  }
}

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

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

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