* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Source Code Pro', 'Courier Prime', monospace;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.terminal-window {
  width: 100%;
  max-width: 1200px;
  background: #000;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 255, 0, 0.3);
  overflow: hidden;
  border: 1px solid #0f0;
  position: relative;
}

/* Terminal Header */
.terminal-header {
  background: #2d2d2d;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #0f0;
}

.header-buttons {
  display: flex;
  gap: 8px;
}

.header-buttons span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
}

.btn-close {
  background: #ff5f57;
}

.btn-minimize {
  background: #ffbd2e;
}

.btn-maximize {
  background: #28c840;
}

.header-title {
  flex: 1;
  text-align: center;
  color: #0f0;
  font-size: 0.9rem;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.header-controls {
  display: flex;
  gap: 8px;
}

.control-btn {
  padding: 5px 12px;
  background: rgba(0, 255, 0, 0.1);
  border: 1px solid #0f0;
  color: #0f0;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.control-btn:hover {
  background: rgba(0, 255, 0, 0.2);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.control-btn:active {
  transform: scale(0.95);
}

/* Terminal Body */
.terminal-body {
  background: #000;
  color: #0f0;
  padding: 20px;
  min-height: 500px;
  max-height: 70vh;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.5;
}

.terminal-body::-webkit-scrollbar {
  width: 10px;
}

.terminal-body::-webkit-scrollbar-track {
  background: #0a0a0a;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: #0f0;
  border-radius: 5px;
}

#output {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.output-line {
  margin: 2px 0;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.command {
  color: #fff;
  font-weight: 600;
}

.success {
  color: #0f0;
}

.error {
  color: #f00;
}

.warning {
  color: #ff0;
}

.info {
  color: #0ff;
}

.progress {
  color: #0f0;
}

.input-line {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.prompt {
  color: #0f0;
  font-weight: 600;
}

.cursor {
  color: #0f0;
  animation: blink 1s steps(2) infinite;
}

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

/* Welcome Screen */
.welcome-screen {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(5px);
  padding: 20px;
  overflow-y: auto;
}

.welcome-screen.hidden {
  display: none;
}

.welcome-content {
  max-width: 95%;
  width: 100%;
  padding: 20px 30px;
  margin: auto;
  text-align: center;
  background: rgba(0, 20, 0, 0.9);
  border: 2px solid #0f0;
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(0, 255, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.welcome-content h1 {
  font-size: 2.2rem;
  color: #0f0;
  margin-bottom: 5px;
  text-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
  letter-spacing: 3px;
}

.tagline {
  font-size: 1rem;
  color: #0a0;
  margin-bottom: 15px;
  letter-spacing: 1px;
}

.instructions {
  text-align: left;
  margin: 10px 0;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.5);
  border-left: 3px solid #0f0;
  border-radius: 5px;
}

.instructions h3 {
  color: #0f0;
  margin-bottom: 8px;
  font-size: 1rem;
}

.instructions ul {
  list-style: none;
  padding: 0;
}

.instructions li {
  margin: 6px 0;
  padding-left: 20px;
  position: relative;
  color: #0a0;
  font-size: 0.9rem;
}

.instructions li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: #0f0;
  font-weight: bold;
}

.instructions strong {
  color: #0f0;
}

.tip {
  margin-top: 10px;
  padding: 10px;
  background: rgba(0, 255, 0, 0.05);
  border: 1px solid #0a0;
  border-radius: 5px;
  color: #0f0;
  font-size: 0.85rem;
}

.welcome-start-btn {
  display: block;
  margin: 20px auto 10px;
  padding: 18px 50px;
  background: #0f0;
  color: #000;
  border: 3px solid #0f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.8),
              0 0 60px rgba(0, 255, 0, 0.4),
              inset 0 0 10px rgba(255, 255, 255, 0.2);
  animation: pulse-glow 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8),
                0 0 60px rgba(0, 255, 0, 0.4),
                inset 0 0 10px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 255, 0, 1),
                0 0 80px rgba(0, 255, 0, 0.6),
                inset 0 0 15px rgba(255, 255, 255, 0.3);
  }
}

.welcome-start-btn:hover {
  background: #1f1;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0 50px rgba(0, 255, 0, 1),
              0 0 100px rgba(0, 255, 0, 0.8),
              inset 0 0 20px rgba(255, 255, 255, 0.4);
}

.welcome-start-btn:active {
  transform: translateY(-1px) scale(1.02);
}

.back-link {
  display: inline-block;
  margin-top: 5px;
  margin-bottom: 5px;
  color: #0a0;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s ease;
  flex-shrink: 0;
}

.back-link:hover {
  color: #0f0;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .terminal-window {
    border-radius: 5px;
  }

  .terminal-body {
    font-size: 12px;
    padding: 15px;
    min-height: 400px;
  }

  .welcome-screen {
    padding: 10px;
  }

  .welcome-content {
    padding: 15px;
    max-width: 98%;
  }

  .welcome-content h1 {
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 3px;
  }

  .tagline {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }

  .instructions {
    margin: 8px 0;
    padding: 10px;
  }

  .instructions h3 {
    font-size: 0.95rem;
  }

  .instructions li {
    font-size: 0.85rem;
    margin: 4px 0;
  }

  .tip {
    font-size: 0.8rem;
    padding: 8px;
  }

  .welcome-start-btn {
    padding: 14px 35px;
    font-size: 1.1rem;
    letter-spacing: 2px;
    margin: 15px auto 8px;
  }

  .header-title {
    font-size: 0.75rem;
  }

  .header-controls {
    flex-wrap: wrap;
  }

  .control-btn {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
}

/* Fullscreen mode */
body.fullscreen .terminal-window {
  max-width: 100%;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

body.fullscreen .terminal-body {
  max-height: calc(100vh - 60px);
}
