/* ==========================================================================
   HD-2D DIORAMA INTERACTIVE WEB GAME - STYLES (PERSIS VIDEO REFERENSI)
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #121820;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #2c1e0e;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   EFEK HD-2D TILT-SHIFT (DEPTH OF FIELD ATAS & BAWAH)
   ========================================================================== */
.tilt-shift-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 13vh;
  pointer-events: none;
  backdrop-filter: blur(3.5px);
  -webkit-backdrop-filter: blur(3.5px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0) 100%);
  z-index: 3;
}

.tilt-shift-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 9vh;
  pointer-events: none;
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 15%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 15%, rgba(0, 0, 0, 0) 100%);
  z-index: 3;
}

.vignette-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%, transparent 68%, rgba(10, 15, 25, 0.35) 100%);
  z-index: 4;
}

/* ==========================================================================
   START / OPENING SCREEN (PERSIS VIDEO REFERENSI FRAME 00:00 - 00:04)
   ========================================================================== */
.start-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: rgba(18, 22, 32, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 7vh;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.start-screen-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-card {
  width: 90%;
  max-width: 420px;
  background: #fbf6ea;
  border: 2.5px solid #2b1d0c;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px #fff inset;
  border-radius: 14px;
  padding: 24px 22px 20px 22px;
  text-align: left;
  animation: slideUpCard 0.5s ease-out;
}

@keyframes slideUpCard {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.start-subtitle {
  font-family: 'Pixelify Sans', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #8c735d;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.start-title {
  font-family: 'Pixelify Sans', 'Plus Jakarta Sans', serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  color: #2b1d0c;
  margin-bottom: 12px;
}

.start-title .dot {
  color: #d4971c;
}

.start-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: #524032;
  margin-bottom: 22px;
}

.btn-start-main {
  width: 100%;
  background: #fdfaf2;
  border: 2px solid #2b1d0c;
  box-shadow: 0 4px 0 #2b1d0c;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  margin-bottom: 14px;
}

.btn-start-main:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #2b1d0c;
}

.btn-start-main .play-icon {
  font-size: 20px;
  color: #d4971c;
  margin-right: 14px;
}

.btn-main-label {
  font-family: 'Pixelify Sans', monospace;
  font-size: 17px;
  font-weight: 700;
  color: #2b1d0c;
  text-align: left;
}

.btn-sub-label {
  font-size: 11.5px;
  color: #7a6350;
  text-align: left;
}

.start-actions-row {
  display: flex;
  gap: 12px;
}

.btn-start-secondary {
  flex: 1;
  background: #f4ecdc;
  border: 1.5px solid #2b1d0c;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #3d2b1d;
  cursor: pointer;
  box-shadow: 0 2px 0 #2b1d0c;
}

.btn-start-secondary:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #2b1d0c;
}

/* ==========================================================================
   HUD LAYER (IN-GAME)
   ========================================================================== */
.hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
}

/* Top-Left Panel (Quest Tracker, 4-Slot Quickbar, Side Job Tracker) */
.hud-top-left-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  pointer-events: none;
  max-width: 320px;
}

/* Top-Left: Quest Tracker Box (Persis Video) */
.quest-tracker {
  pointer-events: auto;
  background: #fbf6ea;
  border: 2px solid #2b1d0c;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  border-radius: 12px;
  padding: 10px 14px;
  max-width: 310px;
}

.quest-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.quest-star-badge {
  background: #2b1d0c;
  color: #ffd166;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 4px;
}

.quest-chapter {
  font-family: 'Pixelify Sans', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #7a6350;
  text-transform: uppercase;
}

.quest-progress-bar-bg {
  flex: 1;
  height: 6px;
  background: #e2d7c5;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #c2b5a1;
}

.quest-progress-fill {
  height: 100%;
  background: #d4971c;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.quest-counter {
  font-family: 'Pixelify Sans', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #7a6350;
}

.quest-title {
  font-family: 'Pixelify Sans', 'Plus Jakarta Sans', serif;
  font-size: 15px;
  font-weight: 700;
  color: #2b1d0c;
  margin-bottom: 6px;
}

.quest-sub-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f3ebd8;
  border: 1px solid #ddceb6;
  border-radius: 6px;
  padding: 6px 8px;
}

