:root {
  --ink: #000000;
  --panel: #16141c;
  --panel-2: #1d1b25;
  --line: #322e3c;
  --gold: #e8c468;
  --gold-dim: #b89a4e;
  --blood: #c4555e;
  --teal: #6fae9a;
  --amber: #d8924a;
  --text: #ece7f2;
  --muted: #8a8593;
  --muted-2: #5e5868;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
}

#app {
  position: relative;
  width: 100vw;
  min-height: 100vh;
}

#game-root {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#game-root canvas {
  display: block;
}

/* #ui-root mengalir natural; bila konten lebih tinggi dari layar,
   halaman (body) yang scroll — berlaku di semua ukuran termasuk laptop */
#ui-root {
  position: relative;
  min-height: 100vh;
  pointer-events: none;
  margin: auto;
  display: flex;
  flex-direction: column;
}

/* ---------------- HUD ---------------- */
.hud {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  background: linear-gradient(180deg, rgba(8, 8, 14, 0.9), rgba(8, 8, 14, 0));
  z-index: 10;
}

.hud-day {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--gold);
}

.hud-day b {
  font-size: 24px;
}

.hud-day small {
  color: var(--muted);
  font-size: 12px;
}

.hud-meters {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hud-meter label {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 3px;
}

.hud-meter .bar {
  width: 150px;
  height: 8px;
  background: #211e29;
  border-radius: 5px;
  overflow: hidden;
}

.hud-meter .bar span {
  display: block;
  height: 100%;
  transition: width .4s;
}

.hud-meter .bar span.good {
  background: linear-gradient(90deg, #3f7a6c, var(--teal));
}

.hud-meter .bar span.warn {
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
}

.hud-meter .bar span.bad {
  background: linear-gradient(90deg, #7a3b41, var(--blood));
}

.hud-stat {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 15px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
}

.hud-stat .ico {
  opacity: .8;
  margin-right: 3px;
}

#hud-infections b {
  color: var(--blood);
}

#hud-score b {
  color: var(--teal);
}


/* ---------------- Overlay cards ---------------- */
.overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 10, 0);
  transition: background .3s;
  opacity: 0;
}

.overlay.show {
  pointer-events: auto;
  opacity: 1;
  background: rgba(5, 6, 10, .72);
}

.oc-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 30px;
  max-width: 440px;
  text-align: center;
  animation: pop .35s ease;
}

