/* Настоящий музейный зал — вид от первого лица */
:root {
  --wall: #d9d0c2;
  --wall-deep: #cfc5b5;
  --trim: #8b7355;
  --floor1: #b8956a;
  --floor2: #9a7548;
  --spot: rgba(255, 245, 220, 0.55);
  --ink: #2a241c;
  --paper: #f7f1e6;
  --gold: #8a6a2e;
  --font-d: "Cormorant Garamond", Georgia, serif;
  --font-b: "Manrope", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-b);
  color: var(--ink);
  background: #1a1510;
}

.museum {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  perspective: 1100px;
  perspective-origin: 50% 45%;
}

.museum::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 35%, rgba(20, 14, 8, 0.35) 100%);
}

.corridor {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.ceil,
.floor {
  /* 3D-плоскости часто «ломаются» в перспективе — прячем, пол/потолок дают strip'ы */
  display: none;
}

.hud {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  background: linear-gradient(180deg, rgba(20, 16, 12, 0.65), transparent);
  color: #f3e6cc;
  pointer-events: none;
}

.hud a {
  pointer-events: auto;
  color: #f3e6cc;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.hud .brand {
  font-family: var(--font-d);
  font-size: 1.25rem;
  color: #e8d09a;
}

.hud .prog {
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.85;
}

/* Коридор */
.corridor {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.wall-back,
.wall-left,
.wall-right,
.ceil,
.floor {
  position: absolute;
  transform-style: preserve-3d;
}

.wall-back {
  left: 8%;
  right: 8%;
  top: 6%;
  bottom: 22%;
  background:
    radial-gradient(ellipse at 50% 20%, var(--spot), transparent 55%),
    linear-gradient(180deg, #e5ddd0 0%, var(--wall) 40%, var(--wall-deep) 100%);
  border: 10px solid #a89070;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.25),
    0 0 60px rgba(0, 0, 0, 0.25);
  transform: translateZ(-420px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.wall-left,
.wall-right {
  top: 4%;
  bottom: 18%;
  width: 55%;
  background:
    linear-gradient(180deg, #e8e0d3, var(--wall) 45%, #c8bdae),
    repeating-linear-gradient(
      180deg,
      transparent 0 120px,
      rgba(0, 0, 0, 0.03) 120px 121px
    );
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.08);
}

.wall-left {
  left: -28%;
  transform: rotateY(72deg) translateZ(-40px);
  transform-origin: right center;
  border-right: 8px solid var(--trim);
}

.wall-right {
  right: -28%;
  transform: rotateY(-72deg) translateZ(-40px);
  transform-origin: left center;
  border-left: 8px solid var(--trim);
}

.rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12%;
  height: 10px;
  background: linear-gradient(180deg, #c4a882, #8a6a45);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.spot {
  position: absolute;
  top: 8%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f5ecd8;
  box-shadow: 0 0 40px 20px rgba(255, 240, 200, 0.35);
}

.spot--l {
  left: 22%;
}
.spot--r {
  right: 22%;
}

/* Картина на дальней стене — крупнее */
.painting {
  --art-ratio: 4 / 3;
  --zoom: 1;
  --pan-x: 0%;
  --pan-y: 0%;
  width: min(94%, 860px);
  max-height: min(78vh, 680px);
  background: #1a1510;
  padding: 12px;
  border: 1px solid #5a4630;
  box-shadow:
    0 0 0 8px #7a5c38,
    0 0 0 10px #d4b56a,
    0 0 0 14px #5a4028,
    0 25px 50px rgba(0, 0, 0, 0.35);
  transform: translateZ(1px);
  transition: opacity 0.4s, width 0.35s ease;
  display: flex;
  flex-direction: column;
  cursor: zoom-in;
}

.painting.is-portrait {
  width: min(62%, 520px);
  max-height: min(82vh, 720px);
}

.painting.is-landscape {
  width: min(96%, 920px);
  max-height: min(74vh, 640px);
}

.painting.is-zoomed {
  cursor: grab;
}

.painting.is-zoomed.is-panning {
  cursor: grabbing;
}

.painting__stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--art-ratio);
  max-height: min(70vh, 620px);
  overflow: hidden;
  background: #0e0b08;
  touch-action: none;
  user-select: none;
}

.painting.is-portrait .painting__stage {
  max-height: min(64vh, 560px);
}

.painting img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #0e0b08;
  transform: scale(var(--zoom)) translate(var(--pan-x), var(--pan-y));
  transform-origin: center center;
  transition: transform 0.08s linear;
  pointer-events: none;
}

.painting__zoom {
  position: absolute;
  z-index: 4;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 4px;
  pointer-events: auto;
}

.painting__zoom button {
  width: 34px;
  height: 34px;
  border: 1px solid #cbb89a;
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.92);
  color: #2a241c;
  font: 700 1.1rem/1 system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.painting__zoom button:active {
  background: #f3e6cc;
}

.museum {
  touch-action: pan-y;
}

.painting img.is-rotate-90 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: rotate(90deg);
  transform-origin: center center;
}

.painting__ph {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(50vh, 380px);
  padding: 1rem;
  text-align: center;
  color: #e8d09a;
  font-family: var(--font-d);
  font-size: 1.25rem;
  background: #1a1510;
}

.plaque {
  margin-top: 0.55rem;
  padding: 0.35rem 0.5rem;
  background: #f3ebe0;
  color: #2a241c;
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
  border: 1px solid #cbb89a;
}

.plaque strong {
  display: block;
  font-family: var(--font-d);
  font-size: 0.95rem;
}

/* Боковые картины (декор зала) */
.side-art {
  position: absolute;
  width: 28%;
  top: 22%;
  aspect-ratio: 3 / 4;
  padding: 6px;
  background: #1a1510 center / contain no-repeat;
  box-shadow: 0 0 0 3px #c4a35a, 0 10px 20px rgba(0, 0, 0, 0.25);
  opacity: 0.9;
  filter: brightness(0.92);
}

.side-art--1 {
  left: 12%;
  top: 18%;
}
.side-art--2 {
  left: 48%;
  top: 28%;
}
.side-art--3 {
  right: 12%;
  top: 18%;
}
.side-art--4 {
  right: 48%;
  top: 28%;
}

/* Гид Сандра — крупнее, в полный рост */
.guide {
  position: absolute;
  z-index: 15;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  max-width: min(98vw, 720px);
  pointer-events: none;
  height: min(88vh, 780px);
}

.guide__photo {
  flex: 0 0 auto;
  width: min(52vw, 320px);
  height: min(84vh, 740px);
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: bottom center;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  pointer-events: none;
  align-self: flex-end;
  transform-origin: 50% 100%;
  animation: none;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.38));
  will-change: transform;
  max-height: none;
}

