:root {
  --ink: #f2e9d8;
  --ink-soft: rgba(242, 233, 216, 0.68);
  --ink-faint: rgba(242, 233, 216, 0.4);
  --gold: #d8b77c;
  --gold-bright: #f2dcb2;
  --gold-dim: rgba(216, 183, 124, 0.3);
  --night: #080b11;
  --panel: #0e1218;
  --serif: "Baskerville", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--night);
}

body {
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

#scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  touch-action: none;
}

body.character-hover #scene {
  cursor: pointer;
}

/* ------------------------------------------------------------------
   Atmospheric overlays
------------------------------------------------------------------ */

.ambient-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(8, 11, 17, 0) 36%, rgba(8, 11, 17, 0.26) 72%, rgba(8, 11, 17, 0.62) 100%),
    linear-gradient(180deg, rgba(8, 11, 17, 0.34) 0%, rgba(8, 11, 17, 0) 23%, rgba(8, 11, 17, 0) 70%, rgba(8, 11, 17, 0.48) 100%);
  transition: opacity 1.5s var(--ease);
}

.ambient-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.17;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------
   Brand
------------------------------------------------------------------ */

.brand {
  position: absolute;
  top: max(34px, env(safe-area-inset-top));
  left: max(42px, env(safe-area-inset-left));
  z-index: 6;
  pointer-events: none;
  text-shadow: 0 2px 18px rgba(8, 11, 17, 0.55);
}

.brand-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.34em;
}

.brand-eyebrow .line {
  display: block;
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
  opacity: 0.7;
}

.brand-eyebrow .line:last-child {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.brand h1 {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.2vw, 55px);
  line-height: 0.86;
  letter-spacing: 0.16em;
  color: var(--gold-bright);
}

.brand h1 span:first-child {
  font-size: 0.52em;
  letter-spacing: 0.42em;
  opacity: 0.92;
  margin-left: 0.1em;
}

.brand h1 span:last-child {
  font-style: italic;
  letter-spacing: 0.12em;
}

.brand-cn {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.22em;
}

.brand-cn i {
  width: 4px;
  height: 4px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  opacity: 0.8;
}

/* ------------------------------------------------------------------
   Time controls
------------------------------------------------------------------ */

.time-cluster {
  position: absolute;
  top: max(30px, env(safe-area-inset-top));
  right: max(38px, env(safe-area-inset-right));
  z-index: 8;
  width: 272px;
  padding: 15px 16px 12px;
  border: 1px solid rgba(216, 183, 124, 0.19);
  background: linear-gradient(160deg, rgba(18, 21, 27, 0.62), rgba(10, 13, 18, 0.42));
  backdrop-filter: blur(18px) saturate(0.9);
  -webkit-backdrop-filter: blur(18px) saturate(0.9);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 243, 215, 0.05);
}

.time-cluster::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(216, 183, 124, 0.7), transparent);
}

.time-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--ink-faint);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.28em;
}

.time-head em {
  font-style: normal;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.time-switch {
  display: flex;
  gap: 3px;
  border-top: 1px solid rgba(216, 183, 124, 0.13);
  border-bottom: 1px solid rgba(216, 183, 124, 0.13);
  padding: 6px 0;
}

.time-btn {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  color: rgba(242, 233, 216, 0.46);
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  transition: color 0.4s var(--ease), background 0.4s var(--ease);
}

.time-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.time-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 0;
  height: 1px;
  background: var(--gold);
  transform: translateX(-50%);
  transition: width 0.4s var(--ease);
}

.time-btn:hover {
  color: rgba(242, 233, 216, 0.8);
}

.time-btn.is-active {
  color: var(--gold-bright);
}

.time-btn.is-active::after {
  width: 20px;
}

.mist-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 10px;
  color: var(--ink-faint);
  font-family: var(--serif);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  transition: color 0.35s var(--ease);
}

.mist-btn:hover {
  color: var(--ink-soft);
}

.mist-btn.is-active {
  color: var(--gold);
}

.mist-switch {
  position: relative;
  width: 29px;
  height: 13px;
  border: 1px solid rgba(216, 183, 124, 0.34);
  border-radius: 99px;
  transition: border-color 0.35s var(--ease);
}

.mist-switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(216, 183, 124, 0.48);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

.mist-btn.is-active .mist-switch i {
  transform: translateX(15px);
  background: var(--gold-bright);
}

/* ------------------------------------------------------------------
   Quote + hint
------------------------------------------------------------------ */

.quote-block {
  position: absolute;
  left: max(43px, env(safe-area-inset-left));
  bottom: max(108px, calc(env(safe-area-inset-bottom) + 92px));
  z-index: 6;
  width: min(310px, 34vw);
  pointer-events: none;
  text-shadow: 0 2px 20px rgba(8, 11, 17, 0.65);
  transition: opacity 1.2s var(--ease);
}

.quote-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  width: 86%;
}

.quote-rule span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(216, 183, 124, 0.64), transparent);
}

.quote-rule i {
  width: 4px;
  height: 4px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}

.quote-block p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(17px, 1.55vw, 22px);
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.14em;
  color: rgba(248, 240, 224, 0.9);
}

.quote-block small {
  display: block;
  margin-top: 13px;
  font-family: var(--sans);
  font-size: 7.5px;
  letter-spacing: 0.28em;
  color: rgba(216, 183, 124, 0.56);
}

.hint {
  position: absolute;
  left: max(44px, env(safe-area-inset-left));
  bottom: max(34px, calc(env(safe-area-inset-bottom) + 22px));
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(242, 233, 216, 0.42);
  pointer-events: none;
}

.hint svg {
  width: 17px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0.72;
}

.hint div {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 9.5px;
  letter-spacing: 0.18em;
}

.hint i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.62;
}

/* ------------------------------------------------------------------
   Archive entry
------------------------------------------------------------------ */

.archive-btn {
  position: absolute;
  right: max(38px, env(safe-area-inset-right));
  bottom: max(34px, calc(env(safe-area-inset-bottom) + 22px));
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 2px 10px 20px;
  border-left: 1px solid rgba(216, 183, 124, 0.4);
  color: var(--ink-soft);
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
  text-align: left;
}

.archive-btn::before {
  content: "";
  position: absolute;
  inset: -18px -22px -18px -20px;
  background: radial-gradient(ellipse at center, rgba(12, 15, 20, 0.5), transparent 70%);
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.archive-btn:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.archive-btn:hover::before {
  opacity: 1;
}

.archive-index {
  font-family: var(--sans);
  font-size: 6.5px;
  line-height: 1.55;
  letter-spacing: 0.2em;
  color: rgba(216, 183, 124, 0.54);
}

.archive-label {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.2em;
}

.archive-count {
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--gold);
  opacity: 0.74;
}

