body {
  background: linear-gradient(135deg, #0a0a0a, #1a1a2e);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  font-family: "Courier New", monospace;
  overflow: hidden;
}

.terminal {
  width: 95%; /* Slightly wider for mobile */
  max-width: 900px;
  height: 90vh; /* Flexible height */
  max-height: 600px;
  padding: 10px;
  background: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5),
              inset 0 0 15px rgba(0, 204, 255, 0.2);
  color: #b0e0e6;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(0, 204, 255, 0.3);
  margin-bottom: 8px;
}

.ascii-art {
  font-size: clamp(8px, 1.5vw, 10px); /* Smaller, tighter range */
  line-height: 1;
  white-space: pre;
  color: #00ccff;
  text-shadow: 0 0 5px rgba(0, 204, 255, 0.5);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  justify-content: center;
}

button {
  background: linear-gradient(45deg, #1a1a2e, #2a2a4e);
  color: #b0e0e6;
  border: 1px solid rgba(0, 204, 255, 0.5);
  padding: 5px 10px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: clamp(8px, 1.8vw, 12px); /* Smaller on mobile */
  text-transform: uppercase;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  flex: 1 0 auto;
  min-width: 60px;
}

button:hover {
  background: linear-gradient(45deg, #00ccff, #1a1a2e);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 204, 255, 0.8),
              inset 0 0 5px rgba(0, 204, 255, 0.5);
  transform: translateY(-2px);
}

button::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: rgba(0, 204, 255, 0.1);
  transform: rotate(30deg);
  transition: all 0.5s ease;
}

button:hover::after {
  top: 100%;
  left: 100%;
}

#terminal-output {
  white-space: pre-wrap;
  word-wrap: break-word; /* Ensures long lines wrap */
  flex-grow: 1;
  overflow-y: auto;
  font-size: clamp(10px, 2vw, 14px); /* Adjusted for mobile */
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.input-area {
  display: flex;
  align-items: center;
  margin-top: 8px;
  padding: 8px;
  background: rgba(10, 10, 20, 0.9);
  border-top: 1px solid rgba(0, 204, 255, 0.3);
}

.prompt {
  color: #ff66cc;
  text-shadow: 0 0 3px rgba(255, 102, 204, 0.5);
  font-size: clamp(10px, 2vw, 14px);
  white-space: nowrap; /* Keeps prompt on one line */
}

#command-input {
  background: none;
  border: none;
  color: #b0e0e6;
  font-family: "Courier New", monospace;
  outline: none;
  width: 100%;
  font-size: clamp(10px, 2vw, 14px);
}

/* Subtle scanline effect */
.terminal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    transparent 0%,
    rgba(0, 204, 255, 0.03) 50%,
    transparent 100%
  );
  animation: scanline 6s linear infinite;
  pointer-events: none;
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* Media Queries for Mobile */
@media (max-width: 600px) {
  .terminal {
    width: 98%;
    height: 95vh; /* Nearly full height on mobile */
    padding: 8px;
  }

  .header {
    padding-bottom: 4px;
    margin-bottom: 6px;
  }

  .buttons {
    gap: 6px;
    margin-bottom: 6px;
  }

  button {
    padding: 4px 8px;
    min-width: 50px; /* Even smaller for mobile */
  }

  #terminal-output {
    padding: 6px;
  }

  .input-area {
    padding: 6px;
  }
}