* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  background: radial-gradient(circle at top, #050810 0, #000000 60%, #000000 100%);
  color: #b6ffe5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scanlines,
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
  z-index: 1;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.06) 0,
    rgba(255, 255, 255, 0.06) 1px,
    transparent 2px,
    transparent 3px
  );
}

.noise {
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='noStitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

.terminal-frame {
  position: relative;
  width: min(1100px, 96vw);
  height: min(650px, 90vh);
  background: radial-gradient(circle at top, #050b11 0, #02040a 50%, #000000 100%);
  border-radius: 14px;
  border: 1px solid rgba(40, 255, 190, 0.35);
  box-shadow: 0 0 140px rgba(0, 0, 0, 1), 0 0 60px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #b6ffe5;
}

.terminal-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from 140deg,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 255, 149, 0.24) 45deg,
    rgba(0, 0, 0, 0) 120deg,
    rgba(145, 9, 255, 0.3) 190deg,
    rgba(0, 0, 0, 0) 260deg
  );
  mix-blend-mode: soft-light;
  opacity: 0.4;
  pointer-events: none;
  animation: signalOrbit 18s linear infinite;
}

.terminal-top {
  position: relative;
  z-index: 2;
  height: 40px;
  display: flex;
  align-items: center;
  padding-inline: 14px;
  background: linear-gradient(90deg, #020409, #040910 40%, #020409 100%);
  border-bottom: 1px solid rgba(0, 255, 170, 0.25);
}

.lights {
  display: flex;
  gap: 6px;
}

.lights span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff5555;
  box-shadow: 0 0 8px rgba(255, 85, 85, 0.7);
}

.lights span:nth-child(2) {
  background: #ffcd1a;
  box-shadow: 0 0 8px rgba(255, 205, 26, 0.7);
}

.lights span:nth-child(3) {
  background: #1aff7a;
  box-shadow: 0 0 10px rgba(26, 255, 122, 0.9);
}

.title {
  margin-left: 12px;
  font-size: 0.8rem;
  color: #7cffcf;
}

.status {
  margin-left: auto;
  font-size: 0.72rem;
  color: #ff3b81;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.terminal-bottom {
  position: relative;
  z-index: 2;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 14px;
  font-size: 0.7rem;
  color: rgba(182, 255, 229, 0.6);
  background: linear-gradient(90deg, #020408, #050911);
  border-top: 1px solid rgba(0, 255, 170, 0.2);
}

.terminal {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 12px 16px 10px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: #b6ffe5;
  overflow: hidden;
}

.terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
      to bottom,
      rgba(0, 255, 133, 0.16) 0,
      rgba(0, 255, 133, 0.16) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(circle at 0 0, rgba(0, 255, 153, 0.18), transparent 60%);
  mix-blend-mode: soft-light;
  opacity: 0.65;
  pointer-events: none;
}

.boot-block {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
  padding-right: 4px;
}

.boot-line {
  white-space: pre-wrap;
}

.boot-line.error {
  color: #ff5c99;
}

.boot-line.warn {
  color: #ffdd66;
}

.boot-line.muted {
  color: rgba(182, 255, 229, 0.6);
}

.cursor-line {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 3;
}

.prompt {
  color: #49f9c8;
}

.input {
  white-space: pre-wrap;
  word-break: break-all;
}

.cursor {
  width: 8px;
  height: 1.1em;
  background: #49f9c8;
  box-shadow: 0 0 12px rgba(73, 249, 200, 0.8);
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
}

.glitch::before {
  transform: translate(1px, -1px);
  color: #ff3b81;
}

.glitch::after {
  transform: translate(-1px, 1px);
  color: #49f9c8;
}

body.flash {
  animation: flash 0.18s linear 1;
}

@keyframes flash {
  0% {
    filter: brightness(1.4) contrast(1.3);
  }
  100% {
    filter: brightness(1) contrast(1);
  }
}

body::before {
  content: "";
  position: fixed;
  inset: -40px;
  background:
    radial-gradient(circle at 20% 0, rgba(0, 255, 153, 0.16), transparent 60%),
    radial-gradient(circle at 80% 100%, rgba(145, 9, 255, 0.22), transparent 60%),
    repeating-linear-gradient(
      90deg,
      rgba(0, 255, 170, 0.06) 0,
      rgba(0, 255, 170, 0.06) 1px,
      transparent 1px,
      transparent 4px
    );
  opacity: 0.65;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: signalSweep 20s linear infinite;
  z-index: 0;
}

.terminal-frame::after {
  content: "";
  position: absolute;
  inset: 10% 6%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 15% 10%, rgba(0, 255, 170, 0.25), transparent 55%),
    radial-gradient(circle at 90% 85%, rgba(145, 9, 255, 0.32), transparent 55%);
  filter: blur(8px);
  opacity: 0.4;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: signalPulse 4.8s ease-in-out infinite alternate;
}

@keyframes signalSweep {
  0% {
    transform: translateX(-30px);
  }
  50% {
    transform: translateX(30px);
  }
  100% {
    transform: translateX(-30px);
  }
}

@keyframes signalPulse {
  0% {
    opacity: 0.18;
    transform: scale(0.98);
  }
  100% {
    opacity: 0.6;
    transform: scale(1.04);
  }
}

@keyframes signalOrbit {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .terminal-frame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .terminal-top,
  .terminal-bottom {
    padding-inline: 10px;
  }
}
