/* Quests (quests.js): dialogue window, quest log (J / Y), tracker, interact prompt, banners, edge arrow, pages.
   Same look as the Settings panel / pixel buttons (style.css). Colours: main = gold, side = blue, daily = green. */
:root { --qm:#ffd24a; --qs:#7ab8ff; --qd:#74e07c; }
.qt-m { color:var(--qm); } .qt-s { color:var(--qs); } .qt-d { color:var(--qd); }
#qPrompt[hidden], #lifePrompt[hidden], #qArrow[hidden], #qTrack[hidden] { display:none !important; }

/* ---------------------------------------------------------------- dialogue */
#qDlg { position:fixed; left:50%; bottom:calc(14px + env(safe-area-inset-bottom,0px)); transform:translateX(-50%); z-index:30;
  width:min(600px, calc(100vw - 16px)); max-height:min(70dvh, 560px); display:flex; flex-direction:column; color:#ecdfc2;
  font-family:var(--ui-font);
  background:var(--ui-wood); border-radius:var(--ui-r-panel); box-shadow:var(--ui-rim), 0 12px 40px rgba(0,0,0,.7);
  animation:qin .18s ease-out; }
@keyframes qin { from { opacity:0; transform:translate(-50%, 12px); } }
#qDlg .qdh { display:flex; align-items:baseline; gap:10px; padding:10px 14px 4px; border-bottom:2px solid #3c2a1a; }
#qDlg .qdn { color:#f3cf7a; font-size:17px; font-weight:700; }
#qDlg .qdr { color:#b8ab90; font-size:12px; font-style:italic; margin-left:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
#qDlg .qdq { margin-left:auto; font-size:13px; letter-spacing:.4px; text-align:right; }
#qDlg .qdq em { font-style:normal; opacity:.75; margin-left:6px; }
#qDlg .qdx { min-width:36px; min-height:32px; margin:0 0 0 6px; padding:0 10px; background:#2a1d12; color:#e6d8b8; border:0; cursor:pointer;
  box-shadow:var(--ui-box); font:inherit; }
#qDlg .qdb { flex:1; min-height:0; overflow-y:auto; padding:10px 16px 6px; font-size:16px; line-height:1.45; cursor:pointer;
  overscroll-behavior:contain; touch-action:pan-y; }
