/* Gallery page: entry overlay, HUD, inspect view, list fallback, touch UI. */

body.gallery-page { overflow: hidden; height: 100vh; }
body.gallery-page canvas { display: block; }

/* ---------- entry overlay ---------- */
.entry {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  background: var(--ivory);
  transition: opacity 0.6s ease;
}
.entry.leaving { opacity: 0; pointer-events: none; }
.entry-card { text-align: center; max-width: 560px; padding: 0 28px; }
.entry-brand {
  font-size: 13px; letter-spacing: 0.34em; color: var(--bronze);
  text-decoration: none;
}
.entry-name {
  margin-top: 18px;
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.15;
}
.entry-sub {
  margin-top: 10px;
  font-size: 17px;
  font-style: italic;
  color: var(--ink-soft);
}
.entry-bar {
  margin: 34px auto 0;
  width: min(320px, 70%);
  height: 1px;
  background: var(--hairline);
}
.entry-progress {
  height: 1px; width: 0%;
  background: var(--bronze);
  transition: width 0.3s ease;
}
.entry-btn { margin-top: 30px; }
.entry-btn:disabled { opacity: 0.45; cursor: default; }
.entry-btn:disabled:hover { background: none; color: var(--bronze); }
.entry-help {
  margin-top: 26px;
  font-size: 14px;
  color: var(--ink-soft);
}
.entry-help b { font-weight: 600; letter-spacing: 0.08em; }
.entry-alt { margin-top: 10px; font-size: 13.5px; }
.entry-alt a { color: var(--ink-soft); }

/* ---------- in-room HUD ---------- */
.crosshair {
  position: fixed; left: 50%; top: 50%; z-index: 30;
  width: 5px; height: 5px; margin: -2.5px;
  border-radius: 50%;
  background: rgba(var(--paper), 0.9);
  box-shadow: 0 0 4px rgba(28, 26, 23, 0.7);
  pointer-events: none;
  transition: transform 0.2s;
}
.crosshair.on-target { transform: scale(1.9); }
.tooltip {
  position: fixed; left: 50%; top: calc(50% + 30px); z-index: 30;
  transform: translateX(-50%);
  background: rgba(var(--paper), 0.94);
  border: 1px solid var(--bronze-soft);
  padding: 7px 16px;
  font-size: 15px;
  font-style: italic;
  white-space: nowrap;
  pointer-events: none;
}
.g-back {
  position: fixed; top: 18px; left: 22px; z-index: 30;
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-soft);
  background: rgba(var(--paper), 0.85);
  padding: 8px 14px;
  border: 1px solid var(--hairline);
}
.g-back:hover { color: var(--bronze); border-color: var(--bronze-soft); }
.g-theme {
  position: fixed;
  top: 16px; right: 20px;
  z-index: 71; /* stays usable above the entry overlay */
}
.g-list {
  position: fixed; top: 64px; left: 22px; z-index: 30;
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  background: rgba(var(--paper), 0.85);
  border: 1px solid var(--hairline);
  padding: 8px 14px;
  color: var(--ink-soft);
  cursor: pointer;
}
.g-list:hover { color: var(--bronze); border-color: var(--bronze-soft); }
.g-toast {
  position: fixed;
  bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 35;
  background: rgba(var(--paper), 0.94);
  border: 1px solid var(--bronze-soft);
  padding: 11px 22px;
  font-size: 15px;
  font-style: italic;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.g-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 640px) {
  .g-toast { white-space: normal; text-align: center; width: calc(100vw - 60px); bottom: 88px; }
}