@keyframes pop {
  from {
    transform: scale(.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.oc-card.oc-correct {
  border-top: 3px solid var(--teal);
}

.oc-card.oc-wrong {
  border-top: 3px solid var(--blood);
}

.oc-verdict {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--muted);
}

.oc-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 26px;
  margin: 4px 0 12px;
}

.oc-reveal {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.cond-terinfeksi {
  color: var(--blood);
}

.cond-sehat {
  color: var(--teal);
}

.oc-truth {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 12px;
}

.oc-flag {
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.oc-flag.danger {
  background: rgba(196, 85, 94, .16);
  color: var(--blood);
}

.oc-log {
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 14px;
}

.oc-judge {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 16px;
}

.oc-correct .oc-judge {
  color: var(--teal);
}

.oc-wrong .oc-judge {
  color: var(--blood);
}

.oc-next,
.end-btn {
  cursor: pointer;
  background: var(--gold);
  color: #1a1406;
  border: none;
  border-radius: 28px;
  padding: 12px 36px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1px;
  transition: .12s;
}

.oc-next:hover,
.end-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.day-card {
  text-align: center;
  animation: pop .35s ease;
}

.day-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 56px;
  color: var(--gold);
  letter-spacing: 4px;
}

.day-sub {
  font-size: 15px;
  color: var(--muted);
  margin: 8px 0 22px;
}

/* ---------------- Toast ---------------- */
.toast {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel-2);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------------- End screen ---------------- */
.end-screen {
  pointer-events: auto;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 38px 6vw;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.end-tier {
  font-size: 26px;
  color: var(--gold);
  letter-spacing: 6px;
}

.end-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 44px;
  margin: 8px 0 12px;
  letter-spacing: 1px;
  text-align: center;
}

.end-summary {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 640px;
  text-align: center;
}

.end-stats {
  display: flex;
  gap: 22px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: center;
}

.end-stats b {
  color: var(--gold);
  font-family: 'Syne', sans-serif;
  font-size: 17px;
}

.recap-label {
  margin: 30px 0 12px;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--muted-2);
}

.recap {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recap-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 10px;
  border-left: 3px solid var(--muted);
}

.recap-row.ok {
  border-left-color: var(--teal);
}

.recap-row.bad {
  border-left-color: var(--blood);
}

.recap-av {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex: none;
  background: var(--c, #555);
  display: grid;
  place-items: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #11101a;
}

.recap-info {
  flex: 1;
}

.recap-name {
  font-weight: 700;
  font-size: 14px;
}

.recap-meta {
  font-size: 11.5px;
  color: var(--muted);
}

.recap-judge {
  font-size: 20px;
  font-weight: 800;
}

.recap-row.ok .recap-judge {
  color: var(--teal);
}

.recap-row.bad .recap-judge {
  color: var(--blood);
}

.end-btn {
  margin-top: 28px;
}


/* ================= VN LAYOUT ================= */

/* HUD FSM chips */
.hud-fsms {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fsm-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 11px;
  min-width: 96px;
}

.fsm-chip label {
  display: block;
  font-size: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted-2);
}

.fsm-chip b {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
}

.b-normal b {
  color: var(--teal);
}

.b-waspada b {
  color: var(--gold);
}

.b-lockdown b {
  color: var(--amber);
}

.b-chaos b {
  color: var(--blood);
}

.b-evakuasi b {
  color: #7fb0d8;
}

.t-kooperatif b {
  color: var(--teal);
}

.t-ragu b {
  color: var(--gold);
}

.t-panik b {
  color: var(--amber);
}

.t-hostile b {
  color: var(--blood);
}

.hud-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 11px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
}

.hud-stat span {
  opacity: .8;
  margin-right: 3px;
}

#hud-infections b {
  color: var(--blood);
}

#hud-score b {
  color: var(--teal);
}

/* Panggung VN: karakter tengah + papan petunjuk kanan */
.vn-stage {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 0;
  padding: 4px 22px 0;
}

.vn-char-wrap {
  pointer-events: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  z-index: 5;
}

/* ===== FIX UTAMA: tinggi pakai clamp, TIDAK bergantung tinggi parent ===== */
.vn-char {
  width: auto;
  height: clamp(280px, 55vh, 650px);
  max-height: 650px;
  aspect-ratio: 3 / 4;
  /* jaga rasio 600x800 agar tidak gepeng */
  max-width: 90vw;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 110px;
  color: #fff;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, .6));
  transition: filter .3s;
}

/* Kalau di dalam .vn-char ada <img> (gambar karakter) */
.vn-char img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom center;
}

.vn-char.is-placeholder {
  box-shadow: inset 0 -60px 80px rgba(0, 0, 0, .5);
  opacity: .92;
}

.vn-char.shake {
  animation: charShake .4s;
}

@keyframes charShake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

.vn-nameplate {
  pointer-events: auto;
  margin-top: -2px;
  text-align: center;
  background: linear-gradient(180deg, rgba(22, 20, 28, .96), rgba(16, 14, 20, .96));
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold-dim);
  border-radius: 0 0 12px 12px;
  padding: 6px 22px;
}

.vn-nameplate b {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  color: var(--gold);
  display: block;
}

.vn-nameplate span {
  font-size: 11px;
  color: var(--muted);
}

/* indikator sikap (DemeanorFSM) di atas karakter */
.vn-demeanor {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(12, 12, 18, .85);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 14px 5px 10px;
  font-size: 12px;
  margin-bottom: 8px;
  backdrop-filter: blur(3px);
}

.vn-demeanor .dm-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.vn-demeanor b {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
}

.dm-calm .dm-dot {
  background: var(--teal);
}

.dm-calm b {
  color: var(--teal);
}

.dm-def .dm-dot {
  background: var(--gold);
}

.dm-def b {
  color: var(--gold);
}

