/* ASTRAL V6 — Editorial Identity, Floating 3D Lyrics, 3D Memory Universe, Now Playing & Sanctuary */

/* --------------------------------------------------------------------------
   1. Persistent World Background & Sanctuary Environmental Actors
   -------------------------------------------------------------------------- */
.world-environment {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #080a14;
  pointer-events: none;
}

.lake-still,
.lake-still-art,
.world-canvas,
.lake-petals {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.still-moon-placement { transform: translateX(160px); }

.sakura-spray {
  position: absolute;
  left: -5%;
  top: -2%;
  width: min(16vw, 210px);
  opacity: 0.44;
  transform-origin: 0 0;
  filter: drop-shadow(0 6px 18px rgba(6, 5, 12, 0.55)) drop-shadow(0 0 18px rgba(255, 140, 174, 0.26)) brightness(1.03);
  animation: spray-sway 19s ease-in-out infinite alternate;
}

@keyframes spray-sway {
  from { transform: rotate(-1.6deg); }
  to { transform: rotate(1.2deg) translateY(4px); }
}

@media (max-width: 740px) {
  .sakura-spray { width: 38vw; left: -14%; opacity: 0.4; }
}

.sanctuary-view.is-live::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(70% 58% at 62% 36%, rgba(255, 214, 186, 0.10), transparent 68%),
    radial-gradient(44% 40% at 90% 6%, rgba(255, 168, 198, 0.14), transparent 74%),
    linear-gradient(180deg, rgba(6, 8, 18, 0) 68%, rgba(6, 8, 18, 0.34));
}

@media (prefers-reduced-motion: reduce) {
  .astral-fx-layer,
  .sanctuary-koi-tag {
    animation: none !important;
  }
}

/* Subtle Winter Snowfall Layer */
.astral-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
}

/* Profile Keyword-Triggered Ambient FX Layer */
.astral-fx-layer {
  position: fixed;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  overflow: hidden;
}

.astral-fx-node {
  position: absolute;
  left: var(--fx-x, 30%);
  top: var(--fx-y, 25%);
  pointer-events: none;
}

.fx-meteor {
  width: 110px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 245, 224, 0) 0%, #ffe6be 65%, #fff 100%);
  box-shadow: 0 0 12px rgba(255, 226, 178, 0.8);
  opacity: 0;
  transform: rotate(-24deg) translateX(0);
  animation: fx-meteor-fly 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--fx-delay, 0ms);
}

@keyframes fx-meteor-fly {
  0% { opacity: 0; transform: rotate(-24deg) translateX(0) scaleX(0.4); }
  25% { opacity: 0.95; }
  100% { opacity: 0; transform: rotate(-24deg) translateX(180px) scaleX(1.1); }
}

.fx-petal {
  width: 11px;
  height: 7px;
  border-radius: 90% 10% 80% 20%;
  background: linear-gradient(135deg, #ffeef2, #e99eb6);
  box-shadow: 0 0 8px rgba(244, 168, 190, 0.5);
  opacity: 0;
  animation: fx-petal-drift 1.95s ease-out forwards;
  animation-delay: var(--fx-delay, 0ms);
}

@keyframes fx-petal-drift {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.5); }
  20% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(var(--fx-dx, 40px), var(--fx-dy, 90px)) rotate(var(--fx-rot, 160deg)) scale(0.9); }
}

.fx-flare {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 1px solid rgba(255, 232, 194, 0.75);
  box-shadow: 0 0 22px rgba(240, 203, 158, 0.65);
  opacity: 0;
  animation: fx-flare-bloom 1.3s ease-out forwards;
}

@keyframes fx-flare-bloom {
  0% { opacity: 0; transform: scale(0.35); }
  30% { opacity: 0.95; }
  100% { opacity: 0; transform: scale(2.1); }
}

.portrait-stage.is-lyric-pulsed {
  animation: portrait-lyric-glow 1.2s ease-out;
}

@keyframes portrait-lyric-glow {
  0% { filter: drop-shadow(0 0 0 rgba(240, 203, 158, 0)); }
  35% { filter: drop-shadow(0 0 26px rgba(240, 203, 158, 0.45)); }
  100% { filter: drop-shadow(0 0 0 rgba(240, 203, 158, 0)); }
}

/* Sanctuary Wish Dialogs */
dialog.sanctuary-release-dialog,
dialog.sanctuary-catch-dialog,
dialog.sanctuary-log-dialog {
  width: min(92vw, 480px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #141524;
  color: var(--paper);
  padding: clamp(20px, 3vw, 28px);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.82);
}

.wish-release-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.wish-row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wish-field {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.wish-field input,
.wish-field select,
.wish-field textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 6px;
  border: 1px solid rgba(240, 203, 158, 0.28);
  background: rgba(10, 11, 20, 0.88);
  color: var(--ivory);
  font: inherit;
  font-size: 0.88rem;
}

.catch-rarity-badge {
  display: inline-flex;
  align-items: center;
  margin: 10px 0 8px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--rarity-color, #f0cb9e);
  color: var(--rarity-color, #f0cb9e);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.catch-message-body {
  margin: 8px 0 10px;
  padding-left: 14px;
  border-left: 2px solid rgba(240, 203, 158, 0.45);
  font: italic 1.12rem/1.5 var(--serif);
  color: #fff6e8;
}

.wish-log-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 52vh;
  overflow-y: auto;
  display: grid;
  gap: 10px;
}

.wish-log-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(240, 203, 158, 0.2);
  background: rgba(20, 22, 36, 0.72);
}

.wish-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ivory);
  font-size: 0.88rem;
}

.wish-log-rarity {
  font-size: 0.72rem;
  color: var(--rarity-color, #f0cb9e);
}

.wish-log-msg {
  margin: 6px 0 4px;
  font-size: 0.85rem;
  line-height: 1.42;
  color: var(--paper);
}

.wish-log-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .sakura-spray { animation: none !important; }
}


@media (max-width: 740px) {
  .still-moon-placement { transform: translateX(112px); }
}

.sanctuary-view.is-live .lake-still {
  visibility: hidden;
}

.sakura-bough {
  position: absolute;
  right: -4%;
  top: -1%;
  width: min(34vw, 500px);
  opacity: 0.96;
  transform-origin: 50% 0;
  transform: scaleX(-1);
  translate: var(--bough-shift, 0px) 0px;
  filter: drop-shadow(0 12px 26px rgba(6, 5, 12, 0.6)) drop-shadow(0 0 22px rgba(255, 138, 172, 0.3)) saturate(1.16) brightness(1.04);
  animation: bough-sway 18s ease-in-out infinite alternate;
}

.sakura-glow {
  animation: sakura-halo 9s ease-in-out infinite alternate;
}

.sakura-blooms {
  animation: sakura-breathe 13s ease-in-out infinite alternate;
}

