/* ==========================================================
   ORÁCULO VITAL — tokens
   Base: mainframe cósmico dos anos 80, não um "hacker terminal"
   genérico — por isso indigo profundo em vez de preto puro,
   e três acentos (ciano/magenta/âmbar) em vez de um só verde.
   ========================================================== */
:root{
  --bg: #150f2e;
  --bg-deep: #0c0820;
  --panel: #1c1440;
  --panel-line: #382a70;
  --text: #e9e6f7;
  --text-dim: #9d94c4;
  --cyan: #5ff2e0;
  --magenta: #ff5db1;
  --amber: #ffc857;
  --good: #7bffb6;
  --bad: #ff6b7a;
  --font-display: 'Press Start 2P', monospace;
  --font-mono: 'Space Mono', monospace;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, #2b1f5e 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, #26154a 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* ---------- textura de CRT (sutil, decorativa) ---------- */
.crt-overlay{
  position: fixed; inset:0; pointer-events:none; z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.035) 0px,
    rgba(255,255,255,0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}
.noise{
  position: fixed; inset:0; pointer-events:none; z-index: 49;
  opacity:.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior:auto !important; }
}

/* ---------- estrutura de telas ---------- */
#app{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 32px 20px 80px;
}
.screen{
  display:none;
  width:100%;
  max-width: 720px;
}
.screen.is-active{ display:block; animation: fade-in .5s ease both; }
@keyframes fade-in{ from{ opacity:0; transform: translateY(8px);} to{opacity:1; transform:none;} }

.eyebrow-code{
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: .04em;
  margin: 0 0 18px;
}

