/* main.css — vIA site público (β.11) — paleta dark scientific */

:root {
  --bg: #0d1117;
  --panel: #131a23;
  --panel-2: #1a222d;
  --line: #1f2a36;
  --fg: #c9d1d9;
  --muted: #8b97a4;
  --accent: #5eead4;
  --accent-2: #58a6ff;
  --warn: #f0b429;
  --bad:  #ef5b5b;
  --good: #2bd4a8;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 14px; line-height: 1.45;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* ─── Top bar ─── */
#topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
#topbar .brand { display: flex; align-items: center; gap: 12px; }
#topbar .logo { height: 36px; }
#topbar .badge { color: var(--muted); font-size: 11px;
  border: 1px solid var(--line); padding: 3px 8px; border-radius: 4px; }
#topbar nav { display: flex; gap: 16px; font-size: 12px; }
#topbar nav a { color: var(--fg); }
#topbar nav a:hover { color: var(--accent); }

/* ─── Banners ─── */
#disclaimer {
  background: rgba(240, 180, 41, 0.12); border-left: 4px solid var(--warn);
  padding: 10px 22px; font-size: 12px;
}
#underground-banner {
  background: rgba(239, 91, 91, 0.15); border-left: 4px solid var(--bad);
  padding: 10px 22px; font-size: 12px; color: var(--fg);
  font-weight: 600;
}
#demo-banner {
  background: rgba(94, 234, 212, 0.12); border-left: 4px solid var(--accent);
  padding: 10px 22px; font-size: 12px;
}

/* ─── Tabuleiro 40-20-40 ─── */
#tabuleiro {
  display: grid; grid-template-columns: 40fr 20fr 40fr; gap: 8px;
  margin: 16px 22px;
}
@media (max-width: 1024px) { #tabuleiro { grid-template-columns: 1fr; } }
.scene-panel {
  position: relative; aspect-ratio: 16/9;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden;
}
.scene-panel.center { background: #050810; }
.scene-panel img, .scene-panel video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: opacity 320ms;
}
.scene-panel.dim img, .scene-panel.dim video { opacity: 0.4; }
.scene-panel canvas { width: 100%; height: 100%; display: block; }
.scene-overlay {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(13, 17, 23, 0.88); padding: 8px 12px; border-radius: 6px;
  border: 1px solid var(--line);
}
.scene-overlay h3 { margin: 0; font-size: 12px; color: var(--accent); }
.scene-overlay .ilc-value { font-size: 22px; font-weight: 600; color: var(--fg); }
.scene-overlay .ilc-ic { font-size: 10px; color: var(--muted); }
.scene-overlay.center { left: 50%; transform: translateX(-50%); text-align: center; }

/* ─── Linha do tempo ─── */
#timeline {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 22px; margin: 0 22px 16px;
}
.timeline-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.timeline-header h3 { margin: 0; font-size: 13px; }
#year-slider { width: 100%; height: 6px; background: var(--line);
  border-radius: 3px; outline: none; appearance: none; }
#year-slider::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px;
  background: var(--accent); border-radius: 50%; cursor: pointer; }
.timeline-marks {
  display: flex; justify-content: space-between; font-size: 10px;
  color: var(--muted); margin-top: 4px;
}
#current-year-display { text-align: center; margin-top: 6px; font-size: 13px; }
#current-year-display #current-year { color: var(--accent); font-weight: 700; font-size: 18px; }

/* ─── Box de prompt + modos ─── */
#prompt-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 16px 22px; margin: 0 22px 16px;
}
#prompt-box h2 { margin: 0 0 10px; font-size: 16px; color: var(--accent); }
#prompt-textarea {
  width: 100%; min-height: 80px; font-family: inherit; font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--fg);
  padding: 10px; border-radius: 4px; resize: vertical;
}
.mode-tabs { display: flex; gap: 4px; margin: 10px 0; }
.mode-tab {
  background: transparent; border: 1px solid var(--line); color: var(--fg);
  padding: 6px 14px; cursor: pointer; border-radius: 4px;
  font-family: inherit; font-size: 12px;
}
.mode-tab.active { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
.prompt-actions { display: flex; gap: 10px; margin-top: 10px; }
button.primary, button.ghost {
  font-family: inherit; padding: 8px 16px; border-radius: 4px; cursor: pointer;
  font-size: 12px;
}
button.primary { background: var(--accent); color: var(--bg);
  border: 1px solid var(--accent); font-weight: 600; }
button.primary:hover { background: var(--accent-2); }
button.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
button.ghost:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

#thinking-indicator {
  margin-top: 10px; padding: 8px 12px;
  background: rgba(94, 234, 212, 0.06);
  border-left: 3px solid var(--accent);
  font-size: 12px;
}
#thinking-indicator.hidden { display: none; }
.spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

#prompt-result {
  margin-top: 12px; padding: 12px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 4px; font-size: 12px;
  white-space: pre-wrap;
}
#prompt-result.hidden { display: none; }

/* ─── Painel variáveis (modo JOGO) ─── */
#vars-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 22px; margin: 0 22px 16px;
}
#vars-panel h3 { margin: 0 0 10px; font-size: 13px; }
.vars-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 768px) { .vars-grid { grid-template-columns: 1fr; } }
.var-item {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--panel-2); padding: 8px 10px; border-radius: 4px;
}
.var-item label { font-size: 11px; color: var(--muted); }
.var-item input[type="range"] { width: 100%; }
.var-value { font-size: 13px; color: var(--accent); font-weight: 600; }
.btn-group-mini { display: flex; gap: 3px; }
.btn-mini {
  flex: 1; background: transparent; border: 1px solid var(--line);
  color: var(--fg); padding: 4px 6px; cursor: pointer; border-radius: 3px;
  font-family: inherit; font-size: 11px;
}
.btn-mini.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-mini:disabled { opacity: 0.45; cursor: not-allowed; }
.var-item input:disabled { opacity: 0.5; }

/* ─── Cards de status (limbo counter, R001) ─── */
.cards-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px; margin: 0 22px 16px;
}
.card-stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px;
}
.card-stat h4 { margin: 0 0 6px; font-size: 12px; color: var(--accent); }
.card-stat .big-num { font-size: 28px; font-weight: 700; color: var(--fg); }
.card-stat .sub { font-size: 11px; color: var(--muted); }
.card-stat table { width: 100%; font-size: 11px; margin-top: 6px; }
.card-stat th, .card-stat td { text-align: left; padding: 3px 0; }
.card-stat .vIA-row td { color: var(--accent); font-weight: 600; }

/* ─── Modal compute_memory ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--panel); border: 1px solid var(--accent); border-radius: 8px;
  width: 80%; max-width: 900px; max-height: 80vh; overflow-y: auto;
  padding: 20px;
}
.modal-header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.modal-header h3 { margin: 0; color: var(--accent); }
.modal pre {
  background: var(--bg); padding: 10px; border-radius: 4px;
  font-size: 11px; white-space: pre-wrap; word-break: break-all;
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--line); background: var(--panel);
  padding: 14px 24px; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted);
}
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
