:root {
  --quest-ember: #d9483f;
  --quest-ember-dark: #a82f2b;
  --quest-flame: #efad3e;
  --quest-wine: #5a2638;
  --quest-night: #102f38;
}

body.wl-quests { color: #2f4143; }
.wl-quest-main { width: min(1280px, calc(100% - 34px)); margin: 30px auto 70px; }
.wl-quest-main a { color: #176475; }
.wl-quest-main a:hover { color: var(--quest-ember-dark); }

.wl-quest-breadcrumbs { margin: 0 0 20px; color: #667879; font-size: 14px; font-weight: 700; }
.wl-quest-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 7px 10px; align-items: center; margin: 0; padding: 0; list-style: none; }
.wl-quest-breadcrumbs li:not(:last-child)::after { margin-left: 10px; color: #aab2ad; content: "›"; }
.wl-quest-breadcrumbs a { text-decoration: none; }

.wl-quest-hero {
  position: relative;
  min-height: 475px;
  overflow: hidden;
  border: 1px solid rgba(107, 54, 42, .32);
  border-radius: 18px;
  background: #40170f center/cover no-repeat;
  box-shadow: var(--atlas-shadow);
  isolation: isolate;
}
.wl-quest-hero::before { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(90deg, rgba(18, 34, 36, .92) 0%, rgba(25, 35, 35, .67) 42%, rgba(53, 22, 15, .12) 76%); }
.wl-quest-hero::after { position: absolute; z-index: -1; right: 0; bottom: 0; left: 0; height: 5px; content: ""; background: linear-gradient(90deg, var(--quest-flame), var(--quest-ember), transparent 80%); }
.wl-quest-hero-content { display: flex; min-height: 475px; max-width: 710px; padding: clamp(38px, 6vw, 78px); flex-direction: column; justify-content: flex-end; color: #fff; }
.wl-quest-kicker { color: #ffd069; font-size: 13px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.wl-quest-hero h1 { max-width: 680px; margin: 10px 0 14px; color: #fff; font: 700 clamp(44px, 7vw, 76px)/.98 var(--atlas-serif); text-wrap: balance; text-shadow: 0 3px 18px rgba(0, 0, 0, .42); }
.wl-quest-hero p { max-width: 620px; margin: 0; color: rgba(255,255,255,.9); font-size: clamp(16px, 2vw, 20px); line-height: 1.55; }
.wl-quest-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.wl-quest-tag { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 7px 12px; color: #fff; background: rgba(13, 49, 58, .86); border: 1px solid rgba(255,255,255,.22); border-radius: 8px; font-size: 13px; font-weight: 800; }
.wl-quest-tag::before { width: 7px; height: 7px; content: ""; background: var(--quest-flame); border-radius: 50%; box-shadow: 0 0 0 3px rgba(239,173,62,.16); }

.wl-quest-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; margin-top: 28px; align-items: start; }
.wl-quest-content { min-width: 0; }
.wl-quest-toc { position: sticky; top: 103px; padding: 22px; background: rgba(255,253,248,.97); border: 1px solid var(--atlas-line); border-radius: 14px; box-shadow: var(--atlas-shadow-soft); }
.wl-quest-toc strong { display: block; margin-bottom: 12px; color: var(--atlas-ink); font: 700 24px var(--atlas-serif); }
.wl-quest-toc ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.wl-quest-toc a { display: block; padding: 8px 10px; border-radius: 7px; color: #526568; font-size: 13px; font-weight: 750; line-height: 1.35; text-decoration: none; }
.wl-quest-toc a:hover, .wl-quest-toc a[aria-current="location"] { color: var(--quest-ember-dark); background: #f8ebe7; }
.wl-quest-progress { height: 5px; margin: 0 0 16px; overflow: hidden; background: #e8e2d8; border-radius: 99px; }
.wl-quest-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--quest-flame), var(--quest-ember)); transition: width .25s ease; }
.wl-quest-progress-label { display: block; margin-top: 10px; color: #758180; font-size: 12px; font-weight: 700; }

.wl-quest-section { margin-bottom: 28px; padding: clamp(24px, 4vw, 42px); background: rgba(255,253,248,.98); border: 1px solid var(--atlas-line); border-radius: 16px; box-shadow: var(--atlas-shadow-soft); }
.wl-quest-section h2 { margin: 0 0 20px; color: var(--atlas-ink); font: 700 clamp(30px, 4vw, 43px)/1.08 var(--atlas-serif); }
.wl-quest-section h3 { margin: 25px 0 11px; color: var(--atlas-ink-2); font: 700 24px/1.2 var(--atlas-serif); }
.wl-quest-section p { margin: 0 0 15px; font-size: 16px; line-height: 1.72; }
.wl-quest-section > :last-child { margin-bottom: 0; }
.wl-quest-lead { color: #4d5e5f; font-size: 18px !important; }
.wl-quest-callout { margin: 20px 0; padding: 17px 19px; color: #3d4c4d; background: #fbf1dc; border-left: 4px solid var(--quest-flame); border-radius: 0 9px 9px 0; line-height: 1.6; }
.wl-quest-callout strong { color: #6f3b22; }
.wl-quest-callout.is-danger { background: #fae9e5; border-left-color: var(--quest-ember); }

.wl-quest-facts, .wl-quest-prep, .wl-quest-reward-grid, .wl-quest-dungeon-grid { display: grid; gap: 12px; }
.wl-quest-facts { grid-template-columns: repeat(4, 1fr); }
.wl-quest-fact { padding: 17px; background: #f6f0e5; border: 1px solid #ded5c4; border-radius: 10px; }
.wl-quest-fact small { display: block; margin-bottom: 5px; color: #73807e; font-size: 11px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.wl-quest-fact strong { color: var(--atlas-ink); font-size: 20px; }

.wl-quest-prep { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 20px; }
.wl-quest-prep li { position: relative; min-height: 64px; margin: 0; padding: 15px 16px 15px 45px; background: #fff; border: 1px solid #e1d9cb; border-radius: 10px; list-style: none; line-height: 1.5; }
.wl-quest-prep li::before { position: absolute; top: 18px; left: 17px; width: 16px; height: 16px; content: ""; border: 2px solid var(--quest-flame); border-radius: 4px; }

.wl-quest-route { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 0 22px; padding: 0; counter-reset: quest-route; list-style: none; }
.wl-quest-route li { min-width: 0; counter-increment: quest-route; }
.wl-quest-route li:last-child { grid-column: 1 / -1; }
.wl-quest-route a { position: relative; display: grid; min-height: 66px; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; align-content: center; padding: 11px 14px; color: #415456; background: #f8f3e9; border: 1px solid #dfd5c5; border-radius: 10px; text-decoration: none; }
.wl-quest-route a::before { display: grid; width: 28px; height: 28px; grid-row: 1 / span 2; place-items: center; align-self: center; color: #fff; background: var(--quest-ember); border-radius: 50%; content: counter(quest-route); font-size: 12px; font-weight: 900; }
.wl-quest-route b { color: var(--atlas-ink); font-size: 14px; line-height: 1.3; }
.wl-quest-route span { color: #6a7878; font-size: 12px; line-height: 1.35; }
.wl-quest-route a:hover { color: inherit; background: #fff8eb; border-color: #d8b86b; transform: translateY(-1px); }

.wl-quest-chapter { scroll-margin-top: 104px; }
.wl-quest-chapter + .wl-quest-chapter { margin-top: 22px; }
.wl-quest-chapter > header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.wl-quest-number { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; color: #fff; background: linear-gradient(145deg, var(--quest-ember), var(--quest-wine)); border-radius: 11px; box-shadow: 0 6px 14px rgba(168,47,43,.2); font-weight: 900; }
.wl-quest-chapter h2 { margin-bottom: 4px; }
.wl-quest-chapter-subtitle { color: #72807f; font-size: 14px; font-weight: 700; }
.wl-quest-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.wl-quest-step { position: relative; display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 13px; padding: 17px 18px; background: #fff; border: 1px solid #e2d9cb; border-radius: 11px; }
.wl-quest-step input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--quest-ember); cursor: pointer; }
.wl-quest-step label { cursor: pointer; }
.wl-quest-step-title { display: block; color: #263b3f; font-size: 16px; font-weight: 800; line-height: 1.45; }
.wl-quest-step-note { display: block; margin-top: 6px; color: #637172; font-size: 14px; line-height: 1.55; }
.wl-quest-step:has(input:checked) { opacity: .63; background: #f2efe8; }
.wl-quest-step:has(input:checked) .wl-quest-step-title { text-decoration: line-through; }
.wl-coord { display: inline-flex; margin: 4px 3px 0 0; padding: 3px 7px; color: #8b332e; background: #faeae5; border: 1px solid #efcbc4; border-radius: 5px; font: 800 12px var(--atlas-sans); white-space: nowrap; }
.wl-quest-link { display: inline-flex; margin-top: 8px; align-items: center; gap: 6px; font-size: 13px; font-weight: 850; text-decoration: none; }
.wl-quest-link::after { content: "→"; }

.wl-quest-media-block { margin-top: 28px; padding-top: 24px; border-top: 1px solid #e4dbcd; }
.wl-quest-media-heading { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.wl-quest-media-heading h3 { margin: 0; }
.wl-quest-media-heading > span { color: #7a8684; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.wl-quest-media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.wl-quest-media { min-width: 0; margin: 0; overflow: hidden; background: #f7f1e7; border: 1px solid #dcd1c0; border-radius: 12px; box-shadow: 0 8px 20px rgba(34, 52, 54, .08); }
.wl-quest-media-image { position: relative; display: block; overflow: hidden; color: #fff; background: #102f38; aspect-ratio: 16 / 9; }
.wl-quest-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease, filter .28s ease; }
.wl-quest-media figcaption { display: grid; gap: 7px; padding: 14px 15px 16px; }
.wl-quest-media figcaption strong { color: var(--atlas-ink); font: 700 18px/1.2 var(--atlas-serif); }
.wl-quest-media figcaption span { color: #58696a; font-size: 13px; line-height: 1.5; }

.wl-quest-dungeon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 18px 0; }
.wl-quest-dungeon { padding: 18px; background: linear-gradient(145deg, #123d47, #1e5964); border-radius: 12px; color: #fff; }
.wl-quest-dungeon strong, .wl-quest-dungeon small { display: block; }
.wl-quest-dungeon strong { margin-bottom: 6px; color: #fff; font: 700 22px var(--atlas-serif); }
.wl-quest-dungeon small { color: rgba(255,255,255,.72); line-height: 1.45; }
.wl-quest-dungeon a { display: inline-block; margin-top: 11px; color: #ffd168; font-size: 13px; font-weight: 850; text-decoration: none; }

.wl-quest-boss { padding: 24px; color: #fff; background: linear-gradient(135deg, #3c1717, #712b23 55%, #263b3d); border: 1px solid rgba(191,85,55,.5); border-radius: 13px; }
.wl-quest-boss h3 { margin-top: 0; color: #ffd06c; }
.wl-quest-boss ul { margin: 14px 0 0; padding-left: 20px; }
.wl-quest-boss li { margin: 8px 0; line-height: 1.55; }
.wl-quest-boss .wl-quest-callout { color: #463a33; }
.wl-quest-thresholds { margin: 18px 0 8px; overflow: hidden; border: 1px solid rgba(255, 208, 108, .32); border-radius: 10px; }
.wl-quest-thresholds > div { display: grid; grid-template-columns: .55fr 1fr 1.25fr; gap: 12px; align-items: center; padding: 11px 14px; }
.wl-quest-thresholds > div + div { border-top: 1px solid rgba(255,255,255,.12); }
.wl-quest-thresholds-heading { color: #ffd06c; background: rgba(0,0,0,.18); font-size: 11px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.wl-quest-thresholds [role="row"]:not(.wl-quest-thresholds-heading) span { color: rgba(255,255,255,.82); }
.wl-quest-threshold-note { margin: 8px 0 16px; color: rgba(255,255,255,.7); font-size: 12px; line-height: 1.5; }

.wl-quest-reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wl-quest-reward { display: grid; min-height: 116px; grid-template-columns: 72px minmax(0,1fr); gap: 15px; align-items: center; padding: 17px; background: #f6f0e5; border: 1px solid #dfd4c0; border-radius: 12px; }
.wl-quest-reward img { width: 72px; height: 72px; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 5px 6px rgba(66,37,25,.18)); }
.wl-quest-reward-glyph { display: grid; width: 62px; height: 62px; place-items: center; color: #fff5d2; background: linear-gradient(145deg, var(--quest-ember), var(--quest-wine)); border: 2px solid #e7b957; border-radius: 50%; box-shadow: 0 5px 12px rgba(89,36,37,.22); font: 800 28px/1 var(--atlas-serif); }
.wl-quest-reward strong { display: block; color: var(--atlas-ink); font-size: 17px; }
.wl-quest-reward span { display: block; margin-top: 5px; color: #687473; font-size: 13px; line-height: 1.45; }
.wl-quest-reward.is-relic { background: linear-gradient(140deg, #fff5da, #f8e2a4); border-color: #ddb85e; }

.wl-quest-resources { overflow: hidden; border: 1px solid #ded4c4; border-radius: 12px; }
.wl-quest-resources > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; padding: 15px 18px; background: #fff; }
.wl-quest-resources > div + div { border-top: 1px solid #e5ddd1; }
.wl-quest-resources strong { color: var(--atlas-ink); }
.wl-quest-resources b { color: var(--quest-ember-dark); font-size: 18px; }

.wl-quest-index-hero { display: grid; min-height: 390px; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); overflow: hidden; background: linear-gradient(130deg, #0f3a45, #184e58 55%, #572a29); border: 1px solid rgba(18,60,70,.42); border-radius: 18px; box-shadow: var(--atlas-shadow); }
.wl-quest-index-copy { align-self: center; padding: clamp(35px, 6vw, 74px); color: #fff; }
.wl-quest-index-copy h1 { margin: 9px 0 13px; color: #fff; font: 700 clamp(48px, 7vw, 76px)/1 var(--atlas-serif); }
.wl-quest-index-copy p { max-width: 650px; margin: 0; color: rgba(255,255,255,.8); font-size: 18px; line-height: 1.6; }
.wl-quest-index-art { min-height: 330px; background: linear-gradient(90deg, #184e58 0%, transparent 28%), url('/quests/assets/dofus-pourpre-hero.webp') 57% center/cover no-repeat; }
.wl-quest-catalog { margin-top: 28px; }
.wl-quest-card { display: grid; min-height: 320px; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); overflow: hidden; color: inherit !important; background: #fffdf8; border: 1px solid var(--atlas-line); border-radius: 16px; box-shadow: var(--atlas-shadow-soft); text-decoration: none; }
.wl-quest-card:hover { transform: translateY(-3px); box-shadow: var(--atlas-shadow); }
.wl-quest-card-art { background: url('/quests/assets/dofus-pourpre-hero.webp') center/cover no-repeat; }
.wl-quest-card-copy { align-self: center; padding: clamp(26px, 5vw, 54px); }
.wl-quest-card-copy h2 { margin: 8px 0 12px; color: var(--atlas-ink); font: 700 clamp(34px, 4vw, 48px)/1.05 var(--atlas-serif); }
.wl-quest-card-copy p { margin: 0; color: #596a6c; line-height: 1.6; }
.wl-quest-card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.wl-quest-card-meta span { padding: 6px 9px; color: #4a5c5d; background: #f5efe4; border: 1px solid #ded5c7; border-radius: 6px; font-size: 12px; font-weight: 800; }
.wl-quest-more { margin: 24px 0 0; padding: 22px; color: #657372; text-align: center; background: rgba(255,253,248,.72); border: 1px dashed #cfc5b6; border-radius: 12px; }

.wl-quest-verified { display: flex; gap: 12px; align-items: flex-start; margin-top: 22px; padding-top: 18px; color: #697675; border-top: 1px solid #e2d9cd; font-size: 13px; line-height: 1.55; }
.wl-quest-verified::before { flex: 0 0 auto; color: #487c5a; content: "✓"; font-weight: 900; }
@media (max-width: 980px) {
  .wl-quest-layout { grid-template-columns: 1fr; }
  .wl-quest-toc { position: static; grid-row: 1; }
  .wl-quest-facts { grid-template-columns: repeat(2, 1fr); }
  .wl-quest-index-hero, .wl-quest-card { grid-template-columns: 1fr; }
  .wl-quest-index-art { min-height: 260px; grid-row: 1; }
  .wl-quest-index-copy { grid-row: 2; }
  .wl-quest-card-art { min-height: 260px; }
}

@media (max-width: 640px) {
  .wl-quest-main { width: min(100% - 20px, 1280px); margin-top: 16px; }
  .wl-quest-hero, .wl-quest-hero-content { min-height: 450px; }
  .wl-quest-hero { background-position: 62% center; }
  .wl-quest-hero-content { padding: 28px 22px; background: linear-gradient(0deg, rgba(14,37,41,.95), rgba(14,37,41,.18)); justify-content: flex-end; }
  .wl-quest-facts, .wl-quest-prep, .wl-quest-reward-grid, .wl-quest-dungeon-grid, .wl-quest-route { grid-template-columns: 1fr; }
  .wl-quest-route li:last-child { grid-column: auto; }
  .wl-quest-section { padding: 23px 18px; }
  .wl-quest-step { padding: 15px 13px; }
  .wl-quest-media-heading { align-items: flex-start; flex-direction: column; }
  .wl-quest-thresholds > div { grid-template-columns: .45fr 1fr; }
  .wl-quest-thresholds > div > :last-child { grid-column: 2; }
  .wl-quest-thresholds-heading > :last-child { display: none; }
  .wl-quest-reward { grid-template-columns: 58px minmax(0,1fr); }
  .wl-quest-reward img { width: 58px; height: 58px; }
  .wl-quest-reward-glyph { width: 54px; height: 54px; font-size: 24px; }
}

@media print {
  .wl-atlas-header, .wl-atlas-footer, .wl-quest-toc { display: none !important; }
  body.wl-atlas { background: #fff; }
  .wl-quest-main { width: 100%; margin: 0; }
  .wl-quest-section, .wl-quest-hero { break-inside: avoid; box-shadow: none; }
}
