:root {
  --ink: #221e18;
  --muted: #756c5d;
  --paper: #f5f1e8;
  --paper-deep: #ece6d8;
  --line: rgba(34, 30, 24, 0.14);
  --gold: #b08a4f;
  --gold-bright: #cfa965;
  --gold-soft: rgba(176, 138, 79, 0.35);
  --accent: #28627a;
  --room-color: #28627a;
  --serif: "Frank Ruhl Libre", Georgia, "Times New Roman", serif;
  --sans: "Heebo", Arial, sans-serif;
  --shadow-soft: 0 18px 44px rgba(44, 36, 24, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
}

body { overflow: hidden; }

button {
  color: inherit;
  font: inherit;
}

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

::selection { background: var(--gold-soft); }

.app-shell {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 60px;
}

/* ---------- Topbar ---------- */

.topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 0 22px;
  position: relative;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(255, 252, 244, 0.6), transparent);
  border-bottom: 1px solid var(--line);
}

.topbar::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 190px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
}

.wordmark {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark strong {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-70 {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 700;
  font-size: 13px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fffaf0;
  background: radial-gradient(circle at 32% 28%, #d8b275, #a97f43 72%);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(150, 112, 56, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.wordmark span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.icon-button, .nav-arrow, .dialog-close {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 50%;
  transition: background 200ms ease;
}

.icon-button:hover { background: rgba(176, 138, 79, 0.12); }

.menu-button {
  gap: 6px;
  align-content: center;
}

.menu-button span {
  width: 20px;
  height: 1.5px;
  background: currentColor;
  display: block;
  border-radius: 2px;
}

.sound-button {
  position: relative;
}

.sound-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.sound-button.playing svg {
  animation: sound-sway 2.6s ease-in-out infinite;
}

@keyframes sound-sway {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(-5deg) scale(1.06); }
}

.sound-button.muted { opacity: 0.55; }

.sound-button.muted::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 1.6px;
  background: currentColor;
  border-radius: 2px;
  transform: rotate(-45deg);
}

/* ---------- Stage ---------- */

#stage {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}

.room {
  min-height: 100%;
  animation: room-enter 700ms cubic-bezier(.22,.8,.24,1) both;
}

@keyframes room-enter {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

.room.enter-back { animation-name: room-enter-back; }

@keyframes room-enter-back {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

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

.entrance {
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #1c1813;
}

.entrance-image {
  position: relative;
  overflow: hidden;
}

.entrance-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(.92);
  /* Keep the slow zoom on its own GPU layer — without this the scale gets
     repainted on the CPU and the photos visibly tremble on some machines. */
  will-change: transform;
  backface-visibility: hidden;
  animation: slow-zoom 26s ease-in-out infinite alternate;
}

.entrance-image:first-child img { object-position: center 26%; }
.entrance-image:last-child img { animation-delay: -13s; }

@keyframes slow-zoom {
  from { transform: scale(1.01) translateZ(0); }
  to { transform: scale(1.08) translateZ(0); }
}

@media (prefers-reduced-motion: reduce) {
  .entrance-image img { animation: none; transform: scale(1.04); }
}

.entrance-copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  color: white;
  background: radial-gradient(ellipse at center, rgba(15, 12, 8, 0.42), rgba(15, 12, 8, 0.1) 70%);
  text-shadow: 0 2px 26px rgba(0,0,0,.6);
}

.entrance-badge {
  justify-self: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 21px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #fff8ea;
  border: 1px solid rgba(216, 178, 117, 0.9);
  border-radius: 50%;
  background: rgba(176, 138, 79, 0.22);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 0 6px rgba(216, 178, 117, 0.14), 0 8px 28px rgba(0, 0, 0, 0.35);
  margin-bottom: 26px;
  animation: badge-glow 3.6s ease-in-out infinite;
}

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 6px rgba(216, 178, 117, 0.12), 0 8px 28px rgba(0,0,0,.35); }
  50% { box-shadow: 0 0 0 9px rgba(216, 178, 117, 0.22), 0 8px 34px rgba(0,0,0,.4); }
}

