* {
  box-sizing: border-box;
}

html,
body {
  min-width: 100%;
  min-height: 100%;
  margin: 0;
  background: #fff;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 16px;
  font-family: "Courier New", Courier, monospace;
}

#video-frame {
  position: relative;
  width: min(30.625cm, calc(100vmin - 32px));
  max-width: 100%;
  aspect-ratio: 1;
  flex: none;
  overflow: hidden;
  background: #000;
}

#video-stream {
  position: absolute;
  inset: 5.88%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
  font: 15px/1.65 "Courier New", Courier, monospace;
  white-space: pre-wrap;
  scrollbar-width: none;
}

#video-stream::-webkit-scrollbar {
  display: none;
}

.video-line {
  min-height: 1.65em;
  max-width: min(100%, 112ch);
  margin: 0 auto;
  color: #fff;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.video-line--typing::after {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 1em;
  margin-left: 1px;
  transform: translateY(0.14em);
  background: #fff;
  animation: cursor-blink 0.8s steps(1) infinite;
}

@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}


@media (max-width: 600px), (max-height: 600px) {
  body {
    padding: 12px;
  }

  #video-frame {
    width: min(30.625cm, calc(100vmin - 24px));
  }

  #video-stream {
    font-size: 11px;
  }
}