.archive-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: 2px;
  border: 1px solid rgba(216, 183, 124, 0.26);
  border-radius: 50%;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}

.archive-arrow svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.archive-btn:hover .archive-arrow {
  border-color: var(--gold);
  transform: translateX(3px);
}

/* ------------------------------------------------------------------
   Character label + dialogue
------------------------------------------------------------------ */

.char-label {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 9px;
  border: 1px solid rgba(216, 183, 124, 0.27);
  background: rgba(11, 14, 19, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.16em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) translateY(6px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

.char-label b {
  font-weight: 400;
  font-size: 10.5px;
  color: var(--gold-bright);
}

.char-label span:last-child {
  color: rgba(242, 233, 216, 0.38);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.char-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(216, 183, 124, 0.75);
  animation: dotPulse 2.8s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

.dialogue {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  width: min(330px, calc(100vw - 36px));
  padding: 18px 20px 15px;
  border: 1px solid rgba(216, 183, 124, 0.3);
  background:
    linear-gradient(145deg, rgba(24, 23, 22, 0.94), rgba(12, 14, 18, 0.9));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 244, 218, 0.07);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% + 4px)) scale(0.97);
  transition: opacity 0.32s var(--ease), transform 0.32s var(--ease);
}

.dialogue::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(216, 183, 124, 0.08);
  pointer-events: none;
}

.dialogue.is-open {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, calc(-100% + 4px)) scale(1);
}

.dialogue-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.dialogue-name span {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.2em;
  color: var(--gold-bright);
}

.dialogue-name i {
  width: 18px;
  height: 1px;
  background: rgba(216, 183, 124, 0.4);
}

.dialogue-name small {
  font-family: var(--sans);
  font-size: 6.5px;
  letter-spacing: 0.26em;
  color: rgba(216, 183, 124, 0.5);
}

.dialogue p {
  margin: 0;
  min-height: 2.9em;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.08em;
  color: rgba(248, 241, 227, 0.92);
}

.dialogue-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(216, 183, 124, 0.11);
  font-family: var(--serif);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: rgba(242, 233, 216, 0.34);
}

.dialogue-foot #dialogueCount {
  color: rgba(216, 183, 124, 0.56);
}

.dialogue-tail {
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: rgba(12, 14, 18, 0.94);
  border-right: 1px solid rgba(216, 183, 124, 0.3);
  border-bottom: 1px solid rgba(216, 183, 124, 0.3);
  transform: translateX(-50%) rotate(45deg);
}

.tooltip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9;
  padding: 6px 11px;
  border: 1px solid rgba(216, 183, 124, 0.24);
  background: rgba(10, 13, 18, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.16em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) translateY(4px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

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

/* ------------------------------------------------------------------
   Archive panel
------------------------------------------------------------------ */

.panel-scrim {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(4, 6, 9, 0.52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s var(--ease);
}

.panel-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.archive-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  width: min(480px, 94vw);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(72, 56, 38, 0.36), transparent 46%),
    linear-gradient(180deg, #0f1318 0%, #0a0d11 100%);
  border-left: 1px solid rgba(216, 183, 124, 0.2);
  box-shadow: -30px 0 90px rgba(0, 0, 0, 0.45);
  transform: translateX(102%);
  transition: transform 0.65s var(--ease);
}

.archive-panel.is-open {
  transform: translateX(0);
}

.archive-panel::before {
  content: "";
  position: absolute;
  inset: 12px 0 12px auto;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(216, 183, 124, 0.35), transparent);
}

.archive-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 32px 22px;
  border-bottom: 1px solid rgba(216, 183, 124, 0.12);
}

.panel-kicker {
  display: block;
  margin-bottom: 10px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.3em;
  color: rgba(216, 183, 124, 0.58);
}

.archive-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 23px;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
}

.panel-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(216, 183, 124, 0.24);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: border-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
}

.panel-close:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: rotate(90deg);
}

.panel-close svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
}

.archive-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 32px 40px;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 183, 124, 0.34) transparent;
}

.archive-scroll::-webkit-scrollbar {
  width: 5px;
}

.archive-scroll::-webkit-scrollbar-thumb {
  background: rgba(216, 183, 124, 0.34);
  border-radius: 99px;
}

.archive-lead {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: 12.5px;
  line-height: 2;
  letter-spacing: 0.08em;
  color: rgba(242, 233, 216, 0.58);
}

.memory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 16px;
}

.memory-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: left;
  color: inherit;
}

.memory-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.22;
  overflow: hidden;
  background: #161a1e;
  border: 1px solid rgba(216, 183, 124, 0.14);
}

.memory-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(4, 6, 8, 0.58));
  transition: opacity 0.4s var(--ease);
}

.memory-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.78) contrast(0.97);
  transition: transform 0.8s var(--ease), filter 0.6s var(--ease);
}

.memory-card:hover .memory-image img {
  transform: scale(1.055);
  filter: saturate(0.94) contrast(1);
}

.memory-image i {
  position: absolute;
  left: 9px;
  bottom: 7px;
  z-index: 1;
  font-family: var(--serif);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(242, 233, 216, 0.8);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.memory-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.memory-meta b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--gold-bright);
}

.memory-meta small {
  font-family: var(--sans);
  font-size: 6px;
  letter-spacing: 0.22em;
  color: rgba(216, 183, 124, 0.45);
}

.memory-desc {
  font-family: var(--serif);
  font-size: 10.5px;
  line-height: 1.75;
  letter-spacing: 0.05em;
  color: rgba(242, 233, 216, 0.44);
}

.archive-divider {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 34px 0 20px;
  color: rgba(216, 183, 124, 0.46);
  font-family: var(--sans);
  font-size: 6.5px;
  letter-spacing: 0.3em;
}

.archive-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 183, 124, 0.22), transparent);
}

.archive-divider i {
  font-style: normal;
}

.voice-block {
  display: flex;
  gap: 15px;
  padding: 18px;
  border: 1px solid rgba(216, 183, 124, 0.14);
  background: linear-gradient(135deg, rgba(216, 183, 124, 0.07), rgba(255, 255, 255, 0.01));
}

.voice-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: rgba(216, 183, 124, 0.72);
}

.voice-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 0.9;
}