@keyframes sakura-halo {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@keyframes sakura-breathe {
  from { opacity: 0.86; }
  to { opacity: 1; }
}

@keyframes bough-sway {
  0% { transform: scaleX(-1) rotate(-1.6deg) translateY(0); }
  45% { transform: scaleX(-1) rotate(0.5deg) translateY(3px); }
  100% { transform: scaleX(-1) rotate(1.3deg) translateY(6px); }
}

.lake-petals {
  z-index: 1;
}

.lake-petal {
  position: absolute;
  left: 0;
  top: 0;
  width: 13px;
  height: 16px;
  clip-path: polygon(50% 100%, 7% 68%, 0 32%, 20% 3%, 50% 26%, 80% 3%, 100% 32%, 93% 68%);
  background:
    radial-gradient(70% 58% at 50% 26%, rgba(255, 255, 255, 0.55), transparent 72%),
    linear-gradient(158deg, var(--petal-a, #f5c6ba) 4%, var(--petal-b, #d29098) 44%, var(--petal-c, #a2657e) 88%);
  opacity: 0.82;
  will-change: transform, opacity;
}

.lake-ripple {
  position: absolute;
  z-index: 2;
  width: 92px;
  height: 32px;
  transform: translate(-50%, -50%);
  border: 1px solid #f5d6b4;
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(236, 201, 175, 0.28);
  animation: lake-ring 0.85s ease-out both;
}

@keyframes lake-ring {
  from { transform: translate(-50%, -50%) scale(0.24); opacity: 0.9; }
  to { transform: translate(-50%, -50%) scale(1.75); opacity: 0; }
}

.water-pointer {
  position: absolute;
  z-index: 2;
  inset: 0 auto auto 0;
  width: 28px;
  height: 14px;
  margin: -7px -14px;
  border: 1px solid rgba(242, 214, 191, 0.58);
  border-radius: 50%;
  pointer-events: none;
}

.world-fish {
  position: absolute;
  width: 46px;
  height: 12px;
  margin: -6px -23px;
  transform-origin: 50% 50%;
}

.world-fish::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 26%;
  height: 6px;
  clip-path: polygon(4% 100%, 26% 4%, 72% 26%, 100% 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), var(--fish-b, #7a83a1) 56%, var(--fish-c, #444d72));
  opacity: 0.34;
}

.world-fish::after {
  content: "";
  position: absolute;
  left: 30%;
  bottom: -2px;
  width: 11px;
  height: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), var(--fish-b, #7a83a1));
  clip-path: polygon(0 50%, 100% 0, 66% 50%, 100% 100%);
  opacity: 0.45;
  transform: rotate(-14deg);
}

.world-fish .fish-body {
  position: absolute;
  z-index: 1;
  inset: 0 13px 0 0;
  clip-path: polygon(96% 50%, 88% 22%, 62% 4%, 26% 8%, 6% 30%, 0 50%, 6% 70%, 26% 92%, 62% 96%, 88% 78%);
  background:
    radial-gradient(90% 70% at 68% 16%, rgba(255, 255, 255, 0.2), transparent 58%),
    radial-gradient(80% 90% at 20% 92%, rgba(255, 255, 255, 0.12), transparent 64%),
    linear-gradient(176deg, var(--fish-a, #b8c2d8) 0%, var(--fish-b, #7a83a1) 34%, var(--fish-c, #444d72) 74%, #1a2036 100%);
  box-shadow: inset 0 -2px 3px rgba(10, 14, 28, 0.72), inset 0 1px 1px rgba(225, 232, 246, 0.26);
  transform: rotate(var(--bend, 0deg));
  transform-origin: 0% 50%;
}

.world-fish .fish-body::before {
  content: "";
  position: absolute;
  inset: 26% 30% auto auto;
  width: 1px;
  height: 26%;
  border-radius: 2px;
  background: rgba(20, 26, 48, 0.28);
  rotate: 12deg;
}

.world-fish .fish-body::after {
  content: "";
  position: absolute;
  inset: 28% 17% auto auto;
  width: 8%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #0b0d16;
  box-shadow: 0 0 0 1px rgba(226, 236, 250, 0.34);
}

.world-fish .fish-tail {
  position: absolute;
  z-index: 0;
  left: -9px;
  top: -1px;
  bottom: -1px;
  width: 19px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), var(--fish-b, #919ab8) 40%, var(--fish-c, #3f4767) 100%);
  clip-path: polygon(0 0, 100% 34%, 100% 66%, 0 100%, 26% 50%);
  opacity: 0.94;
  transform-origin: 100% 50%;
  animation: fish-tail-flap var(--flap, 1.5s) ease-in-out infinite alternate;
}

@keyframes fish-tail-flap {
  from { transform: rotate(-14deg) skewY(-4deg) scaleY(0.88); }
  to { transform: rotate(12deg) skewY(4deg) scaleY(1.1); }
}

.sakura-light {
  position: absolute;
  top: -12%;
  right: -14%;
  width: min(54vw, 720px);
  aspect-ratio: 1;
  pointer-events: none;
  background: radial-gradient(circle at 58% 36%, rgba(255, 172, 200, 0.18), rgba(255, 138, 176, 0.07) 44%, transparent 72%);
  filter: blur(3px);
  animation: sakura-light 12s ease-in-out infinite alternate;
}

@keyframes sakura-light {
  from { opacity: 0.62; }
  to { opacity: 1; }
}

.bloom-mote {
  position: absolute;
  width: 6px;
  height: 8px;
  clip-path: polygon(50% 100%, 7% 68%, 0 32%, 20% 3%, 50% 26%, 80% 3%, 100% 32%, 93% 68%);
  background: linear-gradient(158deg, #fff0f2, #f6b4c6 52%, #d184a0);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  animation: mote-drift var(--mote-dur, 19s) linear var(--mote-delay, 0s) infinite;
}

@keyframes mote-drift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  14% { opacity: 0.5; }
  74% { opacity: 0.34; }
  100% { transform: translate3d(-30vw, 68vh, 0) rotate(300deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .astral-fx-layer,
  .sanctuary-koi-tag {
    animation: none !important;
  }
}

/* Subtle Winter Snowfall Layer */
.astral-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
}

/* Profile Keyword-Triggered Ambient FX Layer */
.astral-fx-layer {
  position: fixed;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  overflow: hidden;
}

.astral-fx-node {
  position: absolute;
  left: var(--fx-x, 30%);
  top: var(--fx-y, 25%);
  pointer-events: none;
}

.fx-meteor {
  width: 110px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 245, 224, 0) 0%, #ffe6be 65%, #fff 100%);
  box-shadow: 0 0 12px rgba(255, 226, 178, 0.8);
  opacity: 0;
  transform: rotate(-24deg) translateX(0);
  animation: fx-meteor-fly 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--fx-delay, 0ms);
}

@keyframes fx-meteor-fly {
  0% { opacity: 0; transform: rotate(-24deg) translateX(0) scaleX(0.4); }
  25% { opacity: 0.95; }
  100% { opacity: 0; transform: rotate(-24deg) translateX(180px) scaleX(1.1); }
}

.fx-petal {
  width: 11px;
  height: 7px;
  border-radius: 90% 10% 80% 20%;
  background: linear-gradient(135deg, #ffeef2, #e99eb6);
  box-shadow: 0 0 8px rgba(244, 168, 190, 0.5);
  opacity: 0;
  animation: fx-petal-drift 1.95s ease-out forwards;
  animation-delay: var(--fx-delay, 0ms);
}

@keyframes fx-petal-drift {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.5); }
  20% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(var(--fx-dx, 40px), var(--fx-dy, 90px)) rotate(var(--fx-rot, 160deg)) scale(0.9); }
}

.fx-flare {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 1px solid rgba(255, 232, 194, 0.75);
  box-shadow: 0 0 22px rgba(240, 203, 158, 0.65);
  opacity: 0;
  animation: fx-flare-bloom 1.3s ease-out forwards;
}

@keyframes fx-flare-bloom {
  0% { opacity: 0; transform: scale(0.35); }
  30% { opacity: 0.95; }
  100% { opacity: 0; transform: scale(2.1); }
}

.portrait-stage.is-lyric-pulsed {
  animation: portrait-lyric-glow 1.2s ease-out;
}

@keyframes portrait-lyric-glow {
  0% { filter: drop-shadow(0 0 0 rgba(240, 203, 158, 0)); }
  35% { filter: drop-shadow(0 0 26px rgba(240, 203, 158, 0.45)); }
  100% { filter: drop-shadow(0 0 0 rgba(240, 203, 158, 0)); }
}

/* Sanctuary Wish Dialogs */
dialog.sanctuary-release-dialog,
dialog.sanctuary-catch-dialog,
dialog.sanctuary-log-dialog {
  width: min(92vw, 480px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #141524;
  color: var(--paper);
  padding: clamp(20px, 3vw, 28px);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.82);
}

.wish-release-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.wish-row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wish-field {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.wish-field input,
.wish-field select,
.wish-field textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 6px;
  border: 1px solid rgba(240, 203, 158, 0.28);
  background: rgba(10, 11, 20, 0.88);
  color: var(--ivory);
  font: inherit;
  font-size: 0.88rem;
}

.catch-rarity-badge {
  display: inline-flex;
  align-items: center;
  margin: 10px 0 8px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--rarity-color, #f0cb9e);
  color: var(--rarity-color, #f0cb9e);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.catch-message-body {
  margin: 8px 0 10px;
  padding-left: 14px;
  border-left: 2px solid rgba(240, 203, 158, 0.45);
  font: italic 1.12rem/1.5 var(--serif);
  color: #fff6e8;
}

.wish-log-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 52vh;
  overflow-y: auto;
  display: grid;
  gap: 10px;
}

.wish-log-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(240, 203, 158, 0.2);
  background: rgba(20, 22, 36, 0.72);
}

.wish-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ivory);
  font-size: 0.88rem;
}

.wish-log-rarity {
  font-size: 0.72rem;
  color: var(--rarity-color, #f0cb9e);
}

.wish-log-msg {
  margin: 6px 0 4px;
  font-size: 0.85rem;
  line-height: 1.42;
  color: var(--paper);
}

.wish-log-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .bloom-mote, .sakura-light { animation: none !important; }
  .bloom-mote { display: none; }
  .world-fish .fish-tail { animation: none !important; }
}

.world-droplet {
  position: absolute;
  width: 3px;
  height: 4px;
  border-radius: 60%;
  background: #eadad8;
}

