/* ═══════════════════════════════════════════════════════════════════
   Aureva — Ruang Kerja
   Palet: void navy + gold sodium lamp + neon magenta signage
   Font: Archivo (variable, self-hosted)
   ═══════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-latin.woff2') format('woff2');
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* base */
  --void:      #0A0C10;
  --surface:   #14181F;
  --surface-2: #1A1F28;
  --line:      #232A35;
  --line-soft: #1B212A;

  /* text */
  --bone:      #E8E4DC;
  --muted:     #98928A;
  --dim:       #6B7078;

  /* lampu sodium — accent utama (dari logo) */
  --gold:      #FFB347;
  --gold-hi:   #FDF4DC;
  --gold-mid:  #EBD29A;
  --gold-deep: #C9A45C;
  --gold-dk:   #7A5C32;

  /* status */
  --work:      #FFB347;   /* bekerja  — sodium */
  --rest:      #4DD4E8;   /* istirahat — screen cyan */
  --block:     #FF3D7F;   /* terblokir — signage neon */
  --idle:      #3A4250;   /* kosong */

  --ease: cubic-bezier(.32,.72,0,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: var(--void);
}

body {
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--bone);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

button {
  font: inherit; color: inherit; background: none; border: 0;
  cursor: pointer; padding: 0;
}

::selection { background: var(--gold-deep); color: var(--void); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ═══════════════════ BOOT / LOADER ═══════════════════ */

#boot {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; align-content: center;
  gap: 0;
  background:
    radial-gradient(720px 460px at 50% 34%, rgba(201,164,92,.10), transparent 68%),
    var(--void);
  transition: opacity .64s var(--ease), visibility .64s;
}

#boot.done { opacity: 0; visibility: hidden; }

.b-mark {
  width: min(240px, 72vw); height: auto;
  display: grid; place-items: center;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 26px rgba(201,164,92,.28));
  animation: markIn 1.1s var(--ease) both;
}

.b-mark img { width: 100%; height: auto; display: block; }

@keyframes markIn {
  from { opacity: 0; transform: scale(.86); }
  to   { opacity: 1; transform: scale(1); }
}

.b-status {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  
  color: var(--dim);
  margin-top: 14px;
  animation: fadeUp .8s .5s var(--ease) both;
}

.b-track {
  width: 148px; height: 1px;
  margin-top: 26px;
  background: var(--line);
  overflow: hidden;
  position: relative;
  animation: fadeUp .8s .64s var(--ease) both;
}

.b-track i {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dk), var(--gold-hi));
  transition: width .5s var(--ease);
  box-shadow: 0 0 10px rgba(255,179,71,.6);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════════ CANVAS 3D ═══════════════════ */

#scene {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene:active { cursor: grabbing; }
#scene.hovering { cursor: pointer; }

/* ═══════════════════ HUD ═══════════════════ */

#hud {
  position: fixed; inset: 0;
  z-index: 10;
  pointer-events: none;
  /* vignette supaya HUD terbaca di atas 3D */
  background:
    radial-gradient(120% 90% at 50% 46%, transparent 42%, rgba(10,12,16,.55) 100%);
}

#hud > * { pointer-events: auto; }

/* ── identitas kiri atas */
.hud-id {
  position: absolute; top: 20px; left: 24px;
  display: flex; align-items: baseline; gap: 10px;
}

.hud-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: #0A0C10;
  border: 1px solid rgba(201,164,92,.45);
  border-radius: 7px;
  align-self: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.34);
  overflow: hidden;
}
.hud-mark img { width: 27px; height: 27px; display: block; }

.hud-word {
  font-size: 15px; font-weight: 700;
  letter-spacing: -.01em;
  color: var(--gold-mid);
}

.hud-sub {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0;
  color: var(--dim);
  padding-left: 4px;
}

/* ── angka kanan atas */
.hud-nums {
  position: absolute; top: 18px; right: 24px;
  display: flex; align-items: center; gap: 0;
}

.nn {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 0 14px;
}
.nn.sep { border-left: 1px solid var(--line-soft); }
.nn:first-child { padding-left: 0; }

.nn-k {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0;
  color: var(--dim);
  line-height: 1.35;
}

.nn-v {
  font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--bone);
  line-height: 1.15;
}

