/* Keep the painted machine and its interactive features on the same 3:1 plane.
   The scene can then crop at any viewport width without displacing its face. */
.crt-window { position: absolute; inset: 0; z-index: -2; overflow: hidden; container-type: size; pointer-events: none; }
.crt-art {
  --align: 50%;
  position: absolute; width: max(100cqw, 300cqh); aspect-ratio: 3;
  left: var(--align); top: 50%; transform: translate(calc(-1 * var(--align)), -50%);
  background: var(--art-wash), var(--workstation-art) center / 100% 100%;
  background-blend-mode: color, normal;
}
.result-screen .crt-art { --align: 55%; }
.hero::before, .result-screen::before { pointer-events: none; }
.hero-copy, .outcome, .result-chips, .round-status { pointer-events: none; }
.hero-copy > *, .outcome > *, .result-chips > *, .round-status > * { pointer-events: auto; }
.result-screen > :is(h1, p, .final-score), .round-screen > :is(.topic, .answer-return) { width: fit-content; max-width: 100%; }
.crt-hit {
  position: absolute; left: 50%; top: 5%; width: 42%; height: 93%; display: block;
  pointer-events: auto; appearance: none; cursor: pointer; padding: 0; border: 0; background: none;
  clip-path: polygon(38% 11%, 77% 2%, 97% 19%, 97% 72%, 83% 81%, 75% 96%, 61% 100%, 2% 90%, 2% 81%, 15% 68%, 34% 66%);
}
/* Sample clean glass directly below the original illustration's eyes and mouth.
   The small patch keeps the screen's dither, tone and artwork color wash. */
.crt-glass {
  position: absolute; display: block; left: 48.34%; top: 27.89%; width: 18.31%; height: 14.41%;
  background-image: var(--art-wash), var(--workstation-art);
  background-size: 100% 100%, 1300.6% 2262.5%; background-position: center, 76.16% 45.81%;
  background-blend-mode: color, normal;
}
.crt-hit:focus-visible { outline: none; }
.crt-hit:focus-visible .crt-glass { outline: 2px dashed #ffdfaa; outline-offset: 3px; }
.crt-gaze { position: absolute; inset: 0; color: #ffc47d; }
.crt-eye, .crt-mouth { display: block; position: absolute; background: currentColor; }
.crt-eye {
  left: 14.4%; top: 12%; width: 12%; height: 46%; transform-origin: center 72%;
  clip-path: polygon(20% 0, 80% 0, 80% 7%, 100% 7%, 100% 90%, 80% 90%, 80% 100%, 20% 100%, 20% 92%, 0 92%, 0 8%, 20% 8%);
}
.crt-eye.right { left: 75.4%; }
.crt-mouth {
  left: 36%; top: 70%; width: 26%; height: 18%;
  clip-path: polygon(0 0, 18% 0, 18% 45%, 81% 45%, 81% 0, 100% 0, 100% 58%, 85% 58%, 85% 100%, 15% 100%, 15% 58%, 0 58%);
}
.crt-hit.is-winking .crt-gaze { transform: translate(3%, -2%); color: #ffe2a9; animation: none; }
.crt-hit.is-winking .crt-eye { animation: none; }
.crt-hit.is-winking .crt-eye.right { transform: scale(1.3, .23) rotate(-9deg); }
.crt-hit.is-winking .crt-mouth { transform: scale(1.17, 1.25); }

@keyframes crt-look {
  0%, 11%, 36%, 53%, 76%, 100% { transform: none; }
  15%, 29% { transform: translate(-8%, 1%); }
  58%, 70% { transform: translate(7%, -4%); }
  84%, 89% { transform: translate(2%, 4%); }
}
@keyframes crt-blink {
  0%, 41%, 44%, 92%, 95%, 100% { transform: none; }
  42%, 93% { transform: scaleY(.17); }
}
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduced"]) .crt-hit:not(.is-winking) .crt-gaze { animation: crt-look 9s steps(3, end) infinite; }
  :root:not([data-motion="reduced"]) .crt-hit:not(.is-winking) .crt-eye { animation: crt-blink 7s steps(2, end) infinite; }
}
@media (min-width: 760px) {
  .round-screen .crt-window {
    inset: auto 1% 0 auto; width: 32%; height: 86%; opacity: var(--machine-light);
    mask-image: linear-gradient(90deg, transparent, black 30%, black 84%, transparent);
  }
  .round-screen .crt-art { --align: 87%; width: 300cqh; }
  .round-screen .crt-window::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, transparent 57%, var(--console)); }
  .reveal-screen .crt-window { right: 13%; }
}
@media (max-width: 759.98px) {
  .round-screen .crt-window { display: none; }
}
@media (max-width: 520px) {
  .hero .crt-window { height: var(--art-height); }
  .hero .crt-art { --align: 100%; width: 300cqh; }
  .result-screen .crt-art { --align: 62%; }
}