.memory-echo {
  position: absolute;
  top: 48%;
  right: 15%;
  width: clamp(120px, 17vw, 260px);
  pointer-events: none;
  mix-blend-mode: screen;
  filter: brightness(0.75) saturate(0.92) blur(0.4px);
  opacity: 0.92;
  mask-image: radial-gradient(ellipse 66% 70% at 50% 46%, #000 28%, #000a 62%, transparent 88%);
  -webkit-mask-image: radial-gradient(ellipse 66% 70% at 50% 46%, #000 28%, #000a 62%, transparent 88%);
}

.memory-echo :is(svg, img) {
  display: block;
  width: 100%;
  border: 0;
}

.memory-echo .echo-reflection {
  position: absolute;
  inset: 100% auto auto 0;
  transform: scaleY(-0.58) skewX(var(--reflection-sway, 0deg));
  transform-origin: 0 25%;
  opacity: 0.28;
  filter: blur(1.4px);
  mask-image: linear-gradient(transparent, #000);
  -webkit-mask-image: linear-gradient(transparent, #000);
}

.progress-rail {
  position: fixed;
  z-index: 5;
  right: max(10px, env(safe-area-inset-right));
  top: 50%;
  translate: 0 -50%;
  width: 2px;
  height: 22vh;
  background: rgba(230, 198, 179, 0.14);
  border-radius: 2px;
}

body[data-chapter="water"] .progress-rail { visibility: hidden; }

.progress-rail span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 0;
  transform: scaleY(var(--progress, 0));
  background: linear-gradient(180deg, var(--scene-accent, #f3cfb4), #b57a90);
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   2. Masthead Navigation & Ambient Mode Chrome
   -------------------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: max(8px, env(safe-area-inset-top)) var(--frame) 8px;
  background: linear-gradient(180deg, rgba(16, 17, 27, 0.92) 0%, rgba(16, 17, 27, 0.68) 70%, rgba(16, 17, 27, 0) 100%);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.home {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 44px;
  text-decoration: none;
  font: 650 13px/1 var(--sans);
  letter-spacing: 0.14em;
  color: var(--ivory);
  white-space: nowrap;
}

.home span {
  color: var(--scene-accent, var(--gold));
  transition: color 0.5s ease;
}

.chapter-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
}

.chapter-nav .nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  color: var(--muted);
  position: relative;
  transition: color 0.2s ease;
}

.chapter-nav .nav-link:hover,
.chapter-nav .nav-link[aria-current="location"] {
  color: var(--ivory);
}

.chapter-nav .nav-link[aria-current="location"]::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 9px;
  height: 1px;
  background: var(--scene-accent, var(--gold));
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-button:hover {
  color: var(--ivory);
  background: rgba(233, 196, 155, 0.08);
}

.nav-button[aria-pressed="true"] {
  color: var(--gold);
  background: rgba(233, 196, 155, 0.12);
}

/* Ambient Mode: hides UI chrome so cosmos/lake + 3D floating lyrics + music shine */
body[data-ambient="true"] .masthead,
body[data-ambient="true"] main,
body[data-ambient="true"] .progress-rail {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

body[data-ambient="true"] .now-playing {
  opacity: 0.36;
  transition: opacity 0.35s ease;
}

body[data-ambient="true"] .now-playing:hover,
body[data-ambient="true"] .now-playing:focus-within,
body[data-ambient="true"] .now-playing[data-expanded="true"] {
  opacity: 1;
}

.ambient-exit {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* --------------------------------------------------------------------------
   3. Chapter I: Game-Showcase Cinematic Identity
   -------------------------------------------------------------------------- */
#title[tabindex="-1"]:focus {
  outline: none;
}

.identity {
  position: relative;
  display: grid;
  grid-template-columns: 52% 48%;
  align-items: center;
  min-height: calc(100svh - 72px);
  padding: 24px var(--frame) 110px;
}

.art-caption {
  position: absolute;
  left: var(--frame);
  bottom: 100px;
  display: grid;
  gap: 4px;
  color: #f6e4d9;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 5px #000;
  pointer-events: none;
}

.art-caption span + span {
  letter-spacing: 0;
  color: #e8cdd0;
}

.intro {
  grid-column: 2;
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0;
  max-width: 580px;
  padding-left: 4%;
}

.intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -38px -44px -34px -52px;
  background: radial-gradient(ellipse at 62% 42%, rgba(10, 9, 20, 0.3) 0%, rgba(10, 9, 20, 0.14) 48%, transparent 78%);
  pointer-events: none;
}

.identity-header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
}

.portrait-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 158px;
  aspect-ratio: 1;
  flex: none;
  perspective: 900px;
  animation: portrait-enter 650ms var(--ease-cinematic) both;
}

.portrait-stage::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 9% 35%, #ffe5ba 0 1px, transparent 1.8px),
    radial-gradient(circle at 24% 6%, #d6c5eb 0 1px, transparent 1.8px),
    radial-gradient(circle at 91% 30%, #f0cb9e 0 1.2px, transparent 2px),
    radial-gradient(circle at 80% 88%, #d6c5eb 0 1px, transparent 1.8px),
    radial-gradient(circle at 26% 93%, #ffe5ba 0 1px, transparent 1.8px);
  opacity: 0.68;
  pointer-events: none;
}

.portrait-stage::after {
  content: none;
}

.portrait-stage .seal {
  filter: drop-shadow(0 9px 18px rgba(4, 3, 10, 0.38));
  transition: transform 0.38s var(--ease-cinematic), filter 0.38s ease;
}

.portrait-stage .seal > :not(.portrait-inner):not(defs) { display: none; }

.portrait-stage:hover .seal {
  transform: translateY(-2px);
  filter: drop-shadow(0 12px 20px rgba(4, 3, 10, 0.42));
}

@keyframes portrait-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.owner-stack {
  display: grid;
  gap: 4px;
  justify-items: start;
  align-content: center;
  min-width: 0;
}

.owner-sign-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.19em;
  color: var(--gold);
  text-transform: uppercase;
}

.owner-glyph {
  font: 34px/1 var(--serif);
  color: var(--gold);
}

.owner-constellation {
  display: block;
  width: clamp(82px, 8vw, 112px);
  height: auto;
  overflow: visible;
}

.owner-constellation path {
  fill: none;
  stroke: rgba(240, 203, 158, 0.68);
  stroke-width: 0.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.owner-constellation circle { fill: #f5dab9; }
.owner-constellation .owner-star-main {
  fill: #fff0d4;
  filter: drop-shadow(0 0 3px rgba(240, 203, 158, 0.75));
}

dialog.sanctuary-owner-dialog {
  width: min(92vw, 480px);
  max-height: min(82dvh, 760px);
  overflow: auto;
  margin: auto;
  border: 1px solid rgba(240, 203, 158, 0.25);
  border-radius: 10px;
  background: #141524;
  color: var(--paper);
  padding: clamp(20px, 3vw, 28px);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.72);
}

dialog.sanctuary-owner-dialog::backdrop { background: rgba(4, 5, 12, 0.76); backdrop-filter: blur(6px); }

.identity .eyebrow.demo {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.19em;
  color: #cbb5bf;
  text-transform: uppercase;
}

.identity h1 {
  font-size: clamp(60px, 6.2vw, 98px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: var(--paper);
  text-shadow: 0 10px 40px rgba(5, 5, 12, 0.82);
}

.identity h1 i {
  font-weight: 400;
  color: var(--gold);
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.profile-meta > :not([hidden]) ~ :not([hidden])::before {
  content: "·";
  margin-right: 10px;
  color: var(--gold);
}

.profile-username {
  color: var(--muted);
}

.profile-motto {
  margin: 12px 0 0;
  color: #f3d4c6;
  font: italic 18px/1.35 var(--serif);
}

.identity .lede {
  max-width: 34ch;
  margin: 18px 0 0;
  padding-left: 14px;
  border-left: 1px solid rgba(240, 203, 158, 0.45);
  color: #f9ecdb;
  font: italic 400 clamp(19px, 1.8vw, 22.5px)/1.56 var(--serif);
  letter-spacing: 0.008em;
  text-shadow: 0 2px 14px rgba(8, 7, 16, 0.72);
}

.profile-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.profile-interests li {
  color: var(--muted);
  font-size: 13px;
}

.profile-interests li + li::before {
  content: "·";
  margin-right: 12px;
  color: var(--gold);
}

.profile-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 20px 0 0;
}

.profile-socials a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--paper);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.profile-socials a:hover,
.profile-socials a:focus-visible {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.profile-socials svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.actions.hero-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
}

.primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--gold);
  border-radius: 3px;
  background: var(--gold);
  color: #201925;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.primary:hover {
  background: #f9dfbf;
  border-color: #f9dfbf;
  color: #201925;
}

.secondary.hero-control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--paper);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.secondary.hero-control:hover {
  background: rgba(233, 196, 155, 0.08);
  border-color: var(--gold);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 12px;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  color: var(--scene-accent, var(--gold));
  font-size: 0.86rem;
  text-decoration: none;
  text-underline-offset: 4px;
}

.profile-links a:hover {
  color: var(--ivory);
  text-decoration: underline;
}

.identity-chapter-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
}

.profile-down,
.profile-sanctuary-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s ease;
}

.profile-down span,
.profile-sanctuary-link span { color: var(--scene-accent, var(--gold)); }
.profile-down:hover,
.profile-sanctuary-link:hover { color: var(--ivory); }

.secret-whisper {
  position: absolute;
  bottom: 6px;
  left: 50%;
  z-index: 4;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 12px;
  border: 1px solid rgba(255, 225, 181, 0.35);
  border-radius: 999px;
  background: rgba(10, 12, 24, 0.9);
  white-space: nowrap;
  color: var(--gold-bright);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.secret-whisper[data-visible="true"] {
  opacity: 1;
}

body[data-secret="awake"] .instrument.seal-trigger {
  filter: drop-shadow(0 0 28px rgba(255, 225, 181, 0.55));
}

.featured-memory-slot {
  width: fit-content;
  max-width: 100%;
  margin: 2px 0 18px;
}

.featured-memory-card {
  width: auto;
  max-width: min(100%, 440px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 8px;
  border: 1px solid rgba(228, 191, 147, 0.24);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(14, 16, 30, 0.76), rgba(10, 11, 22, 0.62));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.featured-memory-card:hover {
  border-color: var(--scene-accent, var(--gold));
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(4, 4, 12, 0.55), 0 0 20px var(--scene-glow, rgba(228, 191, 147, 0.16));
}

.featured-memory-thumb {
  width: 44px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  flex: none;
  border: 1px solid rgba(228, 191, 147, 0.28);
}

.featured-memory-info {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.featured-memory-kicker {
  color: var(--scene-accent, var(--gold));
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.featured-memory-title {
  color: var(--ivory);
  font: 500 0.96rem/1.2 var(--serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.featured-memory-meta {
  color: var(--muted);
  font-size: 0.74rem;
}

.featured-memory-arrow {
  color: var(--scene-accent, var(--gold));
  font-size: 1rem;
}

/* Portrait Medallion Animations */
.instrument.seal-trigger {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--py, 0) * -3deg)) rotateY(calc(var(--px, 0) * 3deg));
  transition: transform 0.2s ease-out, filter 0.4s ease;
}

.instrument::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  box-shadow:
    0 28px 80px rgba(6, 5, 14, 0.78),
    0 0 42px var(--scene-rim, rgba(206, 218, 245, 0.24)),
    0 0 38px rgb(239 178 152 / calc(var(--score-accent, 0) * 0.36));
  pointer-events: none;
}

.instrument::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -16%;
  height: 24%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 46%, var(--scene-glow, rgba(229, 185, 160, 0.24)), transparent 72%);
  filter: blur(16px);
  pointer-events: none;
}