.hud-clock {
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  color: var(--muted);
  padding-left: 16px;
  border-left: 1px solid var(--line-soft);
  margin-left: 2px;
  align-self: center;
  white-space: nowrap;
}

/* ═══════════════════ ROSTER ═══════════════════ */

#roster {
  position: absolute;
  left: 18px; top: 58px; bottom: 82px;
  width: 218px;
  display: flex; flex-direction: column;
  padding: 10px 8px 9px;
  background: rgba(10, 13, 18, 0.78);
  border: 1px solid rgba(35, 42, 53, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: width .32s var(--ease), opacity .32s;
}

.ro-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1px 2px 8px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 7px;
  flex: 0 0 auto;
}

.ro-head > span {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0; 
  color: var(--dim);
}

#ro-toggle {
  color: var(--dim); font-size: 15px; line-height: 1;
  padding: 0 2px;
  transition: color .16s, transform .32s var(--ease);
}
#ro-toggle:hover { color: var(--gold); }

#roster.folded { width: 30px; }
#roster.folded .ro-body,
#roster.folded .ro-foot,
#roster.folded .ro-head > span { display: none; }
#roster.folded #ro-toggle { transform: rotate(180deg); }

.ro-body {
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding-right: 4px;
}
.ro-body::-webkit-scrollbar { width: 3px; }
.ro-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

.ro-div {
  font-size: 8.5px; font-weight: 700;
  letter-spacing: 0; 
  color: var(--gold-dk);
  padding: 12px 0 5px;
  position: sticky; top: 0;
  background: linear-gradient(180deg, rgba(10,13,18,0.96) 64%, rgba(10,13,18,0));
  z-index: 1;
}

.ro-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 5px 6px 5px 4px;
  border-radius: 5px;
  text-align: left;
  transition: background .14s;
  position: relative;
}
.ro-item:hover { background: rgba(201,164,92,.08); }
.ro-item.on { background: rgba(201,164,92,.13); }

.ro-dot {
  width: 5px; height: 5px; border-radius: 50%;
  flex: 0 0 auto;
  background: var(--idle);
  box-shadow: 0 0 0 0 transparent;
  transition: background .3s, box-shadow .3s;
}
.ro-dot[data-s="working"] { background: var(--work); box-shadow: 0 0 7px var(--work); }
.ro-dot[data-s="waiting"] { background: var(--gold-deep); }
.ro-dot[data-s="resting"] { background: var(--rest); }
.ro-dot[data-s="blocked"] { background: var(--block); box-shadow: 0 0 7px var(--block); animation: blink 1.4s infinite; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.35} }

.ro-txt { min-width: 0; flex: 1; }

.ro-name {
  display: block;
  font-size: 12px; font-weight: 600;
  letter-spacing: -.005em;
  color: var(--bone);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}

.ro-title {
  display: block;
  font-size: 9.5px; font-weight: 400;
  color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.25;
}

.ro-item.off .ro-name,
.ro-item.off .ro-title { opacity: .38; }

.ro-foot {
  flex: 0 0 auto;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: .03em;
  line-height: 1.5;
}

/* ═══════════════════ KARTU ORANG ═══════════════════ */

#person {
  position: absolute;
  right: 20px; top: 58px;
  width: 318px;
  max-height: calc(100vh - 132px);
  overflow-y: auto;
  padding: 18px 18px 20px;
  background: rgba(20,24,31,.93);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow:
    0 24px 64px rgba(0,0,0,.6),
    inset 0 1px 0 rgba(255,255,255,.045);
  animation: cardIn .3s var(--ease);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
#person::-webkit-scrollbar { width: 3px; }
#person::-webkit-scrollbar-thumb { background: var(--line); }

