/* Muse 3D Engine v1 - panel UI
   Alasan desain (R-31):
   - Panel indigo gelap: identitas dunia 3D-nya sendiri, bukan "dark biar tech".
   - Aksen cyan hanya di tombol Rekam + outline fokus: momen kunci saja.
   - Segoe UI: selera yang sudah dikunci di engine 2D.
   - Tanpa dekorasi emoji/serif: permintaan eksplisit user.
*/
:root {
  --panel-bg: rgba(7, 11, 24, 0.9);
  --panel-line: rgba(90, 200, 255, 0.22);
  --text: #e9f4ff;
  --muted: #9db4c9;
  --accent: #43dcff;
  --accent-dim: rgba(67, 220, 255, 0.16);
  --danger: #ff5d6c;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #04060d;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
}
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; }

/* Vignette sinematik di atas canvas: memperdalam tepi frame.
   Alasan: meniru bahasa film, membuat fokus ke tengah scene. */
#vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(2, 4, 10, 0.35) 100%);
}

#ui { position: fixed; left: 16px; bottom: 16px; z-index: 10; max-width: min(320px, calc(100vw - 32px)); }
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 12px 14px 8px;
}
.panel-head h1 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0.2px; }
.panel-head .sub { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.icon-btn {
  background: transparent; border: 1px solid var(--panel-line); color: var(--text);
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1;
}
.icon-btn:hover { background: var(--accent-dim); }
.panel-body { padding: 4px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 8px; }
.row.grid { display: grid; grid-template-columns: 1fr 1fr; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
/* Slider kecerahan: kontrol native (keyboard OK), aksen cyan menyatu panel.
   Alasan: kalibrasi layar user, layar HP dan monitor me-render gelap berbeda. */
.bright { display: flex; flex-direction: column; gap: 4px; }
.bright label { font-size: 12px; color: var(--muted); }
.bright-row { display: flex; align-items: center; gap: 8px; }
.bright-row input[type="range"] {
  flex: 1; min-height: 40px; accent-color: var(--accent); cursor: pointer;
}
.bright-val { font-size: 12.5px; color: var(--text); min-width: 38px; text-align: right; }
select, .btn {
  font-family: inherit; font-size: 13.5px; color: var(--text);
  background: rgba(20, 30, 55, 0.9); border: 1px solid var(--panel-line);
  border-radius: 7px; padding: 8px 10px; min-height: 40px;
}
select { width: 100%; cursor: pointer; }
.btn { cursor: pointer; flex: 1; }
.btn:hover { background: rgba(35, 52, 88, 0.95); }
.btn.record {
  border-color: rgba(255, 93, 108, 0.55); color: #ffdfe3;
  background: rgba(120, 24, 34, 0.55);
}
.btn.record:hover { background: rgba(150, 30, 42, 0.65); }
.btn.record:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.expand { flex: none; }
.status {
  font-size: 12.5px; color: var(--accent);
  border-top: 1px solid var(--panel-line); padding-top: 8px;
  min-height: 20px;
}
.status.error { color: var(--danger); }
.note { margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#loader {
  position: fixed; inset: 0; z-index: 20; display: flex;
  align-items: center; justify-content: center;
  background: #04060d; color: var(--muted); font-size: 14px;
  transition: opacity 0.4s ease;
}
#loader.done { opacity: 0; pointer-events: none; }
#fatal {
  position: fixed; inset: 0; z-index: 30; display: flex;
  align-items: center; justify-content: center; text-align: center;
  background: rgba(4, 6, 13, 0.96); color: var(--text);
  padding: 24px; font-size: 14px; line-height: 1.6;
}

@media (max-width: 560px) {
  #ui { left: 8px; right: 8px; bottom: 8px; max-width: none; }
}