.quest-exclamation {
  background: #d4971c;
  color: #2b1d0c;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

.quest-sub-title {
  font-family: 'Pixelify Sans', monospace;
  font-size: 9.5px;
  font-weight: 700;
  color: #8c735d;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.quest-desc {
  font-size: 11.5px;
  color: #3d2b1d;
  line-height: 1.35;
}

/* Top-Right: Retro Square Buttons */
.top-controls {
  position: absolute;
  top: 14px;
  right: 16px;
  pointer-events: auto;
  display: flex;
  gap: 8px;
}

.hud-btn-retro {
  width: 40px;
  height: 40px;
  background: #fbf6ea;
  border: 2px solid #2b1d0c;
  box-shadow: 0 3px 0 #2b1d0c;
  border-radius: 9px;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.hud-btn-retro:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #2b1d0c;
}

.badge-counter {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #d62828;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #2b1d0c;
}

/* 3D Projected Floating Interaction Badge (Mengambang di Atas Objek) */
.floating-prompt-3d {
  position: fixed;
  display: none;
  pointer-events: none;
  z-index: 35;
  transform: translate(-50%, -100%);
  background: #fbf6ea;
  color: #2b1d0c;
  border: 2px solid #2b1d0c;
  border-radius: 20px;
  padding: 5px 14px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  animation: floatBadge 1.5s ease-in-out infinite alternate;
}

.floating-prompt-3d::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #2b1d0c;
}

.floating-prompt-3d.visible {
  display: block;
}

@keyframes floatBadge {
  0% { transform: translate(-50%, -100%) translateY(0px); }
  100% { transform: translate(-50%, -100%) translateY(-5px); }
}

/* Fallback Context Prompt */
.prompt-container {
  display: none;
}

/* Desktop Controls Hint */
.desktop-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(251, 246, 234, 0.92);
  border: 1.5px solid #2b1d0c;
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12px;
  color: #3d2b1d;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

/* ==========================================================================
   KONTROL SENTUH / MOBILE (D-PAD & TOMBOL AKSI A)
   ========================================================================== */
.touch-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0 16px 18px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

/* Circular Compass D-Pad */
.joystick-zone {
  width: 110px;
  height: 110px;
  position: relative;
  pointer-events: auto;
  touch-action: none;
}

.compass-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #3a2717;
  border: 3px solid #24160a;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4), 0 0 0 2px #d4971c inset;
  position: relative;
}

/* Diamond Directional Markers */
.compass-ring::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 7px solid #ffd166;
}

.compass-ring::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #ffd166;
}

.joystick-knob {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffef7, #ebdcc3);
  border: 2.5px solid #2b1d0c;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -25px;
  margin-left: -25px;
  pointer-events: none;
  transform: translate(0px, 0px);
  transition: transform 0.05s ease-out;
}

/* Round Action A Button */
.action-buttons {
  pointer-events: auto;
}

.btn-action-a {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, #f4ecd9);
  border: 3px solid #2b1d0c;
  box-shadow: 0 5px 0 #2b1d0c, 0 8px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-action-a:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #2b1d0c;
}

.btn-action-a .a-letter {
  font-family: 'Pixelify Sans', monospace;
  font-size: 26px;
  font-weight: 700;
  color: #2b1d0c;
  line-height: 1;
}

.btn-action-a .sub {
  font-size: 9.5px;
  font-weight: 700;
  color: #7a6350;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* Toast Notification Dynamic Island Capsule (Responsive di Semua Layar & HP) */
.toast-banner {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px) + 6px);
  left: 50%;
  transform: translate(-50%, -90px) scale(0.9);
  opacity: 0;
  background: rgba(26, 18, 12, 0.94);
  color: #fffdf8;
  border: 1.5px solid rgba(246, 196, 69, 0.75);
  border-radius: 9999px;
  padding: 8px 20px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), 0 0 14px rgba(246, 196, 69, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.25s ease;
  pointer-events: none;
  max-width: min(92vw, 480px);
  width: max-content;
  white-space: normal;
  word-wrap: break-word;
  box-sizing: border-box;
}

