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

:root {
  --bg-dark: #120b07;
  --wood-dark: #2a180d;
  --wood-mid: #4a2a18;
  --amber: #f59e0b;
  --amber-glow: #fbbf24;
  --cream: #fef3c7;
  --text-light: #fffbeb;
  --green: #10b981;
  --red: #ef4444;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Latar Jalanan Malam untuk Layar Lebar (Tablet/iPad/PC) */
.wide-backdrop {
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(10, 6, 4, 0.65), rgba(10, 6, 4, 0.85)),
              url('assets/bg/bg_street_wide.jpg') center/cover no-repeat;
  z-index: 0;
}

/* Kanvas Utama Potret Responsif */
#app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  background: url('assets/bg/bg_warkop.jpg') center top/cover no-repeat;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#app-shell.upgraded-neon {
  box-shadow: 0 0 45px rgba(245, 158, 11, 0.45);
  border-left: 2px solid var(--amber);
  border-right: 2px solid var(--amber);
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* START SCREEN */
#screen-title {
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(18, 11, 7, 0.72);
  backdrop-filter: blur(4px);
}

.title-card {
  background: rgba(42, 24, 13, 0.95);
  border: 2px solid var(--amber);
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  width: 100%;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

.title-logo {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  margin-bottom: 12px;
  border: 2px solid var(--amber-glow);
}

.badge-season {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber-glow);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.title-card h1 {
  font-size: 26px;
  color: var(--cream);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 13px;
  color: #fde68a;
  line-height: 1.45;
  margin-bottom: 20px;
}

.title-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* BUTTONS */
button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-weight: 700;
  transition: transform 0.1s ease, filter 0.15s ease;
}

button:active {
  transform: scale(0.96);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbbf24, #d97706);
  color: #1e130c;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45);
}

.btn-install {
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  border-radius: 12px;
  background: #10b981;
  color: #06281e;
  font-size: 13px;
}

.btn-secondary {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: var(--wood-mid);
  color: var(--cream);
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 12px;
}

.btn-ghost {
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  color: #d6d3d1;
  font-size: 12px;
}

/* HUD ATAS */
.hud-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 12px 6px;
  background: linear-gradient(180deg, rgba(18,11,7,0.9), transparent);
}

.hud-pill {
  background: rgba(42, 24, 13, 0.92);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 10px;
  padding: 5px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
}

.hud-pill.money {
  flex: 1;
  align-items: flex-end;
}

.hud-label {
  font-size: 9px;
  color: #fcd34d;
  letter-spacing: 0.5px;
}

.hud-pill strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.hud-tools {
  display: flex;
  gap: 6px;
  padding: 4px 12px;
}

.tool-btn {
  flex: 1;
  position: relative;
  background: rgba(42, 24, 13, 0.92);
  color: var(--cream);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 8px;
  padding: 6px 4px;
  font-size: 11px;
}

.dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  background: var(--red);
  border-radius: 50%;
}

.count {
  background: var(--amber);
  color: #1e130c;
  padding: 1px 5px;
  border-radius: 99px;
  font-size: 10px;
}

/* AREA JENDELA PELANGGAN (ATAS) */
.window-area {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 12px;
  min-height: 220px;
}

.customer-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  animation: slideUp 0.3s ease-out;
}

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

.patience-wrap {
  width: 130px;
  height: 7px;
  background: rgba(0,0,0,0.7);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.25);
  margin-bottom: 4px;
}

.patience-bar {
  height: 100%;
  width: 100%;
  background: var(--green);
  transition: width 0.25s linear, background-color 0.3s;
}

.char-sprite {
  width: 155px;
  height: 155px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.65));
}

.dialog-box {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  background: rgba(30, 19, 12, 0.95);
  border: 1.5px solid var(--amber);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.7);
  z-index: 5;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.dialog-header strong {
  color: var(--amber-glow);
  font-size: 13px;
}

.role-tag {
  font-size: 10px;
  background: rgba(255,255,255,0.12);
  padding: 2px 7px;
  border-radius: 6px;
  color: #fde68a;
}