@keyframes cardIn {
  from { opacity: 0; transform: translateX(16px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* garis emas di tepi atas kartu */
#person::before {
  content: '';
  position: absolute; top: 0; left: 18px; right: 18px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
}

#p-close {
  position: absolute; top: 12px; right: 12px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  color: var(--dim); font-size: 12px;
  border-radius: 4px;
  transition: color .14s, background .14s;
}
#p-close:hover { color: var(--bone); background: rgba(255,255,255,.06); }

.p-top {
  display: flex; align-items: center; gap: 13px;
  margin-bottom: 15px;
  padding-right: 26px;
}

.p-portrait {
  width: 56px; height: 56px;
  flex: 0 0 auto;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
}

.p-portrait canvas { display: block; width: 100%; height: 100%; }

.p-headtxt { min-width: 0; }

.p-name {
  font-size: 19px; font-weight: 700;
  letter-spacing: -.025em;
  margin: 0 0 2px;
  color: var(--bone);
  line-height: 1.15;
}

.p-role {
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0; 
  color: var(--gold-deep);
  margin: 0;
  line-height: 1.35;
}

.p-now {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500;
  padding: 9px 12px;
  margin-bottom: 16px;
  background: rgba(255,179,71,.07);
  border-left: 2px solid var(--work);
  color: var(--gold-mid);
  border-radius: 0 3px 3px 0;
  line-height: 1.4;
}

.p-now[data-s="resting"] {
  background: rgba(77,212,232,.06);
  border-left-color: var(--rest);
  color: #A5E4EF;
}
.p-now[data-s="blocked"] {
  background: rgba(255,61,127,.08);
  border-left-color: var(--block);
  color: #FF9BBE;
}
.p-now[data-s="idle"],
.p-now[data-s="offline"] {
  background: rgba(255,255,255,.03);
  border-left-color: var(--idle);
  color: var(--muted);
}

.p-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.p-now[data-s="working"] .p-dot { animation: blink 1.6s infinite; }
.p-now[data-s="blocked"] .p-dot { animation: blink .9s infinite; }

.p-row { margin-bottom: 14px; }

.p-k {
  display: block;
  font-size: 8.5px; font-weight: 700;
  letter-spacing: 0; 
  color: var(--dim);
  margin-bottom: 4px;
}

.p-v {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.p-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  margin-bottom: 15px;
  overflow: hidden;
}

.p-stat {
  background: var(--surface);
  padding: 9px 8px;
  text-align: center;
}

.p-stat b {
  display: block;
  font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--bone);
  line-height: 1.2;
}

.p-stat span {
  display: block;
  font-size: 7.5px; font-weight: 600;
  letter-spacing: 0; 
  color: var(--dim);
  margin-top: 2px;
}

.p-hist { display: flex; flex-direction: column; gap: 1px; }

.p-hist-item {
  padding: 7px 9px;
  background: var(--surface);
  border-left: 2px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.p-hist-item b {
  display: block;
  color: var(--bone);
  font-weight: 500;
  font-size: 11px;
  margin-bottom: 1px;
}

.p-hist-item small {
  font-size: 9px;
  color: var(--dim);
  letter-spacing: .04em;
}

.p-hist-item[data-s="done"] { border-left-color: var(--gold-deep); }
.p-hist-item[data-s="blocked"] { border-left-color: var(--block); }
.p-hist-item[data-s="in_progress"] { border-left-color: var(--work); }

.p-empty {
  font-size: 11px;
  color: var(--dim);
  font-style: normal;
  padding: 6px 0;
}

/* ═══════════════════ KONTROL KAMERA ═══════════════════ */

.hud-cam {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 2px;
  padding: 4px;
  background: rgba(20,24,31,.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.cbtn {
  width: 32px; height: 30px;
  display: grid; place-items: center;
  color: var(--dim);
  border-radius: 3px;
  transition: color .15s, background .15s;
}
.cbtn svg { width: 15px; height: 15px; display: block; }
.cbtn:hover { color: var(--bone); background: rgba(255,255,255,.05); }
.cbtn[aria-pressed="true"] { color: var(--gold); background: rgba(255,179,71,.1); }

.hud-hint {
  position: absolute;
  bottom: 26px; right: 24px;
  margin: 0;
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--dim);
  max-width: 260px;
  text-align: right;
  line-height: 1.6;
  pointer-events: none;
}

/* ═══════════════════ LEGEND ═══════════════════ */

.hud-legend {
  position: absolute;
  bottom: 24px; left: 248px;
  display: flex; flex-direction: column; gap: 5px;
  font-size: 9.5px;
  letter-spacing: .08em;
  color: var(--dim);
  pointer-events: none;
}

.hud-legend span {
  display: flex; align-items: center; gap: 7px;
}

.hud-legend i {
  width: 5px; height: 5px; border-radius: 50%;
  flex: 0 0 auto;
}

/* ═══════════════════ TOAST ═══════════════════ */

#toast {
  position: absolute;
  bottom: 78px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 8px 16px;
  background: rgba(20,24,31,.96);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold-deep);
  border-radius: 3px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s, transform .24s var(--ease);
  box-shadow: 0 10px 32px rgba(0,0,0,.5);
  z-index: 40;
}
#toast.on { opacity: 1; transform: translateX(-50%); }