.dm-evade .dm-dot {
  background: var(--amber);
}

.dm-evade b {
  color: var(--amber);
}

.dm-open .dm-dot {
  background: #7fb0d8;
}

.dm-open b {
  color: #7fb0d8;
}

.dm-rebel .dm-dot {
  background: var(--blood);
}

.dm-rebel b {
  color: var(--blood);
}

/* papan petunjuk (kanan atas, mengambang) */
.clue-board {
  pointer-events: auto;
  position: absolute;
  top: 6px;
  right: 22px;
  width: 290px;
  max-height: 52vh;
  display: flex;
  flex-direction: column;
  z-index: 6;
  background: rgba(12, 12, 18, .84);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(3px);
}

.clue-board-title {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--muted-2);
  padding: 10px 14px 6px;
  border-bottom: 1px solid var(--line);
}

.clue-list {
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.clue-list::-webkit-scrollbar {
  width: 6px;
}

.clue-list::-webkit-scrollbar-thumb {
  background: #2a2733;
  border-radius: 3px;
}

/* ===== Checklist pemeriksaan ===== */
.clue {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border-radius: 8px;
  padding: 9px 10px;
  border-left: 3px solid var(--muted-2);
  background: var(--panel);
  transition: opacity .25s, border-color .25s;
}

/* baris belum diperiksa: redup */
.clue.pending {
  background: var(--panel);
  border-left-color: var(--line);
  opacity: .55;
}

/* baris sudah ditanya tapi netral (tak ada temuan): centang abu-abu */
.clue.asked {
  border-left-color: var(--muted-2);
  opacity: .85;
}

.clue.asked .clue-check {
  border: none;
  background: var(--muted-2);
  color: #16141c;
}

.clue.asked .clue-sig {
  color: var(--muted-2);
}

/* kotak centang */
.clue-check {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #16141c;
  font-weight: 800;
  border: 1.5px solid var(--muted-2);
  background: transparent;
}

.clue.done .clue-check {
  border: none;
}

.clue.done.sig-clean .clue-check {
  background: var(--teal);
}

.clue.done.sig-suspect .clue-check {
  background: var(--blood);
}

.clue.done.sig-neutral .clue-check {
  background: var(--amber);
}

.clue-body {
  flex: 1;
  min-width: 0;
}

.clue-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  margin-bottom: 2px;
}

.clue-probe {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

.clue.pending .clue-probe {
  color: var(--muted);
}

.clue-sig {
  margin-left: auto;
  letter-spacing: 1px;
  font-size: 8.5px;
  color: var(--muted-2);
}

.clue-text {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.clue.pending .clue-text {
  color: var(--muted-2);
  font-style: italic;
}

/* warna aksen per sinyal saat sudah diperiksa */
.clue.done.sig-clean {
  border-left-color: var(--teal);
}

.clue.done.sig-clean .clue-sig {
  color: var(--teal);
}

.clue.done.sig-suspect {
  border-left-color: var(--blood);
}

.clue.done.sig-suspect .clue-sig {
  color: var(--blood);
}

.clue.done.sig-neutral {
  border-left-color: var(--amber);
}

.clue.done.sig-neutral .clue-sig {
  color: var(--amber);
}

/* speech bubble */
.speech {
  pointer-events: auto;
  margin: 0 22px 10px;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(24, 22, 30, .97), rgba(16, 14, 20, .97));
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-dim);
  border-radius: 12px;
  min-height: 72px;
  flex: none;
}

.speech-who {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 4px;
}

.speech-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  min-height: 24px;
}

.speech-text.narr {
  color: var(--muted);
  font-style: italic;
}

/* bottom: actions + verdict */
.vn-bottom {
  pointer-events: none;
  padding: 0 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: none;
}

.action-panel {
  pointer-events: auto;
}

.action-head {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted-2);
  margin-bottom: 7px;
}