.seal {
  position: relative;
  display: block;
  width: 100%;
  filter: drop-shadow(0 18px 34px rgba(4, 3, 10, 0.72));
}

.portrait-inner {
  transform: translate(calc(var(--px, 0) * 5px), calc(var(--py, 0) * 5px));
  transition: transform 0.2s ease-out;
}

.portrait-spec {
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle at calc(50% + var(--px, 0) * 28%) calc(38% + var(--py, 0) * 28%),
    rgba(255, 232, 206, 0.16),
    transparent 56%
  );
  mix-blend-mode: screen;
}

.orbit-far,
.orbit-near { opacity: 0.48; }
.seal-pulse { opacity: 0; transform-origin: 50% 50%; }

.entry-orbit,
.ornament-orbit,
.ornament-chart,
.ornament-sweep {
  pointer-events: none;
  transform-origin: 50% 50%;
  transform-box: view-box;
  opacity: 0;
}

.entry-orbit circle { stroke-dasharray: 24 76; }
.entry-orbit circle + circle { stroke-dasharray: 8 92; stroke-dashoffset: -54; }
.living .orbit-near { stroke-dasharray: 21 79; animation: orbit-travel 24s linear infinite; }
.living .ornament-orbit { animation: orbital-drift 37s linear infinite, rim-breath 13s ease-in-out infinite alternate; }
.living .orbit-far { animation: rim-breath 17s ease-in-out infinite alternate-reverse; }

.identity[data-opening="playing"] .entry-orbit { animation: entry-release 2.4s var(--ease-cinematic) both; }
.identity[data-opening="playing"] .ornament-chart { animation: entry-chart 2.2s ease-in-out both; }
.identity[data-opening="playing"] .intro > * { animation: arrival-rise 0.85s var(--ease-cinematic) both; }
.identity[data-opening="playing"] .intro > *:nth-child(2) { animation-delay: 0.08s; }
.identity[data-opening="playing"] .intro > *:nth-child(3) { animation-delay: 0.14s; }
.identity[data-opening="playing"] .intro > *:nth-child(4) { animation-delay: 0.2s; }
.identity[data-opening="playing"] .intro > *:nth-child(5) { animation-delay: 0.26s; }
.identity[data-opening="playing"] .intro > *:nth-child(6) { animation-delay: 0.32s; }
.identity[data-opening="playing"] .intro > *:nth-child(7) { animation-delay: 0.38s; }
.identity[data-opening="playing"] .intro > *:nth-child(8) { animation-delay: 0.44s; }

@keyframes arrival-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.seal-awake .seal-pulse { animation: seal-release 1.18s both; }
.seal-awake .bezel { transform-origin: 50% 50%; animation: bezel-response 1.18s both; }
.instrument[data-ornament="sweep"] .ornament-sweep,
.instrument[data-ornament="signature"] .ornament-sweep { animation: ornament-sweep 2.45s cubic-bezier(0.3, 0.49, 0.22, 1) both; }
.instrument[data-ornament="chart"] .ornament-chart { animation: entry-chart 3.2s ease-in-out both; }
.instrument[data-ornament="signature"] .ornament-chart { animation: signature-chart 3.35s ease-in-out both; }
.instrument[data-ornament="signature"] .seal-pulse { animation: seal-release 2.1s both; }

.instrument.ornament-offscreen :is(.ornament-orbit, .orbit-far, .orbit-near),
body[data-calm="true"] :is(.ornament-orbit, .orbit-far, .orbit-near),
.world-environment[data-calm="true"] .sakura-bough {
  animation-play-state: paused;
}

@keyframes orbit-travel {
  from { stroke-dashoffset: 100; opacity: 0.2; }
  50% { opacity: 0.78; }
  to { stroke-dashoffset: 0; opacity: 0.2; }
}
@keyframes orbital-drift { to { transform: rotate(360deg); } }
@keyframes rim-breath { from { opacity: 0.22; } to { opacity: 0.64; } }
@keyframes entry-release {
  0% { opacity: 0; transform: rotate(-92deg) scale(1.16); }
  22% { opacity: 0.9; }
  64% { opacity: 0.95; transform: rotate(10deg) scale(1); }
  100% { opacity: 0; transform: rotate(28deg) scale(1); }
}
@keyframes entry-chart {
  0%, 100% { opacity: 0; transform: rotate(-9deg) scale(1.025); }
  30%, 65% { opacity: 0.88; transform: rotate(0) scale(1); }
}
@keyframes ornament-sweep {
  0% { opacity: 0; transform: rotate(-127deg); }
  31%, 63% { opacity: 0.95; }
  100% { opacity: 0; transform: rotate(167deg); }
}
@keyframes signature-chart {
  0%, 100% { opacity: 0; transform: rotate(18deg) scale(1.09); }
  32%, 68% { opacity: 1; transform: rotate(-3deg) scale(1); }
}
@keyframes seal-release {
  0%, 12% { transform: scale(0.985); opacity: 0; }
  24% { transform: scale(1.03); opacity: 0.88; }
  68% { transform: scale(1.3); opacity: 0.3; }
  100% { transform: scale(1.38); opacity: 0; }
}
@keyframes bezel-response {
  0%, 100% { transform: rotate(0); }
  14% { transform: rotate(-3deg); }
  38% { transform: rotate(6deg); }
  74% { transform: rotate(-0.9deg); }
}

/* --------------------------------------------------------------------------
   4. Borderless Floating 3D Spatial Lyrics World (#lyrica-world)
   -------------------------------------------------------------------------- */
.lyrica-world {
  position: fixed;
  inset: 0;
  z-index: 22;
  pointer-events: none;
  perspective: 1150px;
  transform-style: preserve-3d;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
}

body[data-sanctuary="open"] .lyrica-world { z-index: 69; }

.lyrica-world[data-enabled="true"][data-active="true"] {
  opacity: 1;
}

.lyrica-thread-svg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.lyrica-phrase {
  --pos-x: 50%;
  --pos-y: 78%;
  --phrase-max-w: 52vw;
  --beat: 0;
  position: absolute;
  left: var(--pos-x);
  top: var(--pos-y);
  transform: translate3d(-50%, -50%, 0);
  width: max-content;
  max-width: var(--phrase-max-w);
  display: grid;
  gap: 4px;
  background: transparent;
  border: 0;
  padding: 6px 14px;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
  transition: left 0.65s var(--ease-cinematic), top 0.65s var(--ease-cinematic);
}

/* Soft borderless obsidian halo behind lyrics for legible contrast over sunlit clouds */
.lyrica-phrase::before {
  content: "";
  position: absolute;
  inset: -14px -28px;
  z-index: -1;
  border-radius: 999px;
  background: radial-gradient(ellipse at 50% 52%, rgba(10, 11, 22, 0.72) 0%, rgba(10, 11, 22, 0.36) 54%, transparent 78%);
  filter: blur(10px);
  pointer-events: none;
}

.lyrica-phrase[data-align="left"] { text-align: left; justify-items: start; }
.lyrica-phrase[data-align="center"] { text-align: center; justify-items: center; }
.lyrica-phrase[data-align="right"] { text-align: right; justify-items: end; }

.lyrica-kicker {
  color: var(--scene-accent, var(--gold));
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.78;
  text-shadow: 0 2px 12px rgba(4, 5, 12, 0.92);
}

.lyrica-3d-line {
  margin: 0;
  font: clamp(20px, 2.35vw, 34px)/1.22 var(--serif);
  color: rgba(245, 234, 220, 0.34);
  text-shadow:
    0 6px 26px rgba(4, 5, 12, 0.94),
    0 2px 10px rgba(4, 5, 12, 0.9);
  transform-style: preserve-3d;
}

.lyrica-3d-line.is-split {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 28px;
  width: min(56vw, 720px);
}

body[data-ambient="true"] .lyrica-3d-line.is-split {
  width: min(76vw, 940px);
}

/* Short rolling word window: chunks stack in one grid cell so only the
   active few words occupy space, while the previous chunk drifts aside. */
.lyrica-3d-line.is-chunked {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 1.3em;
}

.lyrica-3d-line.is-chunked.is-split {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 22px;
  width: auto;
  max-width: var(--phrase-max-w);
}

.lyrica-3d-line.is-chunked.is-split .lyrica-chunk {
  grid-area: auto;
  opacity: 0.42;
  filter: none;
  transform: translate3d(0, 0, -18px) scale(0.96);
}

.lyrica-3d-line.is-chunked.is-split .lyrica-chunk.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 16px) scale(1.06);
}

.lyrica-3d-line.is-chunked.is-split .lyrica-chunk.is-past {
  opacity: 0.56;
  filter: none;
  transform: translate3d(calc(var(--exit-x, -12px) * 0.25), -2px, -12px) scale(0.96);
}

.lyrica-chunk {
  --slot-x: 0px;
  --slot-y: 0px;
  grid-area: 1 / 1;
  display: inline-block;
  opacity: 0;
  filter: blur(6px);
  transform: translate3d(calc(var(--slot-x) + var(--enter-x, 30px)), calc(var(--slot-y) + 10px), -60px) scale(0.94);
  transform-style: preserve-3d;
  transition:
    opacity 1.5s cubic-bezier(0.2, 0.6, 0.3, 1),
    transform 1.7s var(--ease-cinematic),
    filter 1.5s ease;
  will-change: opacity, transform, filter;
}