.voice-mark svg path {
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-block h3 {
  margin: 1px 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
}

.voice-block p {
  margin: 0;
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.85;
  letter-spacing: 0.04em;
  color: rgba(242, 233, 216, 0.55);
}

.story-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 16px;
}

.story-strip button {
  position: relative;
  overflow: hidden;
  aspect-ratio: 0.82;
  border: 1px solid rgba(216, 183, 124, 0.14);
  background: #101318;
}

.story-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.7) brightness(0.84);
  transition: transform 0.7s var(--ease), filter 0.5s var(--ease);
}

.story-strip button:hover img {
  transform: scale(1.06);
  filter: saturate(0.9) brightness(0.95);
}

.story-strip span {
  position: absolute;
  left: 7px;
  bottom: 6px;
  font-family: var(--serif);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: rgba(242, 233, 216, 0.7);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.archive-foot {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid rgba(216, 183, 124, 0.12);
}

.archive-foot p {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 11.5px;
  line-height: 2;
  letter-spacing: 0.08em;
  color: rgba(242, 233, 216, 0.5);
}

.archive-foot span {
  font-family: var(--sans);
  font-size: 6.5px;
  letter-spacing: 0.28em;
  color: rgba(216, 183, 124, 0.38);
}

/* ------------------------------------------------------------------
   Lightbox
------------------------------------------------------------------ */

.lightbox {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 30px);
  padding: 4vh 5vw;
  background: rgba(5, 7, 10, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(1000px, 82vw);
}

.lightbox-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 68vh;
  border: 1px solid rgba(216, 183, 124, 0.22);
  background: #0b0e12;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
}

.lightbox-image-wrap img {
  max-width: min(1000px, 82vw);
  max-height: 68vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox figcaption {
  width: 100%;
  margin-top: 17px;
  text-align: left;
}

.lightbox figcaption span {
  display: block;
  margin-bottom: 6px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.28em;
  color: rgba(216, 183, 124, 0.48);
}

.lightbox figcaption h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
}

.lightbox figcaption p {
  margin: 0;
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.06em;
  color: rgba(242, 233, 216, 0.52);
}

.lightbox-close {
  position: absolute;
  top: max(22px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(216, 183, 124, 0.25);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.lightbox-close:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.lightbox-close svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
}

.lightbox-nav {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(216, 183, 124, 0.22);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background 0.3s var(--ease);
}

.lightbox-nav:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(216, 183, 124, 0.07);
}

.lightbox-nav svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------
   Toast
------------------------------------------------------------------ */

.toast {
  position: absolute;
  left: 50%;
  top: 44px;
  z-index: 35;
  transform: translate(-50%, -10px);
  padding: 9px 18px;
  border: 1px solid rgba(216, 183, 124, 0.24);
  background: rgba(10, 13, 18, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

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

/* ------------------------------------------------------------------
   Loading
------------------------------------------------------------------ */

.loading {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(116, 87, 54, 0.26), transparent 52%),
    radial-gradient(ellipse at 50% 110%, rgba(52, 40, 27, 0.45), transparent 60%),
    linear-gradient(180deg, #080b10 0%, #0d1015 50%, #080a0e 100%);
  transition: opacity 1.1s var(--ease), visibility 1.1s var(--ease);
}

.loading.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.loading-haze {
  position: absolute;
  left: 50%;
  bottom: -18%;
  width: 120vw;
  height: 56vh;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(200, 165, 115, 0.15), transparent 64%);
  filter: blur(30px);
}

.loading-inner {
  position: relative;
  z-index: 1;
  width: min(420px, 78vw);
  text-align: center;
}

.loading-sigil {
  width: 104px;
  height: 104px;
  margin: 0 auto 28px;
  color: rgba(216, 183, 124, 0.64);
  animation: sigilSpin 38s linear infinite;
}

.loading-sigil svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 0.8;
  stroke-linecap: round;
}

.loading-sigil svg path:nth-child(2) {
  stroke-width: 0.55;
  opacity: 0.55;
}

.loading-sigil svg path:nth-child(3) {
  stroke-width: 1;
}

@keyframes sigilSpin {
  to { transform: rotate(360deg); }
}

.loading-kicker {
  margin: 0 0 12px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.32em;
  color: rgba(216, 183, 124, 0.54);
}

.loading-inner h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(27px, 3.6vw, 38px);
  letter-spacing: 0.2em;
  color: #f2e1c2;
  text-indent: 0.2em;
}

.loading-cn {
  margin: 9px 0 32px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.5em;
  color: rgba(242, 233, 216, 0.46);
  text-indent: 0.5em;
}

.loading-bar {
  width: 100%;
  height: 1px;
  background: rgba(216, 183, 124, 0.16);
  overflow: hidden;
}

.loading-bar i {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(216, 183, 124, 0.3), #f2d9ab);
  transition: width 0.5s var(--ease);
  box-shadow: 0 0 10px rgba(242, 217, 171, 0.52);
}

.loading-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 11px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.18em;
  color: rgba(242, 233, 216, 0.32);
}

.loading-meta span:last-child {
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(216, 183, 124, 0.64);
}

.loading-corner {
  position: absolute;
  width: 38px;
  height: 38px;
  border-color: rgba(216, 183, 124, 0.26);
  border-style: solid;
  pointer-events: none;
}

.loading-corner.tl { top: 24px; left: 24px; border-width: 1px 0 0 1px; }
.loading-corner.tr { top: 24px; right: 24px; border-width: 1px 1px 0 0; }
.loading-corner.bl { bottom: 24px; left: 24px; border-width: 0 0 1px 1px; }
.loading-corner.br { bottom: 24px; right: 24px; border-width: 0 1px 1px 0; }

/* ------------------------------------------------------------------
   Entrance states
------------------------------------------------------------------ */

.brand,
.time-cluster,
.quote-block,
.hint,
.archive-btn {
  opacity: 0;
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease);
}

.brand { transform: translateY(-10px); }
.time-cluster { transform: translateY(-10px); }
.quote-block { transform: translateY(10px); }
.hint { transform: translateY(8px); }
.archive-btn { transform: translateY(8px); }

body.is-ready .brand,
body.is-ready .time-cluster,
body.is-ready .quote-block,
body.is-ready .hint,
body.is-ready .archive-btn {
  opacity: 1;
  transform: translateY(0);
}

body.is-ready .time-cluster { transition-delay: 0.12s; }
body.is-ready .quote-block { transition-delay: 0.32s; }
body.is-ready .hint { transition-delay: 0.5s; }
body.is-ready .archive-btn { transition-delay: 0.5s; }

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------ */

