/* ── The museum's screen over its 3D rooms (js/museum/) ──────────────
   Its top bar, room switcher, Find, panels and toasts. First written for
   the Vitrine page's gallery room (js/vitrine/room/ is still its engine),
   which was removed in 2026-11: the museum's Vitrine room took its place. */

html.vroom-open, html.vroom-open body { overflow: hidden; }
/* No scrollbar gutter while it's open: the site keeps one (scrollbar-gutter:
   stable), and nothing paints in it, so with classic scrollbars (Windows, a Mac
   with a mouse) the room had a dark bar down its right side */
html.vroom-open { scrollbar-gutter: auto; }

/* The full window, whatever the page under it */
.vroom {
  position: fixed; left: 0; top: 0; z-index: 9000;
  width: 100vw; height: 100vh; height: 100dvh;
  background: #000; color: var(--off, #F0EBE1);
  font-family: var(--font-ui, 'Geist', sans-serif);
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: contain;
}
.vroom-canvas {
  display: block; width: 100%; height: 100%;
  touch-action: none; cursor: grab; outline: none;
}
.vroom-canvas.is-dragging { cursor: grabbing; }

/* Top: whose gallery, and the way out */
.vroom-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 28px max(20px, env(safe-area-inset-left));
  background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0));
  pointer-events: none;
}
.vroom-title {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 10px 14px 11px; background: rgba(6,5,4,0.62); border: 1px solid rgba(240,235,225,0.12);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.vroom-eyebrow {
  font: 700 11px/1.4 var(--font-mono, monospace); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold, #F5A31A);
}
.vroom-title b {
  font: 600 clamp(20px, 2.4vw, 26px)/1.15 var(--font-display, sans-serif);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
/* Copy link and Exit, top right */
.vroom-actions { display: flex; gap: 8px; flex: none; pointer-events: auto; }
.vroom-copy, .vroom-exit {
  pointer-events: auto; flex: none;
  padding: 10px 18px; min-height: 40px;
  border: 1px solid rgba(240,235,225,0.4); background: rgba(6,5,4,0.6);
  color: var(--off, #F0EBE1); cursor: pointer;
  font: 600 13px/1 var(--font-ui, sans-serif); letter-spacing: 0.12em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.vroom-copy:hover, .vroom-copy:focus-visible,
.vroom-exit:hover, .vroom-exit:focus-visible { border-color: var(--gold, #F5A31A); color: var(--gold, #F5A31A); outline: none; }

/* Getting around: the previous and next rooms, the Rooms list, Find a mask */
.vroom-nav {
  position: absolute; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  width: max-content; white-space: nowrap;
  /* Not the site header's nav */
  right: auto; height: auto; padding: 0; z-index: auto; background: none; transition: none;
}
/* Long names stop short of it */
@media (min-width: 1181px) { .vroom-title { max-width: calc(50vw - 320px); } }
.vroom-nav button {
  min-height: 40px; border: 1px solid rgba(240,235,225,0.4); background: rgba(6,5,4,0.6);
  color: var(--off, #F0EBE1); font: 600 13px/1 var(--font-ui, sans-serif);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.vroom-nav button:not(:disabled):hover, .vroom-nav button:focus-visible { color: var(--gold, #F5A31A); outline: none; }

/* Find a mask by its number or name: opens over the room switcher (phones: at the top) */
.vroom-nav-find { display: flex; align-items: center; gap: 8px; padding: 0 14px; cursor: pointer; }
.vroom-nav-find[hidden] { display: none; }
.vroom-glass { flex: none; }
.vroom:has(.vroom-find:not([hidden])) .vroom-nav { visibility: hidden; }
.vroom-find {
  position: absolute; z-index: 3; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: min(420px, calc(100% - 40px));
  background: rgba(10,9,8,0.94); border: 1px solid var(--gold, #F5A31A);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.vroom-find[hidden] { display: none; }
.vroom-find-bar { display: flex; align-items: center; gap: 10px; padding: 0 4px 0 14px; color: var(--gold, #F5A31A); }
.vroom-find-input {
  flex: 1; min-width: 0; height: 46px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; outline: none;
  color: var(--off, #F0EBE1); font: 500 16px/1.2 var(--font-ui, sans-serif); /* 16px: Safari zooms in on smaller */
  -webkit-appearance: none; appearance: none;
  -webkit-user-select: text; user-select: text;
}
.vroom-find-input::placeholder { color: rgba(240,235,225,0.5); }
.vroom-find-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.vroom-find-close {
  flex: none; width: 38px; height: 38px; border: 0; background: none; cursor: pointer;
  color: rgba(240,235,225,0.7); font-size: 22px; line-height: 1;
}
.vroom-find-close:hover, .vroom-find-close:focus-visible { color: var(--off, #F0EBE1); outline: none; }
.vroom-find-note {
  margin: 0; padding: 10px 14px; border-top: 1px solid rgba(240,235,225,0.12);
  font: 500 14px/1.45 var(--font-ui, sans-serif); color: var(--off, #F0EBE1);
}
.vroom-find-note:empty { display: none; }
.vroom-find-list {
  position: relative; margin: 0; padding: 4px 0; list-style: none;
  max-height: min(436px, calc(100vh - 150px)); overflow-y: auto; overscroll-behavior: contain;
  border-top: 1px solid rgba(240,235,225,0.12);
}
.vroom-find-list:empty { display: none; }
.vroom-find-opt { display: flex; align-items: center; gap: 12px; padding: 6px 14px; cursor: pointer; }
.vroom-find-opt[aria-selected="true"] { background: rgba(245,163,26,0.16); }
.vroom-find-opt img { flex: none; width: 34px; height: 48px; object-fit: cover; background: rgba(240,235,225,0.08); }
.vroom-find-opt span { min-width: 0; }
.vroom-find-opt b, .vroom-find-opt small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vroom-find-opt b { font: 600 16px/1.25 var(--font-display, sans-serif); color: var(--off, #F0EBE1); }
.vroom-find-opt small { margin-top: 3px; font: 500 12px/1.3 var(--font-mono, monospace); color: var(--gold, #F5A31A); }
@media (max-width: 600px) {
  .vroom-nav-find { width: 40px; padding: 0; justify-content: center; }
  .vroom-nav-find span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* At the top of the screen, clear of the keyboard */
  .vroom-find { top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; width: auto; transform: none; }
  .vroom-find-list { max-height: 34vh; }
}

/* A quick fade while jumping to a room further away */
.vroom-fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.18s ease; }
.vroom-fade.is-on { opacity: 1; }

/* Bottom: how to walk, and the pictures still arriving */
.vroom-hint, .vroom-progress {
  position: absolute; left: 50%; transform: translateX(-50%);
  margin: 0; padding: 7px 14px; max-width: calc(100% - 32px);
  background: rgba(6,5,4,0.6); border: 1px solid rgba(240,235,225,0.12);
  font: 500 12px/1.4 var(--font-mono, monospace); color: rgba(240,235,225,0.78);
  text-align: center; pointer-events: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.vroom-hint { bottom: max(18px, env(safe-area-inset-bottom)); }
.vroom-progress { bottom: calc(max(18px, env(safe-area-inset-bottom)) + 40px); color: var(--gold, #F5A31A); }
.vroom-progress[hidden], .vroom-progress:empty { display: none; }

/* Thumb joystick (phones) */
.vroom-stick {
  position: absolute; left: max(24px, env(safe-area-inset-left)); bottom: calc(max(24px, env(safe-area-inset-bottom)) + 48px);
  width: 112px; height: 112px; border-radius: 50%;
  border: 1px solid rgba(240,235,225,0.35); background: rgba(6,5,4,0.35);
  touch-action: none;
}
.vroom-stick[hidden] { display: none; }
.vroom-stick span {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; background: rgba(240,235,225,0.75);
  transition: transform 0.12s ease-out;
}

/* The mask or medal you walked up to */
.vroom-panel {
  position: absolute; z-index: 2; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  width: min(340px, calc(100% - 40px)); padding: 18px 20px 20px;
  background: rgba(10,9,8,0.92); border: 1px solid rgba(240,235,225,0.16);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.vroom-panel[hidden] { display: none; }
.vroom-panel h2 {
  margin: 0 36px 4px 0;
  font: 600 22px/1.15 var(--font-display, sans-serif); color: var(--off, #F0EBE1);
  overflow-wrap: anywhere;
}
.vroom-panel-meta { margin: 0 0 14px; font: 500 12px/1.4 var(--font-mono, monospace); color: var(--gold, #F5A31A); }
.vroom-panel-desc { margin: 0 0 16px; font: 500 15px/1.45 var(--font-ui, sans-serif); color: var(--off, #F0EBE1); }
.vroom-panel-desc:last-child { margin-bottom: 0; }
.vroom-panel dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 0 0 16px; }
.vroom-panel dt { font: 700 11px/1.3 var(--font-mono, monospace); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(240,235,225,0.6); }
.vroom-panel dd { margin: 2px 0 0; font: 500 14px/1.3 var(--font-ui, sans-serif); color: var(--off, #F0EBE1); }
.vroom-panel-close {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px;
  border: 0; background: none; color: rgba(240,235,225,0.7); font-size: 22px; line-height: 1; cursor: pointer;
}
.vroom-panel-close:hover { color: var(--off, #F0EBE1); }
.vroom-open-page {
  width: 100%; min-height: 42px; border: 1px solid var(--gold, #F5A31A);
  background: var(--gold, #F5A31A); color: #1a1004; cursor: pointer;
  font: 600 13px/1 var(--font-ui, sans-serif); letter-spacing: 0.12em; text-transform: uppercase;
}
.vroom-open-page:hover { background: transparent; color: var(--gold, #F5A31A); }
@media (max-width: 600px) {
  /* Short enough that the frame you walked up to stays in view above it */
  .vroom-panel { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; max-height: 46vh; overflow-y: auto; }
  .vroom-hint { display: none; }
  .vroom-nav {
    top: auto; left: auto; right: 12px; transform: none; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 4px);
    /* The narrowest phones: what doesn't fit goes on a row below */
    width: auto; max-width: calc(100% - 24px); flex-wrap: wrap; justify-content: flex-end; gap: 6px;
  }
  /* The panel and the room switcher would share the bottom of the screen */
  .vroom:has(.vroom-panel:not([hidden])) .vroom-nav { display: none; }
  .vroom-copy, .vroom-exit { padding: 10px 11px; letter-spacing: 0.05em; }
}

/* White room: a lighter shade behind the chrome on its light walls */
.vroom--white .vroom-top { background: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0)); }

.vroom-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9100;
  padding: 12px 18px; max-width: calc(100% - 32px);
  background: rgba(10,9,8,0.95); border: 1px solid rgba(245,163,26,0.5);
  color: var(--off, #F0EBE1); font: 500 14px/1.4 var(--font-ui, sans-serif);
}