.lyrica-chunk.is-active {
  opacity: 1;
  filter: none;
  transform: translate3d(var(--slot-x), var(--slot-y), 0) scale(1);
  transition-duration: 0.8s, 0.95s, 0.8s;
}

/* The outgoing phrase keeps drifting and dissolving instead of vanishing
   the instant the next one arrives. */
.lyrica-chunk.is-past {
  opacity: 0;
  filter: blur(8px);
  transform: translate3d(calc(var(--slot-x) + var(--exit-x, -40px)), calc(var(--slot-y) - 18px), -140px) scale(0.86);
  transition-duration: 1.7s, 1.9s, 1.7s;
}

/* Rapid passages: short, crisp hand-offs instead of a long blurry trail. */
.lyrica-chunk[data-pace="fast"] {
  transition-duration: 0.42s, 0.48s, 0.42s;
}

.lyrica-chunk[data-pace="fast"].is-past {
  filter: blur(4px);
  transform: translate3d(calc(var(--slot-x) + var(--exit-x, -20px)), calc(var(--slot-y) - 8px), -70px) scale(0.94);
  transition-duration: 0.34s, 0.4s, 0.34s;
}

.lyrica-chunk[data-pace="mid"] {
  transition-duration: 0.9s, 1s, 0.9s;
}

.lyrica-chunk[data-pace="mid"].is-past {
  transition-duration: 0.85s, 0.95s, 0.85s;
}

.lyrica-chunk[data-side="left"] { justify-self: start; text-align: left; }
.lyrica-chunk[data-side="right"] { justify-self: end; text-align: right; }
.lyrica-chunk[data-side="center"] { justify-self: center; text-align: inherit; }

.lyrica-wing {
  display: inline-block;
  transform-style: preserve-3d;
}

.lyrica-wing-left {
  transform: translateZ(14px) rotateY(8deg);
}

.lyrica-wing-right {
  transform: translateZ(24px) rotateY(-8deg);
}

.lyrica-3d-word {
  display: inline-block;
  opacity: 0.24;
  color: rgba(248, 238, 224, 0.56);
  text-shadow: 0 2px 12px rgba(4, 5, 12, 0.96), 0 0 6px rgba(4, 5, 12, 0.92);
  transform-style: preserve-3d;
  transition:
    opacity 0.28s ease,
    color 0.22s ease,
    transform 0.28s var(--ease-cinematic),
    text-shadow 0.28s ease;
}

.lyrica-3d-word.is-lit {
  opacity: 1;
  color: #fff6ea;
  transform: translateZ(14px);
  text-shadow:
    0 2px 14px rgba(4, 5, 12, 0.98),
    0 4px 24px rgba(4, 5, 12, 0.95),
    0 0 calc(18px + 20px * var(--beat, 0)) rgba(240, 203, 158, 0.58);
}

.lyrica-3d-word.is-current {
  opacity: 1;
  color: #ffe3b8;
  transform: translateZ(26px) scale(1.07);
  text-shadow:
    0 2px 14px rgba(4, 5, 12, 0.98),
    0 0 26px rgba(255, 225, 178, 0.78);
}

.lyrica-3d-word.is-emphasis.is-lit {
  color: var(--gold-bright);
  font-style: italic;
  transform: translateZ(28px) scale(1.09);
  text-shadow:
    0 0 28px rgba(255, 225, 181, 0.68),
    0 4px 22px rgba(4, 5, 12, 0.95);
}

.lyrica-style-intimate-whisper .lyrica-3d-line,
.lyrica-style-whispered .lyrica-3d-line,
.lyrica-motion-restrained-reflection .lyrica-3d-line,
.lyrica-motion-elegant-dissolve .lyrica-3d-line {
  font-style: italic;
  font-size: clamp(19px, 2.05vw, 28px);
  letter-spacing: 0.02em;
}

.lyrica-motion-cinematic-tracking .lyrica-3d-line {
  letter-spacing: calc((1 - var(--enter, 1)) * 0.14em);
}

.lyrica-motion-restrained-reflection .lyrica-3d-line {
  -webkit-box-reflect: below 2px linear-gradient(transparent 55%, rgba(255, 240, 224, 0.14));
}

.lyrica-motion-beat-pulse .lyrica-3d-word.is-current,
.lyrica-style-kinetic-pulse .lyrica-3d-word.is-current {
  transform: translateZ(calc(24px + 18px * var(--beat, 0))) scale(calc(1.06 + 0.08 * var(--beat, 0)));
}

.lyrica-motion-keyword-impact .lyrica-3d-word.is-emphasis.is-lit {
  letter-spacing: 0.03em;
  transform: translateZ(34px) scale(1.13);
}

.lyrica-phrase.is-minimal .lyrica-3d-line {
  font-size: clamp(15px, 1.45vw, 20px);
  line-height: 1.25;
}

.lyrica-phrase.is-minimal .lyrica-3d-word {
  opacity: 0.92;
  transform: none;
  text-shadow: 0 2px 12px rgba(4, 5, 12, 0.94);
}

.lyrica-3d-sub {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 12px rgba(4, 5, 12, 0.9);
}

/* --------------------------------------------------------------------------
   5. Chapter II: Real Spatial 3D Memory Universe (#archive)
   -------------------------------------------------------------------------- */
.archive {
  position: relative;
  padding: max(84px, 8vh) var(--frame) clamp(56px, 8vh, 88px);
  border-top: 1px solid rgba(228, 191, 147, 0.14);
}

.archive-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.archive-heading h2 {
  font-size: clamp(38px, 5.4vw, 72px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  color: var(--ivory);
}

.memory-description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.memory-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.memory-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(240, 203, 158, 0.25);
  background: rgba(14, 16, 28, 0.72);
}

.memory-mode-btn {
  border-color: transparent;
  background: transparent;
}

.memory-control {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  font-size: 0.78rem;
}

.memory-collections {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  max-width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.memory-collections::-webkit-scrollbar {
  display: none;
}

.memory-collection-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(240, 203, 158, 0.22);
  background: rgba(12, 14, 26, 0.68);
  color: var(--paper);
  font: 500 0.78rem/1 var(--sans);
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.memory-collection-pill:hover {
  border-color: rgba(245, 206, 150, 0.56);
  background: rgba(24, 22, 42, 0.85);
}

.memory-collection-pill.is-active,
.memory-collection-pill[aria-selected="true"] {
  border-color: var(--scene-accent, var(--gold-bright));
  background: rgba(240, 203, 158, 0.16);
  color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(240, 203, 158, 0.14);
}

.memory-collection-count {
  font-size: 0.68rem;
  opacity: 0.72;
}

.memory-node[hidden] {
  display: none !important;
}

/* Fullscreen Memory Universe */
.archive.is-fullscreen,
.archive:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) clamp(18px, 3vw, 40px) max(14px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 42%, rgba(20, 18, 34, 0.96), rgba(7, 9, 18, 0.99));
  border-top: 0;
  overflow: hidden;
}

.archive.is-fullscreen .memory-universe-stage.is-universe,
.archive:fullscreen .memory-universe-stage.is-universe {
  flex: 1;
  height: auto;
  min-height: 0;
}

.archive.is-fullscreen .archive-heading,
.archive:fullscreen .archive-heading {
  margin-bottom: 12px;
}

.archive.is-fullscreen .archive-footer-bar,
.archive:fullscreen .archive-footer-bar {
  margin-top: 12px;
}

.memory-universe-stage {
  position: relative;
  width: 100%;
  border: 1px solid rgba(228, 191, 147, 0.16);
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 45%, rgba(20, 22, 42, 0.45), rgba(7, 9, 18, 0.62));
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.memory-universe-stage.is-universe {
  height: clamp(460px, 68svh, 680px);
  touch-action: pan-y;
  cursor: grab;
}

.memory-universe-stage.is-slider {
  height: clamp(470px, 64svh, 580px);
  border-color: transparent;
  background: transparent;
  border-radius: 0;
  touch-action: pan-y;
  cursor: grab;
}

.memory-universe-stage.is-slider .memory-node {
  width: clamp(220px, 24vw, 272px);
  padding: 9px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(16, 18, 34, 0.92), rgba(9, 11, 22, 0.96));
  transition: transform 0.54s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.42s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.memory-universe-stage.is-slider .memory-node .plate-title {
  display: block;
  font-size: 1rem;
  white-space: normal;
}

.memory-universe-stage.is-slider .memory-node .plate-meta {
  display: block;
}

.archive.is-fullscreen .memory-universe-stage.is-universe,
.archive:fullscreen .memory-universe-stage.is-universe,
.archive.is-fullscreen .memory-universe-stage.is-slider,
.archive:fullscreen .memory-universe-stage.is-slider {
  flex: 1;
  height: auto;
  min-height: 0;
  touch-action: none;
}

.memory-universe-stage.is-universe.is-dragging,
.memory-universe-stage.is-slider.is-dragging {
  cursor: grabbing;
}

.memory-threads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.memory-universe-stage.is-slider .memory-threads,
.memory-universe-stage.is-grid .memory-threads {
  display: none;
}

.memory-space {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1100px;
  transform-style: preserve-3d;
}

/* Spatial Memory Atlas: lightweight distant star-nodes + one dominant focused memory */
.memory-node {
  position: absolute;
  left: 0;
  top: 0;
  width: 132px;
  padding: 5px;
  border: 1px solid rgba(228, 191, 147, 0.24);
  border-radius: 10px;
  background: rgba(10, 12, 24, 0.88);
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transform-style: preserve-3d;
  box-shadow: 0 14px 36px rgba(4, 4, 12, 0.72);
  transition: width 0.42s var(--ease-cinematic), padding 0.42s var(--ease-cinematic), border-color 0.25s ease, box-shadow 0.25s ease;
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-select: none;
}

