/* ===== v6 Quests, dialogue, bag ===== */
#qui .hidden, .q-tracker.hidden, .qd.hidden, .qc.hidden { display: none !important; }

/* ---------- expandable quest tracker drawer & mini-icon ---------- */
.q-tracker {
  position: absolute;
  left: 10px;
  top: calc(var(--safe-top) + 94px);
  z-index: 25;
  display: flex;
  align-items: flex-start;
  gap: 0;
  max-width: min(calc(100vw - 20px), 348px);
  font-family: inherit;
  color: #1e293b;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.q-tracker .qt-toggle-btn,
.q-tracker.expanded .qt-drawer {
  pointer-events: auto;
}

/* Hide tracker and pin button whenever driving or when any modal/sheet/dialog is active */
body.title-active .q-tracker,
body.title-active #btn-recenter,
body.mode-driving .q-tracker,
body.mode-driving #btn-recenter,
body.in-minigame .q-tracker,
body.in-minigame #btn-recenter,
body.has-sheet .q-tracker,
body.has-sheet #btn-recenter,
body.has-modal .q-tracker,
body.has-modal #btn-recenter,
body.has-dialog .q-tracker,
body.has-dialog #btn-recenter {
  display: none !important;
}

/* Small Quest Icon Button (always the anchor, tap to toggle) */
.qt-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fffbeb;
  border: 2.5px solid #f59e0b;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: none;
  position: relative;
  z-index: 3;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.qt-toggle-btn:active {
  transform: scale(0.92);
}

.qt-ic {
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.qt-pulse-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #f59e0b;
  opacity: 0.8;
  animation: qtPulse 2.4s ease-out infinite;
  pointer-events: none;
}

/* Minimized state: only the small icon is shown */
.q-tracker.minimized {
  height: 44px;
  width: 44px;
}

.q-tracker.minimized .qt-drawer {
  width: 0;
  max-width: 0;
  height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
  transform: translateX(-12px);
  border: none;
  display: none !important;
}

.q-tracker.minimized .qt-toggle-btn {
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

/* Expanded state: drawer slides out smoothly to the right of the left icon column */
.q-tracker.expanded .qt-drawer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 251, 235, 0.98);
  border: 2px solid #f59e0b;
  border-radius: 16px;
  margin-left: 8px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: min(calc(100vw - 76px), 285px);
  opacity: 1;
  transform: translateX(0);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.qt-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  cursor: pointer;
  flex: 1;
}

.qt-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.qt-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #c2410c;
  background: #ffedd5;
  padding: 1px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.qt-step-badge {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

.qt-title {
  font-size: 13px;
  color: #7c2d12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.qt-objective {
  font-size: 11.5px;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

.qt-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.qt-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #fde68a;
  background: #fef3c7;
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s, background 0.12s;
}

.qt-icon-btn:active {
  transform: scale(0.9);
}

.qt-btn-min {
  background: #fef9c3;
  color: #854d0e;
}

.qt-btn-log {
  background: #ffedd5;
  color: #c2410c;
}

@media (max-height: 500px) {
  .q-tracker {
    top: calc(var(--safe-top) + 60px);
  }
}

@keyframes qtPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.6); } 50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); } }