/* ═══════════════════ RESPONSIVE ═══════════════════ */

@media (max-width: 1080px) {
  #person { width: 290px; }
  .nn { padding: 0 10px; }
  .hud-hint { display: none; }
}

@media (max-width: 820px) {
  .hud-id { top: 14px; left: 16px; }
  .hud-sub { display: none; }
  .hud-nums { top: 12px; right: 16px; }
  .nn { padding: 0 8px; }
  .nn-v { font-size: 14px; }
  .hud-clock { padding-left: 10px; font-size: 10px; }

  #roster {
    left: 16px; top: 54px; bottom: 70px;
    width: 30px;
  }
  #roster .ro-body,
  #roster .ro-foot,
  #roster .ro-head > span { display: none; }
  #roster #ro-toggle { transform: rotate(180deg); margin: 0 auto; }
  #roster.open { width: 200px; }
  #roster.open .ro-body,
  #roster.open .ro-foot,
  #roster.open .ro-head > span { display: block; }
  #roster.open #ro-toggle { transform: none; }

  #person {
    left: 16px; right: 16px;
    width: auto;
    top: auto;
    bottom: 68px;
    max-height: 52vh;
  }

  .hud-cam { bottom: 16px; }
  .hud-legend { display: none; }
  .p-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .nn-k { font-size: 7.5px; }
  .nn-v { font-size: 13px; }
  .nn:nth-child(3) { display: none; }
  .hud-clock { display: none; }
  .p-name { font-size: 17px; }
}

/* ═══════════════════ AKSESIBILITAS ═══════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* ═══════════════════ REFINEMENT VISUAL V2 ═══════════════════ */
@media (max-height: 640px) {
  #roster { bottom: 76px; }
  .ro-foot { display: none; }
  .hud-legend { bottom: 18px; }
  #person { top: 54px; max-height: calc(100vh - 118px); }
}

@media (max-width: 1080px) {
  .hud-legend { left: 236px; }
}

@media (max-width: 820px) {
  .hud-legend { display: none; }
  #roster { padding: 0; background: transparent; border: 0; backdrop-filter: none; }
}