@media (max-width: 980px) {
  .brand { left: 28px; top: 28px; }
  .time-cluster { right: 26px; top: 24px; width: 248px; }
  .archive-btn { right: 26px; bottom: 26px; }
  .hint { left: 28px; bottom: 30px; }
  .quote-block { left: 30px; bottom: 100px; }
}

@media (max-width: 760px) {
  .brand {
    top: max(20px, env(safe-area-inset-top));
    left: max(20px, env(safe-area-inset-left));
  }
  .brand-eyebrow { display: none; }
  .brand h1 { font-size: 29px; letter-spacing: 0.14em; }
  .brand h1 span:first-child { font-size: 0.56em; letter-spacing: 0.34em; }
  .brand-cn { margin-top: 10px; font-size: 9px; letter-spacing: 0.16em; gap: 7px; }
  .brand-cn i,
  .brand-cn span:last-child { display: none; }

  .time-cluster {
    top: max(16px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    width: 166px;
    padding: 10px 11px 9px;
  }
  .time-head { margin-bottom: 7px; font-size: 7.5px; letter-spacing: 0.2em; }
  .time-head em { font-size: 10px; }
  .time-switch { padding: 4px 0; }
  .time-btn { padding: 7px 2px; gap: 4px; font-size: 9px; letter-spacing: 0.04em; }
  .time-btn svg { width: 13px; height: 13px; }
  .time-btn::after { bottom: -5px; }
  .mist-btn { padding-top: 8px; font-size: 8px; letter-spacing: 0.16em; }

  .quote-block {
    left: max(20px, env(safe-area-inset-left));
    bottom: max(86px, calc(env(safe-area-inset-bottom) + 76px));
    width: min(240px, calc(100vw - 150px));
  }
  .quote-block p { font-size: 15px; line-height: 1.75; letter-spacing: 0.1em; }
  .quote-block small { font-size: 6px; letter-spacing: 0.2em; margin-top: 9px; }
  .quote-rule { margin-bottom: 10px; }

  .hint { display: none; }

  .archive-btn {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px));
    gap: 9px;
    padding-left: 13px;
  }
  .archive-index { display: none; }
  .archive-label { font-size: 12px; letter-spacing: 0.16em; }
  .archive-arrow { width: 25px; height: 25px; }
  .archive-count { font-size: 9px; }

  .char-label { font-size: 8px; padding: 5px 9px; }
  .char-label b { font-size: 9.5px; }

  .dialogue {
    width: min(320px, calc(100vw - 30px));
    padding: 15px 16px 12px;
  }
  .dialogue p { font-size: 14px; line-height: 1.85; }
  .dialogue-name span { font-size: 14px; }

  .archive-panel { width: 100%; border-left: 0; }
  .archive-head { padding: 25px 20px 18px; }
  .archive-head h2 { font-size: 20px; }
  .archive-scroll { padding: 20px 20px 32px; }
  .memory-grid { gap: 18px 12px; }
  .memory-desc { font-size: 10px; }
  .lightbox { padding: 5vh 12px; gap: 6px; }
  .lightbox figure { max-width: calc(100vw - 92px); }
  .lightbox-image-wrap img { max-width: calc(100vw - 92px); max-height: 60vh; }
  .lightbox-nav { width: 34px; height: 34px; }
  .lightbox-close { top: 15px; right: 15px; width: 34px; height: 34px; }

  .toast {
    top: 148px;
    max-width: calc(100vw - 36px);
    font-size: 9px;
    text-align: center;
    line-height: 1.7;
  }
  .loading-corner { width: 25px; height: 25px; }
  .loading-corner.tl { top: 15px; left: 15px; }
  .loading-corner.tr { top: 15px; right: 15px; }
  .loading-corner.bl { bottom: 15px; left: 15px; }
  .loading-corner.br { bottom: 15px; right: 15px; }
}

@media (max-width: 420px) {
  .brand h1 { font-size: 25px; }
  .time-cluster { width: 160px; }
  .time-btn span { display: none; }
  .time-btn svg { width: 15px; height: 15px; }
  .time-head { font-size: 7px; }
  .memory-grid { grid-template-columns: 1fr; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .quote-block { display: none; }
  .brand { top: 20px; left: 24px; }
  .time-cluster { top: 16px; right: 24px; }
  .hint { bottom: 18px; }
  .archive-btn { bottom: 18px; }
}

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

/* ==================================================================
   PHASE II · weather, shared memories, moonlight event
================================================================== */

[hidden] {
  display: none !important;
}

body.scene-interactive #scene {
  cursor: pointer;
}

.time-cluster {
  pointer-events: none;
}

.time-btn,
.weather-btn {
  pointer-events: auto;
}

.weather-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(216, 183, 124, 0.11);
  color: var(--ink-faint);
  font-family: var(--serif);
  font-size: 8px;
  letter-spacing: 0.24em;
}

.weather-head em {
  font-style: normal;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.weather-switch {
  display: flex;
  gap: 2px;
  margin-top: 3px;
}

.weather-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 3px;
  color: rgba(242, 233, 216, 0.42);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.1em;
  transition: color 0.35s var(--ease), background 0.35s var(--ease);
}

.weather-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.weather-btn:hover {
  color: rgba(242, 233, 216, 0.8);
}

.weather-btn.is-active {
  color: var(--gold-bright);
}

/* ----------------------------- OUR MEMORIES ------------------------ */

.our-memories-btn {
  position: absolute;
  right: max(38px, env(safe-area-inset-right));
  bottom: max(100px, calc(env(safe-area-inset-bottom) + 88px));
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 2px 8px 17px;
  border-left: 1px solid rgba(216, 183, 124, 0.26);
  color: var(--ink-soft);
  text-align: left;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}

.our-memories-btn:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.our-index {
  font-family: var(--sans);
  font-size: 6px;
  line-height: 1.55;
  letter-spacing: 0.18em;
  color: rgba(216, 183, 124, 0.48);
}

.our-label {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.our-count {
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.our-memories-btn .archive-arrow {
  width: 24px;
  height: 24px;
}

.our-panel {
  width: min(540px, 96vw);
}

.our-scroll {
  padding-top: 22px;
}

.our-lead {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: 11.5px;
  line-height: 2;
  letter-spacing: 0.06em;
  color: rgba(242, 233, 216, 0.55);
}

.growth-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 0 0 24px;
  padding: 10px 0 6px;
}

.growth-track::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 183, 124, 0.24), transparent);
}