.entrance-copy h1 {
  font-family: var(--serif);
  font-size: clamp(58px, 8.5vw, 124px);
  line-height: .92;
  margin: 0 0 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.entrance-copy p {
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.14em;
  margin: 0;
  color: rgba(255, 250, 238, 0.92);
}

.enter-button {
  pointer-events: auto;
  justify-self: center;
  margin-top: 38px;
  border: 1px solid rgba(216, 178, 117, 0.85);
  background: rgba(20, 15, 8, 0.3);
  color: #fff8ea;
  padding: 13px 38px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  font-size: 15px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 250ms ease, transform 250ms ease, box-shadow 250ms ease;
}

.enter-button:hover {
  background: rgba(176, 138, 79, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ---------- Finale ---------- */

.finale {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(30px, 5vw, 60px) 24px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(176, 138, 79, 0.18), transparent 60%),
    #15120e;
  color: white;
}

.finale-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
  max-width: 1100px;
  width: 100%;
}

.finale-letter {
  max-width: 580px;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.finale-kicker {
  color: var(--gold-bright);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.finale-letter h1 {
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.05;
  margin: 14px 0 28px;
  font-weight: 700;
}

.finale-blessing p {
  color: rgba(255, 250, 238, 0.78);
  font-size: 17px;
  line-height: 2;
  font-weight: 300;
  margin: 0 0 22px;
}

.finale-blessing .finale-signature {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--gold-bright);
  margin-bottom: 0;
}

/* The easter egg reads as plain text — only those in the know will press it. */
.finale-egg {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  cursor: inherit;
  transition: color 300ms ease;
}

.finale-egg:hover,
.finale-egg:focus-visible { color: var(--gold-bright); outline: none; }

.finale-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  justify-content: center;
}

/* ---------- Finale lyrics card (Spotify-style synced lyrics) ---------- */

.lyrics-card {
  display: flex;
  flex-direction: column;
  height: min(560px, 72vh);
  border: 1px solid rgba(216, 178, 117, 0.28);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(255, 250, 238, 0.05), rgba(255, 250, 238, 0.015));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.lyrics-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(216, 178, 117, 0.18);
  background: rgba(21, 18, 14, 0.6);
}

.lyrics-meta { display: flex; flex-direction: column; gap: 2px; }

.lyrics-meta strong {
  font-family: var(--serif);
  font-size: 19px;
  color: #fff8ea;
  letter-spacing: 0.02em;
}

.lyrics-meta small { font-size: 11.5px; color: rgba(255, 250, 238, 0.55); }
.lyrics-live-note { display: none; }
.lyrics-card.live .lyrics-live-note { display: block; }
.lyrics-card.live .lyrics-muted-note { display: none; }

.lyrics-eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 22px;
  height: 22px;
  flex: none;
}

.lyrics-eq i {
  flex: 1;
  background: var(--gold-bright);
  border-radius: 2px;
  height: 30%;
  animation: eq-bounce 1.1s ease-in-out infinite;
  animation-play-state: paused;
  opacity: 0.45;
}

.lyrics-card.live .lyrics-eq i { animation-play-state: running; opacity: 1; }
.lyrics-eq i:nth-child(2) { animation-delay: -0.4s; }
.lyrics-eq i:nth-child(3) { animation-delay: -0.8s; }
.lyrics-eq i:nth-child(4) { animation-delay: -0.2s; }

@keyframes eq-bounce {
  0%, 100% { height: 25%; }
  50% { height: 95%; }
}

.lyrics-viewport {
  position: relative;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 14%, black 86%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 14%, black 86%, transparent);
}

.lyrics-viewport::-webkit-scrollbar { display: none; }

.lyrics-lines {
  padding: 130px 26px 150px;
  text-align: center;
}

.lyric-line {
  margin: 0 0 13px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  color: rgba(255, 250, 238, 0.38);
  transition: color 400ms ease, transform 400ms ease;
}

.lyric-line.section-start { margin-top: 30px; }
.lyric-line.past { color: rgba(255, 250, 238, 0.2); }
.lyric-line.active { color: var(--gold-bright); transform: scale(1.08); }

.lyrics-tune-button {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  padding: 14px 26px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #d8b275, #ab8146);
  color: #241b0e;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.finale-actions button {
  border: 1px solid rgba(216, 178, 117, 0.55);
  background: transparent;
  color: #fff8ea;
  padding: 11px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 220ms ease, transform 220ms ease;
}

