/* The picture supplies the glass underneath; this layer supplies its emission.
   Keep this comparison separate from the approved room and ambience styling. */
.screen {
  --raster-pitch: 0.115cqw;
  --tube-ink: #b6d79d;
  --tube-bright: #d0e8b6;
  background: radial-gradient(
    ellipse at 49% 46%,
    #5b865330,
    #31593214 65%,
    transparent 90%
  );
  /* The photographed tube bows along all four edges. A rounded rectangle
     leaves visible shoulders at the corners. Clip every screen layer to the
     same traced silhouette, scaled with the room in both orientations. */
  border-radius: 0;
  -webkit-mask: url(assets/crt-glass-mask.svg) center / 100% 100% no-repeat;
  mask: url(assets/crt-glass-mask.svg) center / 100% 100% no-repeat;
  box-shadow:
    inset 0 0 9px #010b07b0,
    0 0 16px #a4df7b16,
    0 0 40px #92cc6e14;
  transform: none;
}
/* Light is reflected in front of the phosphor. The lamp is to the left,
   so its broad, soft reflection never becomes a white stripe across the text. */
.screen::before {
  z-index: 4;
  opacity: 1;
  background:
    radial-gradient(ellipse at 4% 36%, #e2c79718, transparent 52%),
    linear-gradient(
      112deg,
      transparent 4%,
      #c5d1b90b 19%,
      #c5d1b90d 23%,
      transparent 44%
    ),
    radial-gradient(
      ellipse at 49% 46%,
      transparent 52%,
      #010a054d 86%,
      #010805b8 100%
    );
  box-shadow:
    inset 0 2px 7px #0009,
    inset 3px 0 9px #0006,
    inset 0 -1px 2px #9da68416;
}
.screen::after {
  z-index: 5;
  opacity: 1;
  /* Transparent beam gaps cross every layer without a white compositing
    surface. Pitch follows the physical monitor when zooming. */
  background: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 42%,
      #010a0530 70%,
      #010a050c 90%,
      transparent 100%
    )
    0 0 / 100% var(--raster-pitch) repeat;
  mix-blend-mode: normal;
  box-shadow: inset 0 0 18px #0005;
}
/* One readable phosphor palette; avoid nested blur/compositing on WebKit. */
.screen-inner {
  filter: none;
  color: var(--tube-ink);
  text-shadow:
    0 0 1px #bfec9c70,
    0 0 4px #a5da743d;
}
.screen-inner button,
.screen-inner a,
.screen-inner strong {
  filter: none;
  text-shadow: inherit;
}
.home-key,
.languages button[aria-pressed="true"] {
  color: var(--tube-ink);
  filter: none;
  text-shadow: inherit;
  opacity: 0.85;
}
.languages button {
  filter: none;
}
.screen-top,
.screen-footer {
  border-color: #97b88424;
}
/* A cut affects the menu picture only. System controls stay available. */
#screen[data-picture-pending] :is(#content, #object-world) {
  visibility: hidden;
}
#screen[data-picture-pending] .nav-back { visibility: visible; }
/* Keep Back and the CRT controls usable during a real disc read. */
.project-dossier:has(#afia-native-stage[aria-busy="true"]) { visibility: hidden; }
.disc-read-status { display: none; }
#screen[data-loading-cue] .disc-read-status,
.screen-inner:has(#afia-native-stage[aria-busy="true"]) .disc-read-status {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--tube-ink);
  font: 400 clamp(8px, 1.55cqi, 15px)/1 MenuText, monospace;
  letter-spacing: .02em;
}
.powered-off .screen {
  background: transparent;
  box-shadow: inset 0 0 12px #0009;
}
/* Expanded phone view prioritises touch targets and text, with the same glass. */
@media (max-width: 700px), (max-height: 500px) {
  body:is(.zoomed, .consent-open) .screen {
    --raster-pitch: 2.4px;
    /* The expanded touch view has its own frame, outside the photograph. */
    -webkit-mask: none;
    mask: none;
    transform: none;
    background: radial-gradient(ellipse at 50% 42%, #192b1d, #0a160e);
    border-radius: 24px;
  }
  body:is(.zoomed, .consent-open) .screen::before {
    background:
      radial-gradient(ellipse at 4% 36%, #e2c7970c, transparent 54%),
      radial-gradient(ellipse at 50% 45%, transparent 65%, #01080580 100%);
  }
}