.action-head small {
  letter-spacing: 0;
  text-transform: none;
  color: var(--teal);
  margin-left: 4px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.action-btn {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 5px;
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
  transition: .12s;
  position: relative;
}

.action-btn:hover:not(.disabled) {
  border-color: var(--gold);
  background: #211d28;
  transform: translateY(-2px);
}

.action-btn.disabled {
  opacity: .35;
  cursor: not-allowed;
}

.action-btn.used {
  border-color: var(--gold-dim);
  opacity: .82;
}

.ab-ico {
  font-size: 17px;
}

.ab-label {
  text-align: center;
  line-height: 1.05;
}

.ab-done {
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 10px;
  color: var(--gold-dim);
}

.verdict-bar {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.verdict-btn {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  transition: .12s;
}

.verdict-btn small {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 10px;
  opacity: .85;
  letter-spacing: 0;
}

.verdict-btn .vb-ico {
  font-size: 18px;
}

.verdict-btn.accept {
  background: linear-gradient(180deg, #2f6a5c, #1f4a40);
}

.verdict-btn.reject {
  background: linear-gradient(180deg, #7a3b41, #54282d);
}

.verdict-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}


/* =================================================================
   RESPONSIVE — 3 MODE
   ================================================================= */

/* ---------- MODE TABLET / LANDSCAPE KECIL: <= 1000px lebar ---------- */
@media (max-width: 1000px) {
  .vn-stage {
    flex-direction: column;
    align-items: center;
  }

  /* Karakter sedang */
  .vn-char {
    height: clamp(220px, 40vh, 420px);
    font-size: 70px;
  }

  /* Clue board pindah ke bawah karakter (tidak lagi melayang) */
  .clue-board {
    position: static;
    width: 100%;
    max-width: 560px;
    max-height: 26vh;
    margin: 10px auto 0;
    right: auto;
    top: auto;
  }

  /* Action 3 kolom */
  .action-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .credit-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
  }
}

/* ---------- MODE HP PENDEK: tinggi <= 500px (HP landscape) ---------- */
@media (max-height: 500px) {
  .hud {
    padding: 8px 14px;
  }

  /* Stage tidak lagi memaksa flex:1 — biarkan konten mengalir & scroll */
  .vn-stage {
    flex: none;
    min-height: auto;
    flex-direction: column;
    align-items: center;
  }

  /* Karakter kecil tetap */
  .vn-char {
    height: 180px;
    font-size: 56px;
  }

  /* Clue board pindah ke bawah, full lebar */
  .clue-board {
    position: static;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0 0 12px;
    right: auto;
    top: auto;
  }

  .speech {
    margin-top: 8px;
    min-height: 52px;
  }

  /* Action 2 kolom */
  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lore-head {
    font-size: 40px;
  }

  .lore-sec h3 {
    font-size: 20px;
  }

  .lore-btn,
  .name-btn,
  .intro-btn {
    scale: 0.9;
  }
}

/* ---------- MODE HP PORTRAIT: <= 480px lebar ---------- */
@media (max-width: 480px) {
  .hud {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .hud-day b {
    font-size: 18px;
  }

  .hud-fsms {
    gap: 6px;
  }

  .fsm-chip {
    min-width: 72px;
    padding: 4px 8px;
  }

  .hud-meter .bar {
    width: 90px;
  }

  .vn-char {
    height: clamp(200px, 32vh, 300px);
    font-size: 60px;
  }

  .speech {
    margin: 0 10px 8px;
    padding: 10px 14px;
  }

  .speech-text {
    font-size: 13px;
  }

  .action-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .action-btn {
    padding: 8px 4px;
    font-size: 9.5px;
  }

  .verdict-bar {
    gap: 8px;
  }

  .verdict-btn {
    padding: 10px;
    font-size: 13px;
  }

  .vn-bottom {
    padding: 0 10px 12px;
    gap: 8px;
  }

  .name-title {
    font-size: 24px;
  }

  .end-title {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}


/* ================= NAME / INTRO / CREDIT / END screens ================= */

.name-screen,
.credit-screen {
  pointer-events: auto;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 6vw;
  text-align: center;
}

.name-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 34px;
  color: #f2e6c9;
  letter-spacing: 1px;
}

.name-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 10px 0 26px;
}

.name-input {
  width: 360px;
  max-width: 80vw;
  padding: 14px 18px;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  background: #16141c;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  text-align: center;
  outline: none;
  transition: border-color .15s;
}

.name-input:focus {
  border-color: var(--gold);
}

.name-btn,
.intro-btn,
.credit-btn,
.end-btn {
  margin-top: 24px;
  cursor: pointer;
  background: var(--gold);
  color: #1a1406;
  border: none;
  border-radius: 40px;
  padding: 16px 50px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1.5px;
  transition: .15s;
  box-shadow: 0 4px 15px rgba(232, 196, 104, 0.2);
}

.name-btn:hover,
.intro-btn:hover,
.credit-btn:hover,
.end-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(232, 196, 104, 0.3);
}

.credit-btn {
  background: #16141c;
  color: var(--gold);
  border: 1px solid var(--line);
}

/* intro story */
.intro-screen {
  pointer-events: auto;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 40px 6vw;
  text-align: left;
  background: radial-gradient(circle at center, rgba(20, 20, 24, 0.4) 0%, transparent 70%);
  overflow: hidden;
  position: relative;
}

.intro-viewport {
  width: min(720px, 80vw);
  height: min(64vh, 520px);
  overflow: hidden;
  border-radius: 4px;
  flex: 0 0 auto;
  /* ⟵ viewport tetap ukuran segini, tombol di bawahnya */
}

.intro-track {
  display: flex;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.intro-page {
  flex: 0 0 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 36px 40px;
  position: relative;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(22, 22, 24, 0.94), rgba(12, 12, 14, 0.96));
  border: 1px solid rgba(120, 120, 124, 0.22);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.7);
}

