/* Segunda pantalla: arriba un CRT de un par de líneas con el texto, y abajo un
   teclado plano que refleja las teclas del último golpe. */

.monitor {
  height: 100%;
  padding: 2.5vmin;
  display: flex;
  flex-direction: column;
  gap: 2vmin;
  background: #07100a;
}

/* CRT de dos líneas: alto fijo, y el texto largo se desplaza dentro. */
.monitor__crt {
  position: relative;
  flex: none;
  height: 22vmin;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3vmin 5vmin;

  background: radial-gradient(ellipse at 50% 42%, #16281a 0%, var(--glass) 80%);
  border-radius: 1.4vmin;
  box-shadow:
    inset 0 0 8vmin rgba(0, 0, 0, 0.9),
    inset 0 0 2vmin rgba(92, 232, 92, 0.12);
}

.monitor__crt::-webkit-scrollbar {
  display: none;
}

/* Líneas de barrido y viñeteado, como en el monitor de la máquina. */
.monitor__crt::before,
.monitor__crt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1.4vmin;
  pointer-events: none;
}

.monitor__crt::before {
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0 1px, transparent 1px 3px);
}

.monitor__crt::after {
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.6) 100%);
}

.monitor__text {
  margin: 0;
  font-family: var(--mono);
  font-size: 5.5vmin;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
  color: var(--phosphor);
  text-shadow:
    0 0 0.05em rgba(255, 255, 255, 0.7),
    0 0 0.35em var(--phosphor),
    0 0 1em rgba(92, 232, 92, 0.5);
}

/* Teclado espejo: llena la parte de abajo, plano y sin responder al tacto. */
.monitor__keyboard {
  flex: 1;
  align-self: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: none;
}

.monitor__keyboard .key {
  box-shadow: none;
}

/* Tecla del último golpe: se llena del color de su banco y así se queda hasta
   el siguiente golpe. */
.key--lit {
  background: var(--bank);
  color: var(--bank-ink);
  border-bottom-color: transparent;
}

/* Cursor de bloque pegado al final del texto. */
.monitor__text::after {
  content: "";
  display: inline-block;
  vertical-align: text-bottom;
  width: 0.55em;
  height: 1em;
  margin-left: 0.15em;
  background: var(--phosphor);
  box-shadow: 0 0 0.5em var(--phosphor);
  animation: blink 1.1s steps(1) infinite;
}

.monitor__waiting {
  margin: 0;
  font-family: var(--mono);
  font-size: 3vmin;
  letter-spacing: 0.12em;
  color: color-mix(in srgb, var(--phosphor) 45%, transparent);
}

/* Cuando ya hay texto, el aviso sobra. */
.monitor:has(.monitor__text:not(:empty)) .monitor__waiting {
  display: none;
}

.monitor__foot {
  display: flex;
  justify-content: space-between;
  gap: 2vmin;
  padding: 0 1vmin;
  font-family: var(--mono);
  font-size: 1.9vmin;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--phosphor) 42%, transparent);
}

.monitor__link::before {
  content: "● ";
}

/* Sin conexión hay que verlo desde lejos: si no, parece que no escribes bien. */
.monitor__link--down {
  color: var(--coral);
}

@media (prefers-reduced-motion: reduce) {
  .monitor__text::after {
    animation: none;
  }
}