.guide__photo.is-walking {
  animation: sandra-bob 0.42s ease-in-out infinite;
}

.guide__photo.is-avatar {
  display: grid;
  place-items: center;
  width: min(28vw, 120px);
  height: min(28vw, 120px);
  border-radius: 50%;
  background: #8a6a2e;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  animation: none;
}

/* Лёгкий подъём при смене кадра ног */
@keyframes sandra-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.guide__photo.is-talk {
  animation: sandra-bob 0.55s ease-in-out infinite;
}

.guide__photo.is-stride {
  animation: sandra-stride 0.45s ease-out 1;
}

@keyframes sandra-stride {
  0% {
    transform: translateX(0) translateY(0);
  }
  40% {
    transform: translateX(12px) translateY(-7px);
  }
  100% {
    transform: translateX(0) translateY(0);
  }
}

.bubble {
  pointer-events: auto;
  background: rgba(255, 252, 246, 0.97);
  border: 1px solid #cbb89a;
  border-radius: 16px;
  padding: 1rem 1.1rem 1.05rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
  max-height: 52vh;
  overflow: auto;
  min-width: min(78vw, 380px);
  max-width: min(92vw, 460px);
}

.walk-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #7a6a55;
}

.bubble__who {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
}

.bubble__say {
  margin: 0 0 0.55rem;
  font-family: var(--font-d);
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  line-height: 1.35;
  min-height: 4.2em;
  white-space: pre-line;
}

