* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #0a0a0a;
  color: #00ff88;
  font-family: "Courier New", monospace;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.noise,
.overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.noise {
  background: repeating-radial-gradient(circle at center, rgba(255,255,255,0.03) 0, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 3px);
  opacity: 0.08;
}

.overlay {
  background: linear-gradient(rgba(0,255,136,0.03), rgba(0,0,0,0.15));
}

.terminal {
  position: relative;
  width: min(92%, 720px);
  border: 1px solid rgba(0,255,136,0.25);
  background: rgba(0, 15, 8, 0.88);
  box-shadow: 0 0 25px rgba(0,255,136,0.08);
  padding: 40px;
  z-index: 2;
}

h1 {
  margin-top: 0;
  font-size: clamp(32px, 5vw, 54px);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.errorcode {
  color: #ffffff;
}

.output {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(0,255,136,0.9);
}

.input-group {
  margin: 30px 0;
}

input {
  width: 100%;
  padding: 14px;
  background: #000;
  border: 1px solid rgba(0,255,136,0.35);
  color: #00ff88;
  font-family: inherit;
  font-size: 16px;
  text-align: center;
  outline: none;
}

input:focus {
  border-color: #00ff88;
  box-shadow: 0 0 10px rgba(0,255,136,0.15);
}

.code-box {
  margin-top: 25px;
  padding: 20px;
  border: 1px dashed rgba(0,255,136,0.35);
  text-align: center;
}

.code {
  font-size: clamp(42px, 8vw, 72px);
  font-weight: bold;
  letter-spacing: 6px;
}

.timer {
  margin-top: 10px;
  color: rgba(0,255,136,0.65);
}

.wait-dots::after {
  content: '';
  display: inline-block;
  width: 1.5em;
  text-align: left;
  animation: dots 1s steps(3, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

button {
  flex: 1;
  min-width: 160px;
  padding: 14px;
  background: transparent;
  color: #00ff88;
  border: 1px solid rgba(0,255,136,0.4);
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  transition: 0.2s ease;
}

button:hover {
  background: rgba(0,255,136,0.08);
  border-color: #00ff88;
}

.hint {
  margin-top: 18px;
  font-size: 13px;
  color: rgba(0,255,136,0.5);
}

.toast.error {
  background: rgba(180, 0, 0, 0.95) !important;
  border-color: #ff5555 !important;
  color: #ffdddd !important;
}

.toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 25, 10, 0.95);
  color: #00ff88;
  border: 1px solid rgba(0,255,136,0.45);
  padding: 12px 24px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 999;
  box-shadow: 0 0 15px rgba(0,255,136,0.15);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .terminal {
    padding: 24px;
  }
}