.finale-actions button:hover { background: rgba(176, 138, 79, 0.25); transform: translateY(-1px); }

.finale-actions .restart-tour {
  background: linear-gradient(135deg, #d8b275, #ab8146);
  border-color: transparent;
  color: #241b0e;
  font-weight: 600;
}

.finale-actions .restart-tour:hover { background: linear-gradient(135deg, #e3c084, #b78d50); }

/* ---------- Bottom navigation ---------- */

.room-nav {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: relative;
  z-index: 9;
  direction: ltr;
  background: linear-gradient(to top, rgba(255, 252, 244, 0.5), transparent);
}

.room-exit {
  border: 0;
  background: transparent;
  height: 100%;
  padding: 7px 22px;
  display: flex;
  align-items: center;
  gap: 13px;
  cursor: pointer;
  text-align: right;
  transition: background 220ms ease;
}

.room-exit:hover:not(:disabled) { background: rgba(176, 138, 79, 0.08); }

.next-room { justify-self: start; }
.prev-room { justify-self: end; }

.room-exit small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.room-exit strong {
  display: block;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.exit-arrow {
  color: var(--gold);
  font-size: 20px;
  transition: transform 220ms ease;
}

.next-room:hover:not(:disabled) .exit-arrow { transform: translateX(-3px); }
.prev-room:hover:not(:disabled) .exit-arrow { transform: translateX(3px); }

.room-exit:disabled { opacity: .18; cursor: default; }

.museum-button {
  border: 0;
  border-inline: 1px solid var(--line);
  align-self: stretch;
  background: transparent;
  padding: 0 26px;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.05em;
  transition: background 220ms ease, color 220ms ease;
}

.museum-button:hover { background: rgba(176, 138, 79, 0.1); }

/* ---------- Museum hall (map) ---------- */

.room-map {
  position: fixed;
  inset: 0;
  z-index: 30;
  width: 100%;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(216, 178, 117, 0.2), transparent 60%),
    #efe9dc;
  padding: clamp(22px, 4vw, 58px);
  transform: translateY(105%);
  transition: transform 540ms cubic-bezier(.22,.8,.24,1);
}

.room-map.open { transform: translateY(0); }

.map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.map-head::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: 0;
  width: 150px;
  height: 2px;
  background: linear-gradient(to left, var(--gold), transparent);
}

.map-head span {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 54px);
}

.map-head p { color: var(--muted); margin: 6px 0 0; font-size: 13px; }

.close-map { font-size: 28px; }

.map-list {
  margin-top: clamp(22px, 4vh, 48px);
  display: grid;
  grid-template-columns: repeat(10, minmax(74px, 1fr));
  gap: clamp(10px, 1.5vw, 22px);
  height: min(40vh, 390px);
  align-items: end;
}

.map-item {
  --door-height: 84%;
  border: 1px solid rgba(34, 30, 24, 0.3);
  background-color: #d6d0c5;
  background-image: linear-gradient(to top, rgba(15, 11, 6, 0.82), rgba(15, 11, 6, 0.05) 60%), var(--preview);
  background-size: cover;
  background-position: center;
  height: var(--door-height);
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: right;
  cursor: pointer;
  color: white;
  border-radius: 200px 200px 0 0;
  box-shadow:
    inset 0 0 0 5px rgba(239, 233, 220, 0.5),
    inset 0 0 0 6px rgba(176, 138, 79, 0.55),
    0 14px 30px rgba(44, 36, 24, 0.18);
  transition: height 320ms cubic-bezier(.22,.8,.24,1), filter 320ms ease, transform 320ms ease, box-shadow 320ms ease;
}

.map-item:nth-child(even) { --door-height: 94%; }

.map-item:hover, .map-item.active {
  height: 100%;
  filter: saturate(1.12) brightness(1.05);
  transform: translateY(-4px);
  box-shadow:
    inset 0 0 0 5px rgba(239, 233, 220, 0.5),
    inset 0 0 0 6px rgba(216, 178, 117, 0.9),
    0 22px 44px rgba(44, 36, 24, 0.28);
}

.map-item span {
  color: rgba(232, 213, 178, 0.95);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.map-item strong {
  font-family: var(--serif);
  font-size: clamp(13px, 1.4vw, 19px);
  font-weight: 500;
  margin-top: 3px;
}

.map-item.active { outline: 2px solid var(--gold); outline-offset: 4px; }

.map-item.endpoint {
  --door-height: 70%;
  box-shadow:
    inset 0 0 0 7px rgba(239, 233, 220, 0.6),
    inset 0 0 0 8px rgba(176, 138, 79, 0.65),
    0 14px 30px rgba(44, 36, 24, 0.18);
}

.map-item.entrance { order: -1; }
.map-item.finale { order: 10; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(24, 18, 10, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms ease;
}

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

/* ---------- Album button (inside map) ---------- */

.album-button {
  width: 100%;
  margin-top: clamp(16px, 2.5vh, 26px);
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: right;
  padding: 14px 18px;
  cursor: pointer;
  background: linear-gradient(to left, rgba(216, 178, 117, 0.16), rgba(216, 178, 117, 0.04));
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  transition: border-color 220ms ease, background 220ms ease, transform 220ms ease;
}

.album-button:hover {
  border-color: var(--gold);
  background: linear-gradient(to left, rgba(216, 178, 117, 0.26), rgba(216, 178, 117, 0.08));
  transform: translateY(-2px);
}

.album-button svg {
  width: 26px;
  flex: none;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
}

.album-button span:not(.album-button-arrow) { flex: 1; }

.album-button strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.album-button small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.album-button-arrow {
  color: var(--gold);
  font-size: 20px;
  transition: transform 220ms ease;
}

.album-button:hover .album-button-arrow { transform: translateX(-4px); }

/* ---------- Album view ---------- */

.album-view {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(216, 178, 117, 0.2), transparent 60%),
    #efe9dc;
  padding: clamp(18px, 3vh, 44px) clamp(18px, 4vw, 58px) 0;
  transform: translateY(105%);
  transition: transform 540ms cubic-bezier(.22,.8,.24,1);
}

.album-view.open { transform: translateY(0); }

.album-head {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.album-head::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: 0;
  width: 150px;
  height: 2px;
  background: linear-gradient(to left, var(--gold), transparent);
}

.album-head span {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 48px);
}

.album-head p { color: var(--muted); margin: 6px 0 0; font-size: 13px; }

.close-album { font-size: 28px; }

.album-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
  padding: 6px 2px 54px;
}