/* ---------- dialogue (visual-novel style) ---------- */
.qd { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .38s cubic-bezier(.22,1,.36,1); }
.qd.show { opacity: 1; }
.qd-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,23,42,.18), rgba(15,23,42,.62)); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.qd-box {
  position: relative; width: min(96vw, 560px); margin: 0 0 calc(var(--safe-bottom) + 12px);
  background: #fffbeb; border-radius: 22px; border: 3px solid #fde68a;
  box-shadow: 0 14px 40px rgba(0,0,0,.45); padding: 10px 14px 10px; cursor: pointer;
  transform: translateY(26px) scale(.98); transition: transform .42s cubic-bezier(.22,1,.36,1), background .2s;
  user-select: none; -webkit-user-select: none;
  @media (prefers-reduced-motion: reduce) {
    transform: none;
    transition: background .15s;
  }
}
.qd.show .qd-box { transform: none; }
.qd-head { display: flex; align-items: center; gap: 6px; padding-bottom: 6px; border-bottom: 2px dashed #fde68a; margin-bottom: 8px; }
.qd-qicon { font-size: 18px; }
.qd-qtitle { flex: 1; font-weight: 700; font-size: 13.5px; color: #7c2d12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qd-kind { color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.qd-skip { border: none; background: #fde68a; color: #7c2d12; font-family: inherit; font-weight: 700; font-size: 11.5px; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.qd-body { display: flex; gap: 12px; align-items: flex-start; min-height: 88px; }
.qd-portrait {
  --npc: #64748b; flex: none; width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--npc) 30%, #fff));
  border: 3px solid var(--npc); box-shadow: 0 4px 0 color-mix(in srgb, var(--npc) 60%, #000);
  overflow: hidden;
}
.qd-portrait svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.npc-mini-avatar { display: inline-flex; width: 22px; height: 22px; vertical-align: middle; border-radius: 50%; overflow: hidden; margin-right: 5px; border: 1.5px solid var(--npc, #fb923c); box-sizing: border-box; }
.npc-mini-avatar svg { width: 100%; height: 100%; display: block; }
.qd-portrait.pop { animation: qdPop .28s ease-out; }
@keyframes qdPop { 0% { transform: scale(.6) rotate(-8deg); } 70% { transform: scale(1.08); } 100% { transform: none; } }
.qd-text { flex: 1; min-width: 0; }
.qd-name { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.qd-line { font-size: 15px; line-height: 1.42; color: #1e293b; min-height: 3.2em; white-space: pre-line; }
.qd-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11.5px; color: #a16207; }
.qd-next { font-weight: 700; animation: qdBlink 1.2s ease-in-out infinite; }
@keyframes qdBlink { 50% { opacity: .45; } }
/* Grandpa Jack's journal: old paper */
.qd-box.journal { background: repeating-linear-gradient(180deg, #fdf6e3 0 23px, #e9dcc0 23px 24px); border-color: #c9a96e; }
.qd-box.journal .qd-line { font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; color: #5b3a12; font-size: 15.5px; }
.qd-box.journal .qd-portrait { border-radius: 10px; transform: rotate(-4deg); }
.qd-box.narrator .qd-line { font-style: italic; color: #475569; }
.qd-box.narrator .qd-portrait, .qd-box.system .qd-portrait { width: 44px; height: 44px; font-size: 24px; box-shadow: none; }
.qd-box.system .qd-line { font-weight: 600; color: #0f172a; background: #fef3c7; border-radius: 12px; padding: 8px 10px; font-size: 14px; }
@media (max-height: 500px) {
  .qd-box { width: min(92vw, 680px); padding: 8px 12px; margin-bottom: calc(var(--safe-bottom) + 6px); }
  .qd-body { min-height: 60px; }
  .qd-portrait { width: 50px; height: 50px; font-size: 28px; }
  .qd-line { font-size: 14px; min-height: 2.6em; }
}

/* ---------- reward / offer cards ---------- */
.qc { position: fixed; inset: 0; z-index: 9001; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .36s cubic-bezier(.22,1,.36,1); }
.qc.show { opacity: 1; }
.qc-shade { position: absolute; inset: 0; background: rgba(15,23,42,.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.qc-box {
  position: relative; width: min(92vw, 380px); max-height: calc(100% - 30px); overflow-y: auto;
  background: #fffbeb; border-radius: 24px; padding: 18px 16px 16px; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.45); border: 3px solid #fde68a;
  transform: translateY(14px) scale(.92); transition: transform .38s cubic-bezier(.22,1,.36,1);
  @media (prefers-reduced-motion: reduce) {
    transform: none;
  }
}
.qc.show .qc-box { transform: none; }
.qc-burst { font-size: 34px; animation: qcBurst .6s ease-out; }
@keyframes qcBurst { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.25); } 100% { transform: none; opacity: 1; } }
.qc-kind { display: inline-block; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 6px; }
.qc-bigicon { font-size: 50px; line-height: 1.1; }
.qc-title { font-size: 20px; font-weight: 700; color: #7c2d12; margin: 4px 0; line-height: 1.2; }
.qc-sub { font-size: 13px; color: #a16207; margin-bottom: 4px; }
.qc-giver { --npc: #64748b; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--npc); background: #fff; border: 2px solid var(--npc); border-radius: 999px; padding: 2px 10px 2px 4px; margin: 4px 0; }
.qc-giver span, .qc-npc span { font-size: 18px; }
.qc-desc { font-size: 14px; color: #334155; line-height: 1.4; margin: 6px 0; }
.qc-true { font-size: 12px; color: #0e7490; background: #ecfeff; border-radius: 12px; padding: 6px 10px; margin: 6px 0; }
.qc-rew { font-size: 12.5px; color: #166534; background: #f0fdf4; border-radius: 12px; padding: 6px 10px; margin: 6px 0; font-weight: 600; }
.qc-chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.qc-chip { font-weight: 700; font-size: 15px; padding: 5px 12px; border-radius: 999px; }
.qc-chip.money { background: #fef3c7; color: #92400e; }
.qc-chip.xp { background: #ede9fe; color: #6d28d9; }
.qc-items { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.qc-items .q-item { width: 82px; animation: qcBurst .5s ease-out both; }
.qc-items .q-item:nth-child(2) { animation-delay: .08s; } .qc-items .q-item:nth-child(3) { animation-delay: .16s; } .qc-items .q-item:nth-child(4) { animation-delay: .24s; }
.qc-hint { font-size: 11.5px; color: #a16207; margin-bottom: 4px; }
.qc-badge { font-size: 13px; color: #7c2d12; background: #fde68a; border-radius: 12px; padding: 6px 10px; margin: 6px 0; }
.qc-npc { --npc: #64748b; font-size: 13px; font-weight: 600; color: var(--npc); background: #fff; border: 2px solid var(--npc); border-radius: 12px; padding: 6px 10px; margin: 6px 0; }
.qc-btns { display: flex; gap: 8px; margin-top: 12px; }
.qc-btns .btn { flex: 1; }

/* ---------- item tile (shared) ---------- */
.q-item {
  --rar: #94a3b8; position: relative; background: #fff; border: 2px solid var(--rar); border-radius: 14px;
  padding: 8px 4px 6px; text-align: center; cursor: pointer;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--rar) 45%, #fff), 0 0 10px color-mix(in srgb, var(--rar) 25%, transparent);
}
.q-item-ic { font-size: 28px; line-height: 1.1; }
.q-item-qty { position: absolute; top: 3px; right: 5px; font-size: 11px; font-weight: 700; color: #fff; background: #0f172a; border-radius: 999px; padding: 0 5px; }
.q-item-nm { font-size: 10.5px; font-weight: 600; color: #334155; line-height: 1.15; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.q-item.active::after { content: "✓ ON"; position: absolute; top: 3px; left: 5px; font-size: 9px; font-weight: 700; color: #fff; background: #16a34a; border-radius: 999px; padding: 0 5px; }
.q-item.sel { outline: 3px solid #f59e0b; outline-offset: 1px; }
.q-item:active { transform: scale(.95); }

/* ---------- quest log ---------- */
.ql-counts { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11.5px; font-weight: 600; color: #475569; margin-bottom: 8px; }
.ql-counts span { background: #f1f5f9; border-radius: 999px; padding: 3px 8px; }
.ql-shortcuts { display: flex; gap: 8px; margin-bottom: 10px; }
.ql-shortcuts .btn { flex: 1; }
.ql-tabs { display: flex; gap: 4px; background: #f1f5f9; border-radius: 14px; padding: 4px; margin-bottom: 10px; position: sticky; top: -16px; z-index: 2; }
.ql-tab { flex: 1; border: none; background: none; font-family: inherit; font-weight: 600; font-size: 12.5px; color: #64748b; padding: 8px 4px; border-radius: 10px; cursor: pointer; }
.ql-tab.on { background: #fff; color: #92400e; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.ql-card { background: #fff; border: 2px solid #e2e8f0; border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; }
.ql-card.tracked { border-color: #f59e0b; background: #fffbeb; }
.ql-card.done { opacity: .85; }
.ql-card-head { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ql-ic { font-size: 24px; width: 38px; height: 38px; flex: none; display: flex; align-items: center; justify-content: center; background: #fef3c7; border-radius: 12px; }
.ql-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ql-tt b { font-size: 14px; color: #0f172a; }
.ql-tt small { font-size: 11px; font-weight: 600; }
.ql-prog { font-size: 11.5px; font-weight: 700; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 2px 8px; }
.ql-star { font-size: 16px; }
.ql-new { width: 22px; height: 22px; border-radius: 50%; background: #facc15; color: #78350f; font-weight: 800; display: flex; align-items: center; justify-content: center; animation: qtPulse 1.6s infinite; }
.ql-mini { font-size: 12px; color: #475569; margin-top: 6px; }
.ql-sum { font-size: 13px; color: #334155; line-height: 1.4; margin: 8px 0; }
.ql-step { font-size: 12.5px; color: #334155; padding: 5px 0 5px 4px; border-left: 3px solid #e2e8f0; padding-left: 8px; margin-left: 4px; }
.ql-step.done { color: #16a34a; border-color: #86efac; }
.ql-step.cur { border-color: #f59e0b; background: #fffbeb; border-radius: 0 10px 10px 0; }
.ql-step.future { color: #94a3b8; }
.ql-obj { font-size: 12.5px; margin: 4px 0 0 6px; color: #334155; }
.ql-obj.ok { color: #16a34a; text-decoration: line-through; }
.ql-bar { display: inline-block; width: 70px; height: 7px; background: #e2e8f0; border-radius: 99px; vertical-align: middle; margin: 0 4px; overflow: hidden; }
.ql-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #16a34a); }
.ql-n { font-size: 11px; font-weight: 700; color: #92400e; }
.ql-lock { font-size: 11.5px; color: #b91c1c; background: #fef2f2; border-radius: 8px; padding: 3px 8px; margin-top: 3px; text-decoration: none; }
.ql-hint { font-size: 11.5px; color: #0e7490; margin: 4px 0 2px 6px; }
.ql-true { background: #ecfeff; border-radius: 12px; padding: 6px 10px; margin: 8px 0; font-size: 12.5px; color: #155e75; }
.ql-true summary { cursor: pointer; font-weight: 600; }
.ql-true p { margin: 6px 0; line-height: 1.45; color: #334155; }
.ql-true a { color: #0e7490; font-weight: 600; }
.ql-rew { font-size: 12px; color: #166534; background: #f0fdf4; border-radius: 10px; padding: 5px 8px; margin: 6px 0; }
.ql-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ql-btns:empty { display: none; }
.ql-abandon { background: #fee2e2; color: #b91c1c; }
.ql-empty { text-align: center; color: #64748b; font-size: 13px; padding: 18px 10px; }
.ql-locked { font-size: 12.5px; color: #64748b; background: #f8fafc; border: 2px dashed #cbd5e1; border-radius: 14px; padding: 10px 12px; margin: 8px 0; }

/* ---------- location drawer + NPC modal quest blocks ---------- */
.lq-box, .nq-box { background: #fffbeb; border: 2px solid #fde68a; border-radius: 16px; padding: 8px 10px; margin: 0 0 12px; }
.lq-h, .nq-h { font-weight: 700; font-size: 13px; color: #7c2d12; margin-bottom: 4px; }
.lq-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px dashed #fde68a; }
.lq-row:first-of-type { border-top: none; }
.lq-row > span { font-size: 22px; }
.lq-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.lq-row b { font-size: 13px; color: #0f172a; }
.lq-row small { font-size: 11.5px; color: #64748b; }
.lq-row em { font-size: 11px; color: #a16207; }
.lq-row.obj b { color: #b45309; }
.nq-need { font-size: 12.5px; color: #92400e; background: #fef3c7; border-radius: 10px; padding: 5px 8px; margin: 4px 0; }
.nq-done { font-size: 12.5px; color: #166534; background: #dcfce7; border-radius: 10px; padding: 5px 8px; margin: 4px 0; }
.nq-offer { background: #fff; border: 2px solid #facc15; border-radius: 12px; padding: 8px 10px; margin: 6px 0; }
.nq-o-h { font-size: 13.5px; color: #0f172a; }
.nq-o-s { font-size: 12.5px; color: #475569; margin: 4px 0; line-height: 1.35; }
.nq-o-r { font-size: 11.5px; color: #166534; margin-bottom: 6px; }
.nq-offer em { font-size: 11.5px; color: #a16207; }
.nq-locked { font-size: 12px; color: #64748b; padding: 4px 0; }
.nq-ride { margin-top: 6px; }
.npc-chip .npc-qb, .npc-qbadge { margin-left: 3px; }

/* ---------- bag ---------- */
.bag-rig { position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 10px; border: 2px solid #fde68a; }
.bag-rig canvas { display: block; width: 100%; height: 96px; }
.bag-rig-tx { position: absolute; left: 10px; top: 8px; font-size: 13px; font-weight: 700; color: #7c2d12; text-shadow: 0 1px 0 #fff; line-height: 1.3; }
.bag-rig-tx span { font-weight: 600; font-size: 12px; color: #92400e; }
.bag-buffs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.bag-buff { font-size: 11.5px; background: #ede9fe; color: #5b21b6; border-radius: 999px; padding: 3px 9px; }
.bag-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.bag-cats::-webkit-scrollbar { display: none; }
.bag-cat { flex: none; border: 2px solid #e2e8f0; background: #fff; font-family: inherit; font-weight: 600; font-size: 12px; color: #475569; border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.bag-cat.on { border-color: #f59e0b; background: #fef3c7; color: #92400e; }
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.bag-detail { --rar: #94a3b8; display: grid; grid-template-columns: 56px 1fr; gap: 6px 10px; background: #fff; border: 2px solid var(--rar); border-radius: 16px; padding: 10px; margin-bottom: 10px; animation: qtIn .2s ease-out; }
.bag-d-ic { font-size: 40px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--rar) 15%, #fff); border-radius: 14px; }
.bag-d-tx b { font-size: 15px; color: #0f172a; }
.bag-d-tx p { font-size: 12.5px; color: #475569; margin: 4px 0 0; line-height: 1.35; }
.bag-d-tx .bag-eff { color: #166534; font-weight: 600; }
.bag-rar { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--rar); }
.bag-qty { font-size: 12px; font-weight: 700; color: #92400e; }
.bag-d-btns { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.bag-d-btns .btn { flex: 1; }

/* ---------- shop supplies ---------- */
.shop-group-title { font-size: 14px; margin: 4px 0 8px; color: #0f172a; }
.shop-item-card.supply { border-left: 5px solid var(--rar, #94a3b8); }
.shop-item-card.supply .have { font-size: 11px; color: #16a34a; font-weight: 600; }
.shop-use { font-size: 12px; color: #166534; margin: 4px 0 6px; }
#shop-supplies { margin-bottom: 14px; }

/* ---------- camp loot line ---------- */
.cu-loot { display: flex; align-items: center; justify-content: center; gap: 8px; background: #ede9fe; color: #4c1d95; border-radius: 14px; padding: 6px 10px; margin: 8px 0; font-size: 13.5px; animation: qcBurst .5s ease-out; }
.cu-loot-ic { font-size: 24px; }

/* ---------- nav with 6 buttons on narrow phones ---------- */
@media (max-width: 380px) { .nav-item { font-size: 10px; } .nav-icon { font-size: 20px; } }

.journal-stats { grid-template-columns: repeat(2, 1fr) !important; }

/* ===================== v44 Quest Guide ("How do I do this?") ===================== */
.q-tracker.expanded .qt-drawer { max-width: min(calc(100vw - 70px), 330px); }
.qt-guide {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  font-size: 10.8px;
  line-height: 1.28;
  color: #0f766e;
  background: rgba(204, 251, 241, 0.75);
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 3px 6px;
}
.qt-btn-go {
  background: linear-gradient(180deg, #2dd4bf, #0d9488) !important;
  border-color: #0f766e !important;
  color: #fff !important;
  font-size: 14px !important;
  animation: qtGoPulse 1.8s ease-in-out infinite;
}
@keyframes qtGoPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(13, 148, 136, 0); }
}
.ql-guide {
  margin: 5px 0 3px 18px;
  padding: 7px 9px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0fdfa, #ecfeff);
  border: 1px solid #99f6e4;
  color: #134e4a;
  font-size: 12px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ql-guide-t b { color: #0f766e; }
.ql-guide-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ql-gbtn {
  background: #0d9488 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 5px 11px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3);
}
.ql-gbtn:active { transform: scale(0.96); }
.nq-need .ql-guide, .npc-favour .ql-guide { margin-left: 0; margin-top: 6px; }
.shop-item-card.shop-focus {
  outline: 3px solid #14b8a6;
  outline-offset: 2px;
  animation: shopFocusPulse 1.1s ease-in-out 3;
}
@keyframes shopFocusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.55); }
  50% { box-shadow: 0 0 0 10px rgba(20, 184, 166, 0); }
}

/* ===================== v48 Universal Yellow Quest Target Markers ===================== */
/* Matches the golden-yellow map quest location marker (#facc15 fill, #b45309 border, bold '!') */
.q-target-host {
  position: relative !important;
}

.q-target-mark {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #fef08a 0%, #facc15 55%, #f59e0b 100%);
  border: 2px solid #b45309;
  box-shadow: 0 0 0 1.5px #ffffff, 0 3px 8px rgba(180, 83, 9, 0.55);
  color: #78350f;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 900;
  line-height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  pointer-events: none;
  animation: qTargetPinBob 1.6s ease-in-out infinite;
}

.q-target-mark::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #b45309;
}

#bottom-nav .nav-item.q-target-host .q-target-mark {
  top: 1px;
  right: 6px;
}

#btn-bottom-drawer-toggle.q-target-host {
  border-color: #facc15 !important;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.38), 0 6px 20px rgba(0, 0, 0, 0.45);
}

#btn-bottom-drawer-toggle.q-target-host .q-target-mark {
  top: -7px;
  right: -5px;
}

.shop-tab-btn.q-target-host {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.35);
}

.shop-tab-btn.q-target-host:not(.active) {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
}

.shop-tab-btn.q-target-host .q-target-mark {
  top: -7px;
  right: -4px;
}

.cu-actbtn.q-target-host,
.cu-roundbtn.q-target-host {
  box-shadow: 0 0 0 3px #facc15, 0 6px 18px rgba(180, 83, 9, 0.45) !important;
}

/* Highlighted Card (Shop Item, Camp Activity Row, Route Destination Card, NPC Chip) */
.q-target-card {
  position: relative;
  border: 2px solid #f59e0b !important;
  background: linear-gradient(135deg, #fffbeb 0%, #fef9c3 100%) !important;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.32), 0 6px 16px rgba(180, 83, 9, 0.16) !important;
}

.q-target-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fef08a 0%, #facc15 100%);
  border: 1.5px solid #b45309;
  box-shadow: 0 2px 5px rgba(180, 83, 9, 0.28);
  color: #78350f;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  vertical-align: middle;
  margin-left: 6px;
  animation: qTargetPinBob 1.8s ease-in-out infinite;
}

.q-target-pill-pin {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #b45309;
  color: #fef08a;
  font-size: 10.5px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.q-target-btn {
  position: relative;
  border: 2px solid #facc15 !important;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.42), 0 4px 12px rgba(180, 83, 9, 0.32) !important;
}

@keyframes qTargetPinBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2.5px) scale(1.06); }
}

