/* WoW Journey — character-select hero, war-table replay, faction palettes.
   Tokens switch on <html data-faction="alliance|horde|neutral">, set from the data. */

:root,
[data-faction="alliance"] {
  --bg: #0d1626;        /* midnight */
  --bg-2: #111d31;
  --surface: #1c2a44;   /* steel */
  --line: #2a3b5c;
  --faction: #2f5fb3;   /* royal blue */
  --accent: #d9b45a;    /* gold */
  --accent-ink: #1a1408;
  --ink: #e9e1cc;       /* parchment ink */
  --ink-2: #b7b2a3;
  --ink-3: #8a8d93;
  --blood: #d0573f;
  --moss: #8fb35e;
  --sky: #8fb3e8;
  --violet: #b59ae0;
  --table: #121c2e;
}
[data-faction="horde"] {
  --bg: #140d0b;        /* soot */
  --bg-2: #1b1210;
  --surface: #2a1a16;   /* iron */
  --line: #3d2722;
  --faction: #a3271f;   /* blood */
  --accent: #c98a3c;    /* bronze */
  --accent-ink: #1a0f06;
  --ink: #eadfcf;       /* bone */
  --ink-2: #bfb1a0;
  --ink-3: #94857a;
  --blood: #e2563f;
  --moss: #9cb35e;
  --sky: #d6a77a;
  --violet: #c99ad0;
  --table: #1d1311;
}
[data-faction="neutral"] {
  --bg: #0e1617;
  --bg-2: #122021;
  --surface: #1b2a2b;
  --line: #2a3d3e;
  --faction: #3aa39a;
  --accent: #b9a6e8;
  --accent-ink: #120d1d;
  --ink: #e4e8e3;
  --ink-2: #aab5b1;
  --ink-3: #7f8d8a;
  --blood: #e0604a;
  --moss: #8fc28a;
  --sky: #86c6c0;
  --violet: #b9a6e8;
  --table: #122021;
}

:root {
  --display: "Alegreya SC", "Palatino Linotype", Palatino, Georgia, serif;
  --serif: "Alegreya", "Palatino Linotype", Palatino, Georgia, serif;
  --wrap: 1160px;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: .01em; }
h2 { font-size: 34px; line-height: 1.1; }
.note, .lede { color: var(--ink-2); margin: 6px 0 0; }
.lede { max-width: 56ch; font-size: 19px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 17px/1 var(--display); letter-spacing: .02em;
  padding: 14px 22px; border-radius: 3px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
}
.btn-primary {
  color: var(--accent-ink);
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 78%, #000));
  border-color: color-mix(in srgb, var(--accent) 60%, #000);
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 18px color-mix(in srgb, var(--accent) 25%, transparent);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-quiet { color: var(--ink); background: transparent; border-color: var(--line); }
.btn-quiet:hover { border-color: var(--accent); color: var(--accent); }
.link-btn { font: 500 15px/1 var(--serif); color: var(--ink-2); background: none; border: 1px solid var(--line); border-radius: 3px; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.link-btn:hover { color: var(--accent); border-color: var(--accent); }
.link-btn[hidden] { display: none; }

/* ------------------------------------------------------------ hero: the character select screen */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 72% 62%, color-mix(in srgb, var(--faction) 38%, transparent), transparent 70%),
    radial-gradient(600px 300px at 72% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  border-bottom: 1px solid var(--line);
}
.stage::before { /* faint banner cloth hanging from the top of the page, centred behind the character */
  content: ""; position: absolute; top: -300px; bottom: 6%; left: 50%; width: min(58%, 340px); transform: translateX(-50%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--faction) 34%, transparent), color-mix(in srgb, var(--faction) 10%, transparent) 75%, transparent);
  clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%, 0 90%);
  opacity: .6; pointer-events: none;
}
/* official game logo, displayed unaltered (resize only) */
.brandbar { position: absolute; z-index: 2; top: 18px; left: 0; right: 0; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); pointer-events: none; }
.brandbar a { pointer-events: auto; }
.brandbar[hidden] { display: none; }
.brandbar a { display: inline-block; line-height: 0; }
.brandbar img { width: 132px; height: auto; display: block; }
.has-logo .hero-inner { padding-top: 120px; }
.hero-inner {
  position: relative;
  max-width: var(--wrap); margin: 0 auto; padding: 56px var(--gutter) 28px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 32px;
}
.hero-text { padding-bottom: 0; }
/* official crest, displayed unaltered (resize only) */
.emblem { position: relative; width: 124px; height: 124px; margin: 0 0 14px -14px; }
.emblem::before { /* light behind the crest; the crest image itself is untouched */
  content: ""; position: absolute; inset: -10%; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--ink) 22%, transparent), transparent 75%);
}
.emblem img { position: relative; }
.emblem img { width: 100%; height: 100%; object-fit: contain; display: block; }
html:not(.has-crest) .emblem { display: none; }
.hero h1 {
  font-size: clamp(64px, 11vw, 132px);
  line-height: .88;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
  text-shadow: 0 2px 30px color-mix(in srgb, var(--faction) 45%, transparent);
}
.hero h1 .surname { display: block; font-size: .42em; line-height: 1.05; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); margin-top: .12em; }
.char-line { font: 500 24px/1.3 var(--display); color: var(--ink-2); margin: 16px 0 0; }
.char-line .cls { color: var(--class, var(--accent)); }
.whereabouts { color: var(--ink-3); margin: 10px 0 0; font-size: 17px; }
.whereabouts .live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--moss); margin-right: 8px; vertical-align: 2px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--moss) 18%, transparent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.stage { position: relative; height: min(70vh, 640px); }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
#hero-canvas:active { cursor: grabbing; }
.stage-hint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: var(--ink-3); font-size: 14px; margin: 0; }
html:not(.has-model) .stage-hint { display: none; }

