/* Z80Nostalgia Web - visual "CRT verde fosforo" estilo TRS-80 / CP-300 */

@font-face {
  font-family: "VT323";
  src: local("VT323");
}

:root {
  --phosphor: #4dff6b;
  --phosphor-dim: #1f8f3a;
  --phosphor-bright: #a6ffb4;
  --crt-black: #010402;
}

body {
  background: var(--crt-black);
  color: var(--phosphor);
  font-family: "Courier New", "Consolas", ui-monospace, monospace;
}

.phosphor {
  color: var(--phosphor);
  text-shadow: 0 0 2px var(--phosphor), 0 0 8px rgba(77, 255, 107, 0.55);
}

.phosphor-bright {
  color: var(--phosphor-bright);
  text-shadow: 0 0 3px var(--phosphor-bright), 0 0 10px rgba(166, 255, 180, 0.7);
}

.phosphor-dim {
  color: var(--phosphor-dim);
}

.crt-screen {
  position: relative;
  background: radial-gradient(ellipse at center, #051a08 0%, #010402 78%);
  border-radius: 14px;
  box-shadow:
    inset 0 0 60px 12px rgba(0, 0, 0, 0.85),
    inset 0 0 120px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(77, 255, 107, 0.12);
  overflow: hidden;
}

.crt-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0.22) 2px,
    rgba(0, 0, 0, 0.22) 3px
  );
  mix-blend-mode: multiply;
  z-index: 2;
}

.crt-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.35) 100%);
  z-index: 3;
}

.crt-output {
  position: relative;
  z-index: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

.blink-cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.05em;
  background: var(--phosphor);
  box-shadow: 0 0 6px var(--phosphor);
  vertical-align: text-bottom;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.led {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
}

.led-on {
  background: var(--phosphor);
  box-shadow: 0 0 6px var(--phosphor), 0 0 12px var(--phosphor);
  animation: pulse 2s ease-in-out infinite;
}

.led-off {
  background: #7a1f1f;
  box-shadow: 0 0 6px #ff3b3b;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.btn-retro {
  background: transparent;
  border: 1px solid var(--phosphor-dim);
  color: var(--phosphor);
  text-shadow: 0 0 4px rgba(77, 255, 107, 0.6);
  transition: all 0.15s ease;
}

.btn-retro:hover {
  background: rgba(77, 255, 107, 0.1);
  border-color: var(--phosphor);
  box-shadow: 0 0 10px rgba(77, 255, 107, 0.35);
}

.cmd-input {
  background: transparent;
  color: var(--phosphor-bright);
  text-shadow: 0 0 4px rgba(166, 255, 180, 0.7);
  caret-color: var(--phosphor);
}

.cmd-input:focus {
  outline: none;
}

::selection {
  background: rgba(77, 255, 107, 0.35);
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #010402;
}
::-webkit-scrollbar-thumb {
  background: var(--phosphor-dim);
  border-radius: 6px;
}
