:root {
  --bg: radial-gradient(circle at 30% 20%, #041c12 0%, #010307 60%, #000102 100%);
  --terminal-bg: radial-gradient(circle at 50% 0%, rgba(5, 30, 15, 0.9), rgba(1, 4, 6, 0.95));
  --text: #00ff99;
  --accent: #00d47b;
  --error: #ff4d6d;
  font-family: "SF Mono", "Fira Code", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 5vw, 3rem);
}

.challenge-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.stack {
  width: min(90vw, 720px);
  margin: clamp(2rem, 5vw, 4rem) auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.logo-glitch-area {
  position: relative;
  width: 100%;
  height: clamp(200px, 35vw, 260px);
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(circle at 25% 20%, rgba(6, 26, 16, 0.7), rgba(0, 0, 0, 0.95));
  box-shadow: 0 0 30px rgba(0, 255, 120, 0.35), 0 0 80px rgba(0, 0, 0, 0.85);
}

.logo-glitch-area::before,
.logo-glitch-area::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.logo-glitch-area::before {
  background-image: linear-gradient(
    rgba(0, 0, 0, 0.35),
    rgba(0, 0, 0, 0.55)
  );
}

.logo-glitch-area::after {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 255, 120, 0.07) 0,
    rgba(0, 255, 120, 0.07) 2px,
    transparent 3px,
    transparent 4px
  );
  opacity: 0.35;
}

.glitch-slice {
  position: absolute;
  opacity: 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  filter: contrast(1.3) saturate(1.1);
  pointer-events: none;
  transition: opacity 80ms ease-out;
  image-rendering: pixelated;
  box-shadow: 0 0 18px rgba(0, 255, 150, 0.3);
}

.terminal-shell {
  width: 100%;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 24px;
  background: radial-gradient(circle at 50% 0%, rgba(5, 30, 15, 0.95), rgba(1, 4, 6, 0.98));
  box-shadow: 0 0 40px rgba(0, 255, 120, 0.35), 0 0 120px rgba(0, 0, 0, 0.9),
    inset 0 0 80px rgba(0, 0, 0, 0.7);
  text-shadow: 0 0 6px rgba(0, 255, 153, 0.35);
  position: relative;
  overflow: hidden;
}

.terminal-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.28) 0px,
    rgba(0, 0, 0, 0.28) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  pointer-events: none;
}

.terminal-shell > * {
  position: relative;
  z-index: 1;
}

#challenge-output {
  min-height: 300px;
  margin: 0 0 1.5rem;
  white-space: pre-wrap;
  line-height: 1.5;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

input[type='text'] {
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(0, 255, 153, 0.5);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  text-transform: lowercase;
  letter-spacing: 0.08em;
}

input[type='text']:focus {
  outline: 2px solid var(--accent);
}

button {
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  text-transform: uppercase;
  border: 1px solid rgba(0, 255, 153, 0.7);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  letter-spacing: 0.2em;
  transition: background 150ms ease, color 150ms ease;
}

button:hover,
button:focus-visible {
  background: rgba(0, 255, 153, 0.2);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 540px) {
  #challenge-output {
    min-height: 220px;
    font-size: 0.92rem;
  }

  button {
    letter-spacing: 0.1em;
  }
}
