:root {
  color-scheme: dark;
  caret-color: transparent;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; background: #000; }
.installation {
  --scene-left: 50%;
  --scene-height: min(100dvh, 126vw);
  --scene-top: calc((100dvh - var(--scene-height)) / 2);
  --cabinet-unit: calc(var(--scene-height) / 1432);
  --guide-gap: clamp(6px, 1.35vw, 24px);
  position: relative; height: 100dvh; width: 100%; overflow: hidden; overflow: clip; isolation: isolate; background: #000;
  -webkit-user-select: none; user-select: none; cursor: default;
}
.installation[data-guide-open="true"] {
  --guide-space: calc(112px + var(--guide-gap)*2 + env(safe-area-inset-right, 0px));
  --scene-height: min(100dvh, 126vw, calc((100vw - var(--guide-space))*1.26));
  --scene-left: min(50%, calc(100% - var(--guide-space) - var(--cabinet-unit)*549));
}
/* The film adds red light to the room drawing. Black frames reveal the unlit wall. */
.cabinet-projection { position: absolute; left: var(--scene-left); top: calc(var(--scene-top) + var(--scene-height)*.44); width: calc(var(--scene-height)*1.80); aspect-ratio: 1; transform: translate(-50%, -50%); contain: strict; pointer-events: none; mix-blend-mode: screen; }
.cabinet-projection .projection-film { background: #000; }
.cabinet-projection video { mix-blend-mode: normal; }
.room-lines, .machine { position: absolute; top: var(--scene-top); left: var(--scene-left); height: var(--scene-height); transform: translateX(-50%); }
.room-lines { width: calc(var(--scene-height) * 1600 / 486); pointer-events: none; }
.machine { width: calc(var(--cabinet-unit) * 1098); }
.cabinet-drawing { display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.marquee { position: absolute; z-index: 1; left: 10.86%; top: 4.28%; width: 78.68%; height: 13.066%; cursor: none; user-select: none; animation: marquee-pulse 3.6s ease-in-out infinite; }
@keyframes marquee-pulse { 0%, 100% { opacity: .38; } 48%, 52% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .marquee { animation: none; } }

/* Original glass aperture, bezel, scanlines and photographic reflections. */
.machine::before, .crt-bezel { position: absolute; left: calc(var(--cabinet-unit)*208); top: calc(var(--cabinet-unit)*450.5); width: calc(var(--cabinet-unit)*684); height: calc(var(--cabinet-unit)*519); border-radius: calc(var(--cabinet-unit)*42); }
.machine::before { content: ""; z-index: 1; background: #000; }
.crt-bezel { z-index: 4; pointer-events: none; border: calc(var(--cabinet-unit)*9) solid #141515; box-shadow: 0 0 0 calc(var(--cabinet-unit)*2) #090909, 0 0 0 calc(var(--cabinet-unit)*3) #454644, inset 0 0 0 calc(var(--cabinet-unit)*1.5) #484a48, inset 0 0 0 calc(var(--cabinet-unit)*3) #080909; }
.screen { position: absolute; z-index: 2; left: 50.0910747%; top: calc(var(--cabinet-unit)*462.5); width: auto; aspect-ratio: 4/3; height: calc(var(--cabinet-unit)*495); transform: translateX(-50%); overflow: hidden; border-radius: calc(var(--cabinet-unit)*30); background: #000; contain: strict; isolation: isolate; }
.game-surface { position: absolute; inset: 0; background: #000; contain: strict; transform: translateZ(0); }
#game-frame { display: block; position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.game-surface:fullscreen, .game-surface:-webkit-full-screen { position: fixed; inset: 0; width: 100vw; height: 100vh; background: #000; }
.crt-shading { position: absolute; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(ellipse at 50% 47%, transparent 35%, #0001 73%, #0005 100%); }
.crt-lines { position: absolute; inset: 0; pointer-events: none; z-index: 3; background: repeating-linear-gradient(0deg,#0001 0px,#0001 1px,transparent 1px,transparent 3px); }
.glass { position: absolute; z-index: 5; left: 50.0910747%; top: calc(var(--cabinet-unit)*462.5); width: calc(var(--cabinet-unit)*660); height: calc(var(--cabinet-unit)*495); transform: translateX(-50%); border-radius: calc(var(--cabinet-unit)*30); pointer-events: none; background: url('assets/crt-reflections-v2.png') 50.2040816% 49.4047619% / 180.5921053% 337.7358491%; contain: strict; }

.cabinet-controls { position: absolute; z-index: 6; display: flex; align-items: center; justify-content: center; gap: clamp(2px, calc(var(--scene-height)*.054 - 24px), 14px); left: 50.09%; top: 70.72%; transform: translate(-50%, -50%); }
.icon-control { appearance: none; display: grid; place-items: center; width: clamp(24px, calc(var(--scene-height)*.0385), 38px); height: clamp(24px, calc(var(--scene-height)*.0385), 38px); margin: 0; padding: 0; border: 0; color: #9e9d9a; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.icon-control svg { display: block; width: clamp(12px, calc(var(--scene-height)*.0235), 22px); height: clamp(12px, calc(var(--scene-height)*.0235), 22px); fill: currentColor; shape-rendering: crispEdges; }
.icon-control:hover, .icon-control:focus-visible { color: #f0ece8; }
.icon-control:focus-visible { outline: 1px solid #84807b; outline-offset: 1px; }
#info-button[aria-expanded="true"], #projector-button[aria-pressed="true"] { color: #d45148; }
.sound-off, .music-off, #mute-button[aria-pressed="true"] .sound-on, #music-button[aria-pressed="false"] .music-on { display: none; }
#mute-button[aria-pressed="true"] .sound-off, #music-button[aria-pressed="false"] .music-off { display: block; }

.controls-guide {
  position: absolute; z-index: 8; top: calc(var(--scene-top) + var(--scene-height)*.51);
  left: calc(var(--scene-left) + var(--cabinet-unit)*549 + var(--guide-gap));
  right: max(8px, env(safe-area-inset-right)); max-width: 324px;
  transform: translateY(-50%); isolation: isolate; pointer-events: none;
}
#controls-pixels { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.release { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(11px, env(safe-area-inset-bottom)); font-size: .75rem; line-height: 1; letter-spacing: .04em; color: #777473; background: #000; padding: 2px 3px; font-variant-numeric: tabular-nums; }
.projector-status { position: absolute; z-index: 9; left: 50%; bottom: 1.5rem; max-width: min(36rem, 90vw); transform: translateX(-50%); margin: 0; padding: .5rem .8rem; color: #ddd; background: #080808; font-size: .8rem; }

.installation[data-fullscreen="true"] .machine { position: fixed; inset: 0; width: 100vw; height: 100dvh; transform: none; }
.installation[data-fullscreen="true"] .screen,
.installation[data-fullscreen="true"] .game-surface { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; transform: none; }
.installation[data-fullscreen="true"] :is(.cabinet-projection, .room-lines, .cabinet-drawing, .marquee, .crt-bezel, .glass, .crt-shading, .crt-lines, .cabinet-controls, .controls-guide, .release),
.installation[data-fullscreen="true"] .machine::before { display: none; }
