@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: #0b0c10;
  overflow: hidden; /* Prevent actual page scrolling */
  font-family: 'Press Start 2P', monospace;
  color: #45ff00; 
  font-size: 1rem; 
  line-height: 1.5;
  cursor: text; 
}

.terminal-content {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1; 
  display: flex;
  flex-direction: column;
  justify-content: flex-start; 
  
  /* Remove padding from here to fix the Firefox calculation bug */
  padding: 0; 
  
  text-shadow: 
    0.5px 0 0 rgba(255, 0, 0, 0.4), 
    -0.5px 0 0 rgba(0, 0, 255, 0.4), 
    0 0 5px rgba(69, 255, 0, 0.6);

  border: 15px solid #000;
  border-radius: 15px;
}

.terminal-iframe {
  display: block;
  width: min(100%, calc(max(200px, 100vh - 12rem) * 16 / 9));
  aspect-ratio: 16 / 9;
  border: 2px solid #45ff00;
  margin: 1rem 0;
  background-color: #000;
  filter: drop-shadow(0 0 5px rgba(69, 255, 0, 0.2));
  position: relative;
  z-index: 0;
}

.terminal-img {
  display: block;
  max-width: 90%; 
  max-height: 50vh; 
  height: auto;
  margin: 1rem 0;
  
  /* REMOVED: sepia and hue-rotate */
  /* ADDED: Subtle bloom and sharpening */
  filter: brightness(1.1) contrast(1.1) drop-shadow(0 0 5px rgba(69, 255, 0, 0.2));
  
  /* Keeps pixels sharp for AI/Pixel art */
  image-rendering: auto; 
  
  /* This ensures the global scanlines still 'cut' through the image */
  position: relative;
  z-index: 0; 
}

.line {
  white-space: pre-wrap;
  line-height: 1.3;
  word-wrap: break-word; 
  /* Add padding/margin to the lines instead so they don't touch the edges */
  padding-left: 2rem;
  padding-right: 2rem;
  margin-bottom: 0.2rem;
}

/* Ensure the terminal output has some top clearance */
#output {
  padding-top: 2rem;
}

/* Give the input line some side clearance too */
#input-line {
  padding-left: 2rem;
  padding-right: 2rem;
  padding-bottom: 3rem; /* This creates your bottom "buffer" */
}

.cursor {
  display: inline-block;
  width: 14px; 
  height: 1.1rem; 
  background-color: #45ff00;
  animation: blink 1s step-end infinite;
  box-shadow: 0 0 5px rgba(69, 255, 0, 0.6);
  position: relative;
  top: -2px;
}

.cursor.typing {
  animation: none;
  opacity: 1;
}

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

.error {
  color: #ff3333;
  text-shadow: 0.5px 0 0 rgba(0, 255, 0, 0.3), -0.5px 0 0 rgba(0, 0, 255, 0.3), 0 0 5px rgba(255, 51, 51, 0.6);
}

.warning {
  color: #ffb000;
  text-shadow: 0.5px 0 0 rgba(255, 0, 0, 0.3), -0.5px 0 0 rgba(0, 255, 0, 0.3), 0 0 5px rgba(255, 176, 0, 0.6);
}

.scanlines {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 9998; 
  pointer-events: none; 
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
    linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 6px 100%;
}

.vignette {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 9999; 
  pointer-events: none;
  background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.6) 100%);
  box-shadow: inset 0 0 100px rgba(0,0,0,0.9);
  animation: flicker 0.15s infinite;
}

#hidden-input {
  position: absolute;
  opacity: 0;
  transform: scale(0);
}

@media (max-width: 768px) {
  body, html { font-size: 0.8rem; }
  .terminal-content { padding: 1rem; }
  .cursor { height: 1rem; width: 10px; top: -1px; }
}