.memory-node.is-focused {
  width: clamp(210px, 21vw, 256px);
  padding: 8px;
  border-radius: 14px;
  border-color: var(--scene-accent, var(--gold-bright));
  background: rgba(12, 14, 28, 0.96);
  box-shadow:
    0 28px 72px rgba(4, 4, 12, 0.92),
    0 0 32px var(--scene-glow, rgba(228, 191, 147, 0.3));
}

.memory-node-frame {
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  background: radial-gradient(circle at 50% 42%, rgba(28, 24, 46, 0.85), rgba(8, 10, 20, 0.96));
}

.memory-node:hover {
  border-color: var(--scene-accent, var(--gold-bright));
}

.memory-node-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.memory-video-badge {
  position: absolute;
  bottom: 7px;
  right: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(8, 10, 20, 0.82);
  border: 1px solid rgba(240, 203, 158, 0.35);
  color: var(--ivory);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.memory-featured-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(8, 10, 20, 0.82);
  border: 1px solid rgba(228, 191, 147, 0.45);
  color: var(--gold-bright);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.memory-node:not(.is-focused) .memory-featured-tag {
  display: none;
}

.memory-node-caption {
  display: grid;
  gap: 2px;
  padding: 6px 3px 1px;
  text-shadow: 0 4px 16px rgba(4, 5, 12, 0.92);
  transition: opacity 0.22s ease;
}

.memory-node[data-label-hidden="true"] .memory-node-caption {
  opacity: 0;
  pointer-events: none;
}

.plate-meta,
.plate-caption,
.plate-open-hint {
  display: none;
}

.memory-node.is-focused .plate-meta,
.memory-node.is-focused .plate-caption,
.memory-node.is-focused .plate-open-hint,
.memory-universe-stage.is-grid .plate-meta,
.memory-universe-stage.is-grid .plate-caption {
  display: block;
}

.plate-meta {
  color: var(--scene-accent, var(--gold));
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.plate-title {
  font: 0.88rem/1.2 var(--serif);
  color: var(--ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memory-node.is-focused .plate-title,
.memory-universe-stage.is-grid .plate-title {
  font-size: 1.15rem;
  white-space: normal;
}

.plate-caption {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.plate-open-hint {
  margin-top: 3px;
  color: var(--gold-bright);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Grid Fallback View */
.memory-universe-stage.is-grid {
  height: auto;
  padding: 20px;
}

.memory-universe-stage.is-grid .memory-space {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  height: auto;
}

.memory-universe-stage.is-grid .memory-node {
  position: relative;
  width: 100%;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.memory-text-plate {
  display: grid;
  place-content: center;
  gap: 10px;
  aspect-ratio: 16 / 10;
  padding: 20px;
  background: radial-gradient(circle at 50% 35%, rgba(62, 43, 66, 0.55), rgba(14, 15, 28, 0.9));
  text-align: center;
}

.memory-kind {
  color: var(--gold);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.memory-text-plate p {
  margin: 0;
  font: italic 1rem/1.45 var(--serif);
  color: var(--ivory);
}

.archive-footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.archive-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.archive-position {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.toward-water {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--scene-accent, var(--gold));
  font-size: 0.88rem;
  text-decoration: none;
  text-underline-offset: 5px;
}

.toward-water:hover { color: var(--ivory); text-decoration: underline; }

/* --------------------------------------------------------------------------
   6. Optional Fullscreen Environment: Sanctuary (Independent WebGL2 Lake)
   -------------------------------------------------------------------------- */
html.sanctuary-locked {
  overflow: hidden;
}

.sanctuary-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(28px, env(safe-area-inset-top)) var(--frame) max(96px, calc(84px + env(safe-area-inset-bottom)));
  background: #060812;
  isolation: isolate;
  overflow: hidden;
}

body[data-sanctuary="open"] .masthead,
body[data-sanctuary="open"] main,
body[data-sanctuary="open"] .progress-rail {
  visibility: hidden;
  pointer-events: none;
}

.np-lyric-modes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.np-lyric-modes .scene-button {
  min-height: 36px;
  padding: 0 9px;
  font-size: 0.72rem;
}

.sanctuary-copy {
  position: relative;
  z-index: 6;
  max-width: 520px;
}

.sanctuary-koi-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.sanctuary-koi-tag {
  position: absolute;
  left: var(--koi-x, 30%);
  top: var(--koi-y, 62%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(240, 203, 158, 0.42);
  background: rgba(14, 16, 30, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff3e2;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(4, 5, 14, 0.55);
  animation: koi-tag-glide var(--koi-dur, 12s) ease-in-out infinite alternate;
  animation-delay: var(--koi-delay, 0s);
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.sanctuary-koi-tag:hover {
  border-color: var(--koi-tint, #f0cb9e);
  background: rgba(28, 26, 46, 0.9);
  transform: scale(1.06);
}

.koi-lantern-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--koi-tint, #f0cb9e);
  box-shadow: 0 0 10px var(--koi-tint, #f0cb9e);
}

@keyframes koi-tag-glide {
  from { transform: translate(-18px, -6px); }
  to { transform: translate(22px, 8px); }
}

.wish-status {
  margin: 8px 0 0;
  min-height: 1.3em;
  color: var(--gold, #f0cb9e);
  font-size: 0.85rem;
}

.sanctuary-copy h2 {
  font-size: clamp(46px, 7.4vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--ivory);
  text-shadow: 0 8px 30px rgba(6, 6, 14, 0.85);
}

.sanctuary-copy p {
  margin: 14px 0 0;
  max-width: 34ch;
  color: var(--paper);
  font-size: 1rem;
  text-shadow: 0 2px 16px rgba(6, 6, 14, 0.85);
}

.sanctuary-controls {
  position: relative;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.return-profile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(14, 16, 30, 0.78);
  color: var(--gold);
  font-size: 0.85rem;
  text-decoration: none;
}

.return-profile:hover { border-color: var(--gold); color: var(--ivory); }

/* --------------------------------------------------------------------------
   7. Compact Persistent Now Playing Dock (Progressive Disclosure)
   -------------------------------------------------------------------------- */
.now-playing {
  --beat: 0;
  position: fixed;
  z-index: 32;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(calc(100vw - 32px), 356px);
  border: 1px solid rgba(240, 203, 158, 0.28);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(25, 22, 39, 0.92), rgba(12, 13, 24, 0.96));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 242, 220, 0.14),
    0 18px 46px rgba(4, 4, 12, 0.76),
    0 0 calc(24px * var(--beat)) var(--scene-glow, rgba(228, 191, 147, 0.28));
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.now-playing[data-playing="true"] {
  border-color: rgba(240, 203, 158, 0.44);
}

.np-thin-progress {
  width: 100%;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.08);
}

.np-thin-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--scene-accent, var(--gold)), #fff6e6);
}

.now-playing-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 9px 8px 11px;
}

.np-cover {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgba(240, 203, 158, 0.42);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transform: scale(calc(1 + var(--beat, 0) * 0.07));
  transition: transform 0.14s ease-out;
}

.np-cover-img,
.np-cover-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.np-meta {
  display: grid;
  flex: 1;
  min-width: 0;
}

.np-title {
  color: var(--ivory);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  color: var(--muted);
  font-size: 0.71rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-play,
.np-expand {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(228, 191, 147, 0.1);
  color: var(--ivory);
  cursor: pointer;
  font-size: 0.88rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.np-play {
  background: var(--scene-accent, var(--gold));
  border-color: var(--scene-accent, var(--gold));
  color: #16101c;
  font-weight: 700;
}

.now-playing[data-autoplay-blocked="true"] .np-play {
  animation: seal-release 1.8s ease-in-out infinite;
  box-shadow: 0 0 22px rgba(255, 214, 162, 0.65);
}

.now-playing[data-autoplay-blocked="true"] .np-artist::after {
  content: " · Tap ▶ to play sound";
  color: var(--gold-bright);
}

.np-expand:hover {
  border-color: var(--scene-accent, var(--gold));
}

.now-playing-drawer {
  display: grid;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(228, 191, 147, 0.16);
}

.np-drawer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.np-drawer-controls {
  flex-wrap: wrap;
}

.np-drawer-controls .scene-button {
  min-height: 44px;
  padding: 0 11px;
  font-size: 0.74rem;
}

.np-seek,
.np-volume {
  --played: 0%;
  flex: 1;
  min-width: 0;
  height: 24px;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  cursor: pointer;
}

.np-seek::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-bright) var(--played), rgba(255, 255, 255, 0.22) var(--played));
}
.np-seek::-moz-range-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-bright) var(--played), rgba(255, 255, 255, 0.22) var(--played));
}
.np-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--ivory);
  border: 2px solid var(--void);
}
.np-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--void);
  border-radius: 50%;
  background: var(--ivory);
}

.np-time {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.np-vol,
.np-style-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
}

.np-vol input {
  width: 56px;
  accent-color: var(--gold);
}

.np-style-select {
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 16, 30, 0.9);
  color: var(--ivory);
  font-size: 0.75rem;
}

.np-drawer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.np-act-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(240, 203, 158, 0.32);
  background: rgba(240, 203, 158, 0.08);
  color: #f8dfb0;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.np-lyric-status {
  margin: 0;
  font-size: 0.69rem;
  letter-spacing: 0.03em;
  color: rgba(240, 203, 158, 0.72);
}

