* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05070a;
}
#screen-shell {
  width: 100vw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #0f141c 0%, #05070a 100%);
}
canvas#screen {
  display: block;
  width: min(100vw, calc(100dvh * 4 / 3));
  height: min(100dvh, calc(100vw * 3 / 4));
  aspect-ratio: 4 / 3;
  object-fit: fill;
  border-radius: 4px;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.9);
  touch-action: none;
  cursor: none;
}
.startup-error { color: #f85149; padding: 20px; }
canvas#screen:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}
html:has(#screen[data-screensaver="true"]),
body:has(#screen[data-screensaver="true"]),
#screen-shell:has(#screen[data-screensaver="true"]) {
  background: #000;
}
canvas#screen[data-screensaver="true"] {
  outline: none;
  border-radius: 0;
  box-shadow: none;
  cursor: none;
}
#screen-shell:has(#screen[data-screensaver="true"]) .accessible-link {
  visibility: hidden;
}
.accessible-link {
  position: absolute;
  left: -9999px;
}
.accessible-link:focus-visible {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: .5rem 1rem;
  color: #fff;
  background: #101820;
}
@media (orientation: portrait) {
  #screen-shell {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  canvas#screen {
    width: 100vw;
    height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    aspect-ratio: auto;
    border-radius: 0;
    cursor: default;
  }
}