.bubble__say.is-karaoke::after {
  content: "";
  display: inline-block;
  width: 0.45ch;
  margin-left: 1px;
  height: 1em;
  background: #8a6a2e;
  vertical-align: text-bottom;
  animation: caret 0.8s step-end infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.walk-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #7a6a55;
}

.bubble__ask {
  margin: 0 0 0.4rem;
  font-weight: 700;
  font-size: 0.92rem;
}

.bubble__ask[hidden],
.opts[hidden] {
  display: none !important;
}

.opts .opt.is-hint {
  pointer-events: none;
  opacity: 0.9;
  border-style: dashed;
  background: #fffaf0;
  cursor: default;
}

.painting__hots {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  transform: scale(var(--zoom)) translate(var(--pan-x), var(--pan-y));
  transform-origin: center center;
}

.painting__hots.is-on {
  pointer-events: auto;
  cursor: crosshair;
}

.painting__hots .hot {
  position: absolute;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  cursor: pointer;
  box-sizing: border-box;
}

.painting__hots.is-on .hot {
  /* лёгкая подсказка зоны без спойлера */
  box-shadow: inset 0 0 0 1px rgba(255, 240, 200, 0.12);
}

.painting__hots .hot:focus-visible,
.painting__hots.is-on .hot:hover {
  border-color: rgba(212, 181, 106, 0.55);
  background: rgba(255, 248, 220, 0.12);
}

.painting__hots .hot.is-ok {
  border-color: #5a8a4a;
  background: rgba(120, 180, 100, 0.25);
}

.painting__hots .hot.is-bad {
  border-color: #a05040;
  background: rgba(180, 70, 50, 0.2);
}

.painting__hots .hot.is-done {
  pointer-events: none;
}

.opts {
  display: grid;
  gap: 0.3rem;
}

.opt {
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  border: 1px solid #cbb89a;
  background: #fff;
  border-radius: 6px;
}

.opt:hover {
  border-color: var(--gold);
  background: #fff8ea;
}

.opt.is-ok {
  border-color: #5a8a4a;
  background: #e8f3e2;
}

.opt.is-bad {
  border-color: #a45;
  background: #f8e4e2;
}

.secret {
  display: none;
  margin: 0.45rem 0 0;
  padding: 0.45rem 0.5rem;
  background: #f3ebe0;
  border-left: 3px solid var(--gold);
  font-size: 0.85rem;
  line-height: 1.4;
}

.secret.is-on {
  display: block;
}

.controls {
  position: absolute;
  z-index: 25;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: #2a241c;
  color: #f3e6cc;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn--light {
  background: #f3e6cc;
  color: #2a241c;
}

.illus-dock {
  display: none;
}

@media (max-width: 700px) {
  .guide {
    left: 0;
    right: 0.2rem;
    bottom: 4.2rem;
    max-width: none;
    height: min(58vh, 420px);
    align-items: flex-end;
  }
  .guide__photo {
    width: min(46vw, 190px);
    height: min(54vh, 380px);
    aspect-ratio: 3 / 4;
  }
  .bubble {
    max-height: 34vh;
    width: 100%;
    min-width: 0;
  }
  .painting {
    width: 78% !important;
    padding: 8px;
  }
  .painting.is-portrait {
    width: 52% !important;
  }
  .painting__stage,
  .painting__ph {
    max-height: min(34vh, 260px);
  }
  .wall-left,
  .wall-right {
    opacity: 0.9;
  }
}