/* Subtle non-blocking 5-act soundtrack luminescence across the page */
body[data-soundtrack-act="shore"] .portrait-stage::after {
  box-shadow: 0 0 28px rgba(186, 208, 245, 0.22);
}

body[data-soundtrack-act="awakening"] .portrait-stage {
  filter: drop-shadow(0 0 22px rgba(240, 203, 158, 0.24));
}

body[data-soundtrack-act="collision"] .portrait-stage {
  filter: drop-shadow(0 0 26px rgba(235, 166, 178, 0.28));
}

body[data-soundtrack-act="afterglow"] .portrait-stage {
  filter: drop-shadow(0 0 14px rgba(180, 196, 232, 0.16));
}

/* --------------------------------------------------------------------------
   8. Accessible Modals (Connect, Share Card, Memory Viewer, LRC Studio)
   -------------------------------------------------------------------------- */
dialog.connect-dialog,
dialog.share-dialog,
dialog.memory-viewer,
dialog.lrc-dialog {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #171824;
  color: var(--paper);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.78);
}

dialog::backdrop {
  background: rgba(7, 8, 18, 0.74);
  backdrop-filter: blur(8px);
}

.connect-dialog,
.share-dialog {
  width: min(92vw, 500px);
}

.connect-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.connect-name { font-size: 1.7rem; color: var(--ivory); }
.connect-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; }

.connect-socials { display: grid; gap: 8px; }
.connect-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 24, 42, 0.56);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.connect-row:hover { border-color: var(--gold); background: rgba(38, 34, 56, 0.78); }
.connect-icon { display: grid; place-items: center; width: 24px; height: 24px; color: var(--gold); }
.connect-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.connect-text { display: grid; flex: 1; }
.connect-text strong { color: var(--ivory); font-size: 0.92rem; font-weight: 500; }
.connect-text small { color: var(--muted); font-size: 0.78rem; }
.connect-arrow { color: var(--gold); }

.connect-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.connect-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.82rem;
  text-decoration: none;
}

.share-format-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.share-preview-frame {
  position: relative;
  min-height: 210px;
  border: 1px solid rgba(228, 191, 147, 0.26);
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, rgba(36, 28, 52, 0.65), #080a14);
  display: grid;
  place-items: center;
}

.share-preview-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  color: var(--gold, #f0cb9e);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.share-preview-frame.is-loading .share-preview-loader {
  display: flex;
}

.share-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(240, 203, 158, 0.22);
  border-top-color: var(--gold, #f0cb9e);
  animation: astral-spin 0.9s linear infinite;
}

@keyframes astral-spin {
  to { transform: rotate(360deg); }
}

.share-preview-img {
  display: block;
  max-width: 100%;
  max-height: 46vh;
  object-fit: contain;
}

.share-preview-img[hidden] {
  display: none;
}

.share-status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--gold);
  font-size: 0.84rem;
}

dialog.memory-viewer {
  width: min(92vw, 880px);
  max-height: 88vh;
  padding: 0;
  border: 1px solid rgba(240, 203, 158, 0.28);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(17, 19, 34, 0.96), rgba(9, 11, 20, 0.98));
  color: var(--paper);
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.85), 0 0 48px rgba(240, 203, 158, 0.08);
  overflow: hidden;
}

dialog.memory-viewer::backdrop {
  background: rgba(4, 6, 14, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

dialog.memory-viewer[open] {
  animation: modal-pop-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

dialog.memory-viewer[open]::backdrop {
  animation: modal-backdrop-in 0.3s ease both;
}

@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.memory-viewer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(240, 203, 158, 0.14);
}

.memory-viewer-nav {
  display: flex;
  gap: 8px;
}

.memory-full {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: stretch;
  max-height: calc(88vh - 70px);
  overflow-y: auto;
}

.memory-full.is-switching {
  animation: modal-switch 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modal-switch {
  from {
    opacity: 0.35;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.viewer-media-stage {
  display: grid;
  place-items: center;
  padding: 18px;
  background: radial-gradient(circle at 50% 45%, rgba(28, 24, 48, 0.65), rgba(5, 7, 15, 0.95));
  min-height: 260px;
}

.viewer-media-stage :is(svg, img, video) {
  display: block;
  width: 100%;
  max-height: 64vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
}

.memory-full figcaption {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: clamp(20px, 3vw, 32px);
}

.viewer-collection-badge {
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(240, 203, 158, 0.34);
  background: rgba(240, 203, 158, 0.12);
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.viewer-title {
  margin: 0;
  font: 500 clamp(1.5rem, 2.4vw, 2rem)/1.18 var(--serif);
  color: var(--ivory);
}

.viewer-story {
  margin: 6px 0 0;
  padding-left: 12px;
  border-left: 2px solid rgba(240, 203, 158, 0.45);
  color: var(--paper);
  font: italic 1.02rem/1.55 var(--serif);
}

.lrc-dialog { width: min(92vw, 560px); }
.lrc-dialog:not([open]),
.share-dialog:not([open]) { display: none; }

.lrc-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(8, 10, 18, 0.88);
  color: var(--ivory);
  font: 0.86rem/1.5 ui-monospace, Consolas, monospace;
  resize: vertical;
}
.lrc-feedback { min-height: 1.4em; margin: 8px 0 0; color: var(--gold); font-size: 0.84rem; }
.lrc-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.lrc-tap-tools {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(228, 191, 147, 0.2);
  border-radius: 9px;
  background: rgba(12, 14, 26, 0.72);
}
.lrc-tap-row { display: flex; flex-wrap: wrap; gap: 8px; }
.lrc-tap-hit { border-color: rgba(228, 191, 147, 0.5); color: var(--gold-bright); }
.lrc-tap-hit kbd {
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid rgba(228, 191, 147, 0.35);
  border-radius: 4px;
  background: rgba(228, 191, 147, 0.1);
  font: 0.7em ui-monospace, Consolas, monospace;
}
.lrc-tap-status {
  min-height: 1.3em;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.lrc-nudge-row {
  align-items: center;
  margin-top: 9px;
}

.lrc-nudge-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lrc-nudge-value {
  min-width: 54px;
  color: var(--gold-bright);
  font: 0.82rem ui-monospace, Consolas, monospace;
  text-align: center;
}

/* --------------------------------------------------------------------------
   9. Responsive Breakpoints (Tablet & Mobile Composition)
   -------------------------------------------------------------------------- */
@media (min-width: 1920px) {
  .intro {
    max-width: 600px;
  }
}

@media (max-width: 1099px) and (orientation: portrait) {
  .identity {
    grid-template-columns: 1fr;
    align-content: start;
    min-height: auto;
    padding: 0 var(--frame) 128px;
  }

  .art-caption {
    display: none;
  }

  .intro {
    grid-column: 1;
    padding-left: 0;
    padding-top: 34svh;
    max-width: 600px;
  }

  .portrait-stage {
    width: 136px;
  }
}

@media (max-width: 760px) {
  .masthead {
    flex-wrap: nowrap;
    min-height: 56px;
    gap: 6px;
    padding-inline: var(--frame);
  }
  .home {
    font-size: 12px;
    letter-spacing: 0.12em;
  }
  .chapter-nav {
    gap: 8px;
    margin-left: auto;
  }
  .chapter-nav .nav-link[href="#identity"] {
    display: none;
  }
  .chapter-nav .nav-link { font-size: 12px; }
  .nav-button {
    min-width: 44px;
    padding: 0 6px;
    font-size: 12px;
  }
  .ambient-toggle,
  .wallpaper-btn {
    display: none;
  }
  .open-trigger .header-btn-text {
    display: inline;
  }
  .progress-rail { display: none; }

  .identity {
    display: block;
    min-height: auto;
    padding: 0 var(--frame) 136px;
  }

  .art-caption {
    display: none;
  }

  .intro {
    grid-column: 1;
    padding-left: 0;
    padding-top: 23svh;
    max-width: none;
  }

  .identity-header-row {
    gap: 16px;
    margin-bottom: 12px;
  }

  .portrait-stage {
    width: 110px;
  }

  .owner-glyph {
    font-size: 25px;
  }

  .identity h1 { font-size: clamp(46px, 12.5vw, 60px); }
  .profile-meta { font-size: 13px; margin-top: 10px; }
  .identity .lede { font-size: 18px; line-height: 1.48; margin-top: 12px; padding-left: 12px; }
  .actions.hero-controls { margin-top: 16px; }
  .profile-socials { gap: 4px 10px; margin-top: 14px; }
  .profile-interests { gap: 3px 10px; margin-top: 10px; }

  .lyrica-3d-line {
    font-size: clamp(17px, 4.4vw, 22px);
  }

  .memory-collections {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .memory-universe-stage.is-universe,
  .memory-universe-stage.is-slider {
    height: clamp(390px, 56svh, 460px);
  }
  .memory-fullscreen {
    display: none;
  }
  .memory-node {
    width: 102px;
  }
  .memory-node.is-focused {
    width: min(62vw, 212px);
  }
  .memory-universe-stage.is-slider .memory-node {
    width: min(68vw, 232px);
  }
  .memory-full {
    grid-template-columns: 1fr;
  }
  .viewer-media-stage {
    padding: 12px;
    min-height: 200px;
  }
  .viewer-media-stage :is(svg, img, video) {
    max-height: 44vh;
  }

  .now-playing {
    left: var(--frame);
    right: var(--frame);
    width: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .sakura-bough {
    width: 44vw;
    right: -12%;
    top: 7%;
    opacity: 0.62;
  }
}

/* Mobile landscape composition */
@media (max-height: 520px) and (min-width: 560px) {
  .masthead {
    min-height: 48px;
  }
  .identity {
    grid-template-columns: 44% 56%;
    min-height: auto;
    padding: 8px var(--frame) 96px;
    align-items: start;
  }
  .art-caption { display: none; }
  .intro {
    grid-column: 2;
    padding-left: 2%;
    padding-top: 0;
  }
  .identity-header-row {
    gap: 14px;
    margin-bottom: 10px;
  }
  .portrait-stage { width: 88px; }
  .owner-glyph { font-size: 22px; }
  .identity h1 { font-size: 44px; }
  .profile-meta { margin-top: 8px; }
  .identity .lede { font-size: 16.5px; line-height: 1.42; margin-top: 10px; padding-left: 10px; }
  .actions.hero-controls { margin-top: 12px; }
  .profile-socials { margin-top: 10px; }
  .profile-interests { margin-top: 8px; }
  .now-playing {
    left: 14px;
    right: auto;
    bottom: 10px;
    width: 280px;
  }
}

@media (max-width: 360px) {
  .masthead {
    padding-inline: 14px;
  }
  .open-trigger .header-btn-text {
    display: none;
  }
  .intro {
    padding-top: 20svh;
  }
  .portrait-stage {
    width: 104px;
  }
  .identity h1 {
    font-size: 48px;
  }
  .profile-socials {
    gap: 2px 8px;
  }
  .primary, .secondary.hero-control {
    padding-inline: 14px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .astral-fx-layer,
  .sanctuary-koi-tag {
    animation: none !important;
  }
}

/* Subtle Winter Snowfall Layer */
.astral-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
}

/* Profile Keyword-Triggered Ambient FX Layer */
.astral-fx-layer {
  position: fixed;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  overflow: hidden;
}

.astral-fx-node {
  position: absolute;
  left: var(--fx-x, 30%);
  top: var(--fx-y, 25%);
  pointer-events: none;
}

.fx-meteor {
  width: 110px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 245, 224, 0) 0%, #ffe6be 65%, #fff 100%);
  box-shadow: 0 0 12px rgba(255, 226, 178, 0.8);
  opacity: 0;
  transform: rotate(-24deg) translateX(0);
  animation: fx-meteor-fly 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--fx-delay, 0ms);
}

@keyframes fx-meteor-fly {
  0% { opacity: 0; transform: rotate(-24deg) translateX(0) scaleX(0.4); }
  25% { opacity: 0.95; }
  100% { opacity: 0; transform: rotate(-24deg) translateX(180px) scaleX(1.1); }
}

.fx-petal {
  width: 11px;
  height: 7px;
  border-radius: 90% 10% 80% 20%;
  background: linear-gradient(135deg, #ffeef2, #e99eb6);
  box-shadow: 0 0 8px rgba(244, 168, 190, 0.5);
  opacity: 0;
  animation: fx-petal-drift 1.95s ease-out forwards;
  animation-delay: var(--fx-delay, 0ms);
}

@keyframes fx-petal-drift {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.5); }
  20% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(var(--fx-dx, 40px), var(--fx-dy, 90px)) rotate(var(--fx-rot, 160deg)) scale(0.9); }
}

.fx-flare {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 1px solid rgba(255, 232, 194, 0.75);
  box-shadow: 0 0 22px rgba(240, 203, 158, 0.65);
  opacity: 0;
  animation: fx-flare-bloom 1.3s ease-out forwards;
}

@keyframes fx-flare-bloom {
  0% { opacity: 0; transform: scale(0.35); }
  30% { opacity: 0.95; }
  100% { opacity: 0; transform: scale(2.1); }
}

.portrait-stage.is-lyric-pulsed {
  animation: portrait-lyric-glow 1.2s ease-out;
}

@keyframes portrait-lyric-glow {
  0% { filter: drop-shadow(0 0 0 rgba(240, 203, 158, 0)); }
  35% { filter: drop-shadow(0 0 26px rgba(240, 203, 158, 0.45)); }
  100% { filter: drop-shadow(0 0 0 rgba(240, 203, 158, 0)); }
}

/* Sanctuary Wish Dialogs */
dialog.sanctuary-release-dialog,
dialog.sanctuary-catch-dialog,
dialog.sanctuary-log-dialog {
  width: min(92vw, 480px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #141524;
  color: var(--paper);
  padding: clamp(20px, 3vw, 28px);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.82);
}

.wish-release-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.wish-row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wish-field {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.wish-field input,
.wish-field select,
.wish-field textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 6px;
  border: 1px solid rgba(240, 203, 158, 0.28);
  background: rgba(10, 11, 20, 0.88);
  color: var(--ivory);
  font: inherit;
  font-size: 0.88rem;
}

.catch-rarity-badge {
  display: inline-flex;
  align-items: center;
  margin: 10px 0 8px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--rarity-color, #f0cb9e);
  color: var(--rarity-color, #f0cb9e);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.catch-message-body {
  margin: 8px 0 10px;
  padding-left: 14px;
  border-left: 2px solid rgba(240, 203, 158, 0.45);
  font: italic 1.12rem/1.5 var(--serif);
  color: #fff6e8;
}

.wish-log-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 52vh;
  overflow-y: auto;
  display: grid;
  gap: 10px;
}

.wish-log-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(240, 203, 158, 0.2);
  background: rgba(20, 22, 36, 0.72);
}

.wish-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ivory);
  font-size: 0.88rem;
}

.wish-log-rarity {
  font-size: 0.72rem;
  color: var(--rarity-color, #f0cb9e);
}

.wish-log-msg {
  margin: 6px 0 4px;
  font-size: 0.85rem;
  line-height: 1.42;
  color: var(--paper);
}

.wish-log-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.visitor-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 12px 0 0;
  padding: 3px 0;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.visitor-count svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.sanctuary-controls {
  gap: 8px;
  justify-content: flex-end;
}

.sanctuary-controls .scene-button,
.sanctuary-controls .return-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(240, 203, 158, 0.3);
  border-radius: 999px;
  background: rgba(10, 12, 23, 0.76);
  color: var(--ivory);
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sanctuary-controls .scene-button:hover,
.sanctuary-controls .return-profile:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.sanctuary-controls .wish-fish-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.wish-field small,
.wish-visibility small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
}

.wish-anonymous,
.wish-visibility label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  font-size: 0.82rem;
}

