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

:root {
  --bg: #000000;
  --fg: #ffffff;
  --red: #FF3333;
  --green: #00FF00;
  --dim: #555555;
  --border: #333333;
  --panel-bg: #0a0a0a;
}

body {
  font-family: 'Space Mono', monospace;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

.app {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* Header */
header {
  margin-bottom: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

#mascot {
  width: 64px;
  height: 64px;
  object-fit: contain;
  animation: mascot-bob 3s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes mascot-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

#mascot.munching {
  animation: mascot-munch 0.25s ease-in-out infinite;
}

@keyframes mascot-munch {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.75); }
}

#mascot.celebrate {
  animation: mascot-celebrate 0.6s ease-in-out 3;
}

@keyframes mascot-celebrate {
  0% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-12deg) translateY(-6px); }
  50% { transform: rotate(12deg) translateY(-10px); }
  75% { transform: rotate(-6deg) translateY(-4px); }
  100% { transform: rotate(0deg) translateY(0); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  color: var(--fg);
  line-height: 1;
  letter-spacing: -0.5px;
}

.tagline {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Panels */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 16px;
}

/* Input */
.input-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

textarea {
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 12px;
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.6;
}

textarea:focus { border-color: var(--fg); }
textarea::placeholder { color: var(--dim); }

.btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-primary {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
  padding: 12px 28px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-primary:hover {
  background: var(--bg);
  color: var(--fg);
}

.btn-primary:disabled {
  background: var(--border);
  color: var(--dim);
  border-color: var(--border);
  cursor: not-allowed;
}

.btn-outline {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-outline:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.btn-outline.copied {
  color: var(--green);
  border-color: var(--green);
}

/* Status */
.status-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.scan-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.scan-dots span {
  width: 7px;
  height: 7px;
  background: var(--fg);
  border-radius: 50%;
  animation: dot-pulse 1.2s ease-in-out infinite;
}

.scan-dots span:nth-child(2) { animation-delay: 0.2s; }
.scan-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

#status-text {
  font-size: 0.8rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.progress-log {
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--dim);
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.progress-log::-webkit-scrollbar { width: 4px; }
.progress-log::-webkit-scrollbar-track { background: var(--bg); }
.progress-log::-webkit-scrollbar-thumb { background: var(--border); }

/* Results */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.results-label {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg);
}

.results-output {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 16px;
  color: var(--fg);
  max-height: 600px;
  overflow-y: auto;
}

.results-output::-webkit-scrollbar { width: 4px; }
.results-output::-webkit-scrollbar-track { background: var(--bg); }
.results-output::-webkit-scrollbar-thumb { background: var(--border); }

.flag-red { color: var(--red); }
.flag-green { color: var(--green); }
.flag-dim { color: var(--dim); }


[hidden] { display: none !important; }

/* Responsive */
@media (max-width: 600px) {
  .app { padding: 24px 16px 60px; }
  .brand { gap: 14px; }
  .brand-name { font-size: 1.5rem; }
  #mascot { width: 52px; height: 52px; }
  .btn-row { flex-wrap: wrap; }
  .btn-primary { width: 100%; text-align: center; }
}