.album-room { margin-top: clamp(26px, 4vh, 42px); }

.album-room-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}

.album-room-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 28px);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--room-accent, var(--gold));
}

.album-room-head span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(10px, 1.4vw, 16px);
}

.album-thumb {
  border: 1px solid rgba(34, 30, 24, 0.22);
  background: #fffdf6;
  padding: 7px;
  aspect-ratio: 1;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 6px 16px rgba(44, 36, 24, 0.1);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.album-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}

.album-thumb:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 14px 28px rgba(44, 36, 24, 0.2);
}

/* ---------- Room transition ---------- */

.room-transition {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at center, rgba(216, 178, 117, 0.16), transparent 65%),
    var(--paper);
  transition: opacity 420ms ease;
}

.room-transition.active { opacity: 1; }

.transition-card {
  text-align: center;
  transform: translateY(8px);
  transition: transform 420ms cubic-bezier(.22,.8,.24,1);
}

.room-transition.active .transition-card { transform: translateY(0); }

.transition-kicker {
  display: block;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.22em;
  margin-bottom: 14px;
}

.transition-title {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 76px);
  color: var(--ink);
}

.transition-step {
  display: block;
  margin-top: 12px;
  color: #93753f;
  font-size: 13px;
  letter-spacing: 0.14em;
}

.transition-step:empty { display: none; }

.transition-rule {
  display: block;
  width: 120px;
  height: 2px;
  margin: 22px auto 0;
  background: linear-gradient(to right, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
}

/* ---------- Exhibit dialog ---------- */

.exhibit-dialog {
  width: min(1100px, calc(100vw - 32px));
  height: min(820px, calc(100dvh - 32px));
  border: 0;
  padding: 0;
  border-radius: 10px;
  background: #16130e;
  color: white;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
}

.exhibit-dialog::backdrop { background: rgba(14, 10, 5, 0.82); }

.dialog-close {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  font-size: 26px;
  color: white;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  transition: background 200ms ease;
}

.dialog-close:hover { background: rgba(176, 138, 79, 0.4); }

.dialog-nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 52px;
  height: 52px;
  place-items: center;
  font-size: 26px;
  color: white;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  transition: background 200ms ease;
}