.intro-page::-webkit-scrollbar {
  width: 6px;
}

.intro-page::-webkit-scrollbar-thumb {
  background: rgba(180, 180, 185, 0.14);
  border-radius: 3px;
}

/* teks ketengah vertikal → tidak numpuk di atas */
.intro-page-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* ⟵ ini yang bikin teks ketengah */
  min-height: 100%;
  font-family: 'Special Elite', 'Courier New', monospace;
}

.intro-page-num {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(170, 170, 175, 0.4);
  font-family: 'Courier New', monospace;
}

.intro-p {
  font-size: 19px;
  line-height: 1.7;
  color: #cfcfd4;
  margin: 0;
}

.intro-stamp {
  font-size: 26px;
  color: #f0f0f2;
  letter-spacing: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(180, 180, 185, 0.25);
  padding-bottom: 10px;
  display: inline-block;
}

/* panah navigasi */
.intro-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  line-height: 1;
  color: #d8d8dc;
  background: rgba(10, 10, 12, 0.6);
  border: 1px solid rgba(180, 180, 185, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s, transform .2s, opacity .3s;
  z-index: 5;
}

.intro-nav:hover {
  background: rgba(200, 200, 205, 0.16);
  transform: translateY(-50%) scale(1.08);
}

.intro-nav-prev {
  left: 4vw;
}

.intro-nav-next {
  right: 4vw;
}

.intro-nav.hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-start {
  position: fixed !important;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(10px);
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s, transform .4s;
  z-index: 10;
}

.intro-start.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.intro-stamp {
  font-size: 26px;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(232, 196, 104, 0.3);
  padding-bottom: 10px;
  display: inline-block;
}

.intro-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  line-height: 1;
  color: var(--gold);
  background: rgba(10, 10, 14, 0.55);
  border: 1px solid rgba(232, 196, 104, 0.4);
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s, transform .2s, opacity .3s;
  z-index: 5;
}

.intro-nav:hover {
  background: rgba(232, 196, 104, 0.18);
  transform: translateY(-50%) scale(1.08);
}

.intro-nav-prev {
  left: 4vw;
}

.intro-nav-next {
  right: 4vw;
}

.intro-nav.hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-start {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s, transform .4s;
}

.intro-start.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.credit-head {
  font-family: 'Creepster', cursive;
  font-weight: 800;
  font-size: 60px;
  color: #f2e6c9;
  letter-spacing: 4px;
}

.credit-task {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 12px 0 30px;
}

.credit-task b {
  color: var(--gold);
}