/* ---------- boot screen ---------- */
.boot-box{
  min-height: 40vh;
  display:flex;
  align-items:center;
}
.boot-lines{
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--cyan);
  white-space: pre-wrap;
  margin:0;
}
.boot-lines .ok{ color: var(--good); }
.cursor-blink{
  display:inline-block;
  color: var(--amber);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink{ 50%{ opacity:0; } }

/* ---------- hero ---------- */
.hero-wrap{ text-align:left; }
.pixel-title{
  font-family: var(--font-display);
  font-size: clamp(28px, 8vw, 52px);
  line-height: 1.35;
  margin: 0 0 20px;
  color: var(--text);
  text-shadow: 3px 3px 0 var(--magenta), 6px 6px 0 rgba(95,242,224,.35);
}
.hero-sub{
  color: var(--text-dim);
  max-width: 60ch;
  font-size: 15px;
  margin-bottom: 28px;
}
.terminal-note{
  border-left: 3px solid var(--panel-line);
  padding: 10px 16px;
  margin-bottom: 32px;
  background: rgba(28,20,64,.5);
}
.terminal-note p{ margin: 4px 0; font-size: 13px; }
.dim{ color: var(--text-dim); }

.btn-primary, .btn-ghost{
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  cursor:pointer;
  border-radius: 3px;
  padding: 14px 22px;
}
.btn-primary{
  background: var(--amber);
  color: #1c1440;
  border: 2px solid var(--amber);
  box-shadow: 4px 4px 0 var(--magenta);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover{ transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--magenta); }
.btn-primary:active{ transform: translate(0,0); box-shadow: 2px 2px 0 var(--magenta); }
.btn-primary:focus-visible, .btn-ghost:focus-visible, .quiz-option:focus-visible{
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}
.prompt-arrow{ color:#1c1440; }

.btn-ghost{
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--panel-line);
  margin-top: 14px;
}
.btn-ghost:hover{ color: var(--text); border-color: var(--cyan); }

/* ---------- quiz ---------- */
.quiz-wrap{ width:100%; }
.quiz-head{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom: 22px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .03em;
}
.progress-track{
  width:100%;
  height: 6px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
}
.progress-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  transition: width .35s ease;
}
.quiz-card{
  background: var(--panel);
  border: 1px solid var(--panel-line);
  padding: 28px 24px;
}
.quiz-category{
  color: var(--magenta);
  font-size: 12px;
  letter-spacing: .04em;
  margin: 0 0 10px;
}
.quiz-question{
  font-size: 20px;
  line-height:1.4;
  margin: 0 0 22px;
  color: var(--text);
}
.quiz-options{
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.quiz-option{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  text-align:left;
  width:100%;
  background: var(--bg-deep);
  border: 1px solid var(--panel-line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 14px 16px;
  cursor:pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.quiz-option:hover{ border-color: var(--cyan); background: #241a52; }
.quiz-option:active{ transform: scale(.99); }
.quiz-option .opt-key{
  color: var(--cyan);
  flex-shrink:0;
}
#btn-back{ margin-top:18px; }

/* ---------- loading ---------- */
.loading-wrap{ text-align:center; }
.loading-msg{
  color: var(--cyan);
  font-size: 14px;
  min-height: 22px;
  margin-bottom: 18px;
}
.ascii-bar{
  font-family: monospace;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--amber);
  white-space: pre;
  border: 1px solid var(--panel-line);
  padding: 12px 16px;
  background: var(--bg-deep);
  overflow:hidden;
}
.loading-pct{ margin-top: 12px; color: var(--text-dim); font-size: 13px; }

/* ---------- resultado ---------- */
.result-wrap{ width:100%; }
.result-hero{
  text-align:center;
  padding: 30px 20px;
  border: 1px solid var(--panel-line);
  background: linear-gradient(180deg, rgba(95,242,224,.06), rgba(255,93,177,.06));
  margin-bottom: 26px;
}
.result-label{
  font-size: 12px;
  letter-spacing:.05em;
  color: var(--text-dim);
  margin: 0 0 10px;
}
.result-number{
  font-family: var(--font-display);
  font-size: clamp(38px, 12vw, 64px);
  color: var(--amber);
  margin: 0;
  text-shadow: 3px 3px 0 var(--magenta);
}
.result-unit{ font-size: .4em; color: var(--text-dim); }
.result-caption{ color: var(--text-dim); font-size: 13px; margin-top: 14px; }

.result-panel{
  background: var(--panel);
  border: 1px solid var(--panel-line);
  padding: 20px;
  margin-bottom: 18px;
}
.panel-title{
  color: var(--cyan);
  font-size: 12px;
  margin: 0 0 12px;
}
.result-cause{ font-size: 15px; line-height:1.6; margin:0; }

.stat-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.stat-list li{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  font-size: 13px;
  border-bottom: 1px dashed var(--panel-line);
  padding-bottom: 8px;
}
.stat-name{ color: var(--text-dim); }
.stat-value.good{ color: var(--good); }
.stat-value.bad{ color: var(--bad); }
.stat-value.neutral{ color: var(--text-dim); }

.share-note{
  font-size: 12px;
  color: var(--text-dim);
  margin: -2px 0 14px;
}
.share-preview{
  display:block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-deep);
  border: 1px solid var(--panel-line);
  margin-bottom: 16px;
}
.share-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.btn-channel{
  font-family: var(--font-mono);
  font-size: 13px;
  text-align:left;
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--panel-line);
  padding: 12px 14px;
  cursor:pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn-channel:hover{ border-color: var(--cyan); color: var(--cyan); background:#241a52; }
.btn-channel-native{
  border-color: var(--amber);
  color: var(--amber);
  grid-column: 1 / -1;
}
.btn-channel-native:hover{ border-color: var(--amber); color: var(--amber); background:#2a2050; }

.result-actions{
  display:flex;
  flex-wrap:wrap;
  gap: 14px;
  margin-top: 8px;
}
.share-feedback{ color: var(--good); font-size: 13px; min-height: 18px; margin-top:10px; }

/* ---------- footer ---------- */
.site-footer{
  position: relative;
  z-index: 1;
  text-align:center;
  color: var(--text-dim);
  font-size: 11px;
  padding: 0 20px 30px;
  max-width: 640px;
  margin: -50px auto 0;
}

@media (max-width: 480px){
  .quiz-card{ padding: 20px 16px; }
  .result-hero{ padding: 22px 14px; }
}