.exhibit-dialog.album-mode .dialog-nav { display: grid; }

.dialog-nav:hover:not(:disabled) { background: rgba(176, 138, 79, 0.45); }

.dialog-nav:disabled { opacity: 0.25; cursor: default; }

.dialog-prev { right: 14px; }
.dialog-next { left: 14px; }

.exhibit-dialog figure {
  height: 100%;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.dialog-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.dialog-video {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: black;
}

.exhibit-dialog.video-mode .dialog-video { display: block; }
.exhibit-dialog.video-mode .dialog-image { display: none; }

.exhibit-dialog figcaption {
  border-top: 1px solid rgba(216, 178, 117, 0.35);
  padding: 14px 22px 18px;
  background: linear-gradient(to top, rgba(216, 178, 117, 0.06), transparent);
}

.dialog-room {
  color: var(--gold-bright);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.dialog-counter {
  color: rgba(255, 252, 244, 0.55);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.dialog-counter:not(:empty)::before {
  content: "·";
  margin-inline: 8px;
  color: var(--gold-soft);
}

.dialog-caption {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 17px;
}

/* ---------- 3D room ---------- */

.spatial-room {
  height: 100%;
  overflow: hidden;
  position: relative;
  background: var(--paper-deep);
}

.spatial-room::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 130% 105% at 50% 46%, transparent 62%, rgba(30, 22, 12, 0.18)),
    linear-gradient(to bottom, rgba(34, 26, 16, .08), transparent 12%);
}

.app-shell:has(.spatial-room) {
  grid-template-rows: 64px minmax(0, 1fr) 0;
}

.app-shell:has(.spatial-room) .room-nav { display: none; }

.spatial-canvas, .spatial-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.spatial-canvas canvas:active { cursor: grabbing; }

.spatial-title {
  position: absolute;
  top: 16px;
  right: 24px;
  z-index: 3;
  color: var(--ink);
  padding: 12px 16px 13px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 252, 243, 0.88), rgba(255, 252, 243, 0.62));
  backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid rgba(176, 138, 79, 0.35);
  box-shadow: 0 10px 28px rgba(44, 36, 24, 0.14);
}

.spatial-title span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #93753f;
  margin-bottom: 2px;
}

.spatial-title strong {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.1;
}

.spatial-help {
  position: absolute;
  z-index: 3;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(60, 48, 30, 0.85);
  background: rgba(255, 252, 243, 0.78);
  border: 1px solid rgba(176, 138, 79, 0.3);
  border-radius: 999px;
  padding: 8px 18px 9px;
  font-size: 11px;
  pointer-events: none;
  backdrop-filter: blur(8px);
  text-align: center;
  transition: opacity 600ms ease;
  animation: help-fade 11s ease forwards;
}

@keyframes help-fade {
  0%, 80% { opacity: 1; }
  100% { opacity: 0; }
}

.spatial-room.explored .spatial-help { opacity: 0; }

.spatial-help strong {
  margin-inline-end: 8px;
  font-weight: 600;
}

.spatial-caption {
  position: absolute;
  z-index: 4;
  bottom: 86px;
  left: 50%;
  transform: translate(-50%, 12px);
  max-width: min(480px, calc(100% - 30px));
  color: #2c2317;
  border: 1px solid rgba(176, 138, 79, 0.45);
  border-radius: 10px;
  background: rgba(255, 252, 243, 0.96);
  padding: 11px 18px 12px;
  box-shadow: 0 14px 36px rgba(36, 27, 16, 0.22);
  opacity: 0;
  transition: opacity 240ms ease, transform 240ms ease;
  pointer-events: none;
  font-size: 13px;
  font-family: var(--serif);
  text-align: center;
}

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

.spatial-controls {
  position: absolute;
  z-index: 4;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  direction: ltr;
  padding: 7px;
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.66);
  border: 1px solid rgba(176, 138, 79, 0.35);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(44, 36, 24, 0.16);
}