.growth-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: rgba(242, 233, 216, 0.32);
}

.growth-step i {
  position: relative;
  z-index: 1;
  display: block;
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border: 1px solid rgba(216, 183, 124, 0.3);
  background: #10141a;
  transform: rotate(45deg);
  transition: background 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s var(--ease);
}

.growth-step b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.growth-step small {
  font-family: var(--sans);
  font-size: 6px;
  letter-spacing: 0.1em;
  color: rgba(216, 183, 124, 0.45);
}

.growth-step.is-reached {
  color: rgba(242, 233, 216, 0.66);
}

.growth-step.is-reached i {
  border-color: var(--gold);
  background: rgba(216, 183, 124, 0.58);
}

.growth-step.is-current {
  color: var(--gold-bright);
}

.growth-step.is-current i {
  background: var(--gold-bright);
  box-shadow: 0 0 14px rgba(242, 217, 171, 0.7);
}

.memory-compose {
  position: relative;
  padding: 16px;
  border: 1px solid rgba(216, 183, 124, 0.16);
  background:
    radial-gradient(ellipse at 90% 0%, rgba(216, 183, 124, 0.07), transparent 48%),
    rgba(255, 255, 255, 0.015);
}

.compose-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.compose-head span {
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
}

.compose-head small {
  font-family: var(--sans);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  color: rgba(242, 233, 216, 0.32);
}

.choose-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 64px;
  border: 1px dashed rgba(216, 183, 124, 0.3);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.1em;
  transition: border-color 0.35s var(--ease), color 0.35s var(--ease), background 0.35s var(--ease);
}

.choose-photo svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choose-photo:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(216, 183, 124, 0.05);
}

.choose-photo.is-busy {
  opacity: 0.7;
  cursor: wait;
}

.photo-preview {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 11px;
  padding: 8px;
  border: 1px solid rgba(216, 183, 124, 0.16);
  background: rgba(8, 10, 13, 0.32);
}

.photo-preview img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  filter: saturate(0.9);
}

.photo-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.photo-preview-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 10.5px;
  color: var(--ink-soft);
}

.photo-preview-meta small {
  font-family: var(--sans);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  color: rgba(216, 183, 124, 0.56);
}

.preview-remove {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(216, 183, 124, 0.22);
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1;
}

.preview-remove:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.form-row {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.form-row label {
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(242, 233, 216, 0.44);
}

.form-row input,
.form-row textarea {
  width: 100%;
  border: 1px solid rgba(216, 183, 124, 0.14);
  background: rgba(5, 7, 10, 0.34);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  outline: none;
  color-scheme: dark;
}

.form-row textarea {
  min-height: 56px;
  resize: vertical;
  line-height: 1.65;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: rgba(216, 183, 124, 0.55);
}

.note-count {
  position: absolute;
  right: 9px;
  bottom: 7px;
  font-family: var(--sans);
  font-size: 6px;
  letter-spacing: 0.08em;
  color: rgba(216, 183, 124, 0.42);
  pointer-events: none;
}

.compose-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.save-memory,
.cancel-memory {
  padding: 10px 16px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.12em;
  border: 1px solid rgba(216, 183, 124, 0.28);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.save-memory {
  flex: 1;
  color: #17130d;
  background: linear-gradient(135deg, #f0d9ae, #c5a36b);
  border-color: transparent;
}

.save-memory:hover:not(:disabled) {
  background: linear-gradient(135deg, #fff0ca, #d3b17b);
}

.save-memory:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.save-memory.is-busy {
  opacity: 0.7;
  cursor: wait;
}

.cancel-memory {
  color: var(--ink-soft);
}

.cancel-memory:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.storage-hint {
  margin: 10px 0 0;
  font-family: var(--sans);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  color: rgba(242, 233, 216, 0.3);
  text-align: right;
}

.our-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 0 12px;
  padding-top: 17px;
  border-top: 1px solid rgba(216, 183, 124, 0.12);
}

.our-section-head span {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
}

.our-section-head small {
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.our-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.our-card {
  position: relative;
  padding: 8px;
  border: 1px solid rgba(216, 183, 124, 0.14);
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 0.35s var(--ease);
}

.our-card:hover {
  border-color: rgba(216, 183, 124, 0.32);
}

.our-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1.05;
  overflow: hidden;
  background: #0b0e12;
}

.our-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) brightness(0.92);
  transition: transform 0.7s var(--ease), filter 0.5s var(--ease);
}

.our-photo:hover img {
  transform: scale(1.045);
  filter: saturate(1) brightness(1);
}

.our-photo-shade {
  display: none;
}

.our-card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
}

