@font-face {
  font-family: "ZX Spectrum";
  src: url("./assets/zx_spectrum.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

:root {
  /* 18px at 1920x1080; 36px at 3840x2160. */
  font-size: max(18px, min(0.9375vw, 1.6667vh));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  background: #000;
}

#stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#StarField {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: star-field-fade-in 3s ease-out both;
}

#startButton {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  padding: 0.778rem 1.222rem;
  border: 0.056rem solid #888;
  transform: translate(-50%, -50%);
  color: #ddd;
  background: #000;
  font: 400 1rem "ZX Spectrum", monospace;
  letter-spacing: 0.056rem;
  cursor: pointer;
}

#startButton:not(:disabled):hover,
#startButton:focus-visible {
  border-color: #fff;
  color: #fff;
  background: #181818;
}

#startButton:disabled {
  opacity: 0.6;
  cursor: wait;
}

#startButton[hidden] {
  display: none;
}

.corner-controls {
  --edge: 1rem;

  position: absolute;
  z-index: 3;
  right: var(--edge);
  bottom: var(--edge);
  display: flex;
  anchor-name: --corner-controls;
}

#noui:target .corner-controls {
  display: none;
}

.info-panel {
  position: fixed;
  position-anchor: --corner-controls;
  inset: auto anchor(right) calc(anchor(top) + 0.444rem) auto;
  width: max-content;
  max-width: calc(100vw - var(--edge) - var(--edge));
  margin: 0;
  padding: 1.556rem 2.889rem 1.556rem 1.667rem;
  border: 0.056rem solid #555;
  color: #888;
  background: rgb(0 0 0 / 92%);
  font: 400 1rem/1.45 "ZX Spectrum", monospace;
  letter-spacing: 0.028rem;
}

.info-close {
  position: absolute;
  top: 0.444rem;
  right: 0.556rem;
  padding: 0;
  border: 0;
  color: #888;
  background: none;
  font: 1.111rem/1 sans-serif;
  cursor: pointer;
}

.info-close:hover,
.info-close:focus-visible {
  color: #fff;
}

.info-panel p {
  margin: 0;
}

.info-panel p + p {
  margin-top: 1.333rem;
}

.info-panel h2,
.info-panel cite,
.info-panel .creator {
  color: #eee;
  font-style: normal;
}

.info-panel h2 {
  margin: 0;
  font: inherit;
  font-size: 1.3em;
}

.info-panel a {
  padding: 0.278rem;
}

.info-panel a:hover,
.info-panel a:focus-visible {
  color: #000;
  background: #ff0;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2.333rem;
  height: 2.833rem;
  padding: 0.444rem 0.167rem;
  border: 0;
  color: #aaa;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: #fff;
}

.icon-button:focus-visible {
  outline: 0.056rem solid currentColor;
}

.icon-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

#soundToggle[aria-pressed="false"] .sound-waves,
#soundToggle[aria-pressed="true"] .sound-muted {
  display: none;
}

@keyframes star-field-fade-in {
  from {
    opacity: 0;
  }
}

#TheText {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 3.3083%;
  width: 93.3833%;
  max-height: 90%;
  margin: 0;
  overflow: hidden;
  /* Compensate for the cursor and scripted blank lines below the copy. */
  transform: translateY(-40%);
  color: #e8e8e8;
  font-family: "ZX Spectrum", monospace;
  font-size: min(1.7vw, 2.5vh);
  letter-spacing: 1px;
  line-height: 1.08;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  transition: opacity 2s ease-in-out;
}

#TheText.fade-out {
  opacity: 0;
}
