/* Shared room geometry and ambience. Optical screen treatment lives in glass.css. */
@font-face {
  font-family: Pixel;
  src: url(assets/silkscreen-latin-ext.woff2);
  font-display: swap;
}
@font-face {
  font-family: Pixel;
  src: url(assets/silkscreen-latin.woff2);
  unicode-range: U+0000-00FF;
  font-display: swap;
}
:root {
  --phosphor: #b6d79d;
  --bright: #d0e8b6;
  --room-width: max(100vw, 150svh);
  --motion-room: 600ms;
  --motion-page: 220ms;
}
* {
  box-sizing: border-box;
}
/* Keep native one-finger scrolling, but leave enlargement to the glasses.
   Apply to scroll containers too: gesture negotiation stops at that ancestor. */
* { touch-action: pan-x pan-y; }
html {
  height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
  position: fixed;
  inset: 0;
  background: #070c0a;
  color: var(--phosphor);
  font-family: Pixel, monospace;
}
/* Suppress native selection, image/link dragging and touch callouts in the game UI. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, a { -webkit-user-drag: none; }
input, textarea, [contenteditable]:not([contenteditable="false"]) {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}
button,
a,
input {
  font: inherit;
}
button {
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button:disabled {
  cursor: default;
}
svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.4;
  fill: none;
}
h1,
h2,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
.room {
  position: fixed;
  left: 50%;
  top: 50%;
  width: var(--room-width);
  aspect-ratio: 1.5;
  transform: translate(-50%, -50%);
  transform-origin: 50% 41.35%;
  transition:
    transform var(--motion-room) cubic-bezier(0.22, 0.8, 0.2, 1),
    top var(--motion-room) cubic-bezier(0.22, 0.8, 0.2, 1);
  container-type: inline-size;
}
.room-artwork {
  display: contents;
}
.room-photo {
  width: 100%;
  height: 100%;
  display: block;
}
.screen {
  position: absolute;
  /* Bounds of the traced glass in the 1536 x 1024 source image. */
  left: 34.3098958333%;
  top: 24.51171875%;
  width: 31.3151041667%;
  height: 33.30078125%;
  overflow: hidden;
  isolation: isolate;
}
.screen::before,
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}
.screen-inner {
  position: absolute;
  inset: 5% 6%;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.screen-top {
  display: flex;
  align-items: center;
  flex: none;
}
.home-key {
  color: var(--phosphor);
}
#zoom {
  display: grid;
  place-items: center;
}
#zoom svg {
  width: 1.1cqw;
  height: 1.1cqw;
}
#content {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #718b62 transparent;
  overflow-x: hidden;
  overflow-y: auto;
}
.screen-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}
.languages {
  display: flex;
  gap: 4px;
}
.languages button {
  color: #a7bb99;
}
.languages button[aria-pressed="true"] {
  color: var(--bright);
}
.crt-wordmark {
  display: block;
  aspect-ratio: 8450/1300;
  mask: url(assets/wordmark.svg) left center/contain no-repeat;
  -webkit-mask: url(assets/wordmark.svg) left center/contain no-repeat;
}
.power-switch {
  position: absolute;
  left: 62.6%;
  top: 60%;
  width: 2.15%;
  height: 3.3%;
  border-radius: 50%;
  outline-offset: 4px;
}

