* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #000000;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  color: #00f0ff;
  font-family: Consolas, monospace;
  font-size: clamp(13px, 3.5vw, 15px);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  overflow: hidden;
  perspective: 1000px;
}

.monitor-outer {
  background: #f5f5f0;
  padding: 10px;
  border-radius: 50px;
  position: relative;
  width: 95vw;
  max-width: 900px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 10px 0 #d0d0c8,
    0 20px 0 #a0a098,
    0 30px 40px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(200, 200, 200, 0.3);
  transform: rotateX(2deg);
  animation: monitor-glow-normal 3s infinite ease-in-out;
}

.monitor-outer.typing {
  animation: none;
}

@keyframes monitor-glow-normal {
  0%, 100% {
    box-shadow:
      0 10px 0 #d0d0c8,
      0 20px 0 #a0a098,
      0 30px 40px rgba(0, 0, 0, 0.6),
      0 0 30px rgba(0, 240, 255, 0.15),
      0 0 60px rgba(0, 240, 255, 0.08);
  }
  50% {
    box-shadow:
      0 10px 0 #d0d0c8,
      0 20px 0 #a0a098,
      0 30px 40px rgba(0, 0, 0, 0.6),
      0 0 60px rgba(0, 240, 255, 0.25),
      0 0 120px rgba(0, 240, 255, 0.12);
  }
}

.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

@keyframes particle-float {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

.monitor-bezel {
  background: #e8e8e0;
  flex: 1;
  padding: 35px 35px 60px 35px;
  border-radius: 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 0 8px 10px rgba(255, 255, 255, 0.8),
    inset 0 -8px 10px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(180, 180, 180, 0.2);
  min-height: 0;
}

.monitor-inner {
  background: #000;
  flex: 1;
  border-radius: 25px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 1),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  border: 3px solid #333;
  min-height: 0;
}

.screen-glass {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.03) 0%,
      rgba(255, 255, 255, 0.01) 20%,
      transparent 50%);
  z-index: 15;
  pointer-events: none;
  border-radius: 20px;
}

.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0) 50%,
      rgba(255, 255, 255, 0.02) 50%);
  background-size: 100% 3px;
  z-index: 10;
  pointer-events: none;
  opacity: 0.8;
}

.scanlines::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle,
      transparent 20%,
      rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
}

.monitor-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.01);
  z-index: 5;
  pointer-events: none;
  animation: flicker 0.1s infinite;
}

@keyframes flicker {
  0% {
    opacity: 0.1;
  }

  10% {
    opacity: 0.15;
  }

  20% {
    opacity: 0.1;
  }

  30% {
    opacity: 0.12;
  }

  40% {
    opacity: 0.1;
  }

  50% {
    opacity: 0.18;
  }

  60% {
    opacity: 0.1;
  }

  70% {
    opacity: 0.14;
  }

  80% {
    opacity: 0.1;
  }

  90% {
    opacity: 0.12;
  }

  100% {
    opacity: 0.1;
  }
}

.monitor-controls {
  position: absolute;
  bottom: 10px;
  left: 50px;
  right: 50px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.grille {
  flex: 1;
  height: 20px;
  background: repeating-linear-gradient(90deg,
      #c0c0b8,
      #c0c0b8 4px,
      #e8e8e0 4px,
      #e8e8e0 6px);
  border-radius: 5px;
  box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.1);
}

.brand {
  color: #666;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: none;
}

.dial {
  width: 15px;
  height: 15px;
  background: #d0d0c8;
  border-radius: 50%;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  position: relative;
}

.dial::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  width: 2px;
  height: 4px;
  background: #666;
  transform: translateX(-50%);
  box-shadow: none;
}

.power-btn {
  width: 12px;
  height: 12px;
  background: #ff6a00;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(255, 106, 0, 0.8), inset 0 0 5px rgba(255, 255, 255, 0.3);
  animation: power-glow 2s infinite ease-in-out;
}

@keyframes power-glow {

  0%,
  100% {
    opacity: 0.8;
    box-shadow: 0 0 10px #ff6a00, 0 0 20px rgba(255, 106, 0, 0.5);
  }

  50% {
    opacity: 1;
    box-shadow: 0 0 20px #ff6a00, 0 0 40px rgba(255, 106, 0, 0.8);
  }
}

.terminal {
  height: 100%;
  padding: 35px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
  overflow: hidden;
}

.output {
  flex: 1;
  white-space: pre-wrap;
  overflow-y: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  min-height: 0;
}

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

.input-line {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.prompt {
  margin-right: 6px;
  white-space: nowrap;
  color: #ff6a00;
  text-shadow: 0 0 8px rgba(255, 106, 0, 0.8);
}

input {
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  margin: 0;
  color: #00f0ff;
  font-family: inherit;
  font-size: inherit;
  width: 0ch;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
}

.cursor {
  margin-left: 1px;
  animation: blink 1s infinite;
  background: #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 8px #00f0ff;
}

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

/* Mobile tweaks */
@media (max-width: 600px) {
  .monitor-outer {
    padding: 5px;
    border-radius: 30px;
    height: 90vh;
  }

  .monitor-bezel {
    padding: 15px 15px 40px 15px;
    border-radius: 25px;
  }

  .monitor-inner {
    border-radius: 15px;
  }

  .terminal {
    padding: 15px;
  }

  .monitor-controls {
    left: 20px;
    right: 20px;
    gap: 10px;
  }

  .grille {
    display: none;
  }
}