.toast-banner.show {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

/* ==========================================================================
   MODAL WINDOWS & POPUPS (RETRO CREAM & PARCHMENT STYLING)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  background: rgba(18, 24, 38, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  width: 92%;
  max-width: 480px;
  background: #fbf6ea;
  border: 2.5px solid #2b1d0c;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px #fff inset;
  border-radius: 14px;
  padding: 22px;
  position: relative;
  max-height: 88vh;
  overflow-y: auto;
  animation: popInModal 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes popInModal {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: #f3ebd8;
  border: 1.5px solid #2b1d0c;
  border-radius: 6px;
  font-size: 14px;
  color: #2b1d0c;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:active {
  background: #e2d5bd;
}

/* Dialog Berkarakter */
.dialog-container {
  display: flex;
  flex-direction: column;
}

.dialog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #e5d9c2;
}

.dialog-avatar {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 2px solid #2b1d0c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background-color: #ffd166;
}

.dialog-speaker {
  font-family: 'Pixelify Sans', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #2b1d0c;
}

.dialog-role {
  font-size: 11.5px;
  color: #7a6350;
}

.dialog-text-body {
  font-size: 14px;
  line-height: 1.6;
  color: #3d2b1d;
  min-height: 60px;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

/* Pilihan Opsi Percakapan Interaktif RPG */
.dialog-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 14px;
  animation: fadeInOptions 0.25s ease-out;
}

@keyframes fadeInOptions {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dialog-option-btn {
  background: #ffffff;
  border: 1.5px solid #2b1d0c;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #2b1d0c;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2.5px 0 #2b1d0c;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1.4;
  outline: none;
  width: 100%;
}

.dialog-option-btn:hover {
  background: #fff8e7;
  transform: translateY(-1px);
  box-shadow: 0 3.5px 0 #2b1d0c;
}

.dialog-option-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0.5px 0 #2b1d0c;
}

.dialog-option-btn .opt-icon {
  font-size: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dialog-option-btn .opt-label {
  flex: 1;
}

.dialog-option-btn.opt-quest {
  background: #fff9db;
  border-color: #925e00;
  color: #5c3b00;
  box-shadow: 0 2.5px 0 #925e00;
}

.dialog-option-btn.opt-quest:hover {
  background: #ffec99;
}

.dialog-option-btn.opt-return {
  background: #f1f3f5;
  border-color: #495057;
  color: #343a40;
}

.dialog-option-btn.opt-return:hover {
  background: #e9ecef;
}

.dialog-option-btn.opt-close {
  background: #fdf2f0;
  border-color: #a83232;
  color: #8c2525;
}

.dialog-option-btn.opt-close:hover {
  background: #ffe3e3;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-retro {
  background: #f4ecdc;
  border: 1.5px solid #2b1d0c;
  border-radius: 7px;
  padding: 8px 16px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #2b1d0c;
  cursor: pointer;
  box-shadow: 0 3px 0 #2b1d0c;
}

.btn-retro:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #2b1d0c;
}

.btn-retro-gold {
  background: #ffd166;
  border: 2px solid #2b1d0c;
  border-radius: 8px;
  padding: 10px 18px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #2b1d0c;
  cursor: pointer;
  box-shadow: 0 3px 0 #2b1d0c;
}

.btn-retro-gold:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #2b1d0c;
}

/* Surat Kertas Parchment (Persis Video) */
.letter-window {
  background: #faf4e6;
  border: 3px solid #2b1d0c;
  padding: 28px 24px 20px 24px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.letter-seal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1e4cd;
  border: 1px solid #d8c7a8;
  border-radius: 14px;
  padding: 3px 10px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #8c735d;
  margin-bottom: 12px;
}

.letter-header {
  margin-bottom: 14px;
}

.letter-title {
  font-family: 'Pixelify Sans', 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: #2b1d0c;
  line-height: 1.25;
  margin-bottom: 4px;
}

.letter-date {
  font-size: 11.5px;
  color: #8c735d;
  font-style: italic;
}

.letter-greeting {
  font-size: 14px;
  font-weight: 600;
  color: #2b1d0c;
  margin-bottom: 10px;
}

.letter-content p {
  font-size: 13.5px;
  line-height: 1.65;
  color: #3e2815;
  margin-bottom: 12px;
}

.letter-signature {
  text-align: right;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: #2b1d0c;
  margin: 18px 0 14px 0;
}

.letter-bottom-action {
  display: flex;
  justify-content: flex-end;
}

/* Kupon Kenangan */
.coupons-heading {
  font-family: 'Pixelify Sans', monospace;
  font-size: 12px;
  color: #8c735d;
  margin: 16px 0 8px 0;
  text-transform: uppercase;
}