.credit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 820px;
}

.cr-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cr-role {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 6px;
}

.cr-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}

.cr-photo.cr-ph {
  background: #2a2733;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 38px;
  color: var(--gold);
}

.cr-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.cr-nrp {
  font-size: 12px;
  color: var(--muted);
}

.cr-email {
  font-size: 12px;
  color: #7fb0d8;
  word-break: break-all;
}

/* end screen badge + outro */
.end-badge {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 3px;
  padding: 6px 18px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.end-badge.win {
  background: rgba(111, 174, 154, .18);
  color: var(--teal);
}

.end-badge.lose {
  background: rgba(196, 85, 94, .18);
  color: var(--blood);
}

.outro {
  max-width: 680px;
  margin: 28px auto 8px;
  padding: 18px 22px;

  border-left: 3px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .03);

  text-align: left;
  position: relative;
}

.outro::before {
  content: 'EPILOG';
  display: block;

  margin-bottom: 12px;

  font-size: 11px;
  font-weight: 700;
  letter-spacing: .25em;

  color: rgba(255, 255, 255, .45);
}

.outro p {
  margin: 0 0 14px;

  color: #d8d2e3;
  font-size: 15px;
  line-height: 1.85;

  text-wrap: pretty;
}

.outro p:last-child {
  margin-bottom: 0;
}


/* ================= LORE screen ================= */
.lore-screen {
  pointer-events: auto;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 6vw 18px;
}

.lore-head {
  font-family: 'Creepster', cursive;
  font-weight: 800;
  font-size: 60px;
  color: #f2e6c9;
  letter-spacing: 3px;
  margin-bottom: 14px;
}

.lore-scroll {
  flex: 1;
  overflow-y: auto;
  max-width: 760px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 8px;
}

.lore-scroll::-webkit-scrollbar {
  width: 8px;
}

.lore-scroll::-webkit-scrollbar-thumb {
  background: #2a2733;
  border-radius: 4px;
}

.lore-sec h3 {
  font-family: 'Special Elite', cursive;
  font-weight: 700;
  font-size: 25px;
  color: var(--gold);
  margin: 0 0 6px;
}

.lore-sec p {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: #c9c3d2;
  margin: 0 0 8px;
}

.lore-sec b {
  color: #f2e6c9;
}

.lore-note {
  font-size: 12.5px !important;
  color: var(--teal) !important;
  font-style: italic;
}

.lore-sources ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.lore-sources li {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.lore-disc {
  background: rgba(196, 85, 94, .10);
  border: 1px solid rgba(196, 85, 94, .3);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #d8b3b6;
}

.lore-disc b {
  color: var(--blood);
}

.lore-disc-top {
  background: rgba(232, 196, 104, .08);
  border-color: rgba(232, 196, 104, .3);
  color: #d8cba0;
}

.lore-disc-top b {
  color: var(--gold);
}

.lore-btn {
  margin-top: 20px;
  cursor: pointer;
  background: #16141c;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 30px;
  padding: 14px 44px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  transition: .12s;
}

.lore-btn:hover {
  background: var(--gold);
  color: #16141c;
  transform: translateY(-2px);
}


/* ================= Verdict flash + Outbreak ================= */
.overlay.flash {
  background: rgba(5, 6, 10, .55);
}

.flash-card {
  text-align: center;
  animation: pop .25s ease;
}

.flash-ico {
  font-size: 52px;
  margin-bottom: 8px;
}

.flash-word {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 2px;
}

.flash-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}

.fl-accept .flash-word {
  color: var(--teal);
}

.fl-reject .flash-word {
  color: var(--amber);
}

.day-card.outbreak {
  border: 1px solid rgba(196, 85, 94, .4);
  background: rgba(20, 10, 12, .6);
  border-radius: 16px;
  padding: 26px 30px;
  max-width: 460px;
}

.ob-ico {
  font-size: 46px;
  color: var(--blood);
  margin-bottom: 6px;
  animation: pulse 1.2s infinite;
}

.day-card.outbreak .day-num {
  color: var(--blood);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .5;
  }
}