/* ═══════════ PROFIL LENGKAP + PORTRAIT (tahap layout Jepang) ═══════════ */
.p-top { align-items: flex-start; }
.p-portrait {
  width: 84px; height: 84px;
  border-radius: 6px;
  border: 1px solid rgba(201,164,92,.45);
  box-shadow: 0 8px 24px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.05);
  overflow: hidden; flex: 0 0 auto; background: #141A22;
}
.p-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-meta {
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  color: #A9B4C4; margin: 3px 0 0; line-height: 1.4;
}
.p-list { margin: 0; padding-left: 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.p-list li { margin: 2px 0; }
.p-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.p-chip {
  font-size: 10px; font-weight: 600; letter-spacing: .02em;
  padding: 4px 8px; border-radius: 999px;
  color: #EBD29A; background: rgba(201,164,92,.12);
  border: 1px solid rgba(201,164,92,.35); line-height: 1.3;
}
.p-chip.tool { color: #A5E4EF; background: rgba(77,212,232,.10); border-color: rgba(77,212,232,.32); }

/* Roster: avatar kecil + kanji */
.ro-item { gap: 7px; }
.ro-ava {
  width: 30px; height: 30px; border-radius: 6px; overflow: hidden;
  flex: 0 0 auto; background: #1A2029; border: 1px solid rgba(255,255,255,.10);
  display: grid; place-items: center;
}
.ro-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ro-item.off .ro-ava img { filter: grayscale(.8); opacity: .55; }
.ro-kanji { color: var(--gold-deep); font-weight: 700; font-size: 11px; }

@media (max-width: 820px) {
  .p-portrait { width: 72px; height: 72px; }
}


/* ═══════════════════ KONTROL CUACA & WAKTU ═══════════════════ */
.hud-env {
  position: absolute;
  right: 24px; bottom: 62px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  pointer-events: auto;
}
.env-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0; 
  color: var(--gold-mid);
  background: rgba(14,18,24,.78);
  border: 1px solid rgba(201,164,92,.32);
  padding: 5px 8px; border-radius: 3px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.env-actions {
  display: flex; gap: 2px; padding: 3px;
  background: rgba(20,24,31,.88);
  border: 1px solid var(--line); border-radius: 5px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.ebtn {
  min-width: 44px; height: 26px; padding: 0 8px;
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  color: var(--dim); border-radius: 3px;
}
.ebtn:hover { color: var(--bone); background: rgba(255,255,255,.06); }
.ebtn[aria-pressed="true"] { color: var(--gold); background: rgba(255,179,71,.12); }
@media (max-width: 820px) {
  .hud-env { right: 16px; bottom: 60px; }
  .env-label { font-size: 8.5px; padding: 4px 6px; }
  .ebtn { min-width: 39px; height: 25px; padding: 0 6px; font-size: 9px; }
}
@media (max-width: 480px) {
  .hud-env { bottom: 58px; }
  .env-actions { transform: scale(.94); transform-origin: bottom right; }
}

/* ═══════════ HASIL KERJA + KONTRAS HUD (patch keterbacaan) ═══════════ */
.hud-nums {
  background: rgba(10,12,16,.80);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 12px;
  padding: 8px 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}
.nn-btn { background: transparent; border: 0; border-left: 1px solid var(--line-soft); cursor: pointer; text-align: left; font: inherit; }
.nn-btn:hover .nn-v, .nn-btn:focus-visible .nn-v { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }
.hud-id { background: rgba(10,12,16,.74); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; padding: 7px 12px 7px 8px; backdrop-filter: blur(10px); width: fit-content; }
.hud-legend, .hud-hint { background: rgba(10,12,16,.74); border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 8px 10px; backdrop-filter: blur(8px); color: #D8D2C6; }
#results {
  position: absolute; top: 78px; right: 24px; width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 155px); overflow: auto; z-index: 40;
  background: rgba(12,15,20,.97); color: var(--bone);
  border: 1px solid rgba(201,164,92,.35); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45); padding: 16px;
}
.rs-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rs-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.rs-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
#rs-close { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--bone); cursor: pointer; flex: 0 0 auto; }
.rs-note { margin: 12px 0; padding: 10px 12px; border: 1px solid rgba(201,164,92,.25); background: rgba(201,164,92,.08); border-radius: 10px; font-size: 12px; line-height: 1.55; color: #EDE6D6; }
.rs-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; background: rgba(255,255,255,.025); }
.rs-title { font-weight: 750; line-height: 1.35; }
.rs-meta { color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.5; }
.rs-sum { white-space: pre-wrap; font-size: 12.5px; line-height: 1.6; margin-top: 8px; color: #E8E4DC; max-height: 190px; overflow: auto; }
.rs-files { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.rs-file { color: #0A0C10; background: var(--gold-mid); border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 750; text-decoration: none; }
.rs-file:hover { background: var(--gold-hi); }
.rs-verdict { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(77,212,232,.16); color: #9BE7F5; font-size: 10px; font-weight: 800; letter-spacing: .04em; vertical-align: 2px; }
@media (max-width: 760px) { #results { top: 122px; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 195px); } }

/* Langit pengaman di belakang canvas: terlihat bila renderer/scene background transparan */
body { background: linear-gradient(180deg, #1E6FD9 0%, #5FA8E8 34%, #BFE3F5 68%, #FFE9B8 100%); }
#scene { background: transparent; }

/* SKY-CSS-FALLBACK: gradasi langit di belakang canvas */
html, body { background: linear-gradient(180deg,#1E6FD9 0%,#5FA8E8 34%,#BFE3F5 68%,#FFE9B8 100%) !important; }

/* Kontras teks sekunder: jabatan roster & agent belum aktif tidak tenggelam */
.ro-title { color: #B8B2A6; }
.ro-item.off .ro-name { opacity: .72; }
.ro-item.off .ro-title { opacity: .62; color: #CFC9BC; }
.ro-div { color: #C9BFA9; }

/* Langit pengaman di belakang canvas: terlihat bila renderer/scene background transparan */
body { background: linear-gradient(180deg, #1E6FD9 0%, #5FA8E8 34%, #BFE3F5 68%, #FFE9B8 100%); }
#scene { background: transparent; }

/* Langit pengaman di belakang canvas: terlihat bila renderer/scene background transparan */
body { background: linear-gradient(180deg, #1E6FD9 0%, #5FA8E8 34%, #BFE3F5 68%, #FFE9B8 100%); }
#scene { background: transparent; }

/* ═══════════════════════════════════════════════════════════════════
   AUREVA REALISTIS V3 — polish UI/UX (2026-10-29)
   Prinsip: satu lapisan visual final yang rapi di atas warisan lama.
   Palet tetap void navy + sodium gold dari logo asli Aureva.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Shell: sudut konsisten, bayangan berlapis, fokus keyboard jelas */
#roster, #person, #results, .hud-id, .hud-nums, .hud-cam, .env-actions,
.env-label, .hud-legend, .hud-hint { border-radius: 14px; }
#person, #results { border-radius: 18px; }
#roster {
  width: 248px; padding: 12px 10px 11px;
  background: linear-gradient(180deg, rgba(16,20,27,.90), rgba(10,13,18,.84));
  border: 1px solid rgba(232,205,146,.16);
  box-shadow: 0 18px 48px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.05);
}
.ro-head { padding: 2px 4px 10px; }
.ro-head > span {
  font-size: 10px; letter-spacing: .14em; color: #CDBE9B;
  display: flex; align-items: center; gap: 8px;
}
.ro-head > span::after {
  content: ''; height: 1px; flex: 1;
  background: linear-gradient(90deg, rgba(201,164,92,.45), transparent);
}
#ro-toggle {
  width: 26px; height: 26px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04);
  display: grid; place-items: center;
}
#ro-toggle:hover { border-color: rgba(201,164,92,.5); }

/* ── Roster: avatar terasa seperti daftar orang, bukan menu teks */
.ro-div {
  font-size: 9px; letter-spacing: .15em; color: #D8C9A3;
  padding: 14px 6px 7px; display: flex; align-items: center; gap: 8px;
}
.ro-div::after {
  content: ''; height: 1px; flex: 1;
  background: linear-gradient(90deg, rgba(255,255,255,.10), transparent);
}
.ro-item {
  gap: 10px; padding: 7px 8px; border-radius: 12px; margin: 2px 0;
  border: 1px solid transparent;
  transition: background .16s, border-color .16s, transform .16s;
}
.ro-item:hover { background: rgba(255,255,255,.055); transform: translateX(2px); }
.ro-item.on {
  background: linear-gradient(90deg, rgba(201,164,92,.18), rgba(201,164,92,.06));
  border-color: rgba(201,164,92,.34);
  box-shadow: inset 3px 0 0 var(--gold-deep);
}
.ro-ava {
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 6px 16px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.10);
  position: relative; overflow: hidden; flex: 0 0 auto;
}
.ro-ava::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.13), transparent 46%);
  pointer-events: none;
}
.ro-item .ro-dot {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; box-shadow: 0 0 0 3px rgba(10,12,16,.55);
}
.ro-name { font-size: 12.5px; font-weight: 680; color: #F2EEE4; }
.ro-title { font-size: 10px; color: #B9B2A4; padding-right: 14px; }
.ro-kanji {
  font-size: 10px; padding: 1px 5px; margin-left: 3px; border-radius: 999px;
  color: #EBD29A; background: rgba(201,164,92,.13);
  border: 1px solid rgba(201,164,92,.28); vertical-align: 1px;
}
.ro-foot {
  margin: 8px 4px 0; padding: 9px 10px; border-radius: 10px;
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06);
  color: #B9B2A4; font-size: 10px;
}

/* ── Kartu orang: hero portrait + identitas manusia */
#person {
  width: 342px; padding: 0 0 20px; overflow-x: hidden;
  background: linear-gradient(180deg, rgba(24,29,38,.97), rgba(15,18,24,.96));
  border: 1px solid rgba(232,205,146,.22);
  box-shadow: 0 28px 72px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.06);
}
#person::before { left: 0; right: 0; height: 3px; border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-hi), transparent); }
#p-close {
  top: 12px; right: 12px; z-index: 3; width: 30px; height: 30px;
  border-radius: 999px; background: rgba(9,11,15,.58);
  border: 1px solid rgba(255,255,255,.14); color: #EDE8DB;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.p-top {
  display: block; position: relative; margin: 0 0 14px; padding: 0;
}
.p-portrait {
  width: 100%; height: 218px; border: 0; border-radius: 0;
  background: #141A22; box-shadow: none; display: block;
}
.p-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.p-portrait::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 58%;
  background: linear-gradient(180deg, transparent, rgba(12,15,20,.88));
  pointer-events: none;
}
.p-headtxt {
  position: absolute; left: 18px; right: 48px; bottom: 13px; z-index: 2;
}
.p-name { font-size: 24px; letter-spacing: -.03em; color: #FFF9EA; text-shadow: 0 2px 14px rgba(0,0,0,.55); }
.p-role { color: #EBD29A; font-size: 10px; letter-spacing: .13em; }
.p-meta { color: rgba(240,236,226,.78); font-size: 10.5px; margin-top: 4px; }
#person .p-now, #person .p-row, #person .p-stats { margin-left: 18px; margin-right: 18px; }
.p-now {
  border: 1px solid rgba(255,179,71,.24); border-left: 3px solid var(--work);
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.p-k { color: #9B9484; font-size: 8px; letter-spacing: .16em; margin-bottom: 5px; }
.p-v { font-size: 12.5px; color: #C9C2B2; line-height: 1.65; }
.p-list { font-size: 12px; color: #C9C2B2; }
.p-list li::marker { color: var(--gold-deep); }
.p-chips { gap: 6px; }
.p-chip {
  border-radius: 999px; padding: 5px 9px; font-size: 10px;
  background: rgba(201,164,92,.10); box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.p-stats { border-radius: 12px; border-color: rgba(255,255,255,.07); }
.p-stat { padding: 11px 6px; background: rgba(255,255,255,.025); }
.p-stat b { font-size: 16px; color: #FFF6DE; }
.p-stat span { color: #96907F; }
.p-hist-item {
  border-radius: 10px; margin-bottom: 6px; padding: 9px 11px;
  background: rgba(255,255,255,.028); border: 1px solid rgba(255,255,255,.05);
  border-left: 3px solid var(--line);
}

/* ── HUD atas: lebih seperti bilah kendali kantor hidup */
.hud-id {
  top: 16px; left: 18px; padding: 8px 14px 8px 9px;
  background: linear-gradient(180deg, rgba(18,22,29,.88), rgba(10,13,18,.80));
  border-color: rgba(232,205,146,.18);
  box-shadow: 0 14px 36px rgba(0,0,0,.34);
}
.hud-mark { width: 34px; height: 34px; border-radius: 10px; }
.hud-word { font-size: 16px; color: #F3E7C8; }
.hud-sub { color: #A79E8B; }
.hud-nums {
  top: 16px; right: 18px; padding: 9px 8px;
  background: linear-gradient(180deg, rgba(18,22,29,.88), rgba(10,13,18,.80));
  border-color: rgba(255,255,255,.10);
  box-shadow: 0 14px 36px rgba(0,0,0,.34);
}
.nn { padding: 0 13px; }
.nn-k { color: #9A937F; font-size: 8px; }
.nn-v { font-size: 18px; color: #FFF6DE; }
.hud-clock { color: #CFC7B2; }
.nn-btn { border-radius: 8px; }
.nn-btn:hover { background: rgba(201,164,92,.10); }

/* ── Kontrol kamera/cuaca: tombol sentuh nyaman */
.hud-cam { bottom: 22px; padding: 5px; gap: 4px;
  background: linear-gradient(180deg, rgba(22,27,35,.92), rgba(13,16,21,.90));
  box-shadow: 0 16px 40px rgba(0,0,0,.42); }
.cbtn { width: 38px; height: 36px; border-radius: 9px; }
.cbtn svg { width: 17px; height: 17px; }
.cbtn:hover { background: rgba(255,255,255,.07); }
.cbtn[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(255,179,71,.28); }
.hud-env { right: 18px; bottom: 66px; }
.env-label { border-radius: 999px; padding: 6px 10px; }
.env-actions { padding: 4px; gap: 3px; }
.ebtn { min-width: 48px; height: 30px; border-radius: 8px; font-size: 10.5px; }
.ebtn[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(255,179,71,.25); }
.hud-legend { left: 282px; bottom: 22px; border-radius: 12px; }
.hud-hint { bottom: 22px; right: 18px; border-radius: 12px; }

/* ── Boot: logo asli tetap hero, status lebih tenang */
#boot { background:
  radial-gradient(760px 480px at 50% 32%, rgba(201,164,92,.13), transparent 68%),
  radial-gradient(900px 600px at 50% 88%, rgba(77,141,255,.07), transparent 70%),
  var(--void); }
.b-track { width: 176px; height: 2px; border-radius: 999px; }

/* ── Toast & hasil kerja */
#toast { border-radius: 999px; padding: 9px 16px; }
#results { top: 76px; }
.rs-file { transition: transform .14s, background .14s; }
.rs-file:hover { transform: translateY(-1px); }

/* ── Gerak UI hanya sebagai respons aksi (bukan dekorasi liar) */
.ro-item:active { transform: translateX(1px) scale(.995); }
.cbtn:active, .ebtn:active, .nn-btn:active { transform: scale(.97); }

/* ── Tablet */
@media (max-width: 1080px) {
  #person { width: 322px; }
  .hud-legend { left: 272px; }
  .p-portrait { height: 202px; }
}

/* ── Mobile: roster menjadi laci avatar, kartu orang bottom-sheet */
@media (max-width: 820px) {
  .hud-id { top: 10px; left: 10px; padding: 6px 10px 6px 7px; }
  .hud-nums { top: 10px; right: 10px; padding: 7px 4px; }
  .nn { padding: 0 8px; }
  #roster {
    left: 10px; top: 62px; bottom: auto; width: 52px; max-height: calc(100vh - 150px);
    padding: 7px 5px; background: linear-gradient(180deg, rgba(16,20,27,.92), rgba(10,13,18,.86));
    border: 1px solid rgba(232,205,146,.16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  #roster .ro-head { justify-content: center; padding-bottom: 5px; border: 0; }
  #roster.open { width: min(248px, calc(100vw - 20px)); padding: 12px 10px 11px; }
  #roster.open .ro-head { justify-content: space-between; }
  #person {
    left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 62vh;
    border-radius: 20px; padding-bottom: 16px;
  }
  #person::before { border-radius: 20px 20px 0 0; }
  .p-portrait { height: 178px; }
  .p-headtxt { left: 15px; right: 42px; bottom: 11px; }
  .p-name { font-size: 21px; }
  #person .p-now, #person .p-row, #person .p-stats { margin-left: 15px; margin-right: 15px; }
  .hud-cam { bottom: 12px; }
  .hud-env { right: 10px; bottom: 58px; }
  #results { top: 108px; }
}
@media (max-width: 480px) {
  .p-portrait { height: 164px; }
  .p-stats { grid-template-columns: repeat(4, 1fr); }
  .p-stat { padding: 8px 2px; }
  .p-stat b { font-size: 13px; }
  .p-stat span { font-size: 6.5px; letter-spacing: .06em; }
  .hud-hint { display: none; }
}

/* ═══ FINAL OVERLAP GUARD (2026-10-29): panel orang di atas kontrol ═══ */
#person { z-index: 30; }
.hud-env { z-index: 12; }
.hud-hint { z-index: 12; max-width: 240px; }
#toast { z-index: 45; }
@media (min-width: 821px) {
  /* Saat kartu orang terbuka di desktop, cuaca & hint mundur ke kiri kartu
     agar tidak menutupi teks. Kartu lebar 342 + margin kanan 20. */
  body:has(#person:not([hidden])) .hud-env { right: 378px; }
  body:has(#person:not([hidden])) .hud-hint { display: none; }
  body:has(#person:not([hidden])) .hud-cam { left: calc(50% - 130px); }
}
@media (max-width: 820px) {
  body:has(#person:not([hidden])) .hud-env,
  body:has(#person:not([hidden])) .hud-hint { display: none; }
}