.powered-off .screen-inner {
  opacity: 0;
  pointer-events: none;
}
.desk-caption {
  position: fixed;
  bottom: 20px;
  left: 28px;
  right: 28px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  pointer-events: none;
  font:
    9px Pixel,
    monospace;
  letter-spacing: 0.04em;
  color: #9c9b8c;
  text-shadow: 0 1px 3px #000;
}
.desk-caption button {
  pointer-events: auto;
  min-height: 44px;
  font-size: 9px;
  color: #b8c0a7;
  visibility: hidden;
}
.zoomed .desk-caption button {
  visibility: visible;
}
.zoomed .room {
  transform: translate(-50%, -50%) scale(1.72);
  /* The screen centre is 41.35% down a room whose height is width / 1.5.
     Offset (50% - 41.35%) of that height to centre the glass in the viewport. */
  top: calc(50% + var(--room-width) * 0.057666667);
}
.screen-spill,
.dust,
.cigarette-smoke {
  position: absolute;
  pointer-events: none;
}
.screen-spill {
  left: 25%;
  top: 58%;
  width: 51%;
  height: 39%;
  background: radial-gradient(ellipse, #84d96c35, transparent 67%);
  mix-blend-mode: screen;
  opacity: var(--spill-strength, 0.95);
  transition: opacity 650ms ease-out;
}
.powered-off .screen-spill {
  opacity: 0;
}
.dust {
  left: 3%;
  top: 32%;
  width: 42%;
  height: 50%;
  overflow: hidden;
}
.dust i {
  position: absolute;
  top: 90%;
  left: var(--dust-x);
  width: var(--dust-size);
  height: var(--dust-size);
  border-radius: 50%;
  background: #ffe5b7;
  box-shadow: 0 0 4px #ffd49060;
  filter: blur(0.65px);
  opacity: 0;
  animation: dust-rise var(--dust-duration) linear var(--dust-delay) infinite;
}
@keyframes dust-rise {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  15% {
    opacity: 0.65;
  }
  40% {
    opacity: 0.9;
    transform: translate(calc(var(--dust-drift) * 0.35), -104px);
  }
  70% {
    opacity: 0.45;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dust-drift), -260px);
  }
}
.cigarette-smoke {
  left: 76.3%;
  top: 51.5%;
  width: 16%;
  height: 34%;
  opacity: 1;
  filter: blur(0.55px);
}
.disk-activity {
  position: absolute;
  left: 97.2%;
  top: 49.8%;
  width: 0.25%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: #ffd78b;
  box-shadow:
    0 0 3px #ffb73ee0,
    0 0 9px #ffae4560;
  transform: translate(-50%, -50%);
}
.effects-paused .dust i {
  animation-play-state: paused;
}
.effects-paused .screen-spill,
.effects-paused .room {
  transition: none;
}
.effects-paused .disk-activity {
  display: none;
}
@media (any-hover: hover) and (any-pointer: fine) {
  html,
  body {
    cursor:
      url("assets/win95-arrow_s.cur") 0 0,
      url("assets/win95-arrow_s.png") 0 0,
      default;
  }
  button,
  a,
  [role="button"],
  input[type="range"],
  summary {
    cursor:
      url("assets/win95-select.cur") 10 10,
      url("assets/win95-select.png") 10 10,
      pointer;
  }
}
@media (max-width: 700px), (max-height: 500px) {
  :root {
    /* Keep the monitor controls reachable on short landscape screens too. */
    --room-width: min(205vw, 300svh);
  }
  .room {
    top: calc(48svh + var(--room-width) * 0.035);
    transition: none;
  }
  .desk-caption {
    left: 16px;
    right: 16px;
    bottom: max(8px, env(safe-area-inset-bottom));
    font-size: 7px;
    display: block;
    text-align: center;
  }
  .desk-caption button {
    margin: auto;
    font-size: 9px;
  }
  body:is(.zoomed, .consent-open) .room {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100svh;
    aspect-ratio: auto;
    transform: none;
  }
  :is(.zoomed, .consent-open) .room-photo {
    object-fit: cover;
    filter: brightness(0.35);
  }
  body:is(.zoomed, .consent-open) .screen {
    top: 3%;
    left: 4%;
    width: 92%;
    height: 87%;
    border: 7px solid #655f46;
    border-radius: 24px;
    box-shadow:
      0 0 0 2px #373a2b,
      inset 0 0 25px #000,
      0 25px 75px #0009;
  }
  body:is(.zoomed, .consent-open) .screen-inner {
    inset: 3% 5%;
  }
  :is(.zoomed, .consent-open) #zoom svg {
    width: 18px;
    height: 18px;
  }
  :is(.zoomed, .consent-open) .power-switch,
  :is(.zoomed, .consent-open) .screen-spill,
  :is(.zoomed, .consent-open) .dust,
  :is(.zoomed, .consent-open) .cigarette-smoke,
  :is(.zoomed, .consent-open) .disk-activity {
    display: none;
  }
}
/* The portrait master adds surroundings around the untouched 1536 × 1024
   room. Keep that original coordinate system for the screen and ambience:
   its top is y=200 in a 1536 × 1536 canvas (200/1024 = 19.53125%). */
