/* ============================================================
   BUBUHAN JERUK MANIS 3D — UI overlay stylesheet
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: "Courier New", ui-monospace, monospace;
  background: #191d27;
  color: #e9ecef;
}

#c3d {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
}
#c3d:active { cursor: grabbing; }

/* ---------------- loading ---------------- */
#loading {
  position: fixed; inset: 0;
  background: #191d27;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
#loading.hidden { display: none; }
.ld-box {
  background: #141420;
  border: 4px solid #ffd43b;
  box-shadow: 6px 6px 0 rgba(0,0,0,.4);
  padding: 22px 30px;
  text-align: center;
  color: #ffd43b;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
  animation: ldpulse 1.2s ease-in-out infinite;
}
.ld-box small { display: block; margin-top: 8px; color: #8b95a5; font-size: 11px; font-weight: normal; letter-spacing: 0; }
@keyframes ldpulse { 50% { transform: scale(.97); } }

/* ---------------- hud atas ---------------- */
.hud-top {
  position: fixed; top: 12px; left: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: flex-start;
  z-index: 30; pointer-events: none;
}
.sign3d {
  background: #141420;
  border: 4px solid #ffd43b;
  box-shadow: 4px 4px 0 rgba(0,0,0,.4);
  padding: 8px 14px;
  pointer-events: auto;
}
.sign3d b { color: #ffd43b; font-size: 17px; letter-spacing: 1px; display: block; }
.sign3d small { color: #8b95a5; font-size: 11px; display: block; margin-top: 3px; }
.sign3d #clock3d { color: #7cfc98; }

.viewbtns { display: flex; gap: 8px; pointer-events: auto; }
.vbtn {
  background: #141420;
  border: 3px solid #5f6d8c;
  box-shadow: 3px 3px 0 rgba(0,0,0,.4);
  color: #e9ecef;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 12px;
  font-weight: bold;
  padding: 8px 12px;
  cursor: pointer;
}
.vbtn:hover { border-color: #ffd43b; color: #ffd43b; }
.vbtn.active { border-color: #ffd43b; color: #ffd43b; }

/* ---------------- tombol musik ---------------- */
.bgm-btn {
  position: fixed; left: 12px; bottom: 12px;
  z-index: 55;
  background: #141420;
  border: 3px solid #5f6d8c;
  box-shadow: 3px 3px 0 rgba(0,0,0,.4);
  color: #ffd43b;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 12px;
  font-weight: bold;
  padding: 8px 12px;
  cursor: pointer;
}
.bgm-btn:hover { border-color: #ffd43b; }

/* ---------------- speech bubble 3D (proyeksi HTML) ---------------- */
#bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
.bub3d {
  position: absolute;
  transform: translate(-50%, -100%);
  background: #fff;
  border: 2px solid #12141c;
  color: #212529;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 9px;
  white-space: nowrap;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
}
.bub3d::after {
  content: "";
  position: absolute; bottom: -7px; left: 50%;
  width: 9px; height: 9px;
  background: inherit;
  border-right: 2px solid #12141c;
  border-bottom: 2px solid #12141c;
  transform: translateX(-50%) rotate(45deg);
}
.bub3d .bnm { display: block; font-size: 10px; color: #6c757d; font-weight: normal; }
.bub3d.st-working { background: #fff9db; }
.bub3d.st-success { background: #d3f9d8; }
.bub3d.st-error   { background: #ffe3e3; }
.bub3d.st-stuck   { background: #ffd8a8; }
.bub3d.st-bolos   { background: #d0ebff; }
.bub3d.st-panic   { background: #ffc9c9; }
.bub3d.st-walk    { background: #e7f5ff; }

/* ---------------- toasts ---------------- */
#toasts {
  position: fixed; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 60; max-width: 360px;
}
.toast {
  background: rgba(20,23,32,.94);
  border: 2px solid #12141c;
  border-left: 6px solid #4dabf7;
  color: #e9ecef;
  font-size: 13px;
  padding: 10px 13px;
  box-shadow: 4px 4px 0 rgba(0,0,0,.4);
  animation: toastin .22s ease-out;
}
.toast.t-ok   { border-left-color: #38d9a9; }
.toast.t-err  { border-left-color: #ff6b6b; }
.toast.t-warn { border-left-color: #ffd43b; }
.toast.out { opacity: 0; transform: translateX(14px); transition: all .3s; }
@keyframes toastin { from { transform: translateX(40px); opacity: 0; } }

/* ---------------- modal ---------------- */
#modal {
  position: fixed; inset: 0;
  background: rgba(8,10,16,.62);
  display: flex; align-items: center; justify-content: center;
  z-index: 70; padding: 18px;
}
#modal.hidden { display: none; }
.modal-card {
  width: min(600px, 94vw);
  background: #1b2030;
  border: 4px solid #12141c;
  box-shadow: 8px 8px 0 rgba(0,0,0,.5);
  padding: 18px 20px;
}
.md-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.md-head h3 { font-size: 20px; color: #ffd43b; }
.md-head .rl { color: #8b95a5; font-size: 12px; }
#md-close {
  background: #2b3242; color: #e9ecef;
  border: 2px solid #454f63;
  width: 32px; height: 32px; cursor: pointer; font-size: 14px;
}
#md-close:hover { background: #ff6b6b; color: #fff; }
.md-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.md-meta div { background: #151a26; border: 2px solid #2c3444; padding: 7px 9px; }
.md-meta small { display: block; color: #6c788c; font-size: 10px; letter-spacing: 1px; }
.md-meta span { display: block; font-size: 13px; margin-top: 3px; }
.md-meta .cmd { font-size: 11px; word-break: break-all; color: #74c0fc; }
.md-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.md-stats[hidden] { display: none; }
.md-stats .chip {
  background: #151a26; border: 2px solid #2c3444;
  padding: 6px 10px; font-size: 12px; color: #dfe6ee;
}
.md-stats .chip.ok   { border-color: #38d9a9; }
.md-stats .chip.warn { border-color: #ffd43b; }
.md-stats .chip.err  { border-color: #ff6b6b; }
.md-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.md-table th {
  text-align: left; color: #6c788c;
  font-size: 10px; letter-spacing: 1px;
  border-bottom: 2px solid #2c3444; padding: 5px 6px;
}
.md-table td { padding: 5px 6px; border-bottom: 1px solid #232937; color: #dfe6ee; }
.md-table .ok  { color: #38d9a9; font-weight: bold; }
.md-table .err { color: #ff6b6b; font-weight: bold; }
.md-table .note { color: #8b95a5; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- responsif kecil ---------------- */
@media (max-width: 700px) {
  .hud-top { flex-direction: column; gap: 8px; }
  .sign3d b { font-size: 14px; }
  .viewbtns { flex-wrap: wrap; }
  .toast { font-size: 12px; }
}
/* =========================
   BUTTON KEMBALI KE 2D
========================= */

.back-2d-btn {
    position: fixed;
    left: 12px;
    bottom: 62px;
    z-index: 9999;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 12px;

    background: #141420;
    border: 3px solid #5f6d8c;
    box-shadow: 3px 3px 0 rgba(0,0,0,.4);

    color: #ffd43b;
    font-family: "Courier New", monospace;
    font-size: 12px;
    font-weight: bold;

    text-decoration: none;
    white-space: nowrap;
    transition: .2s ease;
}

.back-2d-btn:hover {
    border-color: #ffd43b;
    background: #25283a;
    color: #fff;
    transform: translateY(-2px);
}