#qDlg .qdb p { margin:0 0 8px; min-height:1.2em; }
#qDlg .qdb p.cur::after { content:'▌'; color:#d9a548; animation:qblink .7s steps(1) infinite; margin-left:2px; }
@keyframes qblink { 50% { opacity:0; } }
#qDlg .qrw { margin:4px 16px 6px; padding:8px 10px; background:rgba(0,0,0,.28); border-radius:10px; box-shadow:inset 0 0 0 1px rgba(232,190,110,.22); font-size:14px; }
#qDlg .qrw b { color:#bda97f; font-weight:400; font-variant:small-caps; font-size:14px; letter-spacing:.05em; margin-right:6px; }
#qDlg .qrw .xp { color:#d6b4ff; margin-right:12px; } #qDlg .qrw .gold { color:#ffd27a; margin-right:12px; } #qDlg .qrw .ttl { color:#f6e7c1; }
.qitems { display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; margin-top:6px; }
.qitem { padding:6px 6px; min-height:44px; text-align:left; font:inherit; font-size:13px; line-height:1.2; cursor:pointer; color:#e6d8b8;
  background:#2a1d12; border:0; box-shadow:var(--ui-box); }
.qitem small { display:block; color:#a8977a; font-size:11px; margin-top:2px; }
.qitem.sel { background:linear-gradient(180deg, #4c3519, #33230f); box-shadow:var(--ui-box-sel), 0 0 12px rgba(232,180,74,.35); }
.qitem.ro { cursor:default; }
.qitem.r-common { color:#e4e4e4; } .qitem.r-uncommon { color:#7ee07a; } .qitem.r-rare { color:#6ab0ff; } .qitem.r-epic { color:#c88aff; }
#qDlg .qbtns { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:2px 6px; padding:2px 10px calc(4px + env(safe-area-inset-bottom,0px)); }
#qDlg .qbtns .pxbtn { min-height:42px; min-width:110px; padding:8px 16px; font-family:inherit; font-size:15px; font-weight:700; color:#1e0f05; }
#qDlg .qbtns .pxbtn.dark { color:#f3e6d6; }
#qDlg .qbtns .pxbtn.choice { flex:1 1 220px; justify-content:flex-start; text-align:left; font-weight:400; }
#qDlg .qbtns .pxbtn:disabled { filter:grayscale(.8) brightness(.6); cursor:not-allowed; }
@media (max-width:520px), (max-height:520px) {
  #qDlg .qdb { font-size:15px; padding:8px 12px 4px; }
  .qitems { grid-template-columns:1fr; }
  #qDlg .qbtns .pxbtn { min-height:40px; min-width:90px; }
}
@media (max-height:520px) { #qDlg { max-height:calc(100dvh - 16px); } }

/* ---------------------------------------------------------------- interact prompt */
#qPrompt, #lifePrompt { position:fixed; left:50%; bottom:calc(150px + env(safe-area-inset-bottom,0px)); transform:translateX(-50%); z-index:8;
  display:flex; align-items:center; gap:8px; padding:7px 14px 7px 8px; border:0; cursor:pointer; color:#f6e7c1;
  font:600 14px system-ui, -apple-system, "Segoe UI", sans-serif; background:rgba(16,11,7,.88);
  border-radius:999px; box-shadow:0 0 0 1px rgba(8,5,2,.9), inset 0 0 0 1px rgba(232,190,110,.5), 0 4px 14px rgba(0,0,0,.5); animation:qin .15s ease-out; touch-action:manipulation; }
#qPrompt kbd, #lifePrompt kbd { min-width:22px; padding:1px 6px; color:#2a1606; background:linear-gradient(#f8d982, #e3a640); font:700 12px system-ui, sans-serif;
  box-shadow:0 2px 0 #a9641d; text-align:center; }
body.touch #qPrompt, body.touch #lifePrompt { bottom:auto; top:38%; left:auto; right:200px; transform:none; padding:12px 16px; font-size:15px; }
body.touch #qPrompt kbd, body.touch #lifePrompt kbd { display:none; }
body.touch #lifePrompt { padding:18px 26px; font-size:17px; }   /* the life-skill tap target: big (lifeskills.js) */

/* ---------------------------------------------------------------- tracker (right side, under the minimap) */
#qTrack { position:fixed; right:8px; z-index:4; width:min(236px, 44vw); color:#efe3c6; pointer-events:none;
  font:600 12px system-ui, -apple-system, "Segoe UI", sans-serif; text-shadow:0 1px 2px #000, 0 0 3px #000; zoom:var(--ui, 1); }
#qTrack .qth { pointer-events:auto; display:flex; align-items:center; gap:6px; width:100%; min-height:26px; padding:2px 8px; border:0; cursor:pointer;
  color:#f3cf7a; font:700 12px system-ui, sans-serif; letter-spacing:.6px; text-transform:uppercase; text-align:left;
  background:rgba(10,8,6,.55); box-shadow:inset 0 0 0 1px rgba(255,220,160,.25); }
#qTrack .qth span { margin-left:auto; color:#bda97f; font-weight:400; }
#qTrack .qtl { padding:4px 2px 0; }
#qTrack.min .qtl { display:none; }
#qTrack .qtq { pointer-events:auto; margin:5px 0 7px; padding:0 4px 0 8px; border-left:2px solid currentColor; cursor:pointer; }
#qTrack .qtq.trk { background:linear-gradient(90deg, rgba(255,210,74,.12), rgba(0,0,0,0)); }
#qTrack .qtt { font-size:13px; }
#qTrack .qto { color:#e8dcc0; font-weight:500; padding-left:6px; margin-top:1px; }
#qTrack .qto.ok { color:#8fdc8a; text-decoration:line-through; text-decoration-color:rgba(143,220,138,.5); }
#qTrack .qto.wait { opacity:.45; }
#qTrack .qto.go { color:#ffe08a; }
#qTrack .qto.flash { animation:qflash .7s ease-out; }
@keyframes qflash { 0% { color:#fff; text-shadow:0 0 8px #ffe08a; transform:translateX(4px); } }
#qTrack .qbar { position:relative; height:9px; margin:3px 0 1px 6px; background:#1a120a; box-shadow:inset 0 0 0 1px #5a4024; }
#qTrack .qbar i { position:absolute; inset:0; transform-origin:0 50%; background:linear-gradient(#ffd27a, #c07a20); }
#qTrack .qbar.hp i { background:linear-gradient(#ff7a5a, #a02a18); }
#qTrack .qhint { color:#bda97f; font-weight:400; font-style:italic; padding-left:6px; margin-top:1px; font-size:11px; }
@media (max-height:520px) { #qTrack { width:min(200px, 36vw); font-size:11px; } #qTrack .qtt { font-size:12px; } #qTrack .qhint { display:none; } }

/* ---------------------------------------------------------------- the arrow toward the current objective */
#qArrow { position:fixed; left:0; top:0; z-index:4; width:34px; height:34px; margin:-17px 0 0 -17px; pointer-events:none; display:flex;
  align-items:center; justify-content:center; filter:drop-shadow(0 0 4px rgba(0,0,0,.9)); }
#qArrow i { width:0; height:0; border-left:9px solid transparent; border-right:9px solid transparent; border-bottom:20px solid var(--c, #ffd24a);
  filter:drop-shadow(0 0 5px var(--c, #ffd24a)); }
#qArrow b { position:absolute; top:30px; font:700 10px system-ui, sans-serif; color:#f6e7c1; text-shadow:0 1px 2px #000; white-space:nowrap; }

/* ---------------------------------------------------------------- quest log */
#qLog { position:fixed; z-index:35; left:50%; top:50%; transform:translate(-50%, -50%); width:min(760px, calc(100vw - 16px));
  height:min(560px, calc(100dvh - 16px)); font-family:var(--ui-font); }
#qLog .qlgrid { flex:1; min-height:0; display:grid; grid-template-columns:230px 1fr; }
#qLog .qllist { overflow-y:auto; border-right:2px solid #3c2a1a; padding:6px 8px; overscroll-behavior:contain; }
#qLog .qlrow { display:block; width:100%; text-align:left; margin:0 0 6px; padding:8px 10px; min-height:44px; border:0; cursor:pointer; font:inherit; font-size:14px;
  color:#e6d8b8; background:var(--ui-btn); box-shadow:var(--ui-box); }
#qLog .qlrow small { display:block; color:#a8977a; font-size:12px; }
#qLog .qlrow.sel { background:linear-gradient(180deg, #4c3519, #33230f); box-shadow:var(--ui-box-sel); }
#qLog .qlrow.rdy small { color:#ffe08a; }
#qLog .qlempty { color:#a8977a; font-size:14px; padding:8px 4px; }
#qLog .qldet { overflow-y:auto; padding:8px 16px 12px; overscroll-behavior:contain; font-size:15px; line-height:1.4; }
#qLog .qldet h3 { margin:2px 0 2px; font-size:19px; }
#qLog .qlmeta { color:#a8977a; font-size:13px; margin-bottom:8px; }
#qLog .qldesc { color:#d8caa8; font-style:italic; margin:6px 0 10px; }
#qLog .qlobj { margin:3px 0; } #qLog .qlobj.ok { color:#8fdc8a; } #qLog .qlobj.wait { opacity:.5; }
#qLog .qlobj::before { content:'◇ '; color:#bda97f; } #qLog .qlobj.ok::before { content:'◆ '; color:#8fdc8a; }
#qLog .qlsec { color:#bda97f; font-size:15px; letter-spacing:.06em; font-variant:small-caps; font-weight:600; margin:12px 0 4px; }
#qLog .qlbtns { display:flex; flex-wrap:wrap; gap:0 6px; margin-top:12px; }
#qLog .qlbtns .pxbtn { min-height:40px; min-width:0; padding:6px 14px; font-family:inherit; font-size:14px; font-weight:700; color:#1e0f05; }
#qLog .qlbtns .pxbtn.dark { color:#f3e6d6; }
#qLog .qlbtns .pxbtn.warn { --face1:#a8402c; --face2:#7a2a1c; --lip:#4a140c; --hi:#d8705a; color:#fff2e0; }
#qLog .qldone { color:#a8977a; font-size:13px; padding:4px 4px 8px; }
@media (max-width:640px) {
  #qLog .qlgrid { grid-template-columns:1fr; grid-template-rows:auto 1fr; }
  #qLog .qllist { border-right:0; border-bottom:2px solid #3c2a1a; max-height:34dvh; }
}

/* ---------------------------------------------------------------- banners + toasts + pages */
#qBanner { position:fixed; left:50%; top:20%; z-index:44; display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none;
  transform:translateX(-50%); animation:qban 3.8s ease-out forwards; filter:drop-shadow(0 0 8px rgba(0,0,0,.85)) drop-shadow(0 0 20px var(--g, rgba(255,190,80,.5))); }
#qBanner .qbrw { font:600 13px system-ui, -apple-system, "Segoe UI", sans-serif; color:#f3e6d6; background:rgba(16,10,6,.78); padding:5px 12px;
  border-radius:999px; box-shadow:inset 0 0 0 1px rgba(232,190,110,.4); text-shadow:0 1px 2px #000; max-width:90vw; text-align:center; }
@keyframes qban { 0% { opacity:0; transform:translateX(-50%) scale(.5); } 7% { opacity:1; transform:translateX(-50%) scale(1.12); }
  13% { transform:translateX(-50%) scale(1); } 82% { opacity:1; transform:translateX(-50%); } 100% { opacity:0; transform:translateX(-50%) translateY(-16px); } }
#qNarr { position:fixed; left:50%; top:13%; z-index:9; transform:translateX(-50%); width:min(560px, calc(100vw - 32px)); pointer-events:none;
  text-align:center; color:#e8dcc0; font:italic 16px Georgia, "Palatino Linotype", serif; text-shadow:0 1px 3px #000, 0 0 10px #000;
  transition:opacity .8s; }
#qNarr.hidden { opacity:0; }
#qRead { position:fixed; z-index:36; left:50%; top:50%; transform:translate(-50%, -50%); width:min(440px, calc(100vw - 16px)); max-height:calc(100dvh - 16px);
  overflow-y:auto; padding:18px 22px 14px; color:#2e1f10; font:16px/1.5 Georgia, "Palatino Linotype", serif;
  background:linear-gradient(#ecdcb4, #d6c092); border-radius:14px; box-shadow:0 0 0 2px #6b4320, 0 0 0 3px rgba(20,10,4,.6), inset 0 0 24px rgba(120,80,30,.25), 0 14px 40px rgba(0,0,0,.7); }
#qRead h3 { margin:0 0 10px; font-size:19px; text-align:center; color:#4a2a10; }
#qRead p { margin:0 0 8px; }
#qRead .qrfoot { display:flex; justify-content:center; }
#qRead .pxbtn { min-height:40px; font-family:inherit; font-weight:700; color:#1e0f05; }
