/* Cross-scene responsive and collectible polish. Loaded last by design. */
.toast {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(100% + 40px));
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.object-hotspot[data-object] span {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: collectibleBreathe 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 5px #ffd170) drop-shadow(0 4px 5px #000b);
}
.object-hotspot[data-object] span svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: rgba(163,100,29,.72);
  stroke: #ffe29a;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.object-hotspot[data-object]:hover span,
.object-hotspot[data-object]:focus-visible span {
  transform: scale(1.16) rotate(-3deg);
  filter: drop-shadow(0 0 10px #fff0b2) drop-shadow(0 5px 6px #000c);
}
.object-hotspot[data-object].is-found span {
  opacity: .5;
  color: inherit;
  background: transparent;
  box-shadow: none;
  animation: none;
}
@keyframes collectibleBreathe {
  50% { transform: translateY(-2px);filter:drop-shadow(0 0 10px #ffd170) drop-shadow(0 5px 5px #000b); }
}

.pocket {
  position: fixed;
  z-index: 920;
  top: calc(var(--header-height,76px) + 12px);
  right: clamp(12px,3vw,40px);
  bottom: 12px;
  width: min(380px,calc(100vw - 24px));
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: linear-gradient(145deg,#111925,#060a12);
  box-shadow: 0 30px 90px #000e,0 0 0 1px rgba(255,209,112,.08);
}
.pocket-items i {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg,#172131,#0c121d);
}
.pocket-items i svg {
  width: 29px;
  height: 29px;
  fill: rgba(171,107,33,.58);
  stroke: #ffd170;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pocket-items button.is-found i {
  box-shadow: inset 0 0 0 1px rgba(255,209,112,.13),0 0 17px rgba(255,190,77,.08);
}

.house-caption {
  bottom: max(68px,calc(env(safe-area-inset-bottom) + 58px));
  max-height: min(32dvh,180px);
  overflow: auto;
}
.house-caption.is-visible { pointer-events:none; }
.house-caption .caption-controls,
.house-caption .caption-controls button { pointer-events:auto; }
.music-now {
  top: calc(var(--header-height,76px) + 9px);
  bottom: auto;
}
.discovery-reveal,
.living-message {
  bottom: max(68px,calc(env(safe-area-inset-bottom) + 58px));
  max-height: min(32dvh,190px);
  overflow: auto;
}

.audio-welcome,
.voice-dialog,
.house-journal,
.story-panel,
.hour-choice,
.quest-dialog {
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
}

@media (max-width:760px) {
  .pocket {
    inset: calc(var(--header-height,68px) + 8px) 8px 8px;
    width: auto;
    padding: 20px 16px;
    border-radius: 18px;
  }
  .pocket h2 { margin-bottom: 12px; }
  .pocket-items { gap: 6px; }
  .pocket-items button { min-height: 54px;padding:7px 9px; }
  .pocket-detail { margin-top: 10px; }
  .room-view .room-actions {
    top: calc(var(--header-height,68px) + 72px);
    right: 10px;
    width: min(350px,calc(100vw - 20px));
  }
  .house-caption,
  .discovery-reveal,
  .living-message {
    width: calc(100vw - 20px);
    bottom: max(62px,calc(env(safe-area-inset-bottom) + 52px));
  }
  body:has(#room.is-active) .house-caption {
    top: calc(var(--header-height,68px) + 82px);
    bottom: auto;
  }
}

@media (max-height:700px) {
  .room-head { top:10px; }
  .room-head > div { padding:9px 12px; }
  .room-head > div > p:last-child { display:none; }
  .room-view .room-actions { top:calc(var(--header-height,68px) + 10px); }
  .house-caption { max-height:145px; }
  .pocket-items button { min-height:48px; }
  .pocket-items i { width:36px;height:36px; }
  .pocket-items i svg { width:25px;height:25px; }
}

@media (min-width:761px) and (max-height:700px) {
  .room-view .room-head + .room-actions { max-width:min(360px,48vw); }
}

@media (max-width:760px) and (max-height:700px) {
  .room-head > div { display:none; }
  .room-view .room-actions {
    top:calc(var(--header-height,68px) + 8px);
    right:10px;
    width:calc(100vw - 86px);
    min-height:42px;
    padding:6px 6px 6px 12px;
  }
  .room-feedback { font-size:.64rem; }
  .room-hint { min-height:34px;padding:7px 10px; }
  .house-caption,
  .discovery-reveal,
  .living-message { max-height:126px; }
  body:has(#room.is-active) .house-caption { top:calc(var(--header-height,68px) + 70px); }
}

@media (prefers-reduced-motion:reduce) {
  .object-hotspot[data-object] span { animation:none; }
}