/* ---------- inspect overlay ---------- */
.inspect {
  position: fixed; inset: 0; z-index: 80;
  display: flex;
  background: rgba(16, 14, 12, 0.94);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.inspect.open { opacity: 1; }
.inspect-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.inspect-stage.dragging { cursor: grabbing; }
.inspect-img {
  position: absolute;
  left: 0; top: 0;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 20px 90px rgba(0, 0, 0, 0.8);
}
.inspect-panel {
  width: min(390px, 42vw);
  overflow-y: auto;
  background: var(--ivory);
  padding: 44px 38px 40px;
  border-left: 1px solid var(--bronze-soft);
}
.inspect-title {
  font-size: 27px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.25;
}
.inspect-meta {
  margin-top: 10px;
  font-size: 15.5px;
  color: var(--ink-soft);
}
.inspect-meta span { display: block; margin-top: 2px; }
.inspect-story {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.inspect-facts { margin-top: 20px; }
.inspect-facts h3 {
  font-size: 11.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bronze);
  font-weight: 500;
}
.inspect-fact {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.inspect-fact a {
  font-size: 12.5px;
  color: var(--bronze);
  font-style: italic;
  white-space: nowrap;
}
.inspect-attr { margin-top: 22px; font-size: 12px; color: var(--ink-soft); opacity: 0.75; }
.inspect-attr a { color: inherit; }
.inspect-close {
  position: absolute; top: 14px; right: 18px; z-index: 5;
  border: none; background: none;
  font-size: 30px; color: rgba(250, 248, 243, 0.85);
  cursor: pointer;
}
.inspect-close:hover { color: #fff; }
.inspect-nav {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 14px; z-index: 5;
}
.inspect-nav button {
  border: 1px solid rgba(250, 248, 243, 0.4);
  background: none;
  color: rgba(250, 248, 243, 0.9);
  font-size: 14px;
  letter-spacing: 0.14em;
  padding: 9px 20px;
  cursor: pointer;
  transition: border-color 0.25s;
}
.inspect-nav button:hover { border-color: var(--bronze-soft); color: #fff; }
.inspect-zoomhint {
  position: absolute; top: 18px; left: 22px;
  font-size: 12.5px; font-style: italic;
  color: rgba(250, 248, 243, 0.55);
  pointer-events: none;
}

@media (max-width: 760px) {
  .inspect { flex-direction: column; }
  .inspect-stage { flex: 1 1 55%; }
  .inspect-panel {
    width: 100%;
    flex: 1 1 45%;
    border-left: none;
    border-top: 1px solid var(--bronze-soft);
    padding: 26px 24px 30px;
  }
  .inspect-nav { bottom: auto; top: 12px; }
}

/* ---------- list fallback ---------- */
.list-view {
  position: fixed; inset: 0; z-index: 65;
  overflow-y: auto;
  background: var(--ivory);
  padding: 90px 24px 80px;
}
.list-inner { max-width: 720px; margin: 0 auto; }
.list-item { margin-top: 56px; }
.list-item img {
  width: 100%;
  border: 1px solid var(--hairline);
  background: #efece4;
}
.list-item h2 { font-size: 24px; font-weight: 500; font-style: italic; margin-top: 16px; }
.list-item .inspect-meta { margin-top: 4px; }
.list-item p { margin-top: 10px; font-size: 16.5px; line-height: 1.6; color: var(--ink-soft); }

/* ---------- touch controls (mobile) ---------- */
.stick {
  position: fixed; z-index: 32;
  width: 108px; height: 108px;
  border: 1px solid rgba(160, 129, 92, 0.5);
  border-radius: 50%;
  left: 26px; bottom: max(88px, calc(24px + env(safe-area-inset-bottom) + 72px));
  background: rgba(250, 248, 243, 0.12);
  backdrop-filter: blur(2px);
}
.stick-knob {
  position: absolute; left: 50%; top: 50%;
  width: 44px; height: 44px; margin: -22px;
  border-radius: 50%;
  background: rgba(250, 248, 243, 0.65);
  border: 1px solid var(--bronze-soft);
}
.strip {
  position: fixed; left: 0; right: 0; z-index: 32;
  bottom: 0;
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(28, 26, 23, 0.55), transparent);
  -webkit-overflow-scrolling: touch;
}
.strip img {
  height: 52px;
  border: 1px solid rgba(250, 248, 243, 0.6);
  flex-shrink: 0;
}
.strip img.active { border-color: var(--bronze); }
