body {
  background-color: #000;
  color: #33ff33;
  font-family: 'Courier New', monospace;
  margin: 0;
  background: #000;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: start;
  flex-direction: column;
  text-shadow: 0 0 2px #0f0, 0 0 5px #0f0;
  position: relative;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
body::-webkit-scrollbar {
  display: none;
}
* {
  /* border: 1px solid #fff; */
  /* update */
}
.commandOut {
  padding-bottom: 20px;
}

a {
  color: #33ff33;
  font-family: 'Courier New', monospace;
}
code {
  font-size: 1.05rem;
  font-weight: 800;
}

#icon-bar ul {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
  min-width: max-content;
  white-space: nowrap;
}

#icon-bar li a {
  display: inline-block;
  transition: transform 0.2s ease, filter 0.2s ease;
}

#icon-bar li a:hover,
#icon-bar li a:focus {
  transform: scale(1.1);
  filter: brightness(1.5);
}
.exit {
  animation: glitchText 0.3s 6;

}
.graphic {
  display: none;
}

.ascii-line {
  margin-bottom: -10px !important;
}

/* Optional: hide scrollbar but still scrollable */
#icon-bar::-webkit-scrollbar {
  display: none;
}
#icon-bar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#nav-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: transparent;
  font-family: 'Courier New', monospace;
  color: #0f0;
  border: 1px solid #0f0;
  padding: 0.5rem 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10010;
  text-shadow: 0 0 2px #0f0;
  transition: all 0.3s ease;
}
#nav-toggle.open {
  background: #0f0;
  color: #000;
}
/* Icon bar, hidden above viewport by default */
#icon-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  background: #000;
  border-bottom: 1px solid #0f0;
  z-index: 10000;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 0.5rem;
  border-top: 1px solid #0f0;
}

/* When open, slide down into view */
#icon-bar.open {
  transform: translateY(0);
}

/* Keep the list layout you already have */
#icon-bar ul {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1rem;
  margin: 0;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
}

/* Icon styling unchanged */
#icon-bar img {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 2px #0f0);
}

/* Rotate the arrow when open */
/* #nav-toggle.open {
  transform: translateX(-50%) rotate(180deg);
} */


/* #terminal {
  max-width: 800px;
  margin: 0 auto;
} */
#terminal {
  display: flex;
  flex-direction: column;
  height: 85vh;
  width: 99%;
  padding: 1rem;
  box-sizing: border-box;
  overflow: hidden; /* Prevent the terminal area from pushing the page */
}

#output p {
  margin: 0.5rem 0;
  white-space: pre-wrap;
}

input[type="text"] {
  width: 100%;
  background-color: #000;
  border: none;
  border-bottom: 2px solid #33ff33;
  color: #33ff33;
  font-size: 1rem;
  font-family: inherit;
  padding: 0.5rem 0;
  outline: none;
}

.visually-hidden {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#glitch-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: none;
  font-family: 'Courier New', monospace;
}

.glitch-text {
  font-size: 2rem;
  color: red;
  animation: glitch 1s infinite;
  text-shadow: 1px 0 red, -1px 0 blue;
}
#flash-image {
  position: fixed;
  inset: 0;
  background: black;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

#flash-image img {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: cover;
  opacity: 66%;
  /* filter: grayscale(29%) brightness(144%) saturate(357%);
  -webkit-filter: grayscale(29%) brightness(144%) saturate(357%);
  -moz-filter: grayscale(29%) brightness(144%) saturate(357%); */
}

.glitching {
  animation: glitchText 0.2s infinite;
}
.cardText {
  text-align: center;
  font-size: 18px;
  animation: flicker 0.15s infinite alternate;
}
.cardText h3 {
  font-size: 1.5rem;
  text-transform: uppercase;
}

/* CRT base */


/* Simulated screen curvature (optional) */
body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0,255,0,0.05), transparent 70%);
  pointer-events: none;
  z-index: 5;
}

/* Scanlines */
body::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 255, 0, 0.03),
    rgba(0, 255, 0, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 6;
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 90px rgba(0,255,0,0.2);
  backdrop-filter: blur(0.25px);
  border-radius: 3px;
}


#output {
  flex: 1;
  z-index: 10;
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  white-space: pre-wrap;
  animation: flicker 0.15s infinite;
  padding-right: 0.5rem;
}


#cursor {
  display: inline-block;
  width: 1ch;
  color: #00ff00;
  animation: blink 1s step-start infinite;
}

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

/* Blinking cursor effect (optional) */
#command::placeholder {
  color: #00ff00;
  opacity: 0.8;
}

/* Input line */
#command-form {
  margin-top: 1rem;
  z-index: 10;
  width: 100%;
}

#command {
  background: transparent;
  border: none;
  color: #0f0;
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
  caret-color: #0f0;
  outline: none;
  animation: flicker 0.2s infinite;
}
#output img {
  filter: contrast(1.1) brightness(1.2);
  image-rendering: pixelated;
  animation: flicker 0.15s infinite alternate;
  border: 1px solid #0f0;
  box-shadow: 0 0 10px #0f0;
  margin-top: 1rem;
  max-width: 300px;
  display: flex;
  margin-left: auto;
  margin-right: auto;
}


@media (max-width: 600px) {
  body {
    padding: 0;
    min-height: var(--vh, 100dvh);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
  }
  #terminal {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: var(--vh, 100dvh);
    padding: 0.5rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }
  #output {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }
  #command-form {
    flex-shrink: 0;
    padding: 0.5rem 0;
    background: #000;
    border-top: 1px solid #0f0;
  }
  #command {
    font-size: 16px;
    padding: 0.75rem 0;
    width: 100%;
    box-sizing: border-box;
  }
  #icon-bar img {
    width: 30px;
    height: 30px;
  }
  .graphic {
    display: none;
  }
  #ascii-line, .ascii-line {
    font-size: 0.6rem;
    line-height: 1.2;
    letter-spacing: 0;
  }
  #output img {
    max-width: 90%;
    margin-left: 5% !important;
    margin-right: 5% !important;
  }
  .cardText {
    max-width: 90%;
    font-size: 12px;
    padding: 1rem !important;
    border-left: 3px #0f0 solid;
    border-bottom: 3px #0f0 solid;
    border-right: 3px #0f0 solid;
    text-align: center;
    margin-left: 5% !important;
    margin-right: 5% !important;
    margin-top: 0 !important;
  }
  pre {
    font-size: 0.75rem;
    line-height: 1.1;
  }
  #output p {
    margin: 0.25rem 0;
  }
  #nav-toggle {
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10020;
  }
}


/* Flicker */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  48%, 52% { opacity: 0.98; }
  50% { opacity: 0.95; }
}

@keyframes glitchText {
  0% { transform: translate(0, 0); color: #33ff33; }
  20% { transform: translate(1px, -1px); color: red; }
  40% { transform: translate(-1px, 1px); color: blue; }
  60% { transform: translate(1px, 1px); color: #fff; }
  80% { transform: translate(-1px, -1px); color: #33ff33; }
  100% { transform: translate(0, 0); }
}

@keyframes glitch {
  0% { transform: translate(0, 0); }
  10% { transform: translate(-2px, 2px); }
  20% { transform: translate(2px, -2px); }
  30% { transform: translate(-2px, -2px); }
  40% { transform: translate(2px, 2px); }
  50% { transform: translate(0, 0); }
  60% { transform: translate(-2px, 2px); }
  70% { transform: translate(2px, -2px); }
  80% { transform: translate(-2px, -2px); }
  90% { transform: translate(2px, 2px); }
  100% { transform: translate(0, 0); }
}