/* =====================================================================
   AETHERIA — quests.css
   Quest log (J "Missões"), the NPC quest dialog, the HUD tracker blocks and the minimap marks
   (js/ui.js section "QUESTS (UI)"; data and rules in js/quests.js). Same pixel theme as style.css.
   ===================================================================== */

/* ---------- marks: gold ! new, blue ! daily, gold ? to turn in, grey ? running ---------- */
.qg { display: inline-block; flex: 0 0 auto; min-width: 12px; font: 400 calc(13px * var(--txt))/1 var(--f-num); text-align: center; text-shadow: 0 1px 0 #000, 0 0 6px currentColor; }
.qg.q-av, .qg.q-rd { color: #ffd34d; }
.qg.q-dy { color: #6fc3ff; }
.qg.q-ac { color: #9a8f7c; text-shadow: 0 1px 0 #000; }
.qg.q-fl { color: #ffd34d; opacity: .45; }                       /* a quest waits here, but 5 are running */

/* ---------- NPC dialog: the quest text scrolls, the Aceitar / Entregar row stays in view (phone landscape) ---------- */
.w-dialog .win-b { display: flex; flex-direction: column; }
.w-dialog .win-b > * { flex: 0 0 auto; }
.w-dialog .win-b > .dl-box { flex: 0 1 auto; min-height: 48px; overflow-y: auto; scrollbar-width: thin; }
.w-dialog .win-b > .dl-btns { position: sticky; bottom: 0; z-index: 1; padding-top: 6px; background: var(--panel); }
@media (max-height: 500px) { .w-dialog .npc-ptw.big { width: 56px; height: 76px; } .w-dialog .dl-top { margin-bottom: 6px; } }
.qg.q-off { color: #5a5248; text-shadow: none; }

/* ---------- NPC dialog: the NPC's quest rows ---------- */
.dlq { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 6px; }
.dlq-row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 8px;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--edge); color: var(--parch);
  font: 600 calc(13px * var(--txt))/1.2 var(--f-ui); text-align: left; cursor: var(--cur-pointer);
}
.dlq-row:hover:not(:disabled) { border-color: var(--gold); background: rgba(40, 30, 46, .8); }
.dlq-row:focus-visible { outline: none; border-color: var(--gold2); }
.dlq-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlq-s { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 calc(9px * var(--txt))/1.2 var(--f-num); color: var(--dim); text-transform: uppercase; }
.dlq-row.off { opacity: .55; cursor: var(--cur-default); }
.dlq-row.easy .dlq-n { color: var(--dim); }
.npc-say2 { font-style: italic; color: var(--parch); }

/* ---------- quest card (dialog views, J detail) ---------- */
.qv { margin-top: 6px; }
.qv.offer { border-left-color: #ffd34d; }
.qv-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 4px; }
.qv-n { font-weight: 700; font-size: calc(15px * var(--txt)); color: var(--gold2); }
.qv-c { margin-left: auto; font: 400 calc(9px * var(--txt))/1.2 var(--f-num); color: var(--dim); text-transform: uppercase; }
.qv-c.daily { color: #6fc3ff; }
.qv-b { margin: 0 0 6px !important; font-size: calc(12px * var(--txt)); line-height: 1.4; color: var(--parch); }
.qobj { display: flex; flex-direction: column; gap: 3px; margin: 4px 0 6px; }
.qo { display: flex; align-items: baseline; gap: 6px; font-size: calc(13px * var(--txt)); line-height: 1.3; }
.qo-c { flex: 0 0 auto; width: 8px; height: 8px; border: 1px solid var(--bronze); background: rgba(0, 0, 0, .5); }
.qo.cur .qo-c { border-color: var(--gold2); background: rgba(244, 212, 124, .3); }
.qo.done .qo-c { border: 0; width: 9px; height: 9px; background: var(--exc); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.qo-t { flex: 1; min-width: 0; }
.qo.done .qo-t { color: var(--dim); text-decoration: line-through; text-decoration-color: rgba(154, 143, 124, .6); }
.qo-n { flex: 0 0 auto; font: 400 calc(10px * var(--txt))/1 var(--f-num); color: var(--parch); }
.qo.done .qo-n { color: var(--exc); }
.qo-w { margin: -1px 0 2px 14px; font-size: calc(11px * var(--txt)); color: var(--dim); }
.qo-bar { margin: 1px 0 2px 14px; }
.qo-bar .bar { height: 6px; }
.qv-carry { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: calc(12px * var(--txt)); color: #e8dcb8; }
.qi { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; background: linear-gradient(135deg, var(--c1, #c8a060) 0 55%, var(--c2, #ffffff) 55%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.qv-ti { margin-top: 4px; font-size: calc(12px * var(--txt)); line-height: 1.35; color: var(--dim); }
.qv-ti.ready { color: var(--exc); font-weight: 700; animation: glowText 1.4s ease-in-out infinite; }
.qrw-it { font-weight: 700; }
.qv-note { margin: 6px 0 0 !important; font-size: calc(12px * var(--txt)); color: var(--dim); }
.qv-note.warn { color: var(--danger); }
.qv-giver { margin-top: 6px; font-size: calc(12px * var(--txt)); color: var(--gold); }

/* ---------- J window "Missões" ---------- */
.w-quest { width: calc(430px * var(--txt-h)); }
/* opened at y 104: it ends above the HUD (orbs, potion slots); its body scrolls */
@media (min-width: 761px) { .w-quest { max-height: calc(100vh - var(--con-h, 116px) - 120px); } }
.qw-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.qw-tabs .btn { flex: 1 1 0; min-width: 0; padding: 0 6px; font-size: calc(12px * var(--txt)); }
.qw-tabs .btn.on { border-color: var(--gold); color: var(--gold2); background: linear-gradient(180deg, #4a3a22, #241a10); }
.qw-note { margin: 0 0 8px; font-size: calc(11px * var(--txt)); line-height: 1.35; color: var(--dim); }
.qw-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; max-height: 236px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bronze) var(--well); }
.qw-row {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; grid-template-areas: "g n t" "g s t";
  column-gap: 6px; align-items: center; width: 100%; padding: 5px 8px;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--edge); color: var(--parch);
  font: 600 calc(13px * var(--txt))/1.25 var(--f-ui); text-align: left; cursor: var(--cur-pointer);
}
.qw-row .qg { grid-area: g; }
.qw-rn { grid-area: n; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qw-rs { grid-area: s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 calc(11px * var(--txt))/1.3 var(--f-ui); color: var(--dim); }
.qw-tr { grid-area: t; width: 8px; height: 8px; background: var(--gold); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.qw-row:hover { border-color: var(--bronze); background: rgba(40, 30, 46, .7); }
.qw-row:focus-visible { outline: none; border-color: var(--gold2); }
.qw-row.sel { border-color: var(--gold); background: rgba(74, 58, 34, .45); }
.qw-row.off { opacity: .5; cursor: var(--cur-default); }
.qw-row.easy .qw-rn { color: var(--dim); }
.qw-chain { margin-bottom: 10px; padding: 6px 8px; background: rgba(0, 0, 0, .3); border: 1px solid var(--edge); }
.qw-chain.done { border-color: rgba(79, 224, 106, .45); }
.qw-ch-h { margin-bottom: 4px; font: 400 calc(18px * var(--txt))/1 var(--f-title); color: var(--gold2); }
.qw-chain .bar { height: 10px; }
.qw-chain.done .bar-f { background: linear-gradient(180deg, #b8ffb0, var(--exc) 50%, #1e7a2a); }
.qw-ch-l { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 5px; font-size: calc(11px * var(--txt)); line-height: 1.35; }
.qw-ch-q.ok { color: var(--exc); }
.qw-ch-q.run { color: var(--gold2); }
.qw-ch-q.no { color: #6a6256; }

/* ---------- HUD tracker: one block per tracked quest (the header shows running / max) ---------- */
.qt-q { padding: 3px 0 4px; }
.qt-q + .qt-q { margin-top: 2px; padding-top: 5px; border-top: 1px solid rgba(138, 106, 58, .35); }
.qt-q-h { display: flex; align-items: baseline; gap: 5px; margin-bottom: 2px; }
.qt-q-h .qg { font-size: calc(11px * var(--txt)); }
.qt-q-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: calc(12px * var(--txt)); color: var(--gold2); }
.qt-q:hover .qt-q-n { color: #fff2c0; }
.qt-q.done .qt-state { color: var(--exc); animation: glowText 1.4s ease-in-out infinite; }
.qt-q.done .qt-q-n { color: var(--exc); }
.qt-also { margin-top: 1px; font-size: calc(11px * var(--txt)); opacity: .85; }        /* other objectives that count now (parallel) */
.qt-wait { color: var(--danger); }                                    /* "… reaparece em ~X min" (boss down) */
.qt-list.hide + .qt-evo { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- minimap: upright marks over the rotated map ---------- */
.mm-mk { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: auto; }

@media (max-width: 760px) {
  .qw-list { max-height: none; }
  .dlq-row { min-height: 40px; }
}
/* phones: the tracker keeps to two short blocks (the J log has the rest) */
@media (max-width: 560px) {
  .qt-q:nth-child(n+3) { display: none; }
  .qt-q .qt-state, .qt-q .qt-also { display: none; }
  .qt-q.done .qt-state { display: block; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .qt-q .qt-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (max-height: 500px) and (min-width: 561px) {
  .qt-q .bar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .qv-ti.ready, .qt-q.done .qt-state { animation: none; }
}