@media (orientation: portrait) {
  :root {
    --room-width: max(170vw, 100svh);
  }
  body:not(.zoomed) .room {
    top: calc(50svh - var(--room-width) * 0.0364583333);
  }
  .room-photo {
    position: absolute;
    top: -19.53125%;
    height: 150%;
  }
}
@media (orientation: portrait) and (max-width: 700px) {
  :root {
    --room-width: max(225vw, 100svh);
  }
  body.consent-open:not(.zoomed) .room { top: 0; }
  body:is(.zoomed, .consent-open) .room-photo {
    top: 0;
    height: 100%;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  :root {
    --room-width: max(100vw, 235svh);
  }
  body:not(.zoomed, .consent-open) .room {
    top: calc(50svh - var(--room-width) * 0.007);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .dust,
  .disk-activity {
    display: none;
  }
}

/* Tower button and LED stay attached to the original photograph coordinates. */
.computer-power {
  position: absolute;
  left: 96.08%;
  top: 49.85%;
  width: 2.3%;
  height: 3.5%;
  border-radius: 50%;
  touch-action: none;
}

/* Cover the photographed halo with the surrounding plastic; only the lens
   itself should read as dark. Coordinates are in the 1536 × 1024 master. */
.power-led-shade {
  display: none;
  position: absolute;
  pointer-events: none;
  width: 1.5625%; /* 24 source pixels */
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle closest-side, #353322 0 13%, #3e3825 21%,
    var(--panel) 30% 65%, transparent 100%);
}
.tower-led {
  left: 95.9961%; /* (1474.5, 472.5) */
  top: 46.1426%;
  --panel: #4b331f;
}
.monitor-led {
  left: 61.1003%; /* (938.5, 638.5) */
  top: 62.3535%;
  --panel: #4d3925;
}
.computer-off .tower-led,
.powered-off .monitor-led { display: block; }
.computer-off .screen-inner,
.computer-off #object-world { visibility: hidden; pointer-events: none; }
.computer-off .screen-spill { opacity: .1; }
.computer-off .disk-activity { display: none; }
.no-signal {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: #020906cc;
  color: #b6d79d;
  font: 400 1.1cqw/1.3 Pixel, monospace;
  text-shadow: 0 0 2px #bddb9238;
}
.no-signal[hidden] { display: none; }
.no-signal span { padding: .75em 1.2em; border: 1px solid #8ca37b80; background: #102018; }
.powered-off .no-signal,
.powered-off .boot-screen { visibility: hidden; }
/* The loading squares animate their own visibility. Blank the whole boot
   picture without stopping its clock if the monitor is switched back on. */
.powered-off .boot-screen { opacity: 0; }
body.powered-off .screen-spill { opacity: 0; }
body:not(.ready) .computer-power { visibility: hidden; }
@media (max-width: 700px), (max-height: 500px) {
  :is(.zoomed, .consent-open) :is(.computer-power, .power-led-shade) { display: none; }
}

body[data-page] .computer-power { visibility: visible; }

.zoomed .computer-power { display: none; }

/* Physical power switches deliberately have no hover decoration: cursor only. */
html.game-selection :is(.power-switch, .computer-power, #room-view, .monitor-hint button):focus { outline: none; }
:is(#room-view, .monitor-hint button).game-selected {
  color: #e0edbd;
  text-shadow: 0 0 5px #c4e49380;
}
@media (forced-colors: active) {
  html.game-selection :is(.power-switch, .computer-power, #room-view, .monitor-hint button):focus-visible { outline: 2px solid Highlight; }
}

/* A shallow desktop window can crop the glass even on a normal display.
   Keep a little space above the real tube; cap the close-up by available height. */
@media (min-width: 701px) and (min-height: 501px) and (min-aspect-ratio: 2/1) {
  body:not(.zoomed) .room { top: max(50%, calc(var(--room-width) * .17 + 3svh)); }
  body.zoomed .room { --room-width: min(100vw, 242svh); }
}
