/* Portal Rooms — the Theater (js/theater/).
   The YouTube player sits in a fixed layer above the WebGL canvas and below the HUD (20),
   the display layer (25) and every overlay, so menus cover it and nothing of the room is
   drawn over it. Each frame TheaterScreen lays it onto the giant screen with matrix3d. */

.theater-layer {
  position: fixed;
  inset: 0;
  z-index: 15;
  overflow: hidden;              /* a screen seen from close up is far bigger than the window */
  pointer-events: none;
  visibility: hidden;            /* TheaterScreen shows it while the screen is in view */
}

.theater-layer__screen {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  background: #000;
  pointer-events: none;          /* walking: clicks go to the room (portals, pointer lock) */
}
.theater-layer__screen iframe { display: block; width: 100%; height: 100%; border: 0; }
.theater-layer.is-interactive .theater-layer__screen { pointer-events: auto; }   /* watch mode: the player's own controls */

/* the watch bar, placed under the screen by TheaterScreen */
.theater-bar {
  --c: #ff5a4a;
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: min(1100px, calc(100vw - 24px));
  padding: 10px 12px 10px 18px;
  border-radius: 16px;
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 40px -12px var(--c), 0 18px 50px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  animation: fade-in 0.3s var(--ease, ease) both;
}
.theater-bar[hidden] { display: none; }
.theater-bar__info { margin: 0 10px 0 0; display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1 1 260px; }
.theater-bar__kicker { font: 600 11px/1 var(--font-display); letter-spacing: 0.24em; text-transform: uppercase; color: var(--c); white-space: nowrap; }
.theater-bar__title { font: 700 17px/1.2 var(--font-display); letter-spacing: 0.02em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theater-bar__room { font-size: 13px; color: var(--ink-dim); white-space: nowrap; }
.theater-bar .btn { white-space: nowrap; }

/* the programme (content/theater.html) */
.pr-card--video .pr-card__media--video { position: relative; }
.pr-card--video .pr-card__media--empty { font-size: 52px; }
.pr-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  display: grid;
  place-items: center;
  padding-left: 5px;
  border-radius: 50%;
  background: rgba(6, 7, 10, 0.62);
  border: 2px solid color-mix(in srgb, var(--cc) 70%, white);
  color: #fff;
  font-size: 22px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.pr-card--video:hover .pr-play { transform: scale(1.08); background: color-mix(in srgb, var(--cc) 55%, rgba(6, 7, 10, 0.7)); }
.pr-card--video .pr-actions button { cursor: pointer; }

/* an exhibit's "Watch its video in the Theater" */
.pr-watch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0 0;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--cc) 70%, transparent);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: 700 14px/1 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.pr-watch:hover, .pr-watch:focus-visible { background: color-mix(in srgb, var(--cc) 22%, transparent); }
.pr-watch span { color: var(--cc); }