.our-card-meta time {
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.our-card-meta span {
  font-family: var(--sans);
  font-size: 5.5px;
  letter-spacing: 0.16em;
  color: rgba(242, 233, 216, 0.28);
}

.our-card-note {
  min-height: 2.8em;
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.55;
  letter-spacing: 0.03em;
  color: rgba(242, 233, 216, 0.55);
  overflow-wrap: anywhere;
}

.our-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.our-delete {
  font-family: var(--serif);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: rgba(242, 233, 216, 0.28);
  transition: color 0.3s var(--ease);
}

.our-delete:hover {
  color: #d9937d;
}

.our-confirm {
  display: none;
  gap: 6px;
}

.our-card.is-confirming .our-delete {
  display: none;
}

.our-card.is-confirming .our-confirm {
  display: flex;
}

.our-confirm-yes,
.our-confirm-no {
  font-family: var(--serif);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  padding: 4px 6px;
  border: 1px solid rgba(216, 183, 124, 0.2);
}

.our-confirm-yes {
  color: #e8b09b;
  border-color: rgba(203, 126, 104, 0.38);
}

.our-confirm-no {
  color: var(--ink-soft);
}

.our-empty {
  padding: 26px 16px;
  border: 1px dashed rgba(216, 183, 124, 0.16);
  text-align: center;
}

.our-empty span {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(242, 233, 216, 0.45);
}

.our-empty p {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.7;
  color: rgba(242, 233, 216, 0.3);
}

.lightbox-nav.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

/* --------------------------- moonlight event ----------------------- */

.moon-event {
  position: absolute;
  inset: 0;
  z-index: 72;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 18%, rgba(186, 214, 255, 0.13), transparent 28%),
    radial-gradient(ellipse at 50% 110%, rgba(34, 51, 74, 0.5), transparent 55%),
    rgba(3, 7, 14, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.7s var(--ease), visibility 0.7s var(--ease);
}

.moon-event.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.moon-event-orb {
  position: absolute;
  top: 8%;
  left: 50%;
  width: min(46vw, 440px);
  height: min(46vw, 440px);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 46% 43%, #fffdf0 0%, #f0f2e6 26%, rgba(213, 226, 243, 0.6) 41%, rgba(169, 198, 235, 0.13) 64%, transparent 76%);
  filter: blur(0.5px);
  opacity: 0.88;
  animation: moonFloat 9s ease-in-out infinite;
}

.moon-event-orb::after {
  content: "";
  position: absolute;
  inset: -20%;
  border: 1px solid rgba(196, 220, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 120px rgba(184, 211, 250, 0.22);
}

@keyframes moonFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

.moon-event-card {
  position: relative;
  z-index: 1;
  width: min(540px, 92vw);
  padding: 35px 40px 32px;
  border: 1px solid rgba(213, 228, 250, 0.2);
  background:
    linear-gradient(180deg, rgba(18, 24, 34, 0.9), rgba(8, 12, 18, 0.94));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
}

.moon-event-card .panel-kicker {
  color: rgba(203, 222, 249, 0.52);
}

.moon-event-card h2 {
  margin: 13px 0 18px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 27px;
  letter-spacing: 0.22em;
  color: #f2eddf;
  text-indent: 0.22em;
}

.moon-event-story {
  margin: 0;
  font-family: var(--serif);
  font-size: 11.5px;
  line-height: 2.05;
  letter-spacing: 0.06em;
  color: rgba(238, 243, 250, 0.55);
}

.moon-event-story.small {
  font-size: 10.5px;
  color: rgba(238, 243, 250, 0.4);
}

.moon-event-card blockquote {
  margin: 24px 0;
  font-family: var(--serif);
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 1.9;
  letter-spacing: 0.14em;
  color: #e8f0ff;
  text-shadow: 0 0 30px rgba(174, 205, 255, 0.25);
}

.moon-event-close {
  margin-top: 24px;
  padding: 11px 30px;
  border: 1px solid rgba(203, 222, 249, 0.3);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(238, 243, 250, 0.7);
  transition: border-color 0.35s var(--ease), color 0.35s var(--ease), background 0.35s var(--ease);
}

.moon-event-close:hover {
  border-color: rgba(226, 238, 255, 0.8);
  color: #fff;
  background: rgba(174, 205, 255, 0.08);
}

body.moon-event-open .char-label,
body.moon-event-open .tooltip {
  opacity: 0 !important;
}

/* ----------------------------- responsive ------------------------- */

@media (max-width: 980px) {
  .our-memories-btn { right: 26px; bottom: 88px; }
}

@media (max-width: 760px) {
  .weather-head { margin-top: 7px; padding-top: 6px; }
  .weather-btn { font-size: 8px; gap: 3px; padding: 4px 1px; }
  .weather-btn svg { width: 12px; height: 12px; }
  .our-memories-btn {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(84px, calc(env(safe-area-inset-bottom) + 76px));
    gap: 8px;
    padding: 6px 0 6px 11px;
  }
  .our-index { display: none; }
  .our-label { font-size: 10px; }
  .our-count { font-size: 8px; }
  .our-memories-btn .archive-arrow { width: 21px; height: 21px; }
  .our-panel { width: 100%; }
  .our-gallery { grid-template-columns: 1fr 1fr; gap: 10px; }
  .our-panel .archive-head { padding: 25px 20px 18px; }
  .our-panel .archive-scroll { padding: 18px 20px 32px; }
  .moon-event { padding: 18px; }
  .moon-event-card { padding: 26px 22px 24px; }
  .moon-event-card h2 { font-size: 23px; }
  .moon-event-orb { width: 82vw; height: 82vw; top: 3%; }
  .moon-event-card blockquote { margin: 20px 0; font-size: 18px; }
  .moon-event-story { font-size: 10.5px; }
}

@media (max-width: 420px) {
  .weather-btn span { display: none; }
  .weather-btn svg { width: 14px; height: 14px; }
  .our-gallery { grid-template-columns: 1fr; }
  .growth-step b { font-size: 8px; }
  .form-row { grid-template-columns: 38px 1fr; gap: 8px; }
  .moon-event-card { padding: 24px 18px 20px; }
}


/* ------------------------------------------------------------------
   PHASE III · opening ritual, ambience, and final visual polish
------------------------------------------------------------------ */

.time-cluster {
  background:
    linear-gradient(160deg, rgba(18, 21, 27, 0.52), rgba(10, 13, 18, 0.31));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 243, 215, 0.04);
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:active:not(:disabled) {
  filter: brightness(0.9);
}

/* ------------------------------ ambience --------------------------- */

.sound-btn {
  position: absolute;
  left: max(38px, env(safe-area-inset-left));
  top: max(188px, calc(env(safe-area-inset-top) + 172px));
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px 7px 8px;
  border: 1px solid rgba(216, 183, 124, 0.16);
  background: rgba(10, 13, 18, 0.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(242, 233, 216, 0.42);
  font-family: var(--serif);
  font-size: 8px;
  letter-spacing: 0.16em;
  opacity: 0;
  transform: translateY(8px);
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease), opacity 1.2s var(--ease), transform 1.2s var(--ease);
}

.sound-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-btn .sound-on { display: none; }
.sound-btn .sound-off { display: block; }

.sound-btn.is-on {
  color: var(--gold-bright);
  border-color: rgba(216, 183, 124, 0.4);
  background: rgba(23, 24, 25, 0.48);
}

.sound-btn.is-on .sound-on { display: block; }
.sound-btn.is-on .sound-off { display: none; }

body.is-ready .sound-btn {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.65s;
}

/* ----------------------------- intro ------------------------------- */

.intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.intro-overlay.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: none;
}

.intro-overlay.is-leaving {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.95s var(--ease), visibility 0.95s var(--ease);
}

.intro-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 24%, rgba(33, 51, 70, 0.18), transparent 30%),
    radial-gradient(ellipse at 50% 100%, rgba(18, 25, 34, 0.46), transparent 56%),
    #02040a;
  opacity: 1;
  transition: opacity 3.2s var(--ease);
}

.intro-overlay.is-revealing .intro-veil {
  opacity: 0.2;
}

.intro-stars {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 2.3s var(--ease);
  pointer-events: none;
}

.intro-overlay.show-stars .intro-stars {
  opacity: 1;
}

