* {
  box-sizing: border-box;
}
:root {
  color-scheme: dark;
  --ink: #10152d;
  --paper: #f3f0fa;
  --muted: #b9bed5;
  --gold: #e9cf9a;
  --line: rgba(211, 201, 238, 0.21);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
body {
  margin: 0;
  color: var(--paper);
  background: #070c1b;
  font: 16px/1.65 var(--sans);
  letter-spacing: 0.035em;
}
button,
input,
a {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  opacity: 0.52;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #f3d9aa;
  outline-offset: 4px;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  background: none;
  border: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
}
p {
  color: var(--muted);
}
.layout {
  margin: auto;
  max-width: 1120px;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}
.landscape {
  display: none;
}
.device {
  position: relative;
  isolation: isolate;
  width: min(100%, 520px);
  margin: auto;
  min-height: 100dvh;
  background:
    linear-gradient(
      180deg,
      rgba(8, 14, 37, 0.23),
      rgba(11, 18, 42, 0.72) 72%,
      #0a1025
    ),
    url(assets/night.webp) center top/cover fixed;
  display: flex;
  flex-direction: column;
}
.device:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse at 80% 10%, #7677ba23, transparent 45%);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(13px + env(safe-area-inset-top)) 23px 10px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 17px var(--serif);
  letter-spacing: 0.16em;
  color: #eee9fa;
}
.brand img {
  height: 27px;
  width: 27px;
  object-fit: contain;
}
.catalog,
.tag,
.status,
.tab,
.tagline {
  font-size: 0.83rem;
}
.catalog {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 4px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #101934b8;
  color: #d8d8e6;
}
.catalog-glyph {
  color: var(--gold);
  line-height: 1;
  font-size: 1.15rem;
}
.loading {
  text-align: center;
  padding: 100px 18px;
}
main {
  width: 100%;
  padding: 12px 23px 36px;
  outline: none;
  flex: 1;
}
main.with-nav {
  padding-bottom: calc(91px + env(safe-area-inset-bottom));
}
.in {
  animation: arrive 0.46s ease-out backwards;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.kicker {
  font:
    500 0.69rem/1.6 Georgia,
    serif;
  letter-spacing: 0.24em;
  color: var(--gold);
  text-transform: uppercase;
}
.heading {
  margin: 15px 0 20px;
}
.heading h1,
.ritual h1 {
  font-size: clamp(30px, 7.6vw, 41px);
  letter-spacing: 0.1em;
  line-height: 1.4;
  margin: 4px 0;
}
.heading p,
.ritual p {
  font-size: 0.94rem;
  line-height: 1.7;
}
.overline {
  display: flex;
  align-items: center;
  gap: 9px;
}
.overline:before {
  content: "";
  height: 1px;
  width: 24px;
  background: var(--gold);
  opacity: 0.7;
}
.section-title {
  font-size: 1.16rem;
  letter-spacing: 0.08em;
  margin: 20px 0 10px;
}
.panel,
.list-group,
.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, #303550b0, #131d39df);
  box-shadow: 0 8px 30px #02061224;
}
.panel {
  padding: 18px;
  margin: 12px 0;
}
.panel p,
.hint,
.detail p {
  font-size: 0.9rem;
}
.muted,
.hint {
  color: var(--muted);
}
.gold {
  color: var(--gold);
}
.primary,
.secondary,
.quiet,
.back,
.chip,
.choice,
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
}
.primary,
.secondary {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  padding: 9px 14px;
  font-weight: 600;
  text-align: center;
}
.primary {
  color: #252236;
  background: linear-gradient(105deg, #e5c28d, #f8e9c5 48%, #debd90);
  border: 1px solid #fae4b2;
  box-shadow: 0 6px 21px #c6a57415;
  letter-spacing: 0.08em;
}
.secondary {
  border: 1px solid #bcb1d854;
  background: #202b4c9c;
  color: #e5e2ee;
}
.quiet {
  color: #e7d5b3;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  font-size: 0.9rem;
  min-height: 40px;
}
.stack {
  display: grid;
  gap: 10px;
  margin: 17px 0;
}
.stack a,
.stack button {
  margin: 0;
}
.back {
  font-size: 0.86rem;
  color: #ddd8e6;
  padding: 0;
  min-height: 31px;
}
.back:before {
  content: "‹";
  font-size: 1.45rem;
  line-height: 1;
  color: var(--gold);
}
.ritual {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: calc(100svh - 106px);
  max-height: 900px;
  padding: 13px 0 5px;
}
.ritual .overline {
  justify-content: center;
}
.ritual .overline:after {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}
.ritual h1 {
  letter-spacing: 0.16em;
  margin: 4px 0;
}
.stage {
  position: relative;
  isolation: isolate;
  width: min(100%, 388px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto;
}
.stage:before,
.stage:after {
  position: absolute;
  content: "";
  pointer-events: none;
  border: 1px solid #b6a7e342;
  border-radius: 50%;
  inset: 5%;
  transform: rotate(-23deg) scaleY(0.94);
  box-shadow:
    0 0 32px #8c91f117,
    inset 0 0 28px #a9b9fc17;
}
.stage:after {
  inset: 10%;
  transform: rotate(29deg) scaleX(0.93);
  border-style: dashed;
  opacity: 0.48;
}
.orb {
  width: 89%;
  height: 89%;
  object-fit: contain;
  mask-image: radial-gradient(
    closest-side,
    #000 68%,
    #000a 81%,
    transparent 100%
  );
  mix-blend-mode: screen;
  filter: saturate(0.91);
  animation: breathe 5s ease-in-out infinite;
}
.fox-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.star {
  position: absolute;
  color: #efd4a3;
  font-size: 16px;
  text-shadow: 0 0 12px #f3ce98;
}
.star.s1 {
  left: 8%;
  top: 27%;
}
.star.s2 {
  right: 5%;
  bottom: 32%;
  font-size: 11px;
}
.star.s3 {
  left: 29%;
  bottom: 8%;
  font-size: 10px;
}
.ritual-footer {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 4px;
}
.hold {
  --fill: 0%;
  border-radius: 100px;
  padding: 5px 18px 5px 7px;
  min-width: 184px;
  min-height: 54px;
  border: 1px solid #e3c58d9c;
  color: #f3dfb7;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  background:
    linear-gradient(90deg, #b7946159 var(--fill), transparent var(--fill)),
    linear-gradient(145deg, #4a4350, #232b49);
  box-shadow: 0 0 27px #d1b96e12;
  font-size: 1.06rem;
  letter-spacing: 0.12em;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.hold .seal {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 100%;
  border: 1px solid #e7cb9a7a;
  font-size: 22px;
}
.ritual-footer small,
.fine {
  font-size: 0.78rem;
  color: #b0b4cc;
}
.ritual-footer .quiet {
  font-size: 0.83rem;
  min-height: 33px;
  color: #d8cbba;
}
.hero {
  position: relative;
  min-height: 234px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: center 31% / cover;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}
.hero h2 {
  font-size: 1.58rem;
  letter-spacing: 0.09em;
}
.hero p {
  font-size: 0.9rem;
  color: #ebe6f0;
}
.hero .tag {
  align-self: flex-start;
}
.tag,
.status {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid #dbcba44d;
  color: var(--gold);
  border-radius: 20px;
  background: #191b36ac;
}
.hero.small {
  min-height: 180px;
}
.hero.tall {
  min-height: 320px;
}
.time {
  font:
    normal clamp(38px, 10vw, 55px) / 1.15 Georgia,
    serif;
  letter-spacing: 0.04em;
  color: #fae4bb;
  font-variant-numeric: tabular-nums;
  margin: 6px 0;
}
.stats {
  display: flex;
  align-items: stretch;
  justify-content: space-evenly;
  margin: 16px 0 4px;
}
.stats > div {
  flex: 1;
  text-align: center;
  border-right: 1px solid var(--line);
}
.stats > div:last-child {
  border: 0;
}
.stats strong,
.stats small {
  display: block;
}
.stats strong {
  font:
    500 1.7rem/1.2 Georgia,
    var(--serif);
  color: #f3d9aa;
}
.stats small {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.row.wrap {
  flex-wrap: wrap;
}
.list-group {
  overflow: hidden;
  margin: 12px 0;
}
.rowlink {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 13px 15px;
  color: var(--paper);
  background: transparent;
  border-bottom: 1px solid var(--line);
  min-height: 50px;
}
.rowlink:last-child {
  border-bottom: 0;
}
.rowlink > span:first-of-type {
  flex: 1;
}
.rowlink small {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 3px;
}
.rowlink i {
  font-style: normal;
  color: #d8c69c;
  font-size: 1.25rem;
}
.thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.chips,
.tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.chip,
.tab {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: #c9cce0;
  background: #171e39;
}
.chip.active,
.tab.active {
  color: #f7e6c2;
  background: #5c50484d;
  border-color: #bfa27a;
}
.themes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.theme {
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    radial-gradient(
      ellipse at center top,
      color-mix(in srgb, var(--theme) 19%, transparent),
      transparent 75%
    ),
    #141e38;
  text-align: center;
  padding: 12px 8px 15px;
}
.theme img {
  width: 68%;
  max-width: 102px;
  aspect-ratio: 1;
  object-fit: contain;
}
.theme h2 {
  font-size: 1.19rem;
  letter-spacing: 0.1em;
}
.theme p {
  color: var(--theme);
  font-size: 0.82rem;
  margin-top: 3px;
}
.map {
  position: relative;
  aspect-ratio: 1.075;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: url(assets/map.webp) center/100% 100%;
}
.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 0.78rem;
  color: #fbe8c4;
  background: #17203aeb;
  border: 1px solid #ecd29a;
  padding: 3px 7px;
  border-radius: 14px;
  white-space: nowrap;
  box-shadow: 0 0 11px #dbc78c59;
  min-height: 28px;
}
.pin.seen {
  background: #4b4740;
}
.empty {
  text-align: center;
  padding: 25px 18px;
}
.empty .ornament {
  display: block;
  color: var(--gold);
  font-size: 28px;
}
.empty h2 {
  font-size: 1.18rem;
  margin: 6px 0;
}
.empty p {
  font-size: 0.88rem;
}
.receipt {
  border-left: 2px solid var(--gold);
  padding-left: 12px;
  margin: 10px 0;
  color: #ede4d0;
}
.quantity {
  display: flex;
  align-items: center;
  gap: 8px;
}
.quantity button {
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 40px;
  height: 38px;
}
.quantity input {
  width: 60px;
  text-align: center;
  color: var(--paper);
  padding: 5px;
  background: #141d38;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.poster {
  width: min(100%, 380px);
  border: 1px solid #d1bd934f;
  border-radius: 8px;
  display: block;
  margin: 12px auto;
  box-shadow: 0 15px 55px #06081166;
}
.demo-note {
  color: #c9bda6;
  font-size: 0.77rem;
  text-align: center;
  letter-spacing: 0.06em;
  margin: 16px 0 0;
}
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice {
  justify-content: flex-start;
  text-align: left;
  font-size: 0.88rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  background: #1b2440;
}
.choice:hover,
.rowlink:hover,
.theme:hover {
  background-color: #303954;
}
nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 520px);
  z-index: 5;
  display: flex;
  justify-content: space-evenly;
  border-top: 1px solid #bab3cc3d;
  background: linear-gradient(180deg, #151c37f2, #0d1329fc);
  backdrop-filter: blur(15px);
  padding: 7px 7px calc(6px + env(safe-area-inset-bottom));
}
nav[hidden] {
  display: none;
}
nav a {
  flex: 1;
  text-align: center;
  font-size: 0.77rem;
  color: #b0b7cf;
  display: grid;
  justify-items: center;
  gap: 2px;
}
nav a.active {
  color: var(--gold);
}
nav svg {
  height: 21px;
  width: 23px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#touch {
  position: fixed;
  z-index: 20;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#toast {
  position: fixed;
  z-index: 30;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: #292e49f5;
  border: 1px solid #ab9d85;
  border-radius: 15px;
  padding: 8px 16px;
  color: #f4e6ca;
  font-size: 0.88rem;
  width: max-content;
  max-width: 88vw;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
#toast.show {
  opacity: 1;
}
dialog {
  width: min(88vw, 410px);
  color: var(--paper);
  border: 1px solid #898092;
  border-radius: 18px;
  padding: 22px;
  background: #17203a;
}
dialog::backdrop {
  background: #050819c9;
}
dialog h2 {
  margin-bottom: 8px;
}
dialog .secondary {
  margin-top: 16px;
}
.glow-tree {
  animation: tree-reveal 2.3s both;
}
.page-art {
  width: 100%;
  max-height: 290px;
  object-fit: contain;
  display: block;
  border-radius: 14px;
}
.seal-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 0.82rem;
}
.seal-line:after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
@keyframes breathe {
  50% {
    transform: scale(1.025);
    filter: brightness(1.12);
  }
}
@keyframes tree-reveal {
  from {
    filter: brightness(0.35) saturate(0.45);
  }
  to {
    filter: brightness(1) saturate(1);
  }
}
@media (min-width: 850px) {
  .layout {
    max-width: 1100px;
    padding: 0 24px;
    gap: 0;
    align-items: stretch;
  }
  .landscape {
    flex: 1;
    display: flex;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100dvh;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: 46px 37px;
    background:
      linear-gradient(180deg, #080f2122 0%, #080d1e18 42%, #0b1128ed 100%),
      url(assets/scroll.webp) center 42% / cover;
    box-shadow: inset -25px 0 55px #10152d66;
  }
  .land-seal {
    writing-mode: vertical-rl;
    letter-spacing: 0.22em;
    font: 500 15px var(--serif);
    color: #f1dec0;
    border: 1px solid #d0b9856b;
    padding: 12px 7px;
    align-self: flex-start;
    background: #1e274480;
  }
  .land-copy h2 {
    font-size: clamp(40px, 5vw, 72px);
    letter-spacing: 0.18em;
    margin: 7px 0 0;
  }
  .land-copy p {
    font-family: var(--serif);
    color: #e5d6b8;
    letter-spacing: 0.15em;
  }
  .device {
    width: 466px;
    flex: none;
    margin: 0;
    background-attachment: scroll;
    border-right: 1px solid var(--line);
  }
  nav {
    left: auto;
    right: max(calc((100vw - 1100px) / 2 + 24px), 24px);
    transform: none;
    width: 466px;
  }
  .stage {
    max-width: 350px;
  }
  .ritual {
    min-height: min(790px, calc(100svh - 106px));
  }
}
@media (max-height: 710px) {
  .stage {
    max-width: min(68vw, 268px);
  }
  .ritual {
    min-height: calc(100svh - 99px);
    gap: 6px;
  }
  .heading {
    margin-top: 6px;
  }
  .ritual h1 {
    font-size: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
