html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    background: #001100;
    font-family: monospace;
    color: #33ff55;
    overflow: hidden;
  }

.terminal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,255,60,0.08) 0px,
      rgba(0,255,60,0.08) 2px,
      rgba(0,0,0,0) 2px,
      rgba(0,0,0,0) 4px
    ),
    radial-gradient(circle at center,
      rgba(0,255,60,0.12),
      rgba(0,0,0,0.75)
    ),
    #001100;
  background-blend-mode: overlay, screen, normal;
  overflow: hidden;
  box-shadow:
    inset 0 0 25px rgba(0,255,60,0.2),
    inset 0 0 60px rgba(0,255,60,0.1);
}


  .sweep-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 5%;
    background: linear-gradient(
      to bottom,
      rgba(0,255,60,0) 0%,
      rgba(0,255,60,0.4) 50%,
      rgba(0,255,60,0) 100%
    );
    opacity: 0.7;
    animation: sweep 3.5s linear infinite;
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 2;
  }

  @keyframes sweep {
    0% { top: -5%; }
    100% { top: 105%; }
  }

  #screen {
    padding: 24px;
    font-size: 18px;
    white-space: pre;
    text-shadow: 0 0 6px rgba(0,255,60,0.6);
  }

  #screen-wrapped {
    overflow: hidden;
    text-overflow: clip;
    word-wrap: break-word;
    padding: 0px 24px 0px 24px;
    margin: 5px 24px 10px 24px;
    font-size: 18px;
    white-space: normal;
    text-shadow: 0 0 6px rgba(0,255,60,0.6);
  }
  
  .menu {
    margin-top: 10%;
  }

  .menu-item {
    padding: 10px 20px;
    cursor: pointer;
    color: #33ff55;
    text-shadow: 0 0 6px rgba(0,255,60,0.5);
    font-size: 18px;
  }

  .menu-item:hover,
  .menu-item.selected {
    background: rgba(0,255,60,0.15);
    color: #66ff88;
    text-shadow: 0 0 10px rgba(0,255,60,0.9);
  }

  .character-img {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 180px;
    z-index: 1;
    display: none; /* hide initially until typing is done */
  }
/* ===== Responsive Scaling for Phones & Small Tablets ===== */

/* Medium screens — adjust font + reduce padding */
@media (max-width: 1024px) {
  .terminal {
    overflow-y: scroll;
  }
  #screen {
    padding: 16px;
    font-size: 16px;
  }

  .menu-item {
    font-size: 16px;
    padding: 8px 16px;
  }

  .character-img {
    width: 300px;
    justify-content: center; /* Center items horizontally */
    position: relative;
  }
  .image-container {
    display: flex; /* Make the parent a flex container */
    justify-content: center; /* Center items horizontally */
    align-items: center; /* Center items vertically */
  }
  .sweep-line {
    animation: sweep 4.5s linear infinite;
  }
}

/* Small phones — move character to bottom, center it */
@media (max-width: 800px) {
  .terminal {
    overflow-y: scroll;
  }
  #screen {
    padding: 12px;
    font-size: 15px;
  }

  .menu {
    margin-top: 8%;
  }

  .menu-item {
    font-size: 15px;
    padding: 6px 14px;
  }

  .character-img {
    width: 150px;
    bottom: 6px;
    top: 6px;
    justify-content: center; /* Center items horizontally */
    position: relative;
  }
  .image-container {
    display: flex; /* Make the parent a flex container */
    justify-content: center; /* Center items horizontally */
    align-items: center; /* Center items vertically */
  }
  .sweep-line {
    animation: sweep 4.5s linear infinite;
  }
}

/* Extra-small devices (very small phones) */
@media (max-width: 420px) {
  .terminal {
    overflow-y: scroll;
  }
  #screen {
    font-size: 13px;
    padding: 10px;
  }

  .menu-item {
    font-size: 14px;
    padding: 6px 10px;
  }

  .character-img {
    width: 130px;
    bottom: 6px;
    top: 6px;
    justify-content: center; /* Center items horizontally */
    position: relative;
  }
  .image-container {
    display: flex; /* Make the parent a flex container */
    justify-content: center; /* Center items horizontally */
    align-items: center; /* Center items vertically */
  }
  .sweep-line {
    animation: sweep 4.5s linear infinite;
  }
}