.intro-stars span {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: #eef4ff;
  box-shadow: 0 0 5px rgba(221, 235, 255, 0.7);
  animation: introTwinkle 4s ease-in-out infinite;
}

@keyframes introTwinkle {
  0%, 100% { opacity: 0.18; transform: scale(0.8); }
  50% { opacity: 0.9; transform: scale(1.2); }
}

.intro-moon {
  position: absolute;
  top: 8%;
  left: 50%;
  width: min(28vw, 280px);
  height: min(28vw, 280px);
  transform: translateX(-50%) translateY(18px) scale(0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 43% 38%, #fffdf1 0%, #eef0e7 37%, rgba(198, 216, 238, 0.7) 58%, rgba(159, 192, 232, 0.1) 78%, transparent 82%);
  box-shadow: 0 0 80px rgba(186, 213, 248, 0.18);
  filter: blur(0.25px);
  opacity: 0;
  transition: opacity 2.8s var(--ease), transform 3.5s var(--ease);
  pointer-events: none;
}

.intro-overlay.show-moon .intro-moon {
  opacity: 0.9;
  transform: translateX(-50%) translateY(0) scale(1);
}

.intro-overlay.is-revealing .intro-moon {
  opacity: 0.22;
  transform: translateX(-50%) translateY(-18px) scale(1.16);
}

.intro-overlay.is-fast .intro-moon {
  display: none;
}

.intro-overlay.is-leaving .intro-moon,
.intro-overlay.is-leaving .intro-content,
.intro-overlay.is-leaving .intro-stars,
.intro-overlay.is-leaving .intro-skip,
.intro-overlay.is-leaving .intro-stage {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none;
}

.intro-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(680px, 88vw);
  text-align: center;
  pointer-events: none;
  transform: translateY(6px);
  transition: transform 2.4s var(--ease);
}

.intro-overlay.show-quote .intro-content {
  transform: translateY(0);
}

.intro-eyebrow {
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.5em;
  color: rgba(216, 183, 124, 0.6);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 1.5s var(--ease), transform 1.5s var(--ease);
}

.intro-content h2 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(33px, 4.5vw, 58px);
  line-height: 1.05;
  letter-spacing: 0.2em;
  color: #f1eadb;
  text-indent: 0.2em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.7s var(--ease), transform 1.7s var(--ease);
}

.intro-content h2 em {
  display: block;
  font-style: normal;
  font-size: 0.63em;
  letter-spacing: 0.34em;
  color: var(--gold-bright);
  text-indent: 0.34em;
}

.intro-cn {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(242, 233, 216, 0.46);
  text-indent: 0.4em;
  opacity: 0;
  transition: opacity 1.5s var(--ease);
}

.intro-rule {
  width: 54px;
  height: 1px;
  margin: 26px 0 22px;
  background: linear-gradient(90deg, transparent, rgba(216, 183, 124, 0.8), transparent);
  opacity: 0;
  transform: scaleX(0.2);
  transition: opacity 1.8s var(--ease), transform 1.8s var(--ease);
}

.intro-overlay.show-title .intro-eyebrow,
.intro-overlay.show-title .intro-cn {
  opacity: 1;
}

.intro-overlay.show-title .intro-content h2 {
  opacity: 1;
  transform: translateY(0);
}

.intro-overlay.show-title .intro-rule {
  opacity: 1;
  transform: scaleX(1);
}

.intro-quote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(17px, 2.2vw, 26px);
  line-height: 1.95;
  letter-spacing: 0.2em;
  color: rgba(242, 235, 221, 0.9);
  opacity: 0;
  transform: translateY(9px);
  transition: opacity 2s var(--ease), transform 2s var(--ease);
}

.intro-note {
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 6px;
  letter-spacing: 0.24em;
  color: rgba(216, 183, 124, 0.36);
  opacity: 0;
  transition: opacity 1.8s var(--ease);
}

.intro-overlay.show-quote .intro-quote,
.intro-overlay.show-quote .intro-note {
  opacity: 1;
  transform: translateY(0);
}

.intro-skip {
  position: absolute;
  top: max(26px, env(safe-area-inset-top));
  right: max(30px, env(safe-area-inset-right));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(216, 183, 124, 0.16);
  background: rgba(5, 8, 13, 0.18);
  color: rgba(242, 233, 216, 0.7);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.18em;
  background: rgba(5, 8, 13, 0.42);
  border-color: rgba(216, 183, 124, 0.36);
  pointer-events: auto;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.intro-skip svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.intro-skip:hover {
  color: var(--gold-bright);
  border-color: rgba(216, 183, 124, 0.5);
}

.intro-stage {
  position: absolute;
  left: max(34px, env(safe-area-inset-left));
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 5;
  font-family: var(--sans);
  font-size: 6px;
  letter-spacing: 0.24em;
  color: rgba(216, 183, 124, 0.34);
}

body.intro-active .brand,
body.intro-active .time-cluster,
body.intro-active .quote-block,
body.intro-active .hint,
body.intro-active .archive-btn,
body.intro-active .our-memories-btn,
body.intro-active .sound-btn,
body.intro-active .char-label,
body.intro-active .tooltip,
body.intro-active .dialogue {
  display: none !important;
  pointer-events: none !important;
}

body.intro-finished .intro-overlay {
  pointer-events: none;
}

body.intro-finished .brand,
body.intro-finished .time-cluster,
body.intro-finished .quote-block,
body.intro-finished .hint,
body.intro-finished .archive-btn,
body.intro-finished .our-memories-btn,
body.intro-finished .sound-btn {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition-duration: 0.7s;
}

/* --------------------------- moon veil ---------------------------- */

.moon-veil {
  position: absolute;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 28%, rgba(164, 196, 239, 0.12), transparent 27%),
    radial-gradient(ellipse at 50% 100%, rgba(10, 20, 34, 0.4), transparent 64%),
    #030710;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}

.moon-veil.is-on {
  opacity: 1;
}

body.moon-event-open .moon-veil {
  opacity: 0.12;
}

.moon-event-echo {
  margin: 20px 0 0;
  padding: 15px 0 3px;
  border-top: 1px solid rgba(203, 222, 249, 0.1);
}

.moon-event-echo p {
  margin: 0 0 7px;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.09em;
  color: rgba(238, 243, 250, 0.66);
}

.moon-event-note {
  margin: 0;
  font-family: var(--sans);
  font-size: 6px;
  letter-spacing: 0.24em;
  color: rgba(203, 222, 249, 0.32);
}

/* A touch more character label clarity. */
.char-label {
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), color 0.4s var(--ease);
}