/* ================= Resolve bar (di dalam .vn-demeanor) ================= */
.dm-resolve-bar {
  width: 100%;
  height: 6px;
  background: #211e29;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.dm-resolve-bar span {
  display: block;
  height: 100%;
  width: 0;
  transition: width .35s ease, background .35s ease;
  background: var(--teal);
}

.dm-resolve-bar[data-level="low"] span {
  background: var(--teal);
}

.dm-resolve-bar[data-level="mid"] span {
  background: var(--gold);
}

.dm-resolve-bar[data-level="high"] span {
  background: var(--amber);
}

.dm-resolve-bar[data-level="full"] span {
  background: var(--blood);
}

/* nameplate demeanor perlu lebar agar bar muat */
.vn-demeanor {
  flex-direction: column;
  align-items: stretch;
  min-width: 150px;
}

.vn-demeanor>span.dm-dot,
.vn-demeanor>b {
  align-self: center;
}


/* ================= TUTORIAL screen (Cara Bermain) ================= */
.tut-screen {
  pointer-events: auto;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 6vw 18px;
}

.tut-head {
  font-family: 'Creepster', cursive;
  font-weight: 800;
  font-size: 100px;
  color: #f2e6c9;
  letter-spacing: 4px;
  margin-bottom: 16px;
}

.tut-scroll {
  flex: 1;
  overflow-y: auto;
  max-width: 760px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: 8px;
}

.tut-scroll::-webkit-scrollbar {
  width: 8px;
}

.tut-scroll::-webkit-scrollbar-thumb {
  background: #2a2733;
  border-radius: 4px;
}

.tut-sec h3 {
  font-family: 'Special Elite', cursive;
  font-weight: 700;
  font-size: 19px;
  color: var(--gold);
  margin: 0 0 8px;
}

.tut-sec p {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #c9c3d2;
  margin: 0;
}

.tut-sec b {
  color: #f2e6c9;
}

.tut-sec i {
  color: var(--teal);
  font-style: italic;
}

.tut-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 5px;
  vertical-align: middle;
}

.tut-tag.clean {
  background: rgba(111, 174, 154, .18);
  color: var(--teal);
}

.tut-tag.suspect {
  background: rgba(196, 85, 94, .18);
  color: var(--blood);
}

.tut-tag.neutral {
  background: rgba(216, 146, 74, .18);
  color: var(--amber);
}

