/* SolarLab · styles.css — Dark Tech responsivo */
:root {
  --bg: #0b1120; --card: #0f182b; --line: #1e2a44; --tx: #e2e8f0; --mut: #94a3b8;
  --cy: #38bdf8; --sun: #f59e0b; --or: #f97316; --gr: #22c55e; --red: #ef4444;
}
* { box-sizing: border-box; margin: 0; }
html, body { background: var(--bg); color: var(--tx); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; overflow-x: hidden; }
button, select, input { font: inherit; color: inherit; }

.top {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(245,158,11,.08), rgba(56,189,248,.06)); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px);
}
.brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.brand h1 { font-size: 1.15rem; letter-spacing: .3px; }
.brand h1 span { color: var(--sun); font-weight: 600; }
.brand small { color: var(--mut); font-size: .78rem; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sel { display: flex; gap: 6px; align-items: center; color: var(--mut); font-size: .85rem; }
select {
  background: #0a1324; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; max-width: 100%; cursor: pointer;
}
select:focus, input:focus-visible, button:focus-visible { outline: 2px solid var(--cy); outline-offset: 2px; }
.prog { display: flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--mut); }
.prog .bar { width: 80px; height: 8px; background: #0a1324; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
#progBar { height: 100%; width: 0; background: linear-gradient(90deg, var(--sun), var(--gr)); transition: width .4s; }

.ghost {
  background: #0a1324; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; min-width: 38px;
}
.ghost:hover { border-color: var(--cy); }
.ghost.sm { padding: 3px 10px; font-size: .8rem; }
.btn {
  background: linear-gradient(135deg, var(--sun), var(--or)); color: #1a1205; font-weight: 700; border: 0;
  border-radius: 10px; padding: 9px 16px; cursor: pointer; white-space: nowrap; box-shadow: 0 4px 18px rgba(249,115,22,.25);
}
.btn:hover { filter: brightness(1.08); }
.btn.alt { background: linear-gradient(135deg, var(--gr), #16a34a); color: #04210f; margin-top: 10px; width: 100%; box-shadow: 0 4px 18px rgba(34,197,94,.25); }

.grid {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 14px;
  padding: 14px 16px 24px; max-width: 1400px; margin: 0 auto;
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-width: 0; }
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
h2 { font-size: 1.02rem; color: var(--cy); }
h3 { font-size: .9rem; text-transform: uppercase; letter-spacing: .8px; color: var(--mut); margin-bottom: 10px; }
.card .head h3 { margin: 0; }

canvas { display: block; width: 100%; height: auto; border-radius: 10px; background: #050a16; }
#scene { aspect-ratio: 960 / 560; border: 1px solid var(--line); }
#chart { margin-top: 10px; aspect-ratio: 520 / 220; }

.playbar { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.playbar input { flex: 1; min-width: 0; }
#clock { font: 700 .95rem ui-monospace, monospace; color: var(--sun); min-width: 58px; text-align: right; }
.brief { margin-top: 10px; color: var(--mut); font-size: .9rem; border-left: 3px solid var(--sun); padding-left: 10px; }

.badge { font-size: .75rem; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--mut); white-space: nowrap; }
.badge.run { color: var(--cy); border-color: var(--cy); }
.badge.ok { color: var(--gr); border-color: var(--gr); }
.badge.bad { color: var(--red); border-color: var(--red); }

.ctl { display: block; margin-bottom: 12px; }
.ctl span { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--mut); margin-bottom: 5px; }
.ctl b { color: var(--sun); font-family: ui-monospace, monospace; white-space: nowrap; }
.ctl select { width: 100%; }
input[type=range] { width: 100%; accent-color: var(--sun); height: 24px; cursor: pointer; }

.msg { font-size: .88rem; padding: 10px; border-radius: 10px; background: #0a1324; border: 1px solid var(--line); color: var(--mut); }
.msg.ok { color: #bbf7d0; border-color: var(--gr); background: rgba(34,197,94,.08); }
.msg.bad { color: #fecaca; border-color: var(--red); background: rgba(239,68,68,.08); }

dl { display: grid; }
#live dt, #live dd { display: block; }
#live { grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .86rem; }
#live dt { color: var(--mut); }
#live dd { margin: 0; text-align: right; font: 700 .9rem ui-monospace, monospace; color: var(--tx); }

pre {
  background: #050a16; border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: #a5f3fc;
  font: .76rem/1.5 ui-monospace, "Cascadia Code", Consolas, monospace; max-height: 340px; overflow: auto; white-space: pre;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); padding: 12px 12px 20px; }
}
@media (max-width: 480px) {
  html, body { font-size: 14px; }
  .top { padding: 8px 12px; }
  .brand h1 span, .prog .bar { display: none; }
  .tools { width: 100%; justify-content: space-between; }
  .sel { flex: 1; min-width: 0; }
  .sel select { flex: 1; min-width: 0; }
  .card { padding: 11px; }
  .btn { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { #progBar { transition: none; } }