.char-label.is-visible {
  opacity: 1;
}

/* Keep the main scene readable on short screens. */
@media (max-width: 760px) {
  .sound-btn {
    top: max(91px, calc(env(safe-area-inset-top) + 80px));
    left: max(20px, env(safe-area-inset-left));
    padding: 6px 8px;
    font-size: 7px;
  }

  .sound-btn span { display: none; }

  .intro-moon {
    top: 12%;
    width: 46vw;
    height: 46vw;
  }

  .intro-content {
    width: 86vw;
    padding-top: 56px;
  }

  .intro-content h2 {
    font-size: 33px;
    letter-spacing: 0.16em;
  }

  .intro-quote {
    font-size: 18px;
    letter-spacing: 0.14em;
  }

  .intro-skip {
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
  }

  .intro-stage {
    left: max(20px, env(safe-area-inset-left));
    bottom: max(20px, env(safe-area-inset-bottom));
  }
}



/* --------------------- phase 3 · character presence --------------------- */

.music-btn {
  top: max(232px, calc(env(safe-area-inset-top) + 216px));
}

.qin-status {
  position: absolute;
  left: max(38px, env(safe-area-inset-left));
  top: max(282px, calc(env(safe-area-inset-top) + 266px));
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 218px;
  padding: 11px 13px 10px;
  border: 1px solid rgba(216, 183, 124, 0.15);
  background:
    linear-gradient(110deg, rgba(17, 18, 22, 0.72), rgba(12, 15, 21, 0.44));
  color: rgba(242, 233, 216, 0.8);
  text-align: left;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), border-color 0.35s var(--ease);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.is-ready .qin-status {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0.78s;
}

.qin-status:hover {
  border-color: rgba(216, 183, 124, 0.4);
}

.qin-status:active {
  filter: brightness(1.08);
}

.qin-status-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(216, 183, 124, 0.68);
  font-family: var(--sans);
  font-size: 6.5px;
  letter-spacing: 0.22em;
}

.qin-status-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px rgba(242, 217, 171, 0.72);
}

.qin-status-main {
  max-width: 100%;
  overflow: hidden;
  color: rgba(242, 233, 216, 0.9);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.qin-status-sub {
  color: rgba(242, 233, 216, 0.36);
  font-family: var(--serif);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.qin-status.is-interacting {
  border-color: rgba(216, 183, 124, 0.52);
  box-shadow: 0 0 24px rgba(216, 183, 124, 0.08);
}

.qin-status.is-interacting .qin-status-dot {
  animation: qinStatusPulse 1.1s ease-in-out infinite;
}

@keyframes qinStatusPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.25); }
}

/* --------------------------- replay flow ----------------------------- */

.moon-event-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.moon-event-close,
.moon-event-replay {
  min-width: 112px;
}

.moon-event-replay {
  padding: 10px 18px;
  border: 1px solid rgba(216, 183, 124, 0.2);
  background: rgba(14, 17, 21, 0.4);
  color: rgba(242, 233, 216, 0.56);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.16em;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.moon-event-replay:hover {
  color: var(--gold-bright);
  border-color: rgba(216, 183, 124, 0.48);
}

.our-replay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 14px 0 0;
  padding: 12px 13px;
  border: 1px solid rgba(216, 183, 124, 0.16);
  background: rgba(216, 183, 124, 0.035);
  color: rgba(242, 233, 216, 0.7);
  text-align: left;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.our-replay small {
  color: rgba(242, 233, 216, 0.32);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.our-replay:hover {
  border-color: rgba(216, 183, 124, 0.38);
  color: var(--gold-bright);
}

.replay-guide {
  position: absolute;
  inset: 0;
  z-index: 135;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 4, 8, 0.76);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}

.replay-guide.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.replay-guide-card {
  width: min(460px, 92vw);
  padding: 30px 30px 24px;
  border: 1px solid rgba(216, 183, 124, 0.18);
  background:
    linear-gradient(145deg, rgba(22, 23, 27, 0.95), rgba(9, 12, 17, 0.98));
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.45);
  transform: translateY(10px);
  transition: transform 0.65s var(--ease);
}

.replay-guide.is-open .replay-guide-card {
  transform: translateY(0);
}

.replay-guide-card h2 {
  margin: 8px 0 0;
  color: rgba(246, 237, 222, 0.96);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.18em;
}

.replay-guide-lead {
  margin: 13px 0 18px;
  color: rgba(242, 233, 216, 0.46);
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.9;
}

.replay-guide-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.replay-guide-steps li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  color: rgba(242, 233, 216, 0.58);
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.7;
}

.replay-guide-steps b {
  color: rgba(216, 183, 124, 0.68);
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.14em;
  padding-top: 2px;
}

.replay-guide-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.replay-start,
.replay-cancel {
  padding: 10px 16px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.replay-start {
  flex: 1;
  border: 1px solid rgba(216, 183, 124, 0.48);
  background: rgba(216, 183, 124, 0.9);
  color: #17130f;
}

.replay-cancel {
  border: 1px solid rgba(216, 183, 124, 0.16);
  background: transparent;
  color: rgba(242, 233, 216, 0.46);
}

.replay-start:hover { background: var(--gold-bright); }
.replay-cancel:hover { color: var(--gold-bright); border-color: rgba(216, 183, 124, 0.36); }

body.intro-active .qin-status,
body.intro-active .music-btn {
  display: none !important;
  pointer-events: none !important;
}

body.intro-finished .qin-status {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition-duration: 0.7s;
}

@media (max-width: 760px) {
  .music-btn {
    top: max(129px, calc(env(safe-area-inset-top) + 118px));
  }

  .qin-status {
    left: max(20px, env(safe-area-inset-left));
    top: auto;
    bottom: max(190px, calc(env(safe-area-inset-bottom) + 180px));
    width: 172px;
    padding: 9px 10px 8px;
  }

  .qin-status-main { font-size: 11px; }
  .qin-status-sub { font-size: 7px; }
  .qin-status-kicker { font-size: 6px; letter-spacing: 0.16em; }

  .moon-event-actions {
    flex-direction: column;
    gap: 7px;
    margin-top: 18px;
  }

  .moon-event-close,
  .moon-event-replay {
    width: 100%;
  }

  .replay-guide-card {
    padding: 24px 20px 18px;
  }

  .replay-guide-card h2 { font-size: 23px; }
  .replay-guide-actions { flex-direction: column; }
  .replay-start, .replay-cancel { width: 100%; }
}