.spatial-controls button {
  border: 1px solid rgba(176, 138, 79, 0.35);
  background: rgba(255, 255, 255, 0.7);
  color: #4a3a22;
  min-width: 56px;
  min-height: 48px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  touch-action: none;
}

.spatial-controls button:hover,
.spatial-controls button:active {
  background: linear-gradient(135deg, #e3c084, #c49a58);
  color: #2c2010;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(150, 112, 56, 0.35);
}

.spatial-controls button span,
.spatial-controls button small {
  display: block;
  line-height: 1.15;
}

.spatial-controls button small {
  margin-top: 1px;
  font-size: 9px;
  opacity: 0.75;
}

/* ---------- Mobile ---------- */

@media (max-width: 760px) {
  .app-shell { grid-template-rows: 56px minmax(0, 1fr) 54px; }
  .topbar { padding: 0 10px; }
  .wordmark { gap: 8px; }
  .wordmark strong { font-size: 22px; }
  .wordmark span { display: none; }
  .badge-70 { width: 26px; height: 26px; font-size: 12px; }
  .entrance { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .entrance-copy {
    place-content: center;
    padding: 0 18px 120px;
    background: linear-gradient(to bottom, transparent 30%, rgba(13, 10, 6, 0.58) 72%, rgba(13, 10, 6, 0.2));
  }
  .entrance-badge { width: 48px; height: 48px; font-size: 18px; margin-bottom: 18px; }
  .entrance-copy h1 { font-size: 58px; }
  .entrance-copy p { font-size: 13px; letter-spacing: 0.1em; }
  .enter-button { margin-top: 22px; padding: 11px 30px; }

  .finale { padding: 28px 20px 44px; }
  .finale-panels { grid-template-columns: 1fr; gap: 30px; }
  .finale-letter h1 { font-size: 38px; margin-bottom: 22px; }
  .finale-blessing p { font-size: 15.5px; margin-bottom: 18px; }
  .finale-blessing .finale-signature { font-size: 18px; }
  .finale-actions { margin-top: 22px; flex-wrap: wrap; }
  .lyrics-card { height: 380px; }
  .lyrics-lines { padding: 110px 20px 130px; }
  .lyric-line { font-size: 15.5px; }
  .lyrics-tune-button { bottom: 64px; width: max-content; max-width: 90vw; }

  .room-exit { padding: 5px 10px; gap: 6px; }
  .room-exit small { display: none; }
  .room-exit strong { font-size: 11px; max-width: 78px; line-height: 1.25; }
  .museum-button { padding: 0 12px; font-size: 10px; }

  .room-map { padding: 18px 14px; }
  .album-button { padding: 11px 14px; gap: 12px; }
  .album-button strong { font-size: 15px; }
  .album-button small { font-size: 11px; }
  .album-view { padding: 16px 14px 0; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .dialog-nav { width: 42px; height: 42px; font-size: 20px; }
  .dialog-prev { right: 8px; }
  .dialog-next { left: 8px; }
  .map-list {
    height: auto;
    max-height: calc(100dvh - 218px);
    overflow-y: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    padding-bottom: 24px;
    gap: 14px;
  }
  .map-item, .map-item:nth-child(even), .map-item:hover, .map-item.active, .map-item.endpoint {
    height: 175px;
    transform: none;
    border-radius: 110px 110px 0 0;
  }

  .app-shell:has(.spatial-room) { grid-template-rows: 56px minmax(0, 1fr) 0; }
  .spatial-title { top: 10px; right: 10px; padding: 9px 12px 10px; }
  .spatial-title strong { font-size: 20px; }
  .spatial-help {
    top: auto;
    bottom: 84px;
    white-space: nowrap;
    font-size: 10px;
    padding: 6px 13px 7px;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .spatial-help strong { display: none; }
  .spatial-caption { bottom: 132px; font-size: 12px; }
  .spatial-controls {
    bottom: 10px;
    gap: 5px;
    padding: 5px;
    max-width: calc(100% - 16px);
  }
  .spatial-controls button {
    min-width: 50px;
    padding: 3px 6px;
    min-height: 46px;
    font-size: 14px;
  }
  .spatial-controls button small { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