.coupon-card {
  background: #fffdf8;
  border: 1.5px dashed #d4971c;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.coupon-code {
  font-family: 'Pixelify Sans', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #d62828;
}

.coupon-title {
  font-size: 13px;
  font-weight: 700;
  color: #2b1d0c;
}

.coupon-desc {
  font-size: 11.5px;
  color: #634d3c;
}

/* Modal Arcade */
.arcade-window {
  background: #1e1428;
  border: 3px solid #d4971c;
  color: #ffffff;
  padding: 16px;
  max-width: 440px;
}

.arcade-title-bar {
  font-family: 'Pixelify Sans', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #ffd166;
  text-align: center;
  margin-bottom: 10px;
}

.arcade-screen-frame {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

#arcade-canvas {
  background: #0d1117;
  border: 2px solid #ffd166;
  border-radius: 6px;
  max-width: 100%;
}

.arcade-controls-touch {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-arcade-key {
  flex: 1;
  background: #2b1d0c;
  border: 1.5px solid #ffd166;
  border-radius: 6px;
  color: #ffd166;
  font-family: 'Pixelify Sans', monospace;
  font-size: 11.5px;
  font-weight: 700;
  padding: 10px 6px;
  cursor: pointer;
  box-shadow: 0 3px 0 #000;
}

.btn-arcade-key:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #000;
}

.btn-arcade-drop {
  background: #d62828;
  color: #fff;
  border-color: #ffbe0b;
}

/* Modal Photobooth */
.photobooth-window {
  max-width: 460px;
}

.photobooth-header {
  font-family: 'Pixelify Sans', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #2b1d0c;
  margin-bottom: 4px;
}

.photobooth-desc {
  font-size: 12px;
  color: #7a6350;
  margin-bottom: 12px;
}

.polaroid-preview-area {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

#photo-preview {
  max-width: 240px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  display: none;
}

.sticker-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.sticker-tag {
  background: #f3ebd8;
  border: 1px solid #c2b5a1;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  color: #3d2b1d;
}

.sticker-tag.active {
  background: #ffd166;
  border-color: #2b1d0c;
  font-weight: 700;
}

.photo-input-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #2b1d0c;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  margin-bottom: 12px;
}

.photobooth-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Modal Settings */
.settings-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5d9c2;
}

.settings-label {
  font-family: 'Pixelify Sans', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #2b1d0c;
  margin-bottom: 6px;
}

.settings-desc {
  font-size: 12px;
  line-height: 1.5;
  color: #5a4535;
}

.time-buttons-row {
  display: flex;
  gap: 8px;
}

.btn-time-opt {
  flex: 1;
  background: #f4ecdc;
  border: 1.5px solid #2b1d0c;
  border-radius: 6px;
  padding: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger {
  background: #d62828;
  color: #fff;
  border: 1.5px solid #2b1d0c;
  border-radius: 6px;
  padding: 8px 14px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}

/* Screen Fade Overlay */
.screen-fade-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0c0914;
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  transition: opacity 0.4s ease-in-out;
}

.screen-fade-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   RESPONSIVE DESIGN (HP / MOBILE FIRST)
   ========================================================================== */
@media (max-width: 600px) {
  .hud-layer {
    padding: 10px;
  }

  .hud-top-left-panel {
    max-width: calc(100% - 130px);
    gap: 8px;
  }

  .quest-tracker {
    max-width: 100%;
    padding: 8px 10px;
  }

  .inventory-4slots-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .quest-title {
    font-size: 13.5px;
  }

  .quest-desc {
    font-size: 10.5px;
  }

  .desktop-hint {
    display: none;
  }

  .touch-controls {
    padding: 0 10px 14px 10px;
  }

  .joystick-zone {
    width: 96px;
    height: 96px;
  }

  .joystick-knob {
    width: 44px;
    height: 44px;
    margin-top: -22px;
    margin-left: -22px;
  }

  .btn-action-a {
    width: 64px;
    height: 64px;
  }

  .btn-action-a .a-letter {
    font-size: 23px;
  }

  .start-card {
    padding: 18px 16px;
  }

  .start-title {
    font-size: 28px;
  }

  .toast-banner {
    top: max(12px, env(safe-area-inset-top, 12px) + 4px);
    font-size: 12px;
    padding: 8px 15px;
    border-radius: 20px;
    max-width: calc(100vw - 28px);
    width: auto;
  }
}