.figures {
  position: relative;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 auto; padding-top: 22px; padding-bottom: 26px;
  border-top: 1px solid var(--line);
}
.figures div { padding: 0 20px; border-left: 1px solid var(--line); }
.figures div:first-child { border-left: 0; padding-left: 0; }
.figures dt { color: var(--ink-3); font-size: 16px; order: 2; }
.figures dd { margin: 0; font: 800 44px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; color: var(--ink); }
.figures dd.deaths { color: var(--blood); }
.figures .sub { display: block; color: var(--ink-3); font-size: 15px; margin-top: 2px; }

/* ------------------------------------------------------------ nav */
.toc { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.toc .wrap { display: flex; gap: 26px; overflow-x: auto; scrollbar-width: none; padding-top: 12px; padding-bottom: 12px; }
.toc a { font: 500 17px/1 var(--display); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.toc a:hover { color: var(--accent); }
section, .day { scroll-margin-top: 60px; }

/* ------------------------------------------------------------ replay: the war table */
.replay { padding: 56px 0 40px; background: linear-gradient(180deg, var(--bg), var(--bg-2) 40%, var(--bg)); }
.replay-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab { font: 500 17px/1 var(--display); color: var(--ink-2); background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 8px 10px 9px; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.table-wrap { position: relative; max-width: 1400px; margin: 0 auto; }
#replay-canvas { display: block; width: 100%; height: min(72vh, 680px); touch-action: pan-y; }
.caption {
  position: absolute; top: 18px; right: max(18px, calc((100% - var(--wrap)) / 2 + var(--gutter)));
  width: min(340px, calc(100% - 36px));
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 3px;
}
.caption[data-type="death"] { border-left-color: var(--blood); }
.caption[data-type="level_up"] { border-left-color: var(--moss); }
.caption[data-type="note"] { border-left-color: var(--violet); }
.caption:empty { display: none; }
.cap-what { margin: 0; font-weight: 500; }
.cap-where { margin: 2px 0 0; color: var(--ink-3); font-size: 15px; }
.transport { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 14px; margin-top: 14px; }
.transport .btn { padding: 10px 18px; min-width: 92px; }
.transport .speed { min-width: 56px; }
.scrub { position: relative; padding-top: 14px; }
.marks { position: absolute; left: 8px; right: 8px; top: 0; height: 12px; }
.mark { position: absolute; top: 0; width: 3px; height: 10px; margin-left: -1px; border-radius: 1px; }
.mark-death { background: var(--blood); height: 12px; }
.mark-level-up { background: var(--moss); }
.mark-note { background: var(--violet); }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0; }
.when { color: var(--ink-3); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fallback2d { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.fallback2d[hidden] { display: none; }
#route-canvas { width: 100%; height: auto; display: block; aspect-ratio: 3 / 2; background: var(--table); border: 1px solid var(--line); }
.map-caption { color: var(--ink-3); font-size: 15px; margin-top: 8px; }
.no-3d #replay-canvas, .no-3d #replay-caption, .no-3d #transport { display: none; }

/* ------------------------------------------------------------ the board below */
.board { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 56px 56px; padding-top: 56px; padding-bottom: 40px; }
.board .wide { grid-column: 1 / -1; }
.side { display: flex; flex-direction: column; gap: 48px; min-width: 0; }
.block { min-width: 0; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 18px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.block-head h2 { font-size: 30px; }
.empty { color: var(--ink-3); font-style: italic; }
.muted { color: var(--ink-3); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font: 500 15px/1 var(--serif); color: var(--ink-2); background: none; border: 1px solid transparent; border-radius: 3px; padding: 6px 10px; cursor: pointer; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--accent); border-color: var(--line); background: var(--surface); }

/* chronicle */
.timeline { list-style: none; margin: 0; padding: 0; }
.day { margin: 0 0 26px; }
.day h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 700 20px/1.2 var(--display); color: var(--ink); margin: 0 0 8px; }
.day h3 .link-btn { padding: 4px 8px; font-size: 13px; opacity: 0; }
.day:hover h3 .link-btn, .day h3 .link-btn:focus-visible { opacity: 1; }
@media (hover: none) { .day h3 .link-btn { opacity: 1; } }
.entry { display: grid; grid-template-columns: 66px 16px 1fr; gap: 12px; align-items: start; padding: 7px 0; }
.entry time { color: var(--ink-3); font-size: 15px; font-variant-numeric: tabular-nums; padding-top: 3px; }
.entry .glyph { width: 10px; height: 10px; margin-top: 9px; border-radius: 50%; background: var(--accent); }
.entry .what { min-width: 0; }
.entry .what strong { font-weight: 700; }
.entry .meta { color: var(--ink-3); font-size: 16px; }
.g-quest { background: var(--accent); }
.g-death { background: var(--blood) !important; border-radius: 1px !important; transform: rotate(45deg); }
.g-level { background: var(--moss) !important; }
.g-zone { background: var(--sky) !important; }
.g-dungeon { background: var(--ink-2) !important; border-radius: 1px !important; }
.g-note { background: var(--violet) !important; }
.g-abandon { background: transparent !important; border: 1px solid var(--ink-3); }
.entry.note .what { font-style: italic; }
.more { display: block; margin: 6px 0 0; font: 500 16px/1 var(--serif); color: var(--accent); background: none; border: 1px solid var(--line); border-radius: 3px; padding: 11px 16px; cursor: pointer; }
.more:hover { border-color: var(--accent); }
.more[hidden] { display: none; }
.coords { font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
a.atlas { color: var(--sky); white-space: nowrap; }

/* chart */
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis text { fill: var(--ink-3); font: 15px var(--serif); }
.chart .axis line { stroke: var(--line); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 3; }
.chart .area { fill: url(#lvlFill); }
.chart .death { fill: var(--blood); }

/* equipment: item names in the game's quality colours */
.gear-list { list-style: none; margin: 0; padding: 0; columns: 1; }
.gear-list li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.gear-list li:last-child { border-bottom: 0; }
.gear-list .slot { color: var(--ink-3); font-size: 15px; }
#equipment[hidden] { display: none; }
.item { font-weight: 500; }
.item.q0 { color: #9d9d9d; }
.item.q1 { color: var(--ink); }
.item.q2 { color: #1eff00; }
.item.q3 { color: #3a9bff; }   /* rare, lifted from #0070dd for contrast on dark */
.item.q4 { color: #b86cf2; }   /* epic */
.item.q5 { color: #ff8000; }
.item.q6, .item.q7 { color: #e6cc80; }
.g-gear { background: #3a9bff !important; border-radius: 2px !important; }

/* official Armory: render, rich equipment, attributes */
.stage-render { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; pointer-events: none;
  filter: drop-shadow(0 18px 40px color-mix(in srgb, var(--faction) 55%, transparent)); }
.stage-render[hidden], .has-model .stage-render { display: none; }
/* torn faction banner when there is no character picture: shown at no more than 2x its size */
.stage-banner { position: absolute; left: 50%; top: 0; height: min(88%, 512px); width: auto; transform: translateX(-50%);
  pointer-events: none; filter: drop-shadow(0 16px 30px rgba(0, 0, 0, .45)); }
.stage-banner[hidden], .has-model .stage-banner { display: none; }
.has-banner:not(.has-model) .stage::before { display: none; }
.has-render:not(.has-model) .stage-hint { display: none; }
#attributes[hidden] { display: none; }
.whereabouts .armory-link { color: var(--accent); white-space: nowrap; }
.gear-list.rich li { grid-template-columns: 40px 1fr; align-items: center; }
.gear-list .icon { width: 40px; height: 40px; border-radius: 4px; border: 1px solid var(--line); overflow: hidden; background: var(--bg-2); }
.gear-list .icon img { width: 100%; height: 100%; display: block; }
.gear-list .icon.q2 { border-color: #1eff00; } .gear-list .icon.q3 { border-color: #3a9bff; }
.gear-list .icon.q4 { border-color: #b86cf2; } .gear-list .icon.q5 { border-color: #ff8000; }
.gear-list .it { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.gear-list .it-meta { color: var(--ink-3); font-size: 14px; }
.gear-list .ench { color: #1eff00; font-size: 14px; }
.attr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
.attr-grid dt { color: var(--ink-3); font-size: 14px; }
.attr-grid dd { margin: 0; font: 700 24px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.talents { color: var(--ink-2); margin: 14px 0 0; }
.talents:empty { display: none; }

/* deaths */
.death-list, .dungeon-list, .quest-list { list-style: none; margin: 0; padding: 0; }
.death-list { max-height: 520px; overflow-y: auto; }
.death-list li, .dungeon-list li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.death-list li:last-child, .dungeon-list li:last-child { border-bottom: 0; }
.killer { font-weight: 700; color: var(--blood); }
.where { color: var(--ink-2); }
.when-line, .dg-meta { color: var(--ink-3); font-size: 16px; }
.dg-name { font-weight: 700; }

/* quests */
#quest-search { font: 17px var(--serif); color: var(--ink); background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; padding: 9px 12px; width: min(320px, 100%); }
.quest-list { columns: 2 340px; column-gap: 40px; }
.quest-list li { break-inside: avoid; display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.q-title { font-weight: 500; }
.q-title.abandoned { color: var(--ink-3); text-decoration: line-through; }
.q-meta, .q-right { color: var(--ink-3); font-size: 15px; }
.q-right { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* lands */
.table-scroll { overflow-x: auto; }
table.zones { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.zones th { font: 500 16px/1.2 var(--display); color: var(--ink-3); text-align: left; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.zones td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.zones td:first-child { font-weight: 700; }
.zones .num { text-align: right; }
.areas-cell details { display: inline-block; text-align: left; }
.areas-cell summary { cursor: pointer; color: var(--accent); list-style: none; }
.areas-cell summary::-webkit-details-marker { display: none; }
.areas-cell summary::after { content: " ▾"; font-size: 12px; color: var(--ink-3); }
.areas-cell details[open] summary::after { content: " ▴"; }
ul.areas { list-style: none; margin: 8px 0 0; padding: 0; font-size: 16px; white-space: nowrap; }

.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 2px transparent; } }

.foot { color: var(--ink-3); font-size: 15px; padding-top: 24px; padding-bottom: 48px; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; max-width: 80ch; }

/* ------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; min-height: 0; padding-top: 40px; }
  .hero-text { padding-bottom: 0; order: 2; }
  .stage { order: 1; height: 52vh; min-height: 320px; }
  html:not(.has-model) .stage { height: 220px; }

  .board { grid-template-columns: 1fr; gap: 44px; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .figures div:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 560px) {
  .brandbar img { width: 104px; }
  .emblem { width: 96px; height: 96px; }
  body { font-size: 17px; }
  .hero h1 { font-size: 64px; }
  .figures dd { font-size: 36px; }
  .figures div { padding: 0 12px; }
  #replay-canvas { height: 62vh; }
  .caption { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; }
  .transport { grid-template-columns: auto auto 1fr; }
  .when { grid-column: 1 / -1; }
  .entry { grid-template-columns: 54px 12px 1fr; gap: 8px; }
}

/* ================================================================ The Journal (spec 005) */
.journal { padding: 64px 0 56px; background:
  radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--bg);
  --j-ink: #3a2714; --j-ink-2: #6b4f2e; --j-rule: rgba(90, 60, 25, .35); --j-blood: #8e1f14;
  --j-paper: none; --j-leather: #3b2414; --j-leather-2: #22140a; }
.journal .replay-head { margin-bottom: 26px; }
.j-wrap { position: relative; max-width: 1140px; margin: 0 auto; padding: 0 var(--gutter); outline: none; }
.j-book { margin: 0 auto; filter: drop-shadow(0 30px 40px rgba(0,0,0,.55)); }

.j-page { background: transparent; color: var(--j-ink); overflow: hidden; font-family: var(--body, Alegreya), Georgia, serif; }
.j-paper { position: absolute; inset: 0; background: var(--j-paper) center / 100% 100% no-repeat,
  radial-gradient(ellipse at 50% 45%, #ecd6a4, #d5b479 75%, #b38a4d); }
.j-page.--left .j-paper { transform: scaleX(-1); }
.j-gutter { position: absolute; top: 0; bottom: 0; width: 9%; pointer-events: none; }
.j-page.--left .j-gutter { right: 0; background: linear-gradient(to left, rgba(60,35,10,.35), transparent); }
.j-page.--right .j-gutter { left: 0; background: linear-gradient(to right, rgba(60,35,10,.35), transparent); }
.j-inner { position: absolute; inset: 0; padding: 9% 10% 7%; display: flex; flex-direction: column; }
.j-folio { margin-top: auto; text-align: center; font: 500 13px var(--display); color: var(--j-ink-2); }

.j-cover { background: radial-gradient(ellipse at 40% 35%, #5a3720, var(--j-leather) 55%, var(--j-leather-2)); color: var(--accent); }
.j-cover .j-inner { align-items: center; justify-content: center; text-align: center; padding: 12%; }
.j-frame { position: absolute; inset: 5%; border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 4px;
  box-shadow: inset 0 0 0 6px rgba(0,0,0,.18), inset 0 0 0 8px color-mix(in srgb, var(--accent) 25%, transparent); }
.j-crest { width: 46%; max-width: 220px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)) sepia(.35); }
.j-t1 { font: 500 16px var(--display); letter-spacing: .3em; margin: 22px 0 4px; opacity: .85; }
.j-t2 { font: 800 clamp(26px, 3.2vw, 38px)/1.05 var(--display); margin: 0; text-shadow: 0 2px 0 rgba(0,0,0,.45); }
.j-t3 { font-style: italic; margin: 10px 0 0; opacity: .8; }

.j-owner { text-align: center; margin-top: 12%; }
.j-avatar { width: 112px; height: 112px; border-radius: 50%; border: 4px solid #a67c35; object-fit: cover;
  box-shadow: 0 3px 8px rgba(0,0,0,.35); filter: sepia(.25); }
.j-belongs { font-style: italic; color: var(--j-ink-2); margin: 18px 0 0; }
.j-owner h3 { font: 700 30px var(--display); margin: 2px 0; color: var(--j-ink); }
.j-what { margin: 0; }
.j-since { margin-top: 26px; font-style: italic; color: var(--j-ink-2); }

.j-ptitle { font: 700 24px var(--display); margin: 0 0 12px; border-bottom: 1px solid var(--j-rule); padding-bottom: 6px; color: var(--j-ink); }
.j-toc { list-style: none; margin: 0; padding: 0; font-size: 15.5px; }
.j-toc a { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; color: var(--j-ink); text-decoration: none; }
/* contents rows scale with the page (journal.js puts 13 levels on each contents page), so they always fit */
.j-page { container-type: size; }
.j-ptitle { font-size: min(24px, 4.2cqh); margin-bottom: min(12px, 1.8cqh); }
.j-cont { font: italic 400 .62em var(--body, Alegreya), Georgia, serif; color: var(--j-ink-2); text-transform: none; letter-spacing: 0; }
.j-toc { font-size: min(16px, 2.9cqh); }
.j-toc a { padding: .14em 0; line-height: 1.4; }
.j-toc .j-dots { transform: translateY(-.25em); }
/* the page-flip library ignores presses on a link, but only when the press lands on the <a> itself: let presses on the
   text inside a journal link reach the link, so following it never also turns a page */
.j-page a * { pointer-events: none; }
.j-lv { font-family: var(--display); min-width: 4.6em; }
.j-where { color: var(--j-ink-2); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.j-dots { flex: 1; border-bottom: 1px dotted var(--j-rule); transform: translateY(-4px); min-width: 12px; }
.j-pg { font-variant-numeric: tabular-nums; color: var(--j-ink-2); }
.j-toc a:hover .j-lv, .j-toc a:focus-visible .j-lv { color: var(--j-blood); }

.j-kicker { font: 500 12.5px var(--display); letter-spacing: .18em; color: var(--j-ink-2); }
.j-lvl { font: 700 clamp(26px, 3vw, 36px)/1 var(--display); margin: 0; color: var(--j-ink); }
.j-lvl::first-letter { color: var(--j-blood); }
.j-date { font-style: italic; color: var(--j-ink-2); margin: 6px 0 12px; }
.j-prose p { margin: 0; line-height: 1.5; font-size: clamp(14.5px, 1.25vw, 17px); }
.j-prose p::first-letter { font: 700 2.6em/.8 var(--display); float: left; padding: 4px 6px 0 0; color: var(--j-blood); }
.j-fell { color: var(--j-blood); }
.j-sub { font: 500 12.5px var(--display); letter-spacing: .14em; color: var(--j-ink-2); margin: 14px 0 2px; border-top: 1px solid var(--j-rule); padding-top: 6px; }
.j-lands { list-style: none; padding: 0; margin: 4px 0 0; font-size: 14.5px; }
.j-lands li { display: flex; gap: 6px; align-items: baseline; }
.j-quests { margin: 10px 0 0; font-size: 13.5px; color: var(--j-ink-2); font-style: italic; line-height: 1.3; }

.j-mapname { font-style: italic; color: var(--j-ink-2); margin: 0 0 8px; }
.j-map { position: relative; border: 6px solid #fff8e6; box-shadow: 0 3px 10px rgba(40,20,0,.35); transform: rotate(-.6deg); background: #b99b62; }
.j-map img { display: block; width: 100%; height: auto; }
.j-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.j-route { fill: none; stroke: #7a1a10; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 9; opacity: .9; }
.j-start { fill: #7a1a10; }
.j-deathdot { fill: var(--j-blood); stroke: #fff2d0; stroke-width: 4; }
.j-lvlpin circle { fill: #f6e6b8; stroke: #7a1a10; stroke-width: 4; }
.j-lvlpin text { font: 700 24px var(--display); fill: #7a1a10; text-anchor: middle; dominant-baseline: central; }
.j-nomap { display: grid; place-items: center; aspect-ratio: 1002/668; border: 2px dashed var(--j-rule); color: var(--j-ink-2); font-style: italic; text-align: center; padding: 10px; }

.j-cards { display: flex; gap: 14px; margin-top: 18px; flex-wrap: wrap; align-items: flex-start; }
.j-card { background: #fbf3dc; padding: 8px 10px 10px; box-shadow: 0 3px 8px rgba(40,20,0,.3); flex: 1 1 40%; min-width: 130px;
  font-size: 13.5px; line-height: 1.2; position: relative; transform: rotate(1.6deg); margin-top: 10px; }
.j-card:first-child { transform: rotate(-2deg); margin-top: 0; }
.j-card::before { content: ""; position: absolute; top: -9px; left: 50%; width: 46px; height: 16px; margin-left: -23px;
  background: rgba(232, 214, 160, .75); transform: rotate(-3deg); }
.j-ct { font: 500 12px var(--display); letter-spacing: .14em; color: var(--j-ink-2); }
.j-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.j-icon { width: 36px; height: 36px; border-radius: 4px; border: 2px solid #3a2a1a; }
.j-skull { width: 36px; height: 36px; }
.j-nm { font-weight: 700; color: var(--j-ink); }
.j-nm.q0 { color: #6d6d6d; } .j-nm.q2 { color: #1d7a12; } .j-nm.q3 { color: #0a55a8; } .j-nm.q4 { color: #7a2fb0; } .j-nm.q5 { color: #b35c00; }
.j-sb { color: var(--j-ink-2); font-style: italic; }
.j-card-fell .j-nm { color: var(--j-blood); }
.j-notes { margin-top: 14px; font-style: italic; }
.j-notes p { margin: 0 0 4px; }
.j-notes p::before { content: "\201C"; } .j-notes p::after { content: "\201D"; }

.j-ribbons { display: flex; justify-content: center; gap: 10px; margin-top: -6px; position: relative; z-index: 2; flex-wrap: wrap; }
.j-ribbon { --c: #7b1d16; appearance: none; border: 0; cursor: pointer; color: #f7ecd2; font: 600 14px var(--display);
  letter-spacing: .06em; padding: 12px 12px 22px; background: var(--c); min-width: 74px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); transition: transform .2s; }
.j-ribbon:nth-child(2) { --c: #1f5a33; } .j-ribbon:nth-child(3) { --c: #4a2a6b; } .j-ribbon:nth-child(4) { --c: #2a4a7a; }
.j-ribbon:hover, .j-ribbon:focus-visible { transform: translateY(6px); }
.j-controls { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 18px; color: var(--ink-2); }
.j-pgbtn { appearance: none; background: transparent; border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent);
  border-radius: 50%; width: 40px; height: 40px; font-size: 22px; line-height: 1; cursor: pointer; }
.j-pgbtn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
@media (max-width: 700px) {
  .j-ribbon { min-width: 0; padding: 10px 8px 18px; font-size: 12px; }
  .j-inner { padding: 8% 8% 6%; }
}

/* loot (spec 005 follow-up) */
.item-link { text-decoration: none; }
.item-link:hover .item, .item-link:focus-visible .item { text-decoration: underline; text-underline-offset: 3px; }
.dg-loot { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.dg-loot li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; }
.dg-loot .icon { width: 32px; height: 32px; border-radius: 4px; border: 1px solid var(--line); overflow: hidden; background: var(--bg-2); }
.dg-loot .icon img { width: 100%; height: 100%; display: block; }
.dg-loot .icon.q2 { border-color: #1eff00; } .dg-loot .icon.q3 { border-color: #3a9bff; }
.dg-loot .icon.q4 { border-color: #b86cf2; } .dg-loot .icon.q5 { border-color: #ff8000; }
.dg-how { display: block; font-size: 14px; color: var(--ink-3); }
.dg-note { margin: 8px 0 0; font-size: 14px; color: var(--ink-3); }
.j-items { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 5px; }
.j-items li { display: flex; gap: 8px; align-items: center; }
.j-items a { text-decoration: none; }
.j-items a:hover .j-nm { text-decoration: underline; }
.j-more { color: var(--j-ink-2); font-style: italic; }
.dungeon-list .dg-loot li { padding: 0; border: 0; margin: 0; }

/* character picker (spec 006) */
.picker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 15px; color: var(--ink-2); }
.picker select { appearance: none; background: var(--bg-2) linear-gradient(45deg, transparent 50%, var(--accent) 50%) no-repeat right 14px center / 6px 6px;
  color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 7px 34px 7px 12px; font: inherit; cursor: pointer; }
.picker select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.picker[hidden] { display: none; }

/* =====================================================================================================
   Native interface (spec 007): the look ProfitScout uses in game. Controls are drawn with the game's own
   interface pieces (assets/ui/, cut from the owner's art export by `journey.py maps`): native tabs, the red
   panel button, radio buttons, list column headers and the gold row highlight, in Blizzard's own colours
   (gold #ffd100 headings and labels, white values, grey notes). Each rule falls back to plain colours if a
   piece is missing.
   ===================================================================================================== */
:root { --wow-gold: #ffd100; --wow-white: #ffffff; --wow-grey: #9d9d9d; --wow-green: #1eff00; --wow-red: #ff3333; }

/* ---- red panel button (UIPanelButtonTemplate) */
.btn, .btn-primary, .btn-quiet, .link-btn, .more, .j-pgbtn, .transport .btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; padding: 2px 14px 3px; border-radius: 0;
  font: 600 15px/1 var(--display); letter-spacing: .02em; color: var(--wow-gold); text-decoration: none;
  text-shadow: 0 1px 1px #000, 0 0 2px #000;
  background: #4a0a07; border: 1px solid #1a0402;
  border-style: solid; border-width: 5px 11px; border-image: url("assets/ui/button-up.png") 5 11 fill stretch;
  box-shadow: none; filter: none; cursor: pointer; white-space: nowrap;
}
.btn::after, .btn-primary::after, .btn-quiet::after, .link-btn::after, .more::after, .j-pgbtn::after {
  content: ""; position: absolute; inset: -5px -11px; pointer-events: none; opacity: 0;
  border-style: solid; border-width: 5px 11px; border-image: url("assets/ui/button-highlight.png") 5 11 fill stretch;
  mix-blend-mode: screen; transition: opacity .12s;
}
.btn:hover::after, .btn-primary:hover::after, .btn-quiet:hover::after, .link-btn:hover::after, .more:hover::after, .j-pgbtn:hover::after,
.btn:focus-visible::after, .link-btn:focus-visible::after, .more:focus-visible::after, .j-pgbtn:focus-visible::after { opacity: 1; }
.btn:hover, .btn-primary:hover, .btn-quiet:hover, .link-btn:hover, .more:hover, .j-pgbtn:hover { color: var(--wow-white); filter: none; background: #4a0a07; }
.btn:active, .btn-primary:active, .btn-quiet:active, .link-btn:active, .more:active, .j-pgbtn:active,
.btn[aria-pressed="true"] { border-image-source: url("assets/ui/button-down.png"); padding-top: 4px; padding-bottom: 1px; }
.btn:focus-visible, .link-btn:focus-visible, .more:focus-visible, .j-pgbtn:focus-visible { outline: 2px solid var(--wow-gold); outline-offset: 7px; }
.btn[disabled], .link-btn[disabled], .more[disabled], .j-pgbtn[disabled] { border-image-source: url("assets/ui/button-disabled.png"); color: var(--wow-grey); cursor: default; }
.hero-actions .btn { min-height: 38px; font-size: 17px; padding-left: 20px; padding-right: 20px; }
.more { margin-top: 12px; }
.j-pgbtn { width: auto; height: auto; min-width: 44px; font-size: 20px; border-radius: 0; }

/* ---- native tabs (PanelTabButtonTemplate). Bottom tabs hang below their frame; top tabs are the same art flipped */
.tabs { gap: 0 2px; margin-bottom: 0; align-items: flex-end; }
.tab, .j-ribbon {
  position: relative; isolation: isolate; height: 36px; min-width: 72px; padding: 0 22px; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 15px/1 var(--display); letter-spacing: .02em; color: var(--wow-gold); text-shadow: 0 1px 1px #000;
  background: none; border: 0; border-radius: 0; clip-path: none; transform: none; cursor: pointer; white-space: nowrap;
}
.tab::before, .j-ribbon::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("assets/ui/tab-inactive-left.png") left top / auto 100% no-repeat,
              url("assets/ui/tab-inactive-right.png") right top / auto 100% no-repeat,
              url("assets/ui/tab-inactive-mid.png") center top / calc(100% - 60px) 100% no-repeat;
}
.tab::after, .j-ribbon::after {
  content: ""; position: absolute; inset: 4px 10px; z-index: -1; opacity: 0; pointer-events: none;
  background: url("assets/ui/tab-highlight.png") center / 100% 100% no-repeat; mix-blend-mode: screen; transition: opacity .12s;
}
.tab:hover::after, .j-ribbon:hover::after, .tab:focus-visible::after, .j-ribbon:focus-visible::after { opacity: .7; }
.tab:hover, .j-ribbon:hover { color: var(--wow-white); transform: none; }
.tab[aria-selected="true"], .j-ribbon[aria-current="true"] { height: 42px; color: var(--wow-white); border: 0; }
.tab[aria-selected="true"]::before, .j-ribbon[aria-current="true"]::before {
  background: url("assets/ui/tab-active-left.png") left top / auto 100% no-repeat,
              url("assets/ui/tab-active-right.png") right top / auto 100% no-repeat,
              url("assets/ui/tab-active-mid.png") center top / calc(100% - 60px) 100% no-repeat;
}
.tab:focus-visible, .j-ribbon:focus-visible { outline: 2px solid var(--wow-gold); outline-offset: -6px; }
/* the replay's land tabs sit on top of the table: flip the art so the lip faces down onto it */
.tabs .tab::before { transform: scaleY(-1); }
.tabs .tab::after { transform: scaleY(-1); }
.replay .tabs { padding-top: 6px; }
/* the journal's bookmarks hang below the book, like ProfitScout's tabs below its window */
.j-ribbons { justify-content: flex-start; align-items: flex-start; gap: 0 2px; margin: -2px auto 0; padding: 0 12px; max-width: 1140px; }
.j-ribbon:nth-child(n) { --c: none; }
/* the level tabs come first, then a small gap before the bookmarks */
/* the art has a soft shadow at each side: overlap neighbours a little, as the game does */
.tabs .tab, .j-ribbon { margin-left: -8px; }
.replay .tabs { padding-left: 8px; }
.j-ribbon.j-range + .j-ribbon.j-mark { margin-left: 10px; }
@media (max-width: 700px) { .tab, .j-ribbon { padding: 0 14px; font-size: 13px; min-width: 0; } .j-ribbon.j-range + .j-ribbon.j-mark { margin-left: -8px; } }

/* ---- radio buttons for a few choices (UIRadioButtonTemplate), used for the chronicle filters */
.chips { gap: 4px 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 2px; border: 0; background: none; border-radius: 0;
  font: 500 15px/1 var(--serif); color: var(--wow-white);
}
.chip::before {
  content: ""; width: 16px; height: 16px; flex: none;
  background: url("assets/ui/radio.png") 0 0 / 64px 16px no-repeat, radial-gradient(circle, #111 55%, #555 60%, transparent 66%);
}
.chip[aria-pressed="true"] { color: var(--wow-gold); background: none; border: 0; }
.chip[aria-pressed="true"]::before { background-position: -16px 0, 0 0; }
.chip:hover { color: var(--wow-gold); }
.chip:hover::before { filter: brightness(1.35); }
.chip:focus-visible { outline: 2px solid var(--wow-gold); outline-offset: 2px; }

/* ---- panels: the dark inset Blizzard windows use (InsetFrameTemplate), gold headings (GameFontNormal) */
.board .block { background: rgba(0, 0, 0, .42); border: 1px solid #2f2f2f; border-radius: 4px; padding: 18px 20px 20px;
  box-shadow: inset 0 0 0 1px #000, inset 0 2px 14px rgba(0, 0, 0, .75); }
.block-head { border-bottom-color: #3a3a3a; }
.block-head h2 { color: var(--wow-gold); text-shadow: 0 1px 2px #000; }
.board .note, .board .muted { color: var(--wow-grey); }

/* ---- lists: the classic column headers, zebra rows and the gold row highlight (WhoFrame / auction list) */
.zones th { padding: 0; border-bottom: 0; }
.zones th button {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 26px; padding: 0 8px; margin: 0;
  font: 500 15px/1 var(--display); color: var(--wow-white); text-shadow: 0 1px 1px #000; cursor: pointer;
  background: #1b1d22; border-style: solid; border-width: 0 4px 0 5px;
  border-image: url("assets/ui/column-header.png") 0 4 0 5 fill stretch;
}
.zones th.num button { justify-content: flex-end; }
.zones th button:hover { color: var(--wow-gold); }
.zones th[aria-sort="ascending"] button::after, .zones th[aria-sort="descending"] button::after {
  content: ""; width: 9px; height: 8px; flex: none; background: url("assets/ui/sort-arrow.png") 0 0 / 9px 8px no-repeat;
}
.zones th[aria-sort="ascending"] button::after { transform: scaleY(-1); }
.zones td { border-bottom: 0; padding: 7px 8px; }
.zones tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .04); }
/* the gold highlight spans the whole row, softened like the game's ADD-blended overlay */
.zones tbody tr:hover, .quest-list li:hover, .death-list li:hover, .dungeon-list > li:hover {
  background: linear-gradient(rgba(8, 10, 14, .45), rgba(8, 10, 14, .45)), url("assets/ui/row-highlight.png") center / 100% 100% no-repeat;
}
.zones tbody tr:hover td { background: transparent; }
.quest-list li { border-bottom: 0; padding: 7px 8px; }
.quest-list li:nth-child(even) { background: rgba(255, 255, 255, .04); }
.zones td:first-child { color: var(--wow-gold); }

/* quest log pages */
.q-pager { margin-top: 14px; }
.q-pager[hidden] { display: none; }
#q-info { font-variant-numeric: tabular-nums; min-width: 15em; text-align: center; }
.quest-list .empty { color: var(--ink-2); font-style: italic; }
@media (max-width: 700px) {
  .q-pager { gap: 10px; }
  #q-info { min-width: 0; flex: 1; font-size: 15px; }
  .q-page { display: none; }
}