#dialog-text {
  font-size: 12.5px;
  line-height: 1.4;
  color: #fffbeb;
}

.dialog-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.btn-choice {
  background: var(--wood-mid);
  color: var(--cream);
  border: 1px solid var(--amber);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  text-align: left;
}

/* AREA MEJA RACIK (BAWAH) */
.counter-area {
  position: relative;
  background: rgba(28, 16, 9, 0.94);
  border-top: 2px solid #78350f;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cat-pet {
  position: absolute;
  top: -46px;
  right: 14px;
  width: 58px;
  height: 58px;
  background: transparent;
  z-index: 6;
}

.cat-pet img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cat-bubble {
  position: absolute;
  top: -16px;
  left: -10px;
  background: var(--amber-glow);
  color: #1e130c;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
}

.prep-station {
  background: rgba(18, 11, 7, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  padding: 8px 10px;
}

.prep-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #fcd34d;
  margin-bottom: 6px;
}

.btn-mini {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
}

.prep-slots {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 8px;
}

.placeholder-text {
  font-size: 11.5px;
  color: #a8a29e;
}

.slot-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--wood-mid);
  border: 1px solid var(--amber);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--cream);
}

.slot-chip.water-done {
  border-color: var(--green);
  background: rgba(16, 185, 129, 0.22);
}

.prep-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
  font-size: 12.5px;
}

.btn-action.water {
  background: #0284c7;
  color: #fff;
}

.btn-action.serve {
  background: var(--green);
  color: #06281e;
}

/* RAK BAHAN */
.shelf-tabs {
  display: flex;
  gap: 4px;
}

.shelf-tab {
  flex: 1;
  padding: 6px 2px;
  border-radius: 7px;
  background: rgba(255,255,255,0.08);
  color: #d6d3d1;
  font-size: 10.5px;
}

.shelf-tab.active {
  background: var(--amber);
  color: #1e130c;
}

.ingredients-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.ing-btn {
  background: var(--wood-mid);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 10px;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--cream);
  font-size: 10.5px;
}

.ing-btn img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.ing-emoji {
  font-size: 22px;
  line-height: 30px;
}

/* MODALS */
.modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  z-index: 20;
}

.modal-card {
  background: var(--wood-dark);
  border: 2px solid var(--amber);
  border-radius: 16px;
  padding: 18px;
  width: 100%;
  max-height: 85dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-close {
  background: rgba(255,255,255,0.12);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.modal-desc {
  font-size: 12px;
  color: #fde68a;
  line-height: 1.4;
}

/* TIMING MINI-GAME */
.timing-track {
  position: relative;
  width: 100%;
  height: 28px;
  background: #1c1917;
  border-radius: 99px;
  border: 2px solid #78716c;
  overflow: hidden;
  margin: 8px 0;
}

.timing-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 38%;
  width: 24%;
  background: var(--green);
}

.timing-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  background: #fff;
  box-shadow: 0 0 8px #fff;
  left: 0%;
}

/* LISTS & ITEMS IN MODALS */
.list-box, .clues-list, .solved-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-card {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
}

.item-card.selected {
  border-color: var(--green);
  background: rgba(16, 185, 129, 0.2);
}

.item-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.summary-stats {
  background: rgba(0,0,0,0.4);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.summary-stats div {
  display: flex;
  justify-content: space-between;
}

.cliffhanger-text {
  font-size: 12px;
  font-style: italic;
  color: #fcd34d;
  text-align: center;
}

.btn-ad {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 12.5px;
}

.input-text {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid var(--amber);
  background: #120b07;
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
}

.ios-steps {
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cream);
}

/* TOAST */
.toast {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: #10b981;
  color: #06281e;
  font-weight: 700;
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  z-index: 50;
}

.hidden {
  display: none !important;
}

/* TUTORIAL HIGHLIGHT */
.tutorial-glow {
  outline: 2.5px solid #38bdf8;
  box-shadow: 0 0 14px #38bdf8;
  animation: pulseGlow 1s infinite alternate;
}

@keyframes pulseGlow {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}