/* ==========================================================================
   4-SLOT INVENTORY BAR HUD & MODAL
   ========================================================================== */
.hud-inventory-box {
  position: relative;
  background: rgba(251, 246, 234, 0.96);
  border: 2px solid #2b1d0c;
  border-radius: 10px;
  padding: 7px 11px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 15;
}

.hud-inventory-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.hud-inv-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
}

.hud-inv-title {
  font-family: 'Pixelify Sans', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #7a6350;
  letter-spacing: 0.5px;
}

.hud-inv-open-hint {
  font-family: 'Pixelify Sans', monospace;
  font-size: 8.5px;
  font-weight: 700;
  color: #c78315;
  background: #f1e4d0;
  border: 1px solid #d9c5ab;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  transition: background 0.15s ease, color 0.15s ease;
}

.hud-inventory-box:hover .hud-inv-open-hint {
  background: #ecd4b5;
  color: #a76b0d;
}

.hud-inv-slots {
  display: flex;
  gap: 6px;
}

.hud-slot {
  width: 38px;
  height: 38px;
  background: #f4ecdc;
  border: 1.5px solid #8c735d;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) inset;
}

.hud-slot.filled {
  border-color: #d4971c;
  background: #fffdf8;
  box-shadow: 0 0 0 1px #d4971c;
}

.hud-slot .slot-num {
  position: absolute;
  top: 2px;
  left: 3px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 8.5px;
  color: #8c735d;
  font-weight: 700;
  line-height: 1;
}

.hud-slot .slot-item-ico {
  font-size: 18px;
  line-height: 1;
  display: block;
}

/* Modal 12 Slots Grid */
.inventory-subnote {
  font-size: 11px;
  color: #7a6350;
  margin-bottom: 10px;
  line-height: 1.35;
  background: #f4ecdc;
  border: 1px dashed #c2b5a1;
  border-radius: 6px;
  padding: 6px 10px;
}

.inventory-4slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.inv-slot-card {
  background: #fffdf8;
  border: 2px solid #c2b5a1;
  border-radius: 8px;
  padding: 8px 4px 6px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.inv-slot-card.quick-slot {
  border-color: #d4a373;
}

.inv-slot-card:hover {
  transform: translateY(-2px);
  border-color: #d4971c;
}

.inv-slot-card.active {
  border-color: #d4971c;
  background: #fdf5e2;
  box-shadow: 0 0 0 2px #d4971c inset;
}

.inv-slot-card.empty {
  border-style: dashed;
  background: #f7f1e3;
  opacity: 0.75;
}

.slot-badge-num {
  position: absolute;
  top: 3px;
  left: 4px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 8px;
  font-weight: 700;
  color: #8c735d;
}

.slot-card-icon {
  font-size: 22px;
  line-height: 1;
  margin: 8px 0 3px 0;
}

.slot-card-name {
  font-family: 'Pixelify Sans', monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: #2b1d0c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 85px;
}

.slot-card-empty-icon {
  font-size: 16px;
  color: #c2b5a1;
  margin: 8px 0 3px 0;
}

.slot-card-empty-name {
  font-family: 'Pixelify Sans', monospace;
  font-size: 9.5px;
  color: #9d8d7b;
}

.slot-card-empty-name {
  color: #8c735d;
  font-size: 11px;
}

/* ==========================================================================
   MODAL GALERI FOTO KENANGAN DI DINDING RUMAH
   ========================================================================== */
.photo-window {
  max-width: 540px;
  background: #fdfaf3;
  border: 3px solid #3e2723;
  border-radius: 16px;
  padding: 20px 22px 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1.5px #ffd166 inset;
}

.photo-viewer-header {
  text-align: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px dashed #d8c8b4;
}

.photo-viewer-header .modal-title {
  font-family: 'Pixelify Sans', monospace;
  font-size: 20px;
  color: #3e2723;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.photo-viewer-header .modal-subtitle {
  font-size: 12px;
  color: #8c6d53;
  margin-top: 3px;
  font-weight: 600;
}

.photo-frame-ornament {
  background: #2b1b17;
  border: 3.5px solid #d4af37;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px #fff3d1 inset;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.photo-frame-ornament img {
  width: 100%;
  height: auto;
  max-height: 52vh;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  image-rendering: auto;
}

.photo-viewer-caption {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #4a3828;
  text-align: center;
  font-style: italic;
  background: #f5ece0;
  border: 1px solid #e0d0be;
  border-radius: 10px;
  padding: 10px 14px;
}

@media (max-width: 600px) {
  .photo-window {
    padding: 16px 14px 18px;
    max-width: 95vw;
  }
  .photo-viewer-header .modal-title {
    font-size: 17px;
  }
  .photo-viewer-caption {
    font-size: 12px;
    padding: 8px 10px;
  }
}

/* ==========================================================================
   SIDE JOB HUD TRACKER & PRATINJAU FOTO INVENTORI
   ========================================================================== */
.hud-sidejob-box {
  position: relative;
  margin: 0;
  background: #fdfaf3;
  border: 2px solid #2b1d0c;
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 3px 0 #2b1d0c;
  font-family: 'Pixelify Sans', monospace;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease;
  max-width: 220px;
  display: inline-flex;
  flex-direction: column;
}

.hud-sidejob-box:hover {
  transform: translateY(-2px);
}

.hud-sidejob-header {
  font-size: 9.5px;
  font-weight: 700;
  color: #8c735d;
  letter-spacing: 0.5px;
}

.hud-sidejob-progress {
  font-size: 12px;
  font-weight: 700;
  color: #2b1d0c;
  margin-top: 2px;
}

/* Pratinjau Foto di Modal Inventori */
.inv-photo-preview-wrapper {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1.5px dashed #c2b5a1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.inv-photo-thumb {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border: 2.5px solid #2b1d0c;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.inv-photo-thumb:hover {
  transform: scale(1.02);
}

#btn-inv-view-photo {
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
}