/* daftar fungsi aksi */
.tut-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.tut-act {
  font-family: 'Syne', sans-serif;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.tut-act .ico {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.tut-act b {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 2px;
}

.tut-act small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* tip box */
.tut-tip {
  background: rgba(232, 196, 104, .08);
  border: 1px solid rgba(232, 196, 104, .3);
  border-radius: 10px;
  padding: 12px 14px;
}

.tut-tip p {
  font-size: 13px;
  color: #d8cba0;
}

.tut-tip b {
  color: var(--gold);
}

.tut-btn {
  margin-top: 18px;
  cursor: pointer;
  background: #16141c;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 30px;
  padding: 14px 44px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  transition: .12s;
}

.tut-btn:hover {
  background: var(--gold);
  color: #16141c;
  transform: translateY(-2px);
}

@media (max-height: 600px) {
  .tut-head {
    font-size: 30px;
  }

  .tut-sec h3 {
    font-size: 17px;
  }

  .tut-btn {
    transform: scale(0.92);
  }
}

@media (max-width: 480px) {
  .tut-head {
    font-size: 28px;
    letter-spacing: 2px;
  }

  .tut-act small {
    font-size: 11.5px;
  }
}

/* ================= PIVOT: Sistem Pemeriksaan Gejala ================= */

/* Baris tombol penghalang (minta buka jaket/syal/topi) */
.barrier-row {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  padding: 0 4px;
}

.barrier-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--muted, #8b8694);
  letter-spacing: .5px;
}

.barrier-btn {
  cursor: pointer;
  background: #1a1620;
  color: #e8c468;
  border: 1px solid rgba(232, 196, 104, .45);
  border-radius: 20px;
  padding: 7px 14px;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: .12s;
}

.barrier-btn:hover {
  background: #e8c468;
  color: #16141c;
  transform: translateY(-1px);
}

/* Tombol pemeriksaan terkunci penghalang */
.action-btn.gated {
  opacity: .5;
  position: relative;
}

.action-btn.gated:hover {
  opacity: .65;
}

.action-btn .ab-lock {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
}

/* Catatan medis netral di bawah data (tanpa warna penilaian) */
.clue-note {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted, #8b8694);
  font-style: italic;
  margin-top: 3px;
}

/* Baris log "dicatat" — netral, tanpa warna merah/hijau penilaian */
.clue.done .clue-sig {
  color: #9fc6b8;
}

.clue.done {
  border-left-color: rgba(159, 198, 184, .4);
}

/* Label kondisi di rekap ending */
.cond-terinfeksi {
  color: var(--blood, #c4555e);
}

.cond-sehat {
  color: var(--teal, #6fae9a);
}


/* ================= INTRO: Rotate device + Warning ================= */

/* ---- Rotate device (sambutan) ---- */
.rotate-screen {
  pointer-events: auto;
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.rotate-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #16131d, #0d0b13);
  border: 1px solid rgba(232, 196, 104, .28);
  border-radius: 18px;
  padding: 38px 36px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}

.rotate-icon {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rot-phone {
  width: 46px;
  height: 80px;
  border: 3px solid #e8c468;
  border-radius: 9px;
  position: relative;
  animation: rotPhone 2.2s ease-in-out infinite;
}

.rot-phone::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  width: 14px;
  height: 2px;
  background: #e8c468;
  border-radius: 2px;
}

@keyframes rotPhone {

  0%,
  30% {
    transform: rotate(0deg);
  }

  60%,
  100% {
    transform: rotate(90deg);
  }
}

.rotate-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: #f2e6c9;
  letter-spacing: 1px;
  margin: 0;
}

.rotate-sub {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #b8b3c2;
  max-width: 320px;
  line-height: 1.6;
  margin: 0;
}

.rotate-dots {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.rotate-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8c468;
  opacity: .3;
  animation: rotDot 1.4s ease-in-out infinite;
}

.rotate-dots span:nth-child(2) {
  animation-delay: .2s;
}

.rotate-dots span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes rotDot {

  0%,
  100% {
    opacity: .3;
  }

  50% {
    opacity: 1;
  }
}

.rotate-btn {
  margin-top: 4px;
  cursor: pointer;
  background: #16141c;
  color: #e8c468;
  border: 1px solid rgba(232, 196, 104, .5);
  border-radius: 24px;
  padding: 12px 28px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .5px;
  transition: .12s;
}

.rotate-btn:hover {
  background: #e8c468;
  color: #16141c;
  transform: translateY(-1px);
}

/* ---- Warning (kilatan cahaya) ---- */
.warn-screen {
  pointer-events: auto;
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.warn-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  width: 100%;
  max-width: 560px;
  background: linear-gradient(180deg, #16131d, #0d0b13);
  border: 1px solid rgba(232, 196, 104, .28);
  border-radius: 18px;
  padding: 38px 40px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}

.warn-ico {
  font-size: 52px;
  color: #e8c468;
  line-height: 1;
}

.warn-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 30px;
  color: #e8c468;
  letter-spacing: 4px;
  margin: 0;
}

.warn-body {
  max-width: 460px;
}

.warn-body p {
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  line-height: 1.7;
  color: #c9c3d2;
  margin: 0 0 12px;
}

.warn-body p:last-child {
  margin-bottom: 0;
}

.warn-body b {
  color: #f2e6c9;
}

.warn-btn {
  margin-top: 6px;
  cursor: pointer;
  background: #e8c468;
  color: #16141c;
  border: none;
  border-radius: 30px;
  padding: 15px 50px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  transition: .12s;
}

.warn-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

@media (max-height: 560px) {
  .warn-card {
    padding: 24px 28px;
    gap: 12px;
  }

  .warn-ico {
    font-size: 38px;
  }

  .warn-title {
    font-size: 23px;
  }

  .warn-body p {
    font-size: 13px;
    margin-bottom: 8px;
  }
}