:root {
  color-scheme: dark;
  background: #000;
  color: #fff;
  font-family: "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
}

body {
  position: relative;
}

.screen {
  position: fixed;
  inset: 0;
  background: #000;
}

.signal {
  position: absolute;
  top: 50%;
  left: 47%;
  display: inline-flex;
  width: max-content;
  max-width: min(76vw, 760px);
  max-height: 70vh;
  transform: translate(-50%, -50%);
  align-items: flex-start;
  overflow: hidden;
  color: #fff;
  font-size: clamp(15px, 1.9vw, 22px);
  line-height: 1.55;
  white-space: pre-wrap;
}

.signal.fade-out {
  opacity: 0;
  transition: opacity 220ms linear;
}

#signalText {
  display: inline;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font: inherit;
}

.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.2em;
  margin-top: 0.16em;
  margin-left: 0.08em;
  flex: 0 0 auto;
  background: #fff;
  animation: blink 1s steps(1, end) infinite;
}

.contact-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: none;
}

.contact-form {
  display: none;
  width: min(400px, calc(100vw - 40px));
  pointer-events: auto;
}

.contact-form.visible {
  display: block;
}

.contact-input {
  width: 100%;
  border: 1px solid #fff;
  background: #000;
  color: #fff;
  outline: none;
  padding: 10px 12px;
  font: inherit;
  font-size: inherit;
  line-height: 1.55;
}

.time-mark {
  position: fixed;
  right: clamp(14px, 3vw, 34px);
  bottom: clamp(12px, 2.6vw, 28px);
  color: #fff;
  font-size: clamp(12px, 1.4vw, 15px);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.countdown {
  position: fixed;
  left: clamp(14px, 3vw, 34px);
  bottom: clamp(12px, 2.6vw, 28px);
  display: none;
  color: #fff;
  font-size: clamp(12px, 1.4vw, 15px);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .signal {
    left: 50%;
    max-width: calc(100vw - 42px);
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation-duration: 1.8s;
  }
}