/* ==========================================================================
   ARCADE TETRIS: TIER SKOR & OVERLAY POPUP HADIAH
   ========================================================================== */
.arcade-window {
  position: relative;
  overflow: hidden;
}

.arcade-intro-overlay,
.arcade-result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 12, 26, 0.96);
  z-index: 30;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  animation: fadeInModal 0.2s ease-out;
}

.arcade-intro-box,
.arcade-result-box {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.arcade-intro-badge {
  display: inline-block;
  background: #39244f;
  border: 1px solid #ffd166;
  color: #ffd166;
  font-family: 'Pixelify Sans', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.arcade-intro-title {
  font-family: 'Pixelify Sans', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.arcade-tier-cards {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 12px 0 14px;
}

.arcade-tier-card {
  background: #251b33;
  border: 1.5px solid #4a3860;
  border-radius: 8px;
  padding: 8px 12px;
  text-align: left;
}

.arcade-tier-card.tier-low {
  border-color: #f4a261;
}

.arcade-tier-card.tier-mid {
  border-color: #2a9d8f;
}

.arcade-tier-card.tier-high {
  border-color: #ffd166;
  background: #361f49;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.25);
}

.tier-card-badge {
  font-family: 'Pixelify Sans', monospace;
  font-size: 9.5px;
  font-weight: 700;
  color: #ffd166;
  margin-bottom: 2px;
}

.tier-card-title {
  font-family: 'Pixelify Sans', monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
}

.tier-card-desc {
  font-size: 11px;
  color: #bfaecb;
  margin-top: 2px;
  line-height: 1.35;
}

.btn-arcade-start {
  width: 100%;
  padding: 10px 16px;
  font-size: 13.5px;
  margin-top: 4px;
}

/* Hasil Skor Arcade */
.arcade-result-title {
  font-family: 'Pixelify Sans', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #ffd166;
  margin-bottom: 8px;
}

.arcade-result-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  color: #ffffff;
  margin-bottom: 12px;
}

.arcade-stat-item b {
  color: #ffd166;
  font-size: 15px;
}

.arcade-won-card {
  background: #361f49;
  border: 2px solid #ffd166;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.35);
}

.arcade-won-badge {
  font-family: 'Pixelify Sans', monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffd166;
  margin-bottom: 4px;
}

.arcade-won-name {
  font-family: 'Pixelify Sans', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.arcade-won-desc {
  font-size: 12px;
  color: #e2d7ec;
  line-height: 1.45;
}

.arcade-result-actions {
  display: flex;
  gap: 10px;
}

.arcade-result-actions button {
  flex: 1;
}

.btn-arcade-finish {
  background: #2a9d8f;
  color: #ffffff;
  border-color: #68d8d6;
}
