/* Quest page — styled after the in-game quest window (wnd_quest textures).
   Palette sampled from DBO client wnd_quest1.png / wnd_quest2.png. */
.quest-page {
  --q-frame: #5a6975;
  --q-edge-dark: #0d1115;
  --q-title-top: #2b4a5e;
  --q-title-bot: #16252f;
  --q-body-top: #111a20;
  --q-body-bot: #1b242b;
  --q-gold: #ffe6a3;
  --q-blue-top: #073650;
  --q-blue-bot: #17567a;
}

.quest-window {
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid var(--q-frame);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--q-body-top), var(--q-body-bot));
  box-shadow: 0 0 0 1px var(--q-edge-dark), 0 10px 34px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

/* ── Title bar ── */
.quest-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: linear-gradient(180deg, var(--q-title-top), var(--q-title-bot));
  border-bottom: 1px solid var(--q-edge-dark);
  box-shadow: inset 0 1px 0 rgba(138, 154, 162, 0.55), inset 0 14px 18px -14px rgba(255, 255, 255, 0.18);
}
.quest-marker {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.quest-titlebar-text { flex: 1 1 auto; min-width: 0; }
.quest-titlebar-name {
  display: block;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--q-gold);
  text-shadow: 0 1px 2px #000;
  line-height: 1.2;
}
.quest-titlebar-sub {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
  font-size: 11px;
  color: #a9cbe2;
}
.quest-cat-badge {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(138, 154, 162, 0.4);
  border-radius: 10px;
  padding: 1px 8px;
  color: #cfe6f5;
}
.quest-hdr-reward {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.quest-hdr-reward.exp { color: #b6fb6a; }
.quest-hdr-reward.zeni { color: #ffd24b; }

.quest-dot {
  margin-left: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd27a, #d98a16 70%, #8a5408);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  flex: 0 0 auto;
}

/* ── Body ── */
.quest-window-body { padding: 16px; }

.quest-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 16px;
  margin-bottom: 14px;
}
.quest-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 2px;
  border-bottom: 1px solid rgba(138, 154, 162, 0.12);
  font-size: 12px;
}
.quest-meta-row .k { color: #8fa6b3; }
.quest-meta-row .v { color: #eef4f8; text-align: right; }
.quest-meta-row .v a { color: #6fc0ff; }

/* ── Blue panels (CSS recreation of the in-game quest panel) ── */
.quest-panel {
  background: linear-gradient(180deg, var(--q-blue-top) 0%, #0d4767 45%, var(--q-blue-bot) 100%);
  border: 1px solid rgba(130, 182, 214, 0.5);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -14px 26px -14px rgba(0, 0, 0, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.35);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.quest-panel:last-child { margin-bottom: 0; }
.quest-panel > h2 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #ffe6a3;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  border: none;
  letter-spacing: 0.3px;
}
.quest-panel p {
  margin: 0 0 6px;
  color: #eaf3fb;
  font-size: 12.5px;
  line-height: 1.5;
}
.quest-panel p:last-child { margin-bottom: 0; }
.quest-panel a { color: #bfe5ff; }
/* Objective lead line(s) before the description */
.quest-objective-line {
  color: #ffe6a3 !important;
  font-weight: 600;
}
.quest-objective-line + p:not(.quest-objective-line) { margin-top: 8px; }

/* Structured objective tasks (kill N mob / collect N item) */
.quest-tasks {
  list-style: none;
  margin: 8px 0;
  padding: 0;
}
.quest-tasks li {
  position: relative;
  padding: 4px 0 4px 18px;
  font-size: 12.5px;
  color: #eaf3fb;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.quest-tasks li:last-child { border-bottom: none; }
.quest-tasks li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd24b;
  box-shadow: 0 0 4px rgba(255, 210, 75, 0.7);
}
.quest-task-verb { color: #ffe6a3; font-weight: 600; }
.quest-task-count { color: #b6fb6a; font-weight: 700; }
.quest-tasks a { color: #bfe5ff; }
.quest-panel ul { margin: 0; padding-left: 18px; }
.quest-panel li { color: #eaf3fb; font-size: 12.5px; margin: 2px 0; }

/* ── Reward / item slots ── */
.quest-rewards-currency {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.quest-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.quest-chip.exp { color: #b6fb6a; }
.quest-chip.zeni { color: #ffd24b; }

.quest-reward-group + .quest-reward-group { margin-top: 8px; }
.quest-reward-label {
  font-size: 11px;
  color: #cfe6f5;
  margin: 0 0 5px;
  opacity: 0.85;
}
.quest-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quest-slot-frame {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 1px solid #3a5468;
  border-radius: 5px;
  background: linear-gradient(180deg, #0a0f14, #1b2730);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.7);
  text-decoration: none;
}
.quest-slot-frame img {
  position: absolute;
  inset: 2px;
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.quest-slot-count {
  position: absolute;
  right: 1px;
  bottom: -1px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 2px #000;
}
.quest-slot-frame:hover {
  border-color: #6fc0ff;
  box-shadow: inset 0 0 7px rgba(0, 0, 0, 0.7), 0 0 6px rgba(111, 192, 255, 0.5);
}

/* Two-column row: rewards (left) + map (right) */
.quest-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.quest-cols > .quest-panel { margin-bottom: 0; }
.quest-col-left { flex: 1 1 240px; }
.quest-col-left > .quest-panel { margin-bottom: 14px; }
.quest-col-left > .quest-panel:last-child { margin-bottom: 0; }
.quest-col-map { flex: 0 1 auto; }

/* Objective map sits flush inside the blue panel, kept compact */
.quest-map-panel .spawn-map-container { margin-bottom: 0; }
.quest-map-panel .spawn-map-img { width: 100%; max-width: 360px; }
.quest-map-panel .spawn-map { max-width: 360px; }

/* Map markers: start (giver dot), go (objective ring), end (turn-in X) */
.quest-go-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border: 2px solid #ff3b3b;
  border-radius: 50%;
  background: rgba(255, 59, 59, 0.28);
  box-shadow: 0 0 6px rgba(255, 59, 59, 0.8), inset 0 0 3px rgba(255, 59, 59, 0.6);
  pointer-events: none;
}
.quest-start-marker {
  position: absolute;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  background: #3aa0ff;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(58, 160, 255, 0.9);
  pointer-events: none;
}
.quest-end-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 2px #000, 0 0 5px #18d24a, 0 0 8px #18d24a;
  pointer-events: none;
}
.quest-map-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 11px;
  color: #cfe6f5;
}
.quest-map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.quest-map-legend .lg {
  display: inline-block;
  width: 13px;
  height: 13px;
  box-sizing: border-box;
  text-align: center;
  line-height: 12px;
  font-style: normal;
}
.quest-map-legend .lg-start { background: #3aa0ff; border: 2px solid #fff; border-radius: 50%; }
.quest-map-legend .lg-go { border: 2px solid #ff3b3b; background: rgba(255, 59, 59, 0.28); border-radius: 50%; }
.quest-map-legend .lg-end { color: #fff; font-weight: 900; text-shadow: 0 0 4px #18d24a; }

.inline-icon { width: 18px; height: 18px; vertical-align: -4px; }