/* Расписание смен */
.sched-btn {
  pointer-events: auto;
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  border: 1px solid rgba(243, 230, 204, 0.45);
  background: rgba(20, 16, 12, 0.55);
  color: #f3e6cc;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.sched {
  display: none;
  position: absolute;
  z-index: 40;
  top: 3.2rem;
  right: 0.75rem;
  width: min(92vw, 340px);
  max-height: 70vh;
  overflow: auto;
  background: rgba(255, 252, 246, 0.97);
  color: #2a241c;
  border: 1px solid #cbb89a;
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.sched.is-open { display: block; }

.sched h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-d);
  font-size: 1.25rem;
}

.sched .note {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #6a5a48;
}

.sched-row {
  display: grid;
  grid-template-columns: 2.6rem 5.2rem 1fr;
  gap: 0.35rem 0.55rem;
  align-items: center;
  padding: 0.45rem 0.4rem;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
}

.sched-thumb {
  width: 2.5rem;
  height: 3.2rem;
  object-fit: contain;
  object-position: bottom center;
  border-radius: 6px;
  background: linear-gradient(180deg, #ebe4d8, #d8cfc0);
}

.sched-thumb--empty {
  display: block;
  border-radius: 6px;
}

.sched-row.is-now {
  background: #fff0d6;
  outline: 2px solid #c4a35a;
}

.sched-row .time {
  font-weight: 800;
  color: #8a6a2e;
}

.sched-row .name {
  font-weight: 700;
}

.guide__photo.is-avatar {
  display: grid;
  place-items: center;
  font-family: var(--font-d);
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  object-fit: unset;
}

.guide__photo[hidden] { display: none !important; }


.museum-closed {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(18, 14, 10, 0.82);
  backdrop-filter: blur(6px);
  padding: 1.25rem;
}
.museum-closed[hidden] { display: none !important; }
.museum-closed__card {
  width: min(92vw, 420px);
  background: #fffaf2;
  color: #2a241c;
  border-radius: 16px;
  padding: 1.4rem 1.3rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
}
.museum-closed__card h1 {
  margin: 0 0 .5rem;
  font-family: var(--font-d);
  font-size: 1.8rem;
}
.museum-closed__hours { margin: 0; color: #6a5a48; }
.museum-closed__come {
  margin: 1rem 0;
  font-family: var(--font-d);
  font-size: 1.45rem;
  font-weight: 700;
  color: #8a6a2e;
}
.museum-closed__hint {
  margin: 0 0 1rem;
  font-size: .85rem;
  color: #6a5a48;
  line-height: 1.4;
}
.museum.is-closed .corridor,
.museum.is-closed .guide,
.museum.is-closed .controls {
  filter: blur(2px);
  pointer-events: none;
}


.hours-warn {
  position: absolute;
  z-index: 35;
  left: 50%;
  top: 3.1rem;
  transform: translateX(-50%);
  width: min(94vw, 520px);
  margin: 0;
  padding: 0.45rem 0.7rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #3a2a10;
  background: #ffe8a8;
  border: 1px solid #c4a35a;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.museum-closed__warn {
  margin: 0 0 0.5rem;
  padding: 0.55rem 0.6rem;
  background: #fff3cd;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #5a4010;
}


/* Фото пола и потолка — всегда видны по краям зала */
.floor-strip {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32vh;
  background:
    linear-gradient(180deg, rgba(26, 21, 16, 0) 0%, rgba(26, 21, 16, 0.18) 55%, rgba(26, 21, 16, 0.45) 100%),
    url("./paintings/museum/floor.jpg?v=floor4") center top / cover no-repeat;
  pointer-events: none;
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
}
.ceil-strip {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: 0;
  height: 20vh;
  background:
    linear-gradient(0deg, rgba(26, 21, 16, 0) 0%, rgba(26, 21, 16, 0.12) 70%, rgba(26, 21, 16, 0.35) 100%),
    url("./paintings/museum/ceiling.jpg?v=floor4") center bottom / cover no-repeat;
  pointer-events: none;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 8% 100%);
}

/* —— museum walk / map / pavilions / book —— */
.hud-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.hall-banner {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: 18%;
  transform: translate(-50%, -12px);
  margin: 0;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: rgba(20, 14, 8, 0.78);
  color: #f3e6cc;
  font-family: var(--font-d);
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.hall-banner.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.corridor.is-step .wall-left,
.corridor.is-step .wall-right {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.corridor.is-hall-change {
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
.corridor.is-hall-change .floor-strip,
.museum:has(.corridor.is-hall-change) .floor-strip {
  animation: floor-step 0.7s ease;
}
@keyframes floor-step {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(6px); }
}

.museum.is-street .wall-back {
  border-color: #5a6570;
  background:
    linear-gradient(180deg, #7ec8e8 0%, #c5d6e0 38%, #9aa3ab 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15), 0 0 40px rgba(0, 0, 0, 0.35);
}
.museum.is-street .painting {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.museum.is-street .plaque {
  background: rgba(18, 22, 28, 0.82);
  color: #e8eef4;
}

.floor-map {
  position: absolute;
  z-index: 45;
  right: 0.75rem;
  top: 3.2rem;
  width: min(92vw, 340px);
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(28, 22, 16, 0.94);
  color: #f3e6cc;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.floor-map__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.floor-map__head h2 {
  margin: 0;
  font-family: var(--font-d);
  font-size: 1.2rem;
}
.floor-map__note {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  opacity: 0.8;
  line-height: 1.35;
}
.floor-map__hall {
  grid-column: 1 / -1;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4a35a;
}
.floor-map__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
}
.floor-map__pin {
  border: 1px solid rgba(243, 230, 204, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #f3e6cc;
  border-radius: 8px;
  min-height: 2rem;
  font-weight: 700;
  cursor: pointer;
}
.floor-map__pin.is-pavilion {
  border-color: #c4a35a;
}
.floor-map__pin.is-here {
  background: #c4a35a;
  color: #1a1510;
}
.floor-map__pin.is-done {
  box-shadow: inset 0 0 0 1px rgba(120, 200, 120, 0.7);
}

.btn--dream {
  background: linear-gradient(180deg, #f0d78c, #c4a35a);
  color: #1a1510;
  font-weight: 700;
}

.entry-artist,
.book-gift {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(12, 10, 8, 0.72);
}
.entry-artist[hidden],
.book-gift[hidden],
.dream-pavilion[hidden],
.floor-map[hidden] {
  display: none !important;
}
.entry-artist__card,
.book-gift__card {
  width: min(92vw, 440px);
  max-height: 90vh;
  overflow: auto;
  padding: 1.2rem 1.25rem 1.35rem;
  border-radius: 16px;
  background: linear-gradient(165deg, #f7f1e6, #e8dcc8);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.entry-artist__kicker,
.book-gift__kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
}
.entry-artist__card h2,
.book-gift__card h2 {
  margin: 0.35rem 0 0.75rem;
  font-family: var(--font-d);
  font-size: 1.65rem;
}
.entry-artist__card img {
  width: 140px;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.entry-artist__name {
  margin: 0.7rem 0 0.25rem;
  font-weight: 800;
}
.entry-artist__why,
.book-gift__congrats {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-line;
}

.ebook {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.75rem;
  text-align: left;
  margin-bottom: 1rem;
}
.ebook__cover {
  width: 110px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}
.ebook__pages h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-d);
  font-size: 1.15rem;
}
.ebook__author {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: #6a5a45;
}
.ebook__pages strong {
  display: block;
  margin-bottom: 0.35rem;
}
.ebook__pages p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}
.ebook__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.dream-pavilion {
  position: absolute;
  inset: 0;
  z-index: 55;
  background: #0d0a08;
}
.dream-hud {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  color: #f3e6cc;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
}
.dream-title {
  font-family: var(--font-d);
  font-size: 1.15rem;
}
.dream-hint {
  font-size: 0.75rem;
  opacity: 0.85;
}
.dream-scene {
  position: absolute;
  inset: 0;
  perspective: 900px;
  overflow: hidden;
}
.dream-world {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 520px;
  height: 420px;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) translate3d(0, 0, -140px);
}
.dream-ceil,
.dream-floor,
.dream-wall {
  position: absolute;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.dream-ceil,
.dream-floor {
  left: 0;
  width: 100%;
  height: 100%;
}
.dream-ceil {
  top: 0;
  background:
    radial-gradient(circle at 20% 30%, #ffe566 0.35rem, transparent 0.4rem),
    radial-gradient(circle at 70% 60%, #111 0.45rem, transparent 0.5rem),
    #f5d84a;
  background-size: 28px 28px, 36px 36px, auto;
  transform: rotateX(90deg) translateZ(210px);
}
.dream-floor {
  bottom: 0;
  background:
    radial-gradient(circle at 30% 40%, #111 0.4rem, transparent 0.45rem),
    #f0c93a;
  background-size: 32px 32px, auto;
  transform: rotateX(-90deg) translateZ(210px);
}
.dream-wall {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 4px solid rgba(20, 14, 8, 0.35);
}
.dream-wall img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dream-wall--n { transform: translateZ(-260px); }
.dream-wall--s { transform: rotateY(180deg) translateZ(-260px); }
.dream-wall--e { transform: rotateY(90deg) translateZ(-260px); }
.dream-wall--w { transform: rotateY(-90deg) translateZ(-260px); }

.dream-guide,
.cave-person,
.robot-dog {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%) scale(var(--near, 1));
  transform-origin: center bottom;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}
.dream-guide img,
.cave-person img {
  display: block;
  height: min(42vh, 320px);
  width: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}
.cave-person {
  left: 28%;
}
.cave-person img {
  height: min(36vh, 280px);
}
.robot-dog {
  left: 72%;
  bottom: 10%;
}
.robot-dog img {
  display: block;
  height: min(18vh, 140px);
  width: auto;
  transform-origin: 70% 80%;
  animation: wag 0.55s ease-in-out infinite;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.4));
}
.robot-dog.is-near img {
  animation-duration: 0.28s;
}
.robot-dog.is-bark img {
  animation: bark-bounce 0.35s ease;
}
@keyframes wag {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(8deg); }
}
@keyframes bark-bounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  40% { transform: translateY(-10px) rotate(-4deg); }
}
.robot-dog__bark {
  position: absolute;
  top: -0.4rem;
  left: 55%;
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  background: #fff;
  color: #222;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.cave-pavilion .dream-ceil {
  background: linear-gradient(180deg, #3a2e24, #2a221c);
}
.cave-pavilion .dream-floor {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(80, 60, 40, 0.5), transparent 55%),
    #1a1510;
}
.cave-wall {
  border-color: #4a3a2a;
}

.dream-bubble {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: rgba(247, 241, 230, 0.95);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

@media (max-width: 700px) {
  .ebook {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .dream-hud {
    flex-wrap: wrap;
  }
  .floor-map__grid {
    grid-template-columns: repeat(5, 1fr);
  }
}


/* full-screen pavilions */
.dream-pavilion,
.cave-pavilion {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 70 !important;
  background: #0a0806;
}
.dream-scene,
.cave-scene {
  inset: 0 !important;
  width: 100%;
  height: 100%;
  perspective: min(1200px, 140vw);
}
.dream-world,
.cave-world {
  width: min(92vw, 720px) !important;
  height: min(72vh, 560px) !important;
}
.dream-hud {
  padding: max(0.7rem, env(safe-area-inset-top)) 1rem 0.7rem;
}
.dream-bubble {
  bottom: max(1.2rem, env(safe-area-inset-bottom));
  width: min(94vw, 520px);
  font-size: 1rem;
}
.guide__photo.is-artist {
  object-fit: cover;
  object-position: center 18%;
  border-radius: 18px 18px 8px 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  background: #1a1510;
}


/* —— game pavilion walk —— */
.pav-game[hidden] { display: none !important; }
.pav-game {
  position: fixed;
  inset: 0;
  z-index: 72;
  background: #050505;
  color: #f3e6cc;
}
.pav-hud {
  position: absolute;
  z-index: 5;
  left: 0; right: 0; top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: max(0.7rem, env(safe-area-inset-top)) 1rem 0.7rem;
  background: linear-gradient(180deg, rgba(0,0,0,.7), transparent);
}
.pav-title { font-family: var(--font-d); font-size: 1.15rem; }
.pav-hint { font-size: 0.75rem; opacity: .85; }

.pav-room {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.pav-wall {
  position: absolute;
  top: 0; bottom: 0;
  width: 34%;
  overflow: hidden;
}
.pav-wall--l { left: 0; }
.pav-wall--r { right: 0; }
.pav-wall img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.05);
}
.pav-floor {
  position: absolute;
  left: 30%;
  right: 30%;
  top: 8%;
  bottom: 0;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(80,60,40,.35), transparent 55%),
    linear-gradient(180deg, #12100e 0%, #1a1510 40%, #0c0a08 100%);
  border-left: 2px solid rgba(255,255,255,.06);
  border-right: 2px solid rgba(255,255,255,.06);
}

.pav-actor,
.pav-player {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -90%) scale(var(--near, 1));
  transform-origin: center bottom;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: center;
}
.pav-actor img {
  display: block;
  height: min(38vh, 280px);
  width: auto;
  max-width: 42vw;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.5));
  pointer-events: none;
}
.pav-actor[data-role="robot"] img {
  height: min(16vh, 120px);
  animation: wag 0.55s ease-in-out infinite;
}
.pav-actor[data-role="artist1"] img,
.pav-actor[data-role="artist2"] img {
  height: min(42vh, 320px);
}
.pav-actor.is-near img { filter: drop-shadow(0 0 12px rgba(240,200,120,.45)); }
.pav-label {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: rgba(0,0,0,.65);
  color: #f3e6cc;
  font-size: 0.68rem;
  white-space: nowrap;
}

.pav-player {
  pointer-events: none;
  z-index: 40;
}
.pav-player__dot {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe08a, #c45c2a 55%, #5a2010);
  box-shadow: 0 0 0 3px rgba(255,220,140,.35), 0 8px 14px rgba(0,0,0,.45);
}
.pav-player.is-walking .pav-player__dot {
  animation: pav-bob 0.28s ease-in-out infinite;
}
@keyframes pav-bob {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.pav-scheme {
  position: absolute;
  z-index: 6;
  right: 0.75rem;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  width: min(42vw, 200px);
  padding: 0.55rem 0.6rem 0.65rem;
  border-radius: 12px;
  background: rgba(8,8,8,.82);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
}
.pav-scheme__title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
}
.pav-scheme__box {
  position: relative;
  height: 140px;
  border-radius: 8px;
  background: #141210;
  border: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
}
.sch-wall {
  position: absolute;
  top: 0; bottom: 0;
  width: 18%;
  display: grid;
  place-items: center;
  font-size: 0.55rem;
  writing-mode: vertical-rl;
  opacity: .7;
  background: rgba(90,70,40,.35);
}
.sch-wall--l { left: 0; }
.sch-wall--r { right: 0; }
.sch-dot,
.sch-you {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  background: #c4a35a;
  color: #1a1208;
}
.sch-dot--dog { background: #8ec8ff; }
.sch-dot--guide { background: #e8a0b8; }
.sch-you {
  background: #ff6b2c;
  color: #fff;
  width: 14px;
  height: 14px;
  box-shadow: 0 0 0 2px rgba(255,120,60,.4);
  z-index: 2;
}
.pav-scheme__keys {
  margin: 0.4rem 0 0;
  font-size: 0.68rem;
  opacity: .8;
}

.pav-pad {
  position: absolute;
  z-index: 7;
  left: 0.75rem;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.pav-pad__row { display: flex; gap: 0.25rem; }
.pav-pad button {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(20,18,14,.75);
  color: #f3e6cc;
  font-size: 1.1rem;
}
@media (max-width: 900px), (pointer: coarse) {
  .pav-pad { display: flex; }
  .pav-wall { width: 22%; }
  .pav-floor { left: 18%; right: 18%; }
  .pav-scheme { width: min(46vw, 160px); }
  .pav-actor img { height: min(32vh, 220px); }
}

.cave-pavilion .pav-floor {
  background:
    radial-gradient(ellipse at 50% 80%, rgba(90,60,30,.4), transparent 50%),
    linear-gradient(180deg, #1a1410, #0a0806);
}
.dream-pavilion .pav-floor {
  background:
    radial-gradient(circle at 30% 40%, rgba(255,230,80,.12), transparent 40%),
    linear-gradient(180deg, #1a1608, #0c0a06);
}
.dream-pavilion .pav-actor[data-role="artist1"] img {
  height: min(34vh, 240px);
  border-radius: 12px;
  object-fit: cover;
}

.chat-fab {
  position: fixed;
  z-index: 60;
  right: 1rem;
  bottom: max(5.5rem, calc(env(safe-area-inset-bottom) + 4.5rem));
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(196,163,90,.5);
  background: #1a1510;
  color: #f3e6cc;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}
.guide-chat[hidden] { display: none !important; }
.guide-chat {
  position: fixed;
  z-index: 85;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(92vw, 360px);
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: linear-gradient(165deg, #f7f1e6, #e8dcc8);
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  overflow: hidden;
}
.guide-chat__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.guide-chat__face {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}
.guide-chat__head strong { flex: 1; font-size: 0.92rem; }
.guide-chat__log {
  flex: 1;
  overflow: auto;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 180px;
}
.chat-msg {
  max-width: 92%;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.4;
  white-space: pre-wrap;
}
.chat-msg--user { align-self: flex-end; background: #2a2218; color: #f3e6cc; }
.chat-msg--bot { align-self: flex-start; background: #fff; border: 1px solid rgba(0,0,0,.08); }
.guide-chat__form {
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem;
  border-top: 1px solid rgba(0,0,0,.08);
}
.guide-chat__form input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #cbb89a;
  font: inherit;
}
.guide-chat__note {
  margin: 0;
  padding: 0 0.7rem 0.65rem;
  font-size: 0.72rem;
  color: #6a5a45;
}


/* Asphalt-like FPS pavilion */
.pav-fps[hidden] { display: none !important; }
.pav-fps {
  position: fixed;
  inset: 0;
  z-index: 74;
  background: #000;
  color: #f3e6cc;
}
.pav-canvas {
  position: absolute;
  inset: 0;
}
.pav-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
  cursor: crosshair;
}
.pav-speedo {
  position: absolute;
  z-index: 6;
  left: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  min-width: 88px;
  padding: 0.55rem 0.75rem 0.65rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20,18,14,.85), rgba(0,0,0,.75));
  border: 1px solid rgba(255,160,60,.35);
  box-shadow: 0 0 24px rgba(255,100,40,.15);
  text-align: center;
  font-family: var(--font-d);
}
.pav-speedo span {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
  color: #ffb060;
  font-weight: 700;
}
.pav-speedo small {
  font-size: 0.65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .75;
}
.pav-fps .pav-scheme {
  right: 0.75rem;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
}
.pav-fps .dream-bubble {
  z-index: 8;
}