.wish-anonymous input,
.wish-visibility input { accent-color: var(--gold); }

.wish-visibility {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(240, 203, 158, 0.2);
  border-radius: 8px;
}

.wish-visibility legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

.wish-visibility label > span { display: block; }

.wish-preview {
  padding: 12px 14px;
  border: 1px solid rgba(240, 203, 158, 0.24);
  border-radius: 8px;
  background: rgba(8, 10, 19, 0.72);
}

.wish-preview-kicker {
  display: block;
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wish-preview-name { display: block; margin-top: 7px; color: var(--ivory); }
.wish-preview-type { display: block; margin-top: 3px; color: var(--gold); font-size: 0.72rem; }
.wish-preview-message { margin: 5px 0; color: var(--paper); font: italic 1rem/1.45 var(--serif); overflow-wrap: anywhere; }
.wish-preview-hue { display: block; color: var(--muted); font-size: 0.7rem; }
.wish-preview-author { color: var(--muted); font-size: 0.72rem; }
.wish-policy { margin: 0; color: var(--muted); font-size: 0.68rem; line-height: 1.4; }
.wish-log-empty { padding: 22px 12px; color: var(--muted); text-align: center; }

dialog.sanctuary-release-dialog {
  max-height: min(88vh, 760px);
  overflow-y: auto;
}

@media (max-width: 600px) {
  .sanctuary-overlay { padding: max(20px, env(safe-area-inset-top)) 18px max(88px, calc(76px + env(safe-area-inset-bottom))); }
  .sanctuary-controls { justify-content: center; gap: 6px; }
  .sanctuary-controls .scene-button,
  .sanctuary-controls .return-profile { min-height: 44px; padding: 0 11px; font-size: 0.73rem; }
  .wish-row-two { grid-template-columns: 1fr 1fr; }
  dialog.sanctuary-release-dialog { padding: 15px; max-height: calc(100dvh - 24px); }
  .wish-release-form { gap: 8px; margin-top: 8px; }
  .wish-visibility { gap: 6px; padding: 8px 10px; }
  .wish-preview { padding: 8px 10px; }
  .wish-preview-name { margin-top: 4px; }
  .wish-preview-message { margin: 3px 0; }
  .wish-field textarea { min-height: 58px; }
  .wish-field input,
  .wish-field select,
  .wish-field textarea { padding: 8px 10px; font-size: 0.82rem; }
  .wish-field { gap: 4px; }
  .wish-anonymous { gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .sakura-bough,
  .living .orbit-near,
  .living .ornament-orbit,
  .living .orbit-far,
  .identity[data-opening="playing"] .entry-orbit,
  .identity[data-opening="playing"] .ornament-chart,
  .identity[data-opening="playing"] .intro > * {
    animation: none !important;
  }

  .portrait-stage,
  .portrait-stage::before,
  .portrait-stage::after,
  .portrait-stage .seal,
  dialog.memory-viewer[open],
  .memory-full.is-switching,
  .lyrica-phrase,
  .lyrica-3d-word,
  .lyrica-chunk,
  .memory-node,
  .np-cover,
  .instrument.seal-trigger,
  .portrait-inner {
    transform: none !important;
    filter: none !important;
    animation: none !important;
  }

  .lake-ripple { animation: lake-light-pulse 0.82s ease-out both; }
  @keyframes lake-light-pulse {
    from { opacity: 0.95; }
    to { opacity: 0; }
  }
}
