:root {
  --bg: #0b0d0a;
  --bg-panel: #12140f;
  --amber: #ffb000;
  --amber-dim: #a87400;
  --amber-faint: #5c4200;
  --text: #d9d2c2;
  --text-dim: #8a8272;
  --green: #7ee787;
  --red: #ff6b6b;
  --border: #2a2a20;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(ellipse at top, rgba(255,176,0,0.05), transparent 60%);
}

.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.015) 0px,
    rgba(255,255,255,0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

@media (prefers-reduced-motion: reduce) {
  .crt-overlay { display: none; }
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1a1c16;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 10px 14px;
}

.topbar-left { display: flex; gap: 6px; }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber-faint);
  display: inline-block;
}
.dot:nth-child(1) { background: #5f4a3a; }
.dot:nth-child(2) { background: #7a6220; }
.dot:nth-child(3) { background: #4a5f3a; }

.topbar-title {
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.terminal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 24px 20px 8px;
}

.banner {
  margin-bottom: 28px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 20px;
}

.ascii {
  color: var(--amber);
  font-size: 9px;
  line-height: 1.1;
  margin: 0 0 16px;
  text-shadow: 0 0 8px rgba(255,176,0,0.35);
  overflow-x: auto;
}

.banner-meta {
  font-size: 12.5px;
  line-height: 1.9;
}
.banner-meta .k {
  color: var(--text-dim);
  display: inline-block;
  min-width: 76px;
}
.banner-meta .v { color: var(--text); }

.panel { margin-bottom: 28px; }

.panel-label {
  color: var(--amber);
  font-size: 12.5px;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.q-btn {
  text-align: left;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  position: relative;
}

.q-btn::before {
  content: '>';
  color: var(--amber-dim);
  margin-right: 8px;
}

.q-btn:hover {
  border-color: var(--amber-dim);
  background: rgba(255,176,0,0.05);
  color: #fff;
}

.q-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.q-btn.active {
  border-color: var(--amber);
  color: var(--amber);
}

.log-panel { min-height: 60px; }

.log {
  font-size: 13px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.log-hint {
  color: var(--text-dim);
  font-style: italic;
}

.log-entry { border-left: 2px solid var(--border); padding-left: 12px; }

.log-q {
  color: var(--green);
  margin-bottom: 4px;
}
.log-q::before { content: 'user@instruction $ '; color: var(--text-dim); }

.log-a {
  color: var(--text);
  white-space: pre-wrap;
}
.log-a .cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--amber);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

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

.custom-panel { margin-bottom: 8px; }

.custom-note {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.7;
  margin: 0;
  border: 1px dashed var(--border);
  padding: 12px 14px;
  border-radius: 4px;
}
.custom-note code {
  color: var(--amber);
  background: rgba(255,176,0,0.08);
  padding: 1px 5px;
  border-radius: 3px;
}

.custom-input-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.custom-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 4px;
}
.custom-input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
  border-color: var(--amber-dim);
}
.custom-input::placeholder { color: var(--text-dim); }

.custom-submit {
  background: transparent;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.custom-submit:hover {
  background: var(--amber);
  color: #0b0d0a;
}
.custom-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.custom-submit:disabled:hover {
  background: transparent;
  color: var(--amber);
}

.log-a.error { color: var(--red); }

.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 18px;
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .ascii { font-size: 6.5px; }
  .wrap { padding: 16px 12px 40px; }
}
