/* Stories stay in the room: a small field note, or the controls for the phone. */
.story-dialog {
  z-index: 12;
  top: 108px;
  right: 30px;
  bottom: auto;
  width: 340px;
  max-width: calc(100vw - 48px);
  height: auto;
  max-height: calc(100dvh - 234px);
  border: 1px solid #c59a6729;
  border-radius: 5px;
  background: #241b16ed;
  color: #ead9bf;
  box-shadow: 0 15px 50px #10090438;
  backdrop-filter: blur(18px);
  scrollbar-color: #8b694944 transparent;
}
.story-dialog::backdrop { background: transparent; }
.drawer-top {
  padding: 16px 22px;
  border-color: #bd93652b;
  background: #241b16ed;
}
#drawer-index { color: #ba9470; font-size: 8px; }
#close-story { color: #d2b796; gap: 12px; font-size: 9px; min-height: 24px; }
#close-story:hover { color: #ffebca; }
#close-story > span:last-child { font-size: 22px; }
.story-content-inner { padding: 22px; }
.story-kicker { color: #b18d6a; font-size: 7px; letter-spacing: 1.25px; }
.story-icon-large { width: 27px; height: 27px; color: #be8c78; margin: 14px 0 10px; }
.story-dialog h2 { font-size: 28px; line-height: 1.12; letter-spacing: -.5px; margin: 12px 0 14px; }
.story-lede { color: #d3b499; font-size: 17px; line-height: 1.5; margin-bottom: 18px; }
.story-body { color: #bda88e; font-size: 11px; line-height: 1.85; margin-top: 14px; }
.story-facts { gap: 18px; padding: 17px 0; margin: 20px 0; border-color: #b8946538; }
.story-fact strong { color: #e2b590; font-size: 25px; }
.story-fact span { color: #b79c7c; font-size: 9px; }
.story-subtitle { font-size: 21px; margin: 24px 0 14px; }
.archive-card { background: #96734b0c; border-color: #c29c6a2e; padding: 14px; }
.archive-card > span { color: #dcb895; font-size: 10px; }
.archive-card small, .material-note { color: #ac9478; font-size: 9px; }
.archive-card:hover { background: #a17b4c18; }
.paper-link { background: #793e4699; color: #f1ddbf; padding: 14px; margin-top: 19px; }
.physics-controls { padding: 15px; margin: 20px 0; border-color: #b8996b30; background: #13100c45; }
.physics-controls label { color: #c8aa87; font-size: 10px; margin-bottom: 12px; }
.physics-controls output { color: #e6c59d; }
.physics-controls input { accent-color: #d0a77a; margin-bottom: 15px; }
.release-button { padding: 12px; background: #91515a99; color: #f1ddbf; }
.release-button:hover { background: #a7616a99; }
.physics-note { color: #aa9276; }
.physics-readout { color: #dbb991; }
.activity-row, .honor-row { border-color: #b894652c; }
.activity-row summary { font-size: 11px; padding: 13px 0; }
.activity-row summary:after { color: #c19d76; }
.activity-row p { color: #b9a185; font-size: 10px; }
.honor-row { padding: 16px 0; }
.honor-row small { color: #b5926c; }
.honor-row h3 { font-size: 20px; }
.honor-row p { color: #bca184; }
.drawer-bottom { padding: 16px 22px; border-color: #bd93652b; }
.drawer-bottom > span { color: #a98a66; font-size: 6px; }
#next-object { color: #dfb994; }
.help-list { color: #c4ab8c; font-size: 11px; }
.index-item { padding: 12px; border-color: #b79d7c30; }
.index-item:hover { background: #b18b5c14; }
.object-index { gap: 8px; }
.index-item .object-name { font-size: 9px; }
html[lang=zh-CN] .story-dialog h2 { font-size: 25px; line-height: 1.3; }
html[lang=zh-CN] .story-lede { font-size: 15px; }
body.panel-open .header { opacity: 1; }
body.panel-open .room-intro, body.panel-open .room-note, body.panel-open .hotspots { visibility: hidden; }
.lab-notes { border-top: 1px solid #b894652c; margin-top: 16px; padding-top: 14px; }
.lab-notes summary { cursor: pointer; color: #dab995; font-size: 11px; }
.story-dialog[data-story=physics] .story-icon-large { display: none; }
.story-dialog[data-story=physics] .story-lede { font-size: 14px; }
#film-status { color: #dec09b; font-size: 11px; line-height: 1.5; margin-top: 10px; }
body.panel-open .object-nav, body.panel-open .camera-controls { opacity: .75; }
body.panel-open .object-nav:hover, body.panel-open .camera-controls:hover { opacity: 1; }

/* The recording lives on a physical phone. Only the transport stays on the page. */
body.cinema-open .room-footer { opacity: 0; visibility: hidden; pointer-events: none; }
body.cinema-open .room-vignette {
  background: linear-gradient(180deg, #1b140cdb, transparent 94px), linear-gradient(0deg, #211b19c9, transparent 170px);
}
body.cinema-open .story-dialog {
  inset: auto 24px 24px;
  width: min(900px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100dvh - 180px);
  height: auto;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}
body.cinema-open .story-dialog:before { display: none; }
body.cinema-open .drawer-top {
  position: fixed;
  top: 98px;
  right: 38px;
  display: flex;
  gap: 24px;
  padding: 0;
  border: 0;
  background: none;
  backdrop-filter: none;
  pointer-events: auto;
}
body.cinema-open #drawer-index { color: #9e7f60; }
body.cinema-open #close-story { padding: 8px 12px; background: #211b19c9; border-radius: 3px; color: #f0dfc6; }
body.cinema-open .drawer-bottom { display: none; }
body.cinema-open .story-content-inner { padding: 0; }
.cinema-meta {
  position: fixed;
  top: 107px;
  left: 39px;
  width: 210px;
  color: #30251f;
  text-shadow: 0 1px 8px #eadaba44;
  pointer-events: none;
}
.cinema-meta .story-kicker { color: #55412f; font-size: 7px; letter-spacing: 1.8px; }
.cinema-meta #story-title { font-size: 25px; line-height: 1.15; margin: 12px 0 10px; }
#projection-title { font-size: 10px; line-height: 1.7; color: #4d3b2d; max-width: 190px; }
.cinema-view-hint { font-size: 9px; line-height: 1.5; color: #483b31; margin-top: 12px; letter-spacing: .1px; }
html[lang=zh-CN] .cinema-meta #story-title { font-size: 22px; }
.projection-player-source {
  --film-aspect: 16 / 9;
  --film-ratio: 1.77778;
  --film-max-height: 48dvh;
  pointer-events: auto;
  width: min(620px, calc(var(--film-max-height) * var(--film-ratio)), 100%);
  margin: 0 auto 12px;
  background: #110c09;
  border: 1px solid #9e77513b;
}
.projection-player-source video, .projection-player-source iframe { display: block; width: 100%; height: auto; max-height: var(--film-max-height); aspect-ratio: var(--film-aspect); object-fit: contain; border: 0; }
body.projection-active .projection-player-source {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
  margin: 0;
  border: 0;
}
.cinema-console {
  padding: 6px 16px 4px;
  border: 1px solid #b18b5b3b;
  background: linear-gradient(180deg, #201a15f2, #17120ff2);
  border-radius: 5px;
  box-shadow: 0 12px 40px #0e09082b, inset 0 1px #e3bd8b0b;
  backdrop-filter: blur(18px);
  pointer-events: auto;
}
.transport-row { display: flex; align-items: center; gap: 15px; min-height: 36px; }
.transport-row button { color: #d7b58c; min-height: 36px; }
.transport-row button:hover { color: #ffedce; }
#film-play { width: 30px; flex-shrink: 0; font-size: 15px; text-align: center; }
#film-time { color: #a98b67; font: 9px monospace; white-space: nowrap; }
#film-progress { min-width: 45px; width: 100%; flex: 1; height: 18px; margin: 0; cursor: pointer; accent-color: #d0ad7f; }
#film-mute { font-size: 9px; white-space: nowrap; padding-inline: 4px; }
#film-fullscreen { width: 28px; flex-shrink: 0; font-size: 21px; }
.coverflow { --cover-size: 104px; position: relative; isolation: isolate; }
.coverflow:after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 100;
  background: linear-gradient(90deg, #1e1815 0, #1e181500 8%, #1e181500 92%, #1e1815 100%);
  pointer-events: none;
}
.coverflow-scroll {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  height: calc(var(--cover-size) + 30px);
  padding: 6px calc(50% - (var(--cover-size) - 24px) / 2) 24px;
  overflow-x: auto;
  overflow-y: hidden;
  perspective: 800px;
  perspective-origin: 50% 38%;
  /* JavaScript centers the untransformed card after scrolling settles. */
  scroll-snap-type: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.coverflow-scroll::-webkit-scrollbar { display: none; }
.coverflow-scroll:active { cursor: grabbing; }
.coverflow-scroll:focus-visible { outline: 1px solid #dab487; outline-offset: -2px; border-radius: 3px; }
.album-cover {
  position: relative;
  flex: 0 0 var(--cover-size);
  width: var(--cover-size);
  height: var(--cover-size);
  margin: 0 -12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff4de;
  transform: translateZ(var(--cover-depth, 0px)) rotateY(var(--cover-angle, 0deg)) scale(var(--cover-scale, 1));
  transform-origin: 50% 50%;
  opacity: var(--cover-opacity, 1);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  cursor: inherit;
}
.album-art {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid #b18b5b50;
  border-radius: 2px;
  background: #110c09;
  box-shadow: 0 5px 15px #0009;
  transition: border-color .18s, box-shadow .18s;
}
.album-art:after { content: ''; position: absolute; inset: 0; border: 1px solid #fff1db12; pointer-events: none; }
.album-art > img, .album-reflection { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
.album-reflection {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  border-radius: 2px;
  transform: scaleY(-1);
  opacity: .22;
  -webkit-mask-image: linear-gradient(to top, #0009, transparent 30%);
  mask-image: linear-gradient(to top, #0009, transparent 30%);
}
.album-play {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding-left: 2px;
  border: 1px solid #f1d5ac68;
  border-radius: 50%;
  background: #1a100dc9;
  box-shadow: 0 2px 10px #0003;
  color: #ffe9c7;
  font-size: 9px;
  opacity: 0;
  transition: opacity .18s;
}
.album-cover[aria-pressed=true] .album-art { border-color: #e5bd83; box-shadow: 0 5px 19px #000b, 0 0 0 1px #b6915b44; }
.album-cover[aria-pressed=true] .album-play { opacity: 1; }
.album-cover:hover .album-art { border-color: #e2bd8c; }
.album-cover:focus-visible { outline: none; }
.album-cover:focus-visible .album-art { outline: 2px solid #ffe0ae; outline-offset: -4px; }
.coverflow-caption { min-height: 28px; padding: 0 10px 3px; text-align: center; }
#film-selection-title { display: block; overflow: hidden; margin: 0; color: #f0d9b9; font-size: 11px; font-weight: 400; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.coverflow-caption > div { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 1px 0 0; color: #ad906d; font: 8px/1.4 monospace; letter-spacing: .3px; }
#film-count, #film-selection-duration { font: 8px/1.4 monospace; color: #ad906d; }
.cinema-links { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 16px; padding: 0 1px; color: #ac8e6b; font-size: 9px; line-height: 1.5; }
.cinema-links a, .cinema-links button { display: inline-flex; align-items: center; min-height: 28px; }
.cinema-links a:hover, .cinema-links button:hover { color: #efd5b2; }
.cinema-links a { text-decoration: none; }
#coverflow-help { margin: 0; color: #947c63; font-size: 8px; line-height: 1.4; text-align: center; }
.music-notes { max-height: 32dvh; overflow-y: auto; margin-top: 10px; padding: 17px 21px; background: #241b16f2; border-top: 1px solid #ba936136; backdrop-filter: blur(18px); pointer-events: auto; scrollbar-width: thin; }
.music-notes .story-subtitle { margin-top: 8px; }
.music-notes .story-facts { margin-block: 14px; }
.music-notes .story-body { max-width: 650px; }
body.cinema-open .toast { bottom: 230px; }

@media (min-width: 1600px) {
  .story-dialog { right: 55px; top: 130px; width: 370px; max-height: calc(100dvh - 265px); }
  body.cinema-open .drawer-top { top: 120px; right: 55px; }
  .cinema-meta { top: 130px; left: 55px; }
}
@media (max-width: 1000px) {
  .story-dialog { right: 22px; width: 320px; top: 95px; max-height: calc(100dvh - 225px); }
  .story-content-inner { padding: 20px; }
  body.cinema-open .drawer-top { right: 28px; top: 91px; }
  .cinema-meta { left: 28px; top: 96px; width: 170px; }
  .cinema-meta #story-title { font-size: 22px; }
  #projection-title { font-size: 9px; max-width: 160px; }
}
@media (max-width: 600px) {
  .story-dialog {
    inset: auto 12px 14px;
    width: calc(100vw - 24px);
    max-width: none;
    height: auto;
    max-height: 42dvh;
    border: 1px solid #c59a6729;
    border-radius: 6px;
    box-shadow: 0 10px 40px #10090444;
    background: #241b16f2;
  }
  .story-dialog:before { display: none; }
  .drawer-top { padding: 13px 18px; }
  .story-content-inner { padding: 18px; }
  .story-dialog h2 { font-size: 25px; margin: 10px 0 12px; }
  .story-lede { font-size: 16px; }
  .story-body { font-size: 11px; }
  .drawer-bottom { padding: 14px 18px; }
  .physics-controls { margin-block: 16px; padding: 13px; }
  html[lang=zh-CN] .story-dialog h2 { font-size: 23px; }
  body.panel-open:not(.cinema-open) .room-footer { opacity: 0; visibility: hidden; }
  body.cinema-open .story-dialog { inset: auto 12px max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 24px); max-height: calc(100dvh - 160px); }
  body.cinema-open .drawer-top { top: 82px; right: 21px; gap: 13px; }
  body.cinema-open #drawer-index { display: none; }
  body.cinema-open #close-story { font-size: 8px; gap: 7px; padding-top: 3px; }
  body.cinema-open #close-story > span:last-child { font-size: 20px; }
  .cinema-meta { top: 86px; left: 23px; width: 180px; }
  .cinema-meta .story-kicker { font-size: 6px; letter-spacing: 1.2px; }
  .cinema-meta #story-title { font-size: 20px; margin: 7px 0 6px; }
  html[lang=zh-CN] .cinema-meta #story-title { font-size: 18px; }
  #projection-title { font-size: 8px; max-width: 155px; line-height: 1.5; }
  .cinema-view-hint { font-size: 8px; margin-top: 8px; max-width: 170px; }
  .cinema-console { padding: 5px 10px 3px; }
  .transport-row { gap: 8px; }
  .transport-row button { min-height: 44px; }
  #film-play { width: 32px; }
  #film-time { font-size: 9px; }
  #film-mute { font-size: 9px; padding-inline: 0; }
  #film-fullscreen { width: 23px; font-size: 19px; }
  .coverflow { --cover-size: 88px; }
  .coverflow-scroll { height: calc(var(--cover-size) + 26px); padding-block: 5px 21px; perspective: 650px; }
  .coverflow:after { background: linear-gradient(90deg, #1e1815, #1e181500 7%, #1e181500 93%, #1e1815); }
  .coverflow-caption { min-height: 26px; padding-bottom: 2px; }
  #film-selection-title { font-size: 10px; }
  .album-play { width: 22px; height: 22px; right: 5px; bottom: 5px; font-size: 8px; }
  .cinema-links { gap: 7px; font-size: 8px; }
  .cinema-links a, .cinema-links button { min-height: 32px; }
  #coverflow-help { max-width: 95px; font-size: 7px; }
  .music-notes { max-height: 29dvh; padding: 15px; }
  .projection-player-source { --film-max-height: 38dvh; }
  body.cinema-open .toast { bottom: 190px; }
}
@media (max-height: 550px) and (min-width: 601px) {
  .story-dialog { top: 69px; right: 20px; max-height: calc(100dvh - 146px); width: 310px; }
  .drawer-top { padding-block: 10px; }
  .story-content-inner { padding: 16px 20px; }
  body.cinema-open .story-dialog { bottom: 9px; max-height: calc(100dvh - 90px); width: min(740px, calc(100vw - 40px)); }
  body.cinema-open .drawer-top { top: 65px; right: 24px; }
  .cinema-meta { top: 68px; left: 26px; }
  .cinema-meta #story-title { font-size: 19px; margin-block: 6px; }
  .cinema-console { padding-block: 4px; }
  .transport-row { min-height: 24px; }
  .transport-row button { min-height: 24px; }
  .coverflow { --cover-size: 60px; }
  .coverflow-scroll { height: calc(var(--cover-size) + 24px); padding-block: 4px 20px; }
  .coverflow-caption { min-height: 24px; padding-bottom: 1px; }
  #film-selection-title { font-size: 10px; }
  .album-play { width: 18px; height: 18px; right: 4px; bottom: 4px; font-size: 7px; }
  .cinema-links { padding-top: 0; }
  .cinema-links a, .cinema-links button { min-height: 24px; }
  .music-notes { max-height: 25dvh; }
}
@media (prefers-reduced-motion: reduce) {
  .album-art, .album-play { transition: none; }
  .coverflow-scroll { scroll-behavior: auto; }
}
