/* Hearthfell UI v3. Classic RPG materials: bronze-framed leather windows,
   parchment for maps and notes, unit frames, a square action bar and
   genre tooltips. One accent (ember) plus rarity colours. */
:root {
  color-scheme: dark;
  --soot: #0c0907;
  --leather: #1b1410;
  --leather-hi: #2a1f17;
  --ink: #050403;
  --bronze: #8a6a3e;
  --bronze-hi: #c9a063;
  --bronze-lo: #4a3520;
  --text: #ece0c8;
  --text-dim: #a89a86;
  --gold: #f0c75e;
  --gold-text: #f0d9a8;
  --ember: #ff8f3a;
  --ember-hot: #ffc46b;
  --blood: #b8321e;
  --stagger: #e9c34a;
  --dodge: #7fc4ff;
  --fog: #8e9aa6;
  --stone: #4a3a2e;
  --stone-line: #2a2018;
  --paper: #dcc79c;
  --paper-ink: #3b2a1e;
  --c-common: #e8e4dc;
  --c-uncommon: #1eff00;
  --c-rare: #3d8ff0;
  --c-epic: #b45cf5;
  --c-mythic: #ff8000;
  --c-legendary: #ff8000;
  --display: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --display-sc: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  --fibre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035 .012' numOctaves='4' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='.55'/%3E%3C/svg%3E");
  --frame: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cg fill='none'%3E%3Crect x='.5' y='.5' width='47' height='47' stroke='%23050403'/%3E%3Crect x='1.5' y='1.5' width='45' height='45' stroke='%23b48a52'/%3E%3Crect x='3.5' y='3.5' width='41' height='41' stroke='%236e5130' stroke-width='3'/%3E%3Crect x='5.5' y='5.5' width='37' height='37' stroke='%233b2a18'/%3E%3Crect x='6.5' y='6.5' width='35' height='35' stroke='%23050403'/%3E%3Crect x='7.5' y='7.5' width='33' height='33' stroke='%23574330' stroke-opacity='.6'/%3E%3C/g%3E%3Cg id='c'%3E%3Crect x='.5' y='.5' width='13' height='13' fill='%23050403'/%3E%3Crect x='1.5' y='1.5' width='11' height='11' fill='%238a6a3e'/%3E%3Crect x='2.5' y='2.5' width='9' height='9' fill='%23b48a52'/%3E%3Ccircle cx='7' cy='7' r='2.4' fill='%233b2a18'/%3E%3Ccircle cx='6.4' cy='6.4' r='.9' fill='%23e8c88c'/%3E%3C/g%3E%3Cuse href='%23c' x='34'/%3E%3Cuse href='%23c' y='34'/%3E%3Cuse href='%23c' x='34' y='34'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.45; }
body {
  min-height: 100vh;
  background:
    var(--grain),
    radial-gradient(ellipse 80% 55% at 50% 0%, #2a1a0f 0%, transparent 70%),
    radial-gradient(ellipse 120% 80% at 50% 120%, #1a0f08 0%, transparent 60%),
    var(--soot);
  background-attachment: fixed;
}
canvas.atmo { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 0; }
#app { position: relative; z-index: 1; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible, input:focus-visible { outline: 2px solid var(--ember-hot); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0 0 .45rem; text-wrap: balance; }
h2 { font-size: 1.5rem; color: var(--gold-text); }
h3 { font-family: var(--display-sc); font-size: 1.12rem; color: var(--gold); letter-spacing: .03em; }
p { margin: .3rem 0 .6rem; }
.muted { color: var(--text-dim); }
.small { font-size: .88rem; }
.hint { color: var(--text-dim); font-size: .88rem; margin: .4rem 0; }
.center { text-align: center; justify-content: center; }
.lore { font-family: var(--display); font-size: 1.06rem; color: #d9c7a4; line-height: 1.4; }
.warn { color: #ff8f7a; }
.good { color: #8fdc98; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px 48px; }
.coin { display: inline-block; width: 1em; height: 1em; vertical-align: -.15em; }
.coin svg { width: 100%; height: 100%; display: block; }

/* ---------- frames: bronze 9-slice around dark leather */
.frame {
  position: relative;
  border: 16px solid transparent;
  border-image: var(--frame) 16 stretch;
  background: var(--grain), radial-gradient(ellipse 120% 70% at 50% 0%, var(--leather-hi), var(--leather) 70%);
  padding: 2px 6px 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  min-width: 0;
}
.plate { display: flex; justify-content: center; width: max-content; max-width: 100%; margin: -30px auto 12px; position: relative; z-index: 2;
  background: linear-gradient(180deg, var(--bronze-hi), var(--bronze) 50%, var(--bronze-lo)); padding: 2px;
  clip-path: polygon(0 50%, 12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%); }
.plate > span { display: block; padding: 4px 26px 3px; background: linear-gradient(180deg, #3a1d12, #1c0e08);
  clip-path: polygon(0 50%, 11px 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 11px 100%);
  font-family: var(--display-sc); font-size: 1.12rem; color: var(--gold); letter-spacing: .05em; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.plate small { font-family: var(--body); font-size: .8rem; color: var(--text-dim); margin-left: 4px; }
.pad { padding: 4px 6px; }
h3.sub { margin: 14px 0 4px; font-size: 1rem; border-bottom: 1px solid rgba(201, 160, 99, .2); padding-bottom: 3px; }

/* ---------- parchment */
.parch {
  color: var(--paper-ink);
  background: var(--fibre), var(--grain), radial-gradient(ellipse at 50% 40%, #ead9b0 0%, #d6bf8f 55%, #ae8f5c 100%);
  box-shadow: inset 0 0 36px rgba(90, 55, 20, .55), inset 0 0 3px rgba(60, 40, 20, .7), 0 6px 18px rgba(0, 0, 0, .5);
}
.parch h3 { color: #5a1d10; font-family: var(--display-sc); }
.parch p { color: var(--paper-ink); }
.ink-faint { color: #6b5338 !important; font-size: .9rem; }
.note { padding: 14px 18px; }

/* ---------- buttons */
.btn {
  font-weight: 700; letter-spacing: .02em; color: var(--gold-text);
  background: linear-gradient(180deg, #4a3524 0%, #2b1e14 55%, #1d140d 100%);
  border: 1px solid var(--ink); border-radius: 3px; padding: 7px 14px; text-shadow: 0 1px 0 #000;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, .18), inset 0 0 0 1px rgba(138, 106, 62, .6), 0 1px 0 rgba(0, 0, 0, .6);
  transition: filter .12s, transform .06s;
}
.btn:hover:not(:disabled) { filter: brightness(1.25); color: #fff3d6; }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(138, 106, 62, .6); }
.btn:disabled { filter: grayscale(.85) brightness(.75); color: #9d9080; cursor: not-allowed; }
.btn.primary { color: #ffe1a0; background: linear-gradient(180deg, #b03a1e 0%, #7a1c0c 55%, #4e1006 100%);
  box-shadow: inset 0 1px 0 rgba(255, 200, 140, .35), inset 0 0 0 1px rgba(217, 164, 65, .7), 0 0 14px rgba(255, 110, 40, .18), 0 1px 0 rgba(0, 0, 0, .6); }
.btn.big { font-family: var(--display-sc); font-weight: 400; font-size: 1.18rem; letter-spacing: .04em; padding: 9px 24px; }
.btn.small { font-size: .82rem; padding: 4px 10px; }
.btn.warn { color: #ffb3a8; box-shadow: inset 0 0 0 1px #c0392b; }
.iconbtn { width: 36px; height: 36px; padding: 7px; color: var(--gold-text); background: linear-gradient(180deg, #3a2a1d, #1d140d); border: 1px solid var(--ink); border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(138, 106, 62, .6); }
.iconbtn svg { width: 100%; height: 100%; display: block; }
.iconbtn:hover { filter: brightness(1.3); }
.link { background: none; border: 0; padding: 0; color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .85rem; }
.link:hover { color: var(--gold-text); }

/* ---------- top bar */
.topbar { display: flex; align-items: center; gap: 22px; padding: 10px 16px; margin: 0 -16px 26px;
  background: var(--grain), linear-gradient(180deg, #23180f, #120c08); border-bottom: 1px solid var(--ink);
  box-shadow: 0 1px 0 var(--bronze-lo), 0 2px 0 var(--ink), 0 8px 20px rgba(0, 0, 0, .5); }
.brand { font-family: var(--display-sc); font-size: 1.75rem; letter-spacing: .03em; color: var(--ember);
  background: linear-gradient(180deg, #ffd9a0, #ff9a3c 55%, #b9501b); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(255, 143, 58, .35)); }
.purse { display: flex; gap: 16px; align-items: center; }
.res { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: .92rem; }
.res svg { width: 18px; height: 18px; }
.res b { color: var(--text); font-size: 1rem; }
.topbar .auras { flex: 1; }
.topbar .mute { margin-left: auto; }

/* ---------- unit frames */
.unit { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ubody { flex: 1; min-width: 0; display: grid; gap: 4px; }
.uname { font-family: var(--display); font-size: 1.1rem; color: var(--gold-text); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring { position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #3a2c22, #0d0a08 75%);
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px var(--bronze), 0 0 0 6px var(--ink), inset 0 0 14px #000, 0 4px 12px rgba(0, 0, 0, .6); }
.ring > svg { width: 100%; height: 100%; display: block; clip-path: circle(50%); }
.ring .lvl { position: absolute; left: -6px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: .78rem; font-weight: 800; color: var(--gold); background: #140d08; box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--bronze), 0 0 0 4px var(--ink); }
.unit.mini .ring { width: 44px; height: 44px; }
.unit.mini .ring .lvl { width: 20px; height: 20px; font-size: .7rem; left: -7px; bottom: -5px; }
.unit.mini .uname { font-size: 1rem; }
.unit.mini .ubody { min-width: 120px; }
.xp { height: 6px; background: #0b0807; box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px var(--bronze-lo); }
.xp i { display: block; height: 100%; background: linear-gradient(180deg, #c58cff, #7a3fd0); }

/* ---------- status bars */
.sbar { position: relative; height: 16px; background: #0b0807; box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px rgba(110, 81, 48, .9), inset 0 2px 3px #000; overflow: hidden; }
.sbar > i { position: absolute; inset: 0 auto 0 0; display: block; transition: width .1s linear; }
.sbar > i::after { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .04)); }
.sbar .label { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; font-size: .74rem; font-weight: 700; color: #fff; text-shadow: 0 1px 1px #000, 0 0 3px #000; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.sbar.hp > i { background: linear-gradient(180deg, #4cc23a, #1f7a17); }
.sbar.fury > i { background: linear-gradient(180deg, #e0442a, #8a1d10); }
.sbar.fury.frenzy > i { background: linear-gradient(90deg, #ff5a1f, #ffcc33, #ff5a1f); background-size: 200% 100%; animation: fire .6s linear infinite; }
@keyframes fire { from { background-position: 0 0; } to { background-position: 200% 0; } }
.sbar.ember { height: 12px; margin: 4px 0 10px; }
.sbar.ember > i { background: linear-gradient(180deg, #ffb347, #c4551a); }
.sbar.skill > i { background: linear-gradient(180deg, #4f86c9, #1f4a80); }
.swingrow .sbar { height: 5px; }
.sbar.swing > i { background: linear-gradient(90deg, #6d6255, #e2d4be); }
.sbar.swing > i::after { display: none; }
.sbar.swing.wound > i { background: linear-gradient(90deg, #8a4a1a, var(--ember-hot)); }
.sbar.swing.flash { animation: swingflash .2s; }
@keyframes swingflash { from { box-shadow: 0 0 10px var(--ember-hot); } }
.label-l b { color: var(--gold); font-family: var(--display); font-weight: 400; font-size: 1.1rem; }
.label-r { color: var(--text-dim); font-size: .86rem; }

/* ---------- auras (buff and debuff icons) */
.auras { display: flex; gap: 4px; flex-wrap: wrap; min-height: 0; }
.aura { position: relative; width: 28px; height: 28px; padding: 0; color: var(--gold-text); background: radial-gradient(#2c2f3a, #0d0e12);
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px #5a5a60; }
.aura svg { width: 100%; height: 100%; display: block; }
.aura.debuff { color: #ffb0a0; background: radial-gradient(#4a1810, #160806); box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px #b8321e; }
.aura .t { position: absolute; left: 0; right: 0; bottom: -15px; text-align: center; font-size: .68rem; font-weight: 700; color: #fff; text-shadow: 0 1px 1px #000; font-variant-numeric: tabular-nums; }
.topbar .aura { width: 30px; height: 30px; }

/* ---------- tabs */
.tabs { display: flex; gap: 3px; padding: 0 20px; position: relative; z-index: 3; margin-bottom: 8px; flex-wrap: wrap; }
.tab { position: relative; font-family: var(--display-sc); font-size: 1.04rem; letter-spacing: .03em; color: #b49c74; padding: 7px 18px 6px;
  background: var(--grain), linear-gradient(180deg, #2a1f17, #140e0a); border: 1px solid var(--ink); border-bottom-color: var(--bronze-lo);
  box-shadow: inset 0 1px 0 rgba(201, 160, 99, .35), inset 0 0 0 1px rgba(110, 81, 48, .5); border-radius: 4px 4px 0 0; }
.tab:hover { color: var(--gold-text); }
.tab.on { color: var(--gold); background: var(--grain), linear-gradient(180deg, #4a3020, #24170f); box-shadow: inset 0 1px 0 var(--bronze-hi), inset 0 0 0 1px var(--bronze), 0 0 16px rgba(255, 143, 58, .15); }
.tab .bang { position: absolute; top: -9px; right: -2px; font-family: var(--body); font-weight: 800; font-size: 1.1rem; color: #ffd100; text-shadow: 0 0 6px #000, 0 1px 0 #000; }

/* ---------- layout columns */
.cols { display: grid; gap: 34px 22px; align-items: start; margin-top: 18px; }
.cols > * { min-width: 0; }
.stack { display: grid; gap: 34px; align-content: start; }
.c-hearth { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.c-char { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.c-book { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.c-profs { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.c-run { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }

/* ---------- scenes */
.scene { position: relative; height: 210px; overflow: hidden; margin: 0 -6px 10px; box-shadow: inset 0 0 0 1px var(--ink), inset 0 -20px 30px rgba(0, 0, 0, .5); }
.scene.short { height: 110px; }
.backdrop { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-hearth { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); width: 210px; }
.hearth-art { display: block; width: 100%; height: auto; filter: drop-shadow(0 0 26px rgba(255, 143, 58, .5)); }
.flames path { transform-origin: 100px 148px; }
.flames .f1 { animation: flick 1.3s ease-in-out infinite alternate; }
.flames .f2 { animation: flick .9s ease-in-out infinite alternate-reverse; }
.flames .f3 { animation: flick .7s ease-in-out infinite alternate; }
@keyframes flick { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(.94, 1.06) skewX(2deg); } 100% { transform: scale(1.04, .96) skewX(-2deg); } }
.perks { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; font-size: .9rem; color: var(--text-dim); }
.perks li { display: flex; gap: 8px; align-items: baseline; }
.perks b { color: #8f826f; font-weight: 700; }
.perks .pip { flex: none; width: 8px; height: 8px; transform: rotate(45deg) translateY(-1px); background: #2a1f17; box-shadow: 0 0 0 1px var(--bronze-lo); }
.perks li.lit { color: var(--text); }
.perks li.lit b { color: var(--gold); }
.perks li.lit .pip { background: var(--ember); box-shadow: 0 0 0 1px var(--ink), 0 0 8px var(--ember); }
.crier { list-style: none; padding: 0; margin: 0 0 8px; font-size: .9rem; }
.crier li { padding: 6px 0 6px 16px; position: relative; border-bottom: 1px solid rgba(201, 160, 99, .1); }
.crier li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 5px; height: 5px; transform: rotate(45deg); background: var(--bronze); }

/* ---------- item slots, paper doll, bags */
.r-common { color: var(--c-common); }
.r-uncommon { color: var(--c-uncommon); }
.r-rare { color: var(--c-rare); }
.r-epic { color: var(--c-epic); }
.r-mythic, .r-legendary { color: var(--c-mythic); }
.slot { position: relative; width: 48px; height: 48px; padding: 4px; flex: none; display: inline-block; border: 0; border-radius: 0;
  background: radial-gradient(circle at 50% 35%, #2b2620, #0c0a08 80%); box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px #3f3123, inset 0 0 10px #000; }
.slot .ico, .abtn .ico { display: block; width: 100%; height: 100%; }
.slot .ico svg, .abtn .ico svg { width: 100%; height: 100%; display: block; }
button.slot:hover:not(:disabled) { filter: brightness(1.25); }
.slot.r-uncommon { box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px #1a9e0a, inset 0 0 10px #000, inset 0 0 6px rgba(30, 255, 0, .25); }
.slot.r-rare { box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px #2a6bc0, inset 0 0 10px #000, inset 0 0 8px rgba(61, 143, 240, .3); }
.slot.r-epic { box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px #8a3ad0, inset 0 0 10px #000, inset 0 0 10px rgba(180, 92, 245, .35); }
.slot.r-mythic { box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px #e07000, inset 0 0 10px #000, inset 0 0 12px rgba(255, 128, 0, .4), 0 0 10px rgba(255, 128, 0, .35); }
.slot.empty { cursor: default; }
.slot .ghost { opacity: .13; filter: grayscale(1); }
.slot.broken .ico { filter: grayscale(1) sepia(1) hue-rotate(-40deg) saturate(3) brightness(.6); }
.slot.sel { outline: 2px solid var(--gold); outline-offset: 2px; }
.slot .up { position: absolute; left: 2px; top: 2px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid #1eff00; filter: drop-shadow(0 1px 1px #000); }
.slot .tu { position: absolute; right: 3px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: #ffd100; box-shadow: 0 0 4px #ffd100; }
.slot .count { position: absolute; right: 3px; bottom: 1px; font-size: .78rem; font-weight: 800; color: #fff; text-shadow: 0 1px 1px #000, 0 0 3px #000; }
.dollgrid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "l c r" "w w w"; gap: 14px 18px; padding: 6px 4px; }
.dcol { display: grid; gap: 10px; align-content: start; }
.dcol:first-child { grid-area: l; }
.dcenter { grid-area: c; text-align: center; display: grid; justify-items: center; align-content: start; gap: 6px; }
#dr { grid-area: r; }
.dweap { grid-area: w; display: flex; justify-content: center; gap: 12px; }
.ring.hero { width: 96px; height: 96px; margin-top: 4px; }
.ring.hero .lvl { width: 28px; height: 28px; font-size: .9rem; }
.classline { font-family: var(--display); color: var(--gold-text); }
.sheet { display: grid; grid-template-columns: 1fr auto; gap: 1px 14px; margin: 4px 0 0; width: 100%; max-width: 260px; font-size: .9rem; text-align: left; font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, .3); padding: 8px 12px; box-shadow: inset 0 0 0 1px rgba(110, 81, 48, .4); }
.sheet dt { color: var(--text-dim); }
.sheet dd { margin: 0; color: var(--text); font-weight: 700; text-align: right; }
.baggrid { display: grid; grid-template-columns: repeat(6, 48px); gap: 6px; justify-content: center; padding: 10px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px rgba(110, 81, 48, .4), inset 0 0 20px #000; }
.inspect { margin-top: 12px; }
.insp { display: grid; gap: 8px; }
.tt-inline .tt-card, .cmp .tt-card { width: auto; max-width: none; }

/* ---------- tooltips */
.tt { position: fixed; z-index: 50; display: none; gap: 6px; align-items: flex-start; pointer-events: none; max-width: calc(100vw - 16px); flex-wrap: wrap; }
.tt.on { display: flex; }
.tt-card { width: 270px; background: rgba(9, 9, 16, .96); border: 1px solid #77726a; border-radius: 4px; box-shadow: 0 0 0 1px #000, 0 8px 22px rgba(0, 0, 0, .7);
  padding: 8px 11px 9px; font-size: .86rem; line-height: 1.38; color: #fff; text-align: left; }
.tt-card.debuff { border-color: #a0402e; }
.tt-head { color: #9d9d9d; font-size: .8rem; margin-bottom: 2px; }
.tt-name { font-weight: 800; font-size: 1rem; }
.tt-ilvl { color: #ffd100; }
.tt-spread { display: flex; justify-content: space-between; gap: 10px; }
.tt-green { color: #1eff00; }
.tt-gold { color: #ffd100; }
.tt-red { color: #ff4433; }
.tt-grey { color: #9d9d9d; }
.tt-blue { color: #71d5ff; }
.tt-mod { color: #c58cff; }
.tt-modname { color: #8f6cbf; }
.tt-sell { color: #d8d8d8; margin-top: 2px; }
.tt-diff { width: 200px; }

/* ---------- action bar */
.abar { display: flex; gap: 6px; padding: 8px; flex-wrap: wrap; justify-content: center;
  background: var(--grain), linear-gradient(180deg, #1d150f, #0e0a07); box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--bronze-lo), 0 0 0 4px var(--ink), inset 0 0 14px #000; }
.abtn { position: relative; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 0; flex: none; display: inline-block; color: #ffd9a0;
  background: radial-gradient(circle at 50% 30%, #7a2a14, #2b0e06 75%); box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px #6e5130, 0 0 0 4px var(--ink), inset 0 0 12px rgba(0, 0, 0, .85);
  transition: filter .1s, transform .06s; overflow: visible; }
.abtn:hover { filter: brightness(1.2); }
.abtn:active, .abtn.pressed { transform: scale(.94); }
.abtn .kb { position: absolute; top: 2px; right: 4px; z-index: 3; font-size: .72rem; font-weight: 800; color: #fff; text-shadow: 0 1px 1px #000, 0 0 3px #000; }
.abtn .sweep { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: conic-gradient(transparent calc((1 - var(--p, 0)) * 360deg), rgba(0, 0, 0, .74) 0); }
.abtn .cdnum { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font-size: 1.3rem; font-weight: 800; color: #ffe9b0; text-shadow: 0 1px 2px #000, 0 0 4px #000; pointer-events: none; }
.abtn.no-res::after { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(40, 60, 170, .5); mix-blend-mode: multiply; }
.abtn.no-res .ico { filter: grayscale(.6) brightness(.8); }
.abtn.no .ico { filter: grayscale(1) brightness(.55); }
.abtn.empty { background: radial-gradient(#1a1410, #0b0806); }
.abtn.auto::before { content: ""; position: absolute; inset: -4px; z-index: 4; pointer-events: none; padding: 2px;
  background: conic-gradient(from var(--spin, 0deg), #ffd27a 0 12%, transparent 12% 50%, #ffd27a 50% 62%, transparent 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 2.4s linear infinite; }
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --spin: 360deg; } }
.abtn.fired { animation: fired .3s; }
@keyframes fired { 0% { filter: brightness(2.2); } 100% { filter: none; } }
.abtn.flash { animation: readyflash .45s; }
@keyframes readyflash { 0% { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px #ffe9b0, 0 0 18px #ffd27a; } 100% { } }
.abtn.dodge { color: #d6efff; background: radial-gradient(circle at 50% 30%, #2a5c80, #0b1c2a 75%); }
.abtn.dodge.big { width: 72px; height: 72px; }
.abtn.dodge.alert { animation: alert .25s infinite alternate; }
@keyframes alert { from { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px #c0392b, 0 0 0 4px var(--ink), 0 0 8px #e0483a88; } to { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px #ff6a4a, 0 0 0 4px var(--ink), 0 0 28px #e0483a; } }
.abar.static .abtn { cursor: default; }

/* ---------- spellbook */
.pages { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; padding: 18px 20px; position: relative;
  color: var(--paper-ink);
  background: linear-gradient(90deg, transparent calc(50% - 18px), rgba(70, 40, 15, .35) 50%, transparent calc(50% + 18px)),
    var(--fibre), var(--grain), radial-gradient(ellipse at 50% 40%, #ead9b0 0%, #d6bf8f 60%, #ae8f5c 100%);
  box-shadow: inset 0 0 36px rgba(90, 55, 20, .55), inset 0 0 3px rgba(60, 40, 20, .7); }
.spell { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(80, 50, 20, .25); align-items: start; }
.spell .abtn { cursor: help; }
.spell.locked { opacity: .5; }
.spell.locked .abtn .ico { filter: grayscale(1); }
.sname { font-family: var(--display); font-size: 1.2rem; color: #3b1d10; line-height: 1.1; }
.spell.onbar .sname::after { content: " (equipped)"; font-family: var(--body); font-size: .76rem; color: #7a5a30; }
.ssub { font-size: .8rem; color: #6b5338; font-weight: 700; }
.sdesc { font-size: .88rem; color: #3b2a1e; margin: 4px 0 6px; }
.mast { position: relative; height: 12px; background: rgba(60, 35, 15, .3); box-shadow: inset 0 0 0 1px rgba(60, 35, 15, .5); margin-bottom: 6px; }
.mast i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #5d7fc2, #2d4f8a); }
.mast span { position: relative; display: block; text-align: center; font-size: .68rem; font-weight: 800; color: #fff; text-shadow: 0 1px 1px #000; line-height: 12px; }
.barframe .abar { margin: 6px 0 14px; }

/* ---------- professions */
.prof { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center; padding: 5px 0; }
.prof .pname { font-weight: 700; }
.prof .main { color: var(--gold); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; margin-left: 4px; }
.prof.off { grid-template-columns: 150px 1fr; color: #6e6458; }
.psoon { font-size: .8rem; font-style: italic; }
.mats { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.recipes { display: grid; }
.recipe { display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(201, 160, 99, .1); }
.rname { font-weight: 700; color: #1eff00; }
.recipe.cant .rname { color: #9d9d9d; }
.rsub { font-size: .84rem; color: var(--text-dim); margin-bottom: 5px; }
.why { color: #ff7a66; font-size: .8rem; }

/* ---------- quest board */
.board { margin-top: 18px; padding: 30px 26px; border: 16px solid transparent; border-image: var(--frame) 16 stretch;
  background: var(--grain), repeating-linear-gradient(90deg, #3a2716 0 2px, #4d331d 2px 118px, #2a1b0f 118px 121px), #3f2a18;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, .7), 0 10px 30px rgba(0, 0, 0, .55); }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 26px; }
.quest { position: relative; padding: 22px 18px 16px; transform: rotate(-.8deg); }
.quest:nth-child(2n) { transform: rotate(.9deg); }
.quest:nth-child(3n) { transform: rotate(-.3deg); }
.pin { position: absolute; top: 7px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a7a, #9a1a0e 60%, #4a0804); box-shadow: 0 2px 3px rgba(0, 0, 0, .6); }
.qkind { font-family: var(--display); font-style: italic; color: #7a5a30; font-size: .88rem; }
.quest h3 { font-size: 1.25rem; margin: 2px 0 4px; }
.quest p { font-size: .92rem; }
.qprog { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; font-weight: 800; font-size: .86rem; margin: 6px 0; }
.inkbar { height: 8px; background: rgba(60, 35, 15, .25); box-shadow: inset 0 0 0 1px rgba(60, 35, 15, .6); position: relative; }
.inkbar i { position: absolute; inset: 0 auto 0 0; background: #8e1f12; }
.qreward { font-size: .86rem; color: #5a4128; margin-bottom: 10px; }
.qclock { font-weight: 800; font-size: .84rem; color: #7a5a30; margin: 4px 0 8px; }
.qclock.last { color: #8e1f12; }
.quest.done { box-shadow: inset 0 0 36px rgba(90, 55, 20, .55), 0 0 0 2px #d9a441, 0 0 22px rgba(255, 196, 107, .4); }

/* ---------- run map on parchment */
.map { position: relative; padding: 14px 8px 8px; margin: 0 -2px; }
.map::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 34%; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, rgba(70, 76, 82, .6), rgba(70, 76, 82, 0)); mix-blend-mode: multiply; }
.mapsvg { position: relative; width: 100%; max-width: 380px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.mapsvg .edge { fill: none; stroke: #6b5236; stroke-width: 1.6; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .8; }
.mapsvg .edge.walked { stroke: #8e1f12; stroke-width: 3; stroke-dasharray: none; opacity: .9; }
.mnode { color: #3b2a1e; }
.mnode .disc { fill: #ead9b2; stroke: #4a3826; stroke-width: 1.6; }
.mnode .halo { fill: none; stroke: none; }
.mnode.t-elite { color: #6a2a7a; }
.mnode.t-treasure { color: #9a6a0a; }
.mnode.t-camp { color: #a4501a; }
.mnode.t-event { color: #2f5d7a; }
.mnode.t-shrine { color: #b8650f; }
.mnode.t-boss { color: #7a160c; }
.mnode.t-boss .disc { stroke: #7a160c; stroke-width: 2.6; fill: #e3cfa2; }
.mnode.next { cursor: pointer; }
.mnode.next .disc { fill: #f4e7c6; stroke: #8e1f12; stroke-width: 2; }
.mnode.next .halo { stroke: #8e1f12; stroke-width: 1.5; animation: halo 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mnode.next:hover .disc { fill: #fff6dc; }
.mnode.here .disc { fill: #8e1f12; stroke: #4a0804; }
.mnode.here { color: #f6e3bc; }
.mnode.walked .disc { fill: #d2b98a; }
.mnode.walked { opacity: .75; }
.mnode.gone { opacity: .3; }
.townmark path { fill: #4a3826; }
.maplabel { font-family: var(--display-sc); fill: #4a2a16; font-size: 15px; letter-spacing: .04em; }
.compass circle { fill: none; stroke: #6b5236; stroke-width: 1.2; }
.compass path { fill: #6b5236; }
.compass text { font-family: var(--display-sc); font-size: 10px; fill: #6b5236; }
@keyframes halo { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.14); opacity: .1; } }
.runres { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(201, 160, 99, .12); font-size: .88rem; }
.tiles { display: flex; gap: 6px; flex-wrap: wrap; }
.tile { width: 36px; height: 36px; display: inline-block; }
.tile svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }

/* ---------- dialogs and boon cards */
.overlay { position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, .6), rgba(0, 0, 0, .88)); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; animation: fadein .25s; }
@keyframes fadein { from { opacity: 0; } }
.dialog { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; padding-top: 30px; animation: rise-in .3s ease-out; }
.dialog > div > .plate:first-child, .dialog > .plate:first-child { margin-top: -14px; }
.dialog.wide { max-width: 880px; }
@keyframes rise-in { from { transform: translateY(16px); opacity: 0; } }
.dicon { width: 60px; height: 60px; margin: 2px auto 6px; color: var(--ember); filter: drop-shadow(0 0 10px rgba(255, 143, 58, .4)); }
.dicon svg { width: 100%; height: 100%; display: block; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 0 0 6px; padding: 14px 12px 10px; }
.bcard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 20px 16px 16px; min-height: 250px; border: 0;
  background: var(--grain), linear-gradient(180deg, #2c2018, #120c09); box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--bronze-lo), 0 0 0 4px var(--ink), inset 0 0 0 1px currentColor, inset 0 0 30px rgba(0, 0, 0, .6);
  transition: transform .14s, box-shadow .14s; }
.bcard-wrap:hover .bcard { transform: translateY(-5px); box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--bronze), 0 0 0 4px var(--ink), inset 0 0 0 1px currentColor, 0 12px 30px rgba(0, 0, 0, .6), 0 0 26px color-mix(in srgb, currentColor 35%, transparent); }
.bcard .gem { width: 64px; height: 64px; display: block; filter: drop-shadow(0 0 12px color-mix(in srgb, currentColor 55%, transparent)) drop-shadow(0 3px 3px rgba(0, 0, 0, .7)); }
.bcard .gem svg { width: 100%; height: 100%; display: block; }
.bname { font-family: var(--display); font-size: 1.35rem; margin-top: 6px; line-height: 1.1; }
.brar { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; opacity: .8; }
.bdesc { color: var(--text); font-size: .95rem; margin: 8px 0; flex: 1; }
.btags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: #8f826f; }
.btags .hit { color: var(--gold); text-shadow: 0 0 8px rgba(240, 199, 94, .5); }
.opts { display: grid; gap: 2px; margin-top: 10px; }
.opt { text-align: left; background: none; border: 0; padding: 8px 12px; color: var(--gold-text); border-left: 2px solid transparent; font-size: 1rem; }
.opt:hover { background: linear-gradient(90deg, rgba(255, 143, 58, .14), transparent); border-left-color: var(--ember); color: #fff; }
.opt .n { color: var(--gold); font-weight: 800; margin-right: 4px; }
.endcard { max-width: 460px; text-align: center; }
.endcard h2 { font-size: 2rem; }
.won .endcard h2 { color: var(--ember-hot); }
.lost .endcard h2 { color: var(--fog); }
.lost .dicon { color: var(--fog); filter: none; }

/* ---------- fight */
.arena { display: grid; gap: 18px; position: relative; margin-top: 18px; }
.stage { position: relative; height: clamp(300px, 42vh, 390px); overflow: hidden; margin: 0 -6px; box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 50px rgba(0, 0, 0, .6); }
.k-boss .stage::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 100%, rgba(150, 20, 10, .3), transparent 70%); pointer-events: none; }
.foes { position: relative; z-index: 1; display: flex; justify-content: center; align-items: flex-end; gap: clamp(8px, 3vw, 28px); height: 100%; padding: 16px 10px 14px; }
.foe { position: relative; flex: 0 1 230px; min-width: 0; display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: opacity .5s, filter .5s, transform .5s; }
.foe .ring { width: min(108px, 24vw); height: min(108px, 24vw); transition: box-shadow .15s, transform .15s; }
.foe.is-boss { flex-basis: 300px; }
.foe.is-boss .ring { width: min(156px, 34vw); height: min(156px, 34vw); box-shadow: 0 0 0 2px var(--ink), 0 0 0 6px #9a3a1e, 0 0 0 7px var(--ink), 0 0 0 9px #c9a063, 0 0 0 10px var(--ink), inset 0 0 18px #000, 0 6px 22px rgba(0, 0, 0, .7); }
.foe.is-elite .ring { box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px #c9a063, 0 0 0 6px var(--ink), 0 0 0 8px #8a6a3e, 0 0 0 9px var(--ink), inset 0 0 14px #000, 0 4px 14px rgba(0, 0, 0, .6); }
.foe .fbody { width: 100%; margin-top: 12px; padding: 6px 8px 7px; display: grid; gap: 4px; background: rgba(8, 6, 5, .86); box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px #6e5130, 0 0 0 3px var(--ink), 0 6px 16px rgba(0, 0, 0, .6); }
.nameplate { display: flex; justify-content: center; align-items: baseline; gap: 6px; min-width: 0; }
.nameplate .nm { font-family: var(--display); font-size: 1.08rem; color: #ffd9c0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nameplate .cls { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.is-boss .nameplate .cls { color: #ff6a4a; }
.foe .sbar.ehp { height: 16px; }
.sbar.ehp > i.cur { background: linear-gradient(180deg, #d8402c, #7e1a10); }
.sbar.ehp > i.lag { background: #f3d9a8; transition: width .6s ease-out .15s; }
.sbar.ehp > i.lag::after { display: none; }
.sbar.stg { height: 5px; }
.sbar.stg > i { background: linear-gradient(90deg, #b8901f, var(--stagger)); }
.sbar.stg > i::after { display: none; }
.sbar.cast { height: 15px; }
.sbar.cast > i { background: linear-gradient(180deg, #e0a030, #9a5a10); }
.imminent .sbar.cast > i { background: linear-gradient(180deg, #ff5a3a, #a81e10); }
.sbar.cast.idle { opacity: .18; }
.foe .debuffs { min-height: 22px; justify-content: center; margin-bottom: 8px; }
.foe .debuffs .aura { width: 22px; height: 22px; }
.foe .debuffs .aura .t { bottom: auto; top: 50%; left: auto; right: -2px; transform: translateY(-50%); font-size: .7rem; width: auto; }
.foe.target .ring { transform: translateY(-3px); }
.foe.target::before { content: ""; position: absolute; top: -14px; left: 50%; margin-left: -8px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 11px solid var(--gold); filter: drop-shadow(0 0 4px var(--gold)); z-index: 2; animation: bob 1s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(4px); } }
.foe.target .fbody { box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px var(--gold), 0 0 0 3px var(--ink), 0 0 16px rgba(240, 199, 94, .3); }
.foe.casting .ring { filter: drop-shadow(0 0 10px rgba(224, 72, 58, .55)); }
.foe.imminent .ring { animation: imminent .25s infinite alternate; }
@keyframes imminent { from { filter: drop-shadow(0 0 4px #e0483a88); } to { filter: drop-shadow(0 0 22px #ff4a2a); } }
.foe.staggered .ring { filter: drop-shadow(0 0 16px var(--stagger)); }
.foe.dead, .foe.dying { opacity: .22; filter: grayscale(1); transform: translateY(8px) scale(.96); }
.ring .stun { position: absolute; inset: auto 0 40% 0; text-align: center; font-family: var(--display-sc); color: var(--stagger); font-size: .82rem; letter-spacing: .06em; opacity: 0; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.staggered .ring .stun { opacity: 1; }
.foe .ring > svg { transition: transform .15s; }
.casting .ring > svg { transform: scale(1.06); }
.imminent .ring > svg { transform: scale(1.12) translateY(-2px); }
.staggered .ring > svg { transform: rotate(-8deg); filter: brightness(.7); }
.foe.hit .ring { animation: hitflash .18s; }
@keyframes hitflash { 0% { filter: brightness(2.4) saturate(.3); } 100% { filter: none; } }
.foe.burst .ring::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--stagger); animation: burst .5s ease-out forwards; pointer-events: none; }
@keyframes burst { from { opacity: 1; transform: scale(.9); } to { opacity: 0; transform: scale(1.25); } }
.foe.enter { animation: enter .4s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
.float { position: absolute; top: 4px; font-weight: 800; font-size: 1.15rem; pointer-events: none; animation: rise .9s ease-out forwards; z-index: 5; color: #fff1dc; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #000, 0 0 4px #000; -webkit-text-stroke: .5px #000; }
.float.crit { color: var(--ember-hot); font-size: 1.7rem; animation: risecrit .9s ease-out forwards; }
.float.s-bleed { color: #e0604c; font-size: .9rem; }
.float.s-windup, .float.s-finishing, .float.s-armorbreaker { font-size: 1.4rem; color: #ffe0b0; }
@keyframes rise { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-34px); } }
@keyframes risecrit { 0% { opacity: 1; transform: translateY(0) scale(1.7); } 20% { transform: translateY(-6px) scale(1); } 100% { opacity: 0; transform: translateY(-40px) scale(1); } }

.hud { display: grid; grid-template-columns: minmax(250px, 340px) 1fr auto; gap: 22px; align-items: center; padding: 14px 18px;
  background: var(--grain), linear-gradient(180deg, #1f1610, #0f0a07); box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--bronze-lo), 0 0 0 4px var(--ink), 0 10px 30px rgba(0, 0, 0, .5); }
.hud-left { display: grid; gap: 8px; transition: transform .12s; }
.hud-left .auras { min-height: 30px; padding-left: 78px; }
.hud .unit .ring { width: 66px; height: 66px; }
.hud .abar { justify-self: center; }
.hud-left.low .ring { box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px #b8321e, 0 0 0 6px var(--ink), inset 0 0 14px #000, 0 0 22px rgba(192, 57, 43, .6); }
.hud-left.dash { animation: dash .3s ease-out; }
@keyframes dash { 0% { transform: translateX(0); } 30% { transform: translateX(-22px); opacity: .7; } 100% { transform: translateX(0); opacity: 1; } }
.hud-left.hurtflash .ring { animation: hurt .3s; }
@keyframes hurt { from { filter: brightness(1.8) sepia(1) hue-rotate(-30deg) saturate(4); } to { filter: none; } }
.lower { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.chatlog { height: 150px; overflow-y: auto; font-size: .84rem; background: rgba(0, 0, 0, .55); padding: 6px 10px; display: flex; flex-direction: column-reverse; box-shadow: inset 0 0 0 1px rgba(110, 81, 48, .35); color: #d8cfc0; }
.chatlog div { padding: 1px 0; }
.chatlog .warn { color: #ff9b88; }
.chatlog .stagger { color: var(--stagger); }
.chatlog .frenzy { color: var(--ember); }
.chatlog .dodge { color: var(--dodge); }
.chatlog .kill, .chatlog .win { color: #9fe0a9; }
.chatlog .death { color: #ff6b5b; }
.chatlog .phase { color: var(--c-epic); }
.boonbox { margin-top: 14px; }
.keys { font-size: .82rem; color: var(--text-dim); margin: 0; text-align: center; }
kbd { border: 1px solid #5a4632; border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; font-size: .76rem; background: #1a120c; font-family: var(--body); color: var(--gold-text); }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 5; box-shadow: inset 0 0 0 #0000; transition: box-shadow .4s; }
.vignette.in-frenzy { box-shadow: inset 0 0 140px #ff4a1a55; }
.vignette.redflash { animation: redflash .35s; }
@keyframes redflash { 0% { box-shadow: inset 0 0 120px #c0392bbb; } 100% { box-shadow: inset 0 0 0 #0000; } }
.arena.shake { animation: shake .22s; }
.arena.shake-big { animation: shake-big .4s; }
@keyframes shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, 1px); } 50% { transform: translate(3px, -1px); } 75% { transform: translate(-2px, 0); } }
@keyframes shake-big { 0%, 100% { transform: translate(0, 0); } 15% { transform: translate(-8px, 3px); } 30% { transform: translate(7px, -3px); } 45% { transform: translate(-5px, 2px); } 60% { transform: translate(4px, -1px); } 80% { transform: translate(-2px, 0); } }
.callout { position: fixed; left: 50%; top: 34%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; font-family: var(--display-sc); font-size: clamp(2rem, 7vw, 3.6rem); opacity: 0; text-shadow: 0 0 30px currentColor, 0 2px 0 #000, 0 0 6px #000; white-space: nowrap; }
.callout.show { animation: callout 1s ease-out forwards; }
.callout.stagger { color: var(--stagger); }
.callout.perfect { color: var(--dodge); }
.callout.frenzy { color: var(--ember); }
.callout.boss { color: #ff5a3a; }
@keyframes callout { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }

/* ---------- title */
.title { text-align: center; padding: 0 0 40px; }
.title-scene { position: relative; height: 300px; margin: 0 -16px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.title-hearth { position: absolute; left: 50%; bottom: 12px; width: 230px; transform: translateX(-50%); }
.title h1 { font-family: var(--display-sc); font-weight: 400; font-size: clamp(3rem, 11vw, 5.4rem); margin: -54px 0 0; position: relative; letter-spacing: .03em; line-height: 1;
  background: linear-gradient(180deg, #ffe2b0, #ff9a3c 55%, #a8461a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 22px rgba(255, 143, 58, .45)) drop-shadow(0 3px 0 #000); }
.rule { width: min(360px, 70%); height: 12px; margin: 10px auto 30px; position: relative; background: linear-gradient(90deg, transparent, var(--bronze) 20%, var(--bronze) 80%, transparent) center / 100% 1px no-repeat; }
.rule::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; transform: translate(-50%, -50%) rotate(45deg); background: var(--ember); box-shadow: 0 0 0 2px var(--ink), 0 0 10px var(--ember); }
.title-card { max-width: 620px; margin: 0 auto; padding: 14px 22px 18px; }
.title-card p { font-family: var(--display); font-size: 1.14rem; color: #d9c7a4; }
.namebox { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.namebox input { background: #0b0807; border: 1px solid var(--ink); box-shadow: 0 0 0 1px var(--bronze-lo), inset 0 2px 6px #000; color: var(--text); padding: 10px 14px; font-size: 1.05rem; width: 230px; font-family: var(--body); }
.fine { color: var(--text-dim); font-size: .85rem; margin-top: 18px; }

/* ---------- footer */
.footer { margin-top: 32px; padding-top: 12px; border-top: 1px solid rgba(110, 81, 48, .4); display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-dim); font-size: .85rem; align-items: center; }
.toast { color: var(--gold); }

/* ---------- small screens */
@media (max-width: 900px) {
  .c-hearth, .c-char, .c-book, .c-profs, .c-run, .lower { grid-template-columns: minmax(0, 1fr); }
  .hud { grid-template-columns: minmax(0, 1fr) auto; }
  .hud .abar { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 600px) {
  .topbar { gap: 10px 14px; flex-wrap: wrap; padding: 8px 16px; margin-bottom: 20px; }
  .brand { font-size: 1.35rem; }
  .unit.mini .ubody { min-width: 80px; }
  .purse { gap: 10px; }
  .tabs { padding: 0 4px; }
  .tab { padding: 6px 10px 5px; font-size: .92rem; }
  .frame { border-width: 12px; border-image-width: 12px; padding: 2px 2px 4px; }
  .plate { margin-top: -24px; }
  .pages { grid-template-columns: 1fr; padding: 12px; background: var(--fibre), var(--grain), radial-gradient(ellipse at 50% 40%, #ead9b0 0%, #d6bf8f 60%, #ae8f5c 100%); }
  .prof, .prof.off { grid-template-columns: 1fr; gap: 4px; }
  .dollgrid { gap: 10px; }
  .baggrid { grid-template-columns: repeat(5, 46px); }
  .slot { width: 46px; height: 46px; }
  .stage { height: 270px; }
  .foe .fbody { padding: 4px 5px; }
  .nameplate .nm { font-size: .9rem; }
  .nameplate .cls { display: none; }
  .sbar .label { font-size: .66rem; }
  .hud { padding: 10px; gap: 12px; }
  .hud-left .auras { padding-left: 0; }
  .abtn { width: 50px; height: 50px; padding: 6px; }
  .abtn.dodge.big { width: 64px; height: 64px; }
  .chatlog { height: 110px; }
  .keys { display: none; }
  .board { padding: 18px 8px; border-width: 12px; border-image-width: 12px; }
  .scene-hearth { width: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.r-common .bcard { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--bronze-lo), 0 0 0 4px var(--ink), inset 0 0 0 1px rgba(201, 160, 99, .35), inset 0 0 30px rgba(0, 0, 0, .6); }
.r-common .bcard .gem { color: var(--gold-text); }

/* ---------- theater: flipping cards, loot reveal, level-ups */
.flip { perspective: 1000px; }
.flipper { position: relative; display: block; height: 100%; transform-style: preserve-3d; animation: flip .7s cubic-bezier(.2, .7, .3, 1.15) var(--d, 0ms) both; }
.flipper > .front { display: flex; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flipper > .back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: rotateY(180deg); }
@keyframes flip { 0% { transform: translateY(-30px) rotateY(180deg); opacity: 0; } 25% { opacity: 1; transform: translateY(0) rotateY(180deg); } 100% { transform: rotateY(0); } }
.cardback { display: grid; place-items: center; background: var(--grain), repeating-linear-gradient(45deg, #2a1a10 0 6px, #22150c 6px 12px);
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--bronze), 0 0 0 4px var(--ink), inset 0 0 0 6px #1a100a, inset 0 0 0 7px var(--bronze-lo), inset 0 0 30px #000; }
.cardback .sigil { width: 38%; max-width: 64px; aspect-ratio: 1; filter: drop-shadow(0 0 10px rgba(255, 143, 58, .6)); }
.cardback .sigil svg { width: 100%; height: 100%; display: block; }

.bcard-wrap { position: relative; display: block; background: none; border: 0; padding: 0; min-height: 250px; transition: transform .3s, opacity .4s, filter .3s; }
.bcard-wrap .bcard { height: 100%; }
.bcard-wrap.chosen { transform: translateY(-10px) scale(1.06); z-index: 2; }
.bcard-wrap.chosen .bcard { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--gold), 0 0 0 4px var(--ink), inset 0 0 0 1px currentColor, 0 0 40px color-mix(in srgb, currentColor 60%, transparent), 0 0 80px rgba(255, 196, 107, .35); }
.bcard-wrap.dismissed { opacity: 0; transform: translateY(40px) rotate(-3deg) scale(.95); filter: grayscale(1); pointer-events: none; }
.bcard .rays { position: absolute; inset: -30%; z-index: -1; pointer-events: none; opacity: .5;
  background: repeating-conic-gradient(from 0deg, rgba(255, 160, 60, .35) 0 6deg, transparent 6deg 18deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%); mask: radial-gradient(circle, #000 20%, transparent 65%); animation: rays 14s linear infinite; }
.bcard { overflow: hidden; isolation: isolate; }
@keyframes rays { to { transform: rotate(360deg); } }

.reveal { max-width: 640px; text-align: center; }
.reveal h2 { font-size: 1.9rem; margin-top: 2px; }
.lost .reveal h2 { color: var(--fog); }
.won .reveal h2 { color: var(--ember-hot); }
.dicon.burst { position: relative; animation: pop .5s cubic-bezier(.2, .8, .3, 1.4) .1s both; }
.dicon.burst::before { content: ""; position: absolute; inset: -60%; z-index: -1; background: radial-gradient(circle, rgba(255, 170, 80, .45), transparent 60%); animation: glowpulse 2.4s ease-in-out infinite; }
.lost .dicon.burst::before { background: radial-gradient(circle, rgba(140, 150, 160, .3), transparent 60%); }
@keyframes pop { from { opacity: 0; transform: scale(.3); } }
@keyframes glowpulse { 50% { opacity: .5; transform: scale(.9); } }
.tokens { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 6px; }
.token { display: grid; justify-items: center; gap: 0; min-width: 84px; padding: 8px 10px 6px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px rgba(201, 160, 99, .3);
  animation: pop .45s cubic-bezier(.2, .8, .3, 1.4) var(--d, 0ms) both; }
.token .ti { width: 30px; height: 30px; display: grid; place-items: center; }
.token .ti svg { width: 100%; height: 100%; display: block; }
.token b { font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.token.tk-gold b { color: #ffd76a; }
.token.tk-xp b { color: #c99bff; }
.token.tk-emb b { color: var(--ember-hot); }
.token .tl { font-size: .74rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.xpgem { width: 22px; height: 22px; transform: rotate(45deg); background: radial-gradient(circle at 35% 35%, #f0dcff, #9a5ae0 50%, #3a1466); box-shadow: 0 0 0 2px var(--ink), 0 0 10px rgba(180, 120, 255, .6); }
.lines p { margin: 4px 0; animation: fadeup .4s var(--d, 0ms) both; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } }
.levelup { position: relative; margin: 8px auto; display: grid; justify-items: center; animation: levelin .8s cubic-bezier(.2, .8, .3, 1.3) var(--d, 0ms) both; }
.levelup span { font-family: var(--display-sc); font-size: 2.2rem; line-height: 1; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff3c4, #ffc94a 50%, #b8741a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 14px rgba(255, 200, 80, .6)) drop-shadow(0 2px 0 #000); }
.levelup small { color: var(--gold-text); font-size: .9rem; }
.levelup::before { content: ""; position: absolute; left: 10%; right: 10%; bottom: -6px; height: 2px; z-index: -1; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
@keyframes levelin { 0% { opacity: 0; transform: scale(2); filter: blur(4px); } 60% { opacity: 1; transform: scale(.95); filter: none; } 100% { transform: scale(1); } }
.loot { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 14px 0 6px; }
.lootcard { position: relative; width: 150px; height: 168px; }
.lootcard .front { height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 8px; text-align: center;
  background: var(--grain), linear-gradient(180deg, #2c2018, #120c09); box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--bronze-lo), 0 0 0 4px var(--ink), inset 0 0 0 1px color-mix(in srgb, currentColor 60%, transparent), inset 0 -30px 40px color-mix(in srgb, currentColor 14%, transparent); }
.lootcard .slot { width: 64px; height: 64px; }
.lc-name { font-family: var(--display); font-size: 1.02rem; line-height: 1.15; }
.lc-type { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); }
.lootcard .beam { position: absolute; left: 50%; bottom: 10%; width: 70%; height: 220%; transform: translateX(-50%); z-index: -1; pointer-events: none; opacity: 0;
  background: linear-gradient(0deg, currentColor, color-mix(in srgb, currentColor 40%, transparent) 50%, transparent 90%); filter: blur(7px); -webkit-mask: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); mask: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
  animation: beam 1.6s ease-out calc(var(--d, 0ms) + 350ms) both; }
.lootcard.r-common .beam { display: none; }
.lootcard.r-uncommon .beam { animation-name: beamsoft; }
@keyframes beam { 0% { opacity: 0; transform: translateX(-50%) scaleY(.2); transform-origin: bottom; } 30% { opacity: 1; transform: translateX(-50%) scaleY(1); } 100% { opacity: .6; transform: translateX(-50%) scaleY(1); } }
@keyframes beamsoft { 0% { opacity: 0; } 40% { opacity: .5; } 100% { opacity: .2; } }
.sparks { position: absolute; inset: 0; pointer-events: none; }
.sparks i { position: absolute; left: 50%; top: 40%; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; opacity: 0; animation: spark 1.2s ease-out calc(var(--d, 0ms) + 450ms) both; }
.sparks i:nth-child(1) { --x: -70px; --y: -60px; }
.sparks i:nth-child(2) { --x: 70px; --y: -50px; }
.sparks i:nth-child(3) { --x: -80px; --y: 20px; }
.sparks i:nth-child(4) { --x: 80px; --y: 30px; }
.sparks i:nth-child(5) { --x: -20px; --y: -90px; }
.sparks i:nth-child(6) { --x: 30px; --y: -85px; }
@keyframes spark { 0% { opacity: 1; transform: translate(0, 0) scale(1.4); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.3); } }
.runsum { margin: 16px auto 4px; max-width: 420px; padding: 14px 20px; text-align: left; animation: fadeup .5s var(--d, 0ms) both; }
.runsum h3 { text-align: center; }
.runsum dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 16px; margin: 6px 0 0; font-size: .95rem; }
.runsum dt, .runsum dd { margin: 0; animation: fadeup .35s var(--d, 0ms) both; }
.runsum dd { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.runsum .sick { color: #9a2a14 !important; font-weight: 700; font-size: .9rem; text-align: center; animation: fadeup .4s var(--d, 0ms) both; }
.hearthup { display: grid; justify-items: center; margin-top: 10px; padding: 8px; background: rgba(140, 50, 10, .12); box-shadow: inset 0 0 0 1px rgba(140, 60, 20, .45); animation: levelin .8s cubic-bezier(.2, .8, .3, 1.3) var(--d, 0ms) both; }
.hearthup span { font-family: var(--display-sc); font-size: 1.25rem; color: #8e2a0c; }
.hearthup small { color: #5a4128; }
.reveal .go { margin-top: 14px; animation: fadeup .4s var(--d, 0ms) both; }
@media (max-width: 600px) {
  .lootcard { width: 132px; height: 156px; }
  .token { min-width: 72px; }
  .levelup span { font-size: 1.8rem; }
  .bcard-wrap { min-height: 0; }
  .bcard { min-height: 0; padding: 14px 12px 12px; }
  .bcard .gem { width: 48px; height: 48px; }
  .bdesc { margin: 4px 0; }
}
.lootcard { isolation: isolate; }

/* ---------- tutorial coach */
.coach { padding: 12px 18px 10px; position: relative; display: none; }
.coach.on { display: block; }
.coach.pop { animation: fadeup .35s ease-out; }
.coach .ct { font-family: var(--display-sc); font-size: 1.2rem; color: #5a1d10; }
.coach p { margin: 2px 0 8px; font-size: 1rem; }
.coach kbd { background: #f4e7c6; color: #3b2a1e; border-color: #8a6a3e; }
.coach .red { color: #9a1a0c; }
.coach .link { color: #6b5338; }
.coach .link:hover { color: #3b1d10; }
.abtn.coached { animation: coached 1s ease-in-out infinite; z-index: 2; }
@keyframes coached { 0%, 100% { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--gold), 0 0 0 4px var(--ink), 0 0 6px rgba(255, 210, 122, .4); } 50% { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px #fff3c4, 0 0 0 4px var(--ink), 0 0 24px rgba(255, 210, 122, .9); } }
.abtn.dodge.coached.alert { animation: alert .25s infinite alternate; }

/* ---------- v6: strikes vs spells, counters */
.sbar.cast.spell > i { background: linear-gradient(180deg, #7ab8ff, #2a5aa8); box-shadow: 0 0 8px rgba(122, 184, 255, .6); }
.imminent .sbar.cast.spell > i { background: linear-gradient(180deg, #b8dcff, #3a7ae0); }
.casting:has(.sbar.cast.spell) .ring { box-shadow: 0 0 0 2px var(--ink), 0 0 16px rgba(122, 184, 255, .7); }
.float.interrupt { color: var(--dodge); font-family: var(--display-sc); font-size: 1.15rem; }
.float.eheal { color: #6aff8a; }
.callout.interrupt { color: var(--dodge); }
.abtn.alert:not(.dodge) { animation: alertblue .25s infinite alternate; z-index: 2; }
@keyframes alertblue { from { box-shadow: 0 0 0 2px #7fc4ff, 0 0 8px #7fc4ff; } to { box-shadow: 0 0 0 3px #d6efff, 0 0 22px #7fc4ff; } }
.keys .amber { color: #e0a030; }
.keys .blue, .coach .blue { color: #3a7ae0; }
.counter { font-family: var(--body); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; vertical-align: middle; border-radius: 2px; color: #fff; background: #6a4a2a; white-space: nowrap; }
.counter.c-spell { background: #2a5aa8; }
.counter.c-any { background: #8a6a10; }
.counter.c-fast, .counter.c-heavy { background: #8a2a1a; }

/* ---------- v6: editable action bar */
.abar.editable .abtn { cursor: pointer; }
.abar.editable .abtn.empty { box-shadow: inset 0 0 0 1px rgba(201, 160, 99, .35); }
.abar.picking .abtn:not(.locked):not(.dodge) { animation: coached 1s ease-in-out infinite; }
.abtn.sel, .spell.sel .abtn { outline: 2px solid var(--gold); outline-offset: 2px; }
.abtn.dropping { outline: 2px dashed var(--gold); outline-offset: 2px; filter: brightness(1.3); }
.abtn.locked { background: repeating-linear-gradient(45deg, #15100c 0 5px, #0c0907 5px 10px); box-shadow: inset 0 0 0 1px #2a2018; cursor: default; }
.abtn .lockt { position: absolute; inset: 0; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #6e6458; }
.spell .abtn[draggable="true"] { cursor: grab; }

/* ---------- v6: talents */
.talents { margin-top: 6px; }
.tal-head { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 0 4px 18px; }
.tal-head .good { color: #6aff8a; }
.tal-head .hint { flex: 1 1 260px; margin: 0; }
.trees { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tree .tiers { display: grid; gap: 14px; padding: 6px 10px 14px; }
.tree.t-blade { background-image: radial-gradient(ellipse at 50% 0%, rgba(138, 26, 36, .28), transparent 70%); }
.tree.t-fury { background-image: radial-gradient(ellipse at 50% 0%, rgba(224, 112, 42, .25), transparent 70%); }
.tree.t-bulwark { background-image: radial-gradient(ellipse at 50% 0%, rgba(95, 116, 136, .3), transparent 70%); }
.tier { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 6px; position: relative; }
.tier + .tier::before { content: ""; position: absolute; left: 50%; top: -14px; height: 14px; width: 2px; background: linear-gradient(var(--bronze-lo), var(--bronze)); }
.tneed { font-size: .72rem; color: var(--text-dim); text-align: right; }
.tnodes { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.tier.shut .talent { filter: grayscale(1) brightness(.45); }
.talent { position: relative; width: 52px; height: 52px; padding: 0; border: 0; cursor: pointer; background: #0b0806;
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px #3b2a18, 0 0 0 4px var(--ink); }
.talent .ico { display: block; width: 100%; height: 100%; }
.talent .ico svg { width: 100%; height: 100%; display: block; }
.talent:not(.has) .ico { filter: grayscale(.85) brightness(.7); }
.talent.can { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px #3f9a3a, 0 0 0 4px var(--ink), 0 0 12px rgba(80, 220, 80, .35); }
.talent.has { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px #3f9a3a, 0 0 0 4px var(--ink); }
.talent.max { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--gold), 0 0 0 4px var(--ink), 0 0 12px rgba(240, 199, 94, .35); }
.talent .rank { position: absolute; right: -8px; bottom: -8px; z-index: 2; min-width: 26px; padding: 0 3px; font-size: .7rem; font-weight: 800; line-height: 16px;
  background: #0b0806; color: #6aff8a; box-shadow: 0 0 0 1px var(--bronze-lo); }
.talent.max .rank { color: var(--gold); }
.talent:not(.has) .rank { color: var(--text-dim); }

/* ---------- v6: market and craft preview */
.wares { display: grid; gap: 4px; padding: 4px 6px 8px; }
.ware { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 8px 4px; border-top: 1px solid rgba(201, 160, 99, .1); }
.ware:first-child { border-top: 0; }
.wname { font-weight: 700; }
.ware .ssub { color: var(--text-dim); }
.wcmp { font-size: .8rem; display: flex; flex-wrap: wrap; gap: 0 10px; margin-top: 2px; }
.ware.ore .row { gap: 6px; }
.rcmp { font-size: .8rem; margin: 2px 0 6px; padding: 6px 8px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px rgba(201, 160, 99, .15); }
.rcmp .tt-head { font-size: .74rem; }
.c-market { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 900px) {
  .c-market, .trees { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .ware { grid-template-columns: 46px 1fr; }
  .ware > .btn, .ware > .row { grid-column: 2; justify-self: start; }
}
.talent { margin-bottom: 18px; }
.talent .tname { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); width: 92px; text-align: center; font-size: .7rem; line-height: 1.1; color: var(--text-dim); pointer-events: none; }
.talent.has .tname { color: var(--gold-text); }
.tier + .tier::before { display: none; }
.tnodes { gap: 12px 30px; }
.barframe .abar .abtn { width: 50px; height: 50px; }

/* ---------- v7: quest groups and run tasks */
.qgroup + .qgroup { margin-top: 30px; }
.qhead { font-family: var(--display-sc); font-weight: 400; font-size: 1.35rem; color: var(--gold-text); margin: 0 0 14px; text-shadow: 0 2px 0 #000;
  display: flex; align-items: center; gap: 12px; }
.qhead::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--bronze), transparent); }
.qempty { color: #c9b48e; font-style: italic; margin: 0; }
.quest.q-side .pin { background: radial-gradient(circle at 35% 35%, #9ad0ff, #1e5aa0 60%, #0a2244); }
.quest.q-bounty .pin { background: radial-gradient(circle at 35% 35%, #ffe08a, #a87a10 60%, #4a3404); }
.tasks { padding: 12px 16px 10px; }
.tasks h3 { margin: 0 0 6px; font-size: 1.05rem; }
.tasks ul { list-style: none; margin: 0; padding: 0; color: var(--paper-ink); }
.tasks li { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: .92rem; border-top: 1px dashed rgba(90, 55, 20, .3); }
.tasks li:first-child { border-top: 0; }
.tasks .tk { min-width: 34px; font-weight: 800; color: #7a5a30; font-variant-numeric: tabular-nums; }
.tasks li.done { color: #3a6a20; }
.tasks li.done .tk { color: #3a8a20; }
.tasks .trw { margin-left: auto; display: inline-flex; gap: 3px; align-items: center; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.tasks .trw svg { width: 13px; height: 13px; }

/* ---------- v7: map legend */
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 10px 8px 4px; padding-top: 10px; border-top: 1px solid rgba(74, 56, 38, .35); position: relative; z-index: 2; }
.legend .lg { display: flex; align-items: center; gap: 8px; font-size: .8rem; line-height: 1.2; color: #4a3826; }
.legend .lg b { color: #3b2a1e; font-family: var(--display); font-weight: 400; font-size: .95rem; margin-right: 3px; }
.legend .lg svg { width: 28px; height: 28px; flex: none; color: inherit; }
.legend .lg.t-fight svg, .legend .lg.t-boss svg { color: #3b2a1e; }
.legend .lg span { color: #4a3826; }
.legend .next-key .ring { fill: #f4e7c6; stroke: #8e1f12; stroke-width: 2; }
@media (max-width: 600px) { .legend { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- v8: trips and the inn */
.cd { font-variant-numeric: tabular-nums; font-weight: 700; }
.ring.tiny { width: 40px; height: 40px; }
.trip { border-top: 1px solid rgba(201, 160, 99, .25); padding: 10px 0 4px; margin-top: 10px; }
.trip-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.trip-out .sbar { margin: 4px 0 8px; }
.trip .row { gap: 6px; }
.c-inn { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.folk { display: grid; gap: 12px; margin-top: 10px; }
.npc { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 4px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px rgba(201, 160, 99, .18); }
.npc .ring { width: 56px; height: 56px; }
.npc.away .ring { filter: grayscale(1) brightness(.6); }
.npc-body { flex: 1; min-width: 0; }
.npc-name { font-family: var(--display-sc); color: var(--gold-text); font-size: 1.05rem; }
.npc-name small { font-family: var(--body); color: #9c8a6c; font-size: .8rem; margin-left: 6px; }
.npc .say { margin: 6px 0 8px; font-style: italic; color: #e6d9bf; line-height: 1.4; }
.npc .say.away { color: #8f8270; }
@media (max-width: 900px) { .c-inn { grid-template-columns: 1fr; } }
.aura .stk { position: absolute; right: -5px; top: -6px; min-width: 15px; height: 15px; border-radius: 8px; background: #b8321e; color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 1px #000; }

/* ---- origin: class, people, Fell-touched ---- */
.title-card:has(.origin) { max-width: 820px; }
.origin { text-align: left; margin-top: 14px; }
.o-step { font-family: var(--display-sc); color: var(--gold, #e6b24a); letter-spacing: .06em; margin: 14px 0 8px; font-size: 1.05rem; }
.o-classes { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #14100d; border: 1px solid var(--bronze-lo, #5a4630); color: var(--text); padding: 6px 12px; font-family: var(--body); cursor: pointer; }
.chip.on { border-color: #e6b24a; box-shadow: 0 0 0 1px #e6b24a55, inset 0 0 12px #e6b24a33; color: #fff2b8; }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip small { font-size: .72rem; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }
.o-races { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.race { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: #0f0c0a; border: 1px solid var(--bronze-lo, #5a4630); color: var(--text); padding: 10px; cursor: pointer; font-family: var(--body); font-size: .9rem; }
.race.on { border-color: #e6b24a; box-shadow: 0 0 0 1px #e6b24a66, inset 0 0 18px #e6b24a22; }
.race.no { opacity: .5; cursor: not-allowed; }
.race .ring { flex: 0 0 58px; width: 58px; height: 58px; }
.race .rbody { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.race .rbody > b { font-family: var(--display); font-size: 1.1rem; color: #fff2d0; }
.rblurb { color: #c9b896; font-style: italic; }
.rwhy { color: #e08a6a; }
.rskill { display: flex; gap: 6px; align-items: flex-start; }
.rskill .ico { flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid #000; }
.rskill .ico svg, .race .ring svg { width: 100%; height: 100%; display: block; }
.rpass b, .rskill b { color: #ffd27a; }
.fellbox { display: flex; gap: 10px; align-items: flex-start; background: #0b120b; border: 1px solid #2f4a2c; padding: 10px; cursor: pointer; font-size: .9rem; }
.fellbox.on { border-color: #7fdc6a; box-shadow: inset 0 0 18px #4fbf5a33; }
.fellbox input { margin-top: 4px; accent-color: #6ad05a; }
.fellbox > span { display: flex; flex-direction: column; gap: 4px; }
.fellbox .gift { color: #b8f59a; }
.fellbox .price { color: #d0a890; }
.o-go { text-align: center; margin-top: 16px; }
.origin-dialog { max-width: 820px; max-height: 92vh; overflow: auto; }
.traits { font-size: .85rem; color: #c9b896; margin: 4px 0 8px; text-align: center; }
.traits b { color: #ffd27a; }
.fell { color: #8fe86a; }
.abtn.racial { margin-right: 8px; }
.callout.chaos { color: #b8f59a; text-shadow: 0 0 18px #4fbf5a, 0 2px 0 #000; }
.vignette.greenflash { animation: greenflash .5s; }
@keyframes greenflash { 0% { box-shadow: inset 0 0 160px #4fbf5acc; } 100% { box-shadow: inset 0 0 0 #0000; } }
@media (max-width: 640px) {
  .o-races { grid-template-columns: 1fr; }
  .race .ring { flex-basis: 46px; width: 46px; height: 46px; }
}
.sbar.cast.fell .label { color: #b8f59a; text-shadow: 0 0 6px #2a9a3a, 0 1px 0 #000; }

/* ---- v10: Rogue resource, characters, boon sets ---- */
.sbar.energy > i { background: linear-gradient(180deg, #ffe066, #b88a12); }
.combo { display: flex; gap: 5px; margin: 4px 0 2px; }
.combo i { width: 14px; height: 14px; transform: rotate(45deg) scale(.8); background: #1a1410; border: 1px solid #5a4630; box-shadow: inset 0 0 4px #000; transition: background .15s, box-shadow .15s; }
.combo i.on { background: radial-gradient(circle at 40% 35%, #fff2b8, #e6602a 60%, #8a1d10); border-color: #ffb347; box-shadow: 0 0 8px #ff8f3a; }
.o-cdesc { margin: 6px 0 0; }
.roster { margin-bottom: 16px; }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.charcard { display: flex; gap: 10px; align-items: center; text-align: left; background: #0f0c0a; border: 1px solid var(--bronze-lo, #5a4630); color: var(--text); padding: 8px 10px; cursor: pointer; font-family: var(--body); }
.charcard:hover { border-color: #e6b24a; box-shadow: inset 0 0 14px #e6b24a22; }
.charcard .ring { flex: 0 0 48px; width: 48px; height: 48px; }
.charcard .ring svg { width: 100%; height: 100%; display: block; }
.charcard b { display: block; font-family: var(--display); font-size: 1.1rem; color: #fff2d0; }
.sets { list-style: none; padding: 0; margin: 8px 0 0; font-size: .85rem; }
.sets li { padding: 4px 6px; border-left: 2px solid #5a4630; margin-bottom: 4px; color: #b9a988; }
.sets li.on { border-color: #1eff00; color: #e8ffe0; background: #1eff0010; }
.sets li b { color: #ffd27a; }
.btags .done { color: #1eff00; text-shadow: 0 0 8px rgba(30, 255, 0, .4); }
.bset { display: block; margin-top: 6px; font-size: .78rem; color: #8fe86a; }
.origin .o-cdesc { font-family: var(--body); font-size: .92rem; color: #c9b896; }

/* ---------- v11: Mage, Ranger, Break, affixes */
.sbar.mana > i { background: linear-gradient(180deg, #6ab8ff, #1f4f9a); }
.sbar.focus > i { background: linear-gradient(180deg, #b8e05a, #5a7a14); }
.sbar.pcast { height: 12px; margin-top: 4px; transition: opacity .15s; }
.sbar.pcast > i { background: linear-gradient(180deg, #e8c8ff, #8a4ad0); }
.sbar.pcast .label { font-size: .66rem; }
.sbar.pcast.idle { opacity: 0; }
.abtn.casting { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px #c88aff, 0 0 0 4px var(--ink), 0 0 16px #c88aff; }
.abtn.breakbtn { margin-right: 8px; opacity: .45; filter: grayscale(.7); transition: opacity .12s, filter .12s; }
.abtn.breakbtn.ready { opacity: 1; filter: none; animation: breakready .3s infinite alternate; }
@keyframes breakready { from { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--gold), 0 0 0 4px var(--ink), 0 0 8px #ffd27a88; } to { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px #fff3c4, 0 0 0 4px var(--ink), 0 0 30px #ffd27a; } }
.ring .brk { position: absolute; inset: 8% 0 auto 0; text-align: center; font-family: var(--display-sc); color: #fff3c4; font-size: .9rem; letter-spacing: .12em; opacity: 0; pointer-events: none; text-shadow: 0 0 10px #ffb347, 0 1px 2px #000; }
.foe.breakable .ring .brk { opacity: 1; animation: brkpulse .3s infinite alternate; }
.foe.breakable .ring { filter: drop-shadow(0 0 18px #ffd27a) !important; }
@keyframes brkpulse { from { transform: scale(1); } to { transform: scale(1.15); } }
.foe.broken .ring { animation: broken .45s ease-out; }
@keyframes broken { 0% { filter: brightness(4) saturate(0); transform: scale(1.12); } 100% { filter: none; transform: scale(1); } }
.float.brkfloat { color: #fff3c4; font-family: var(--display-sc); font-size: 1.9rem; animation: risecrit 1.1s ease-out forwards; text-shadow: 0 0 14px #ffb347, 0 2px 0 #000; }
.callout.break { color: #fff3c4; text-shadow: 0 0 22px #ffb347, 0 2px 0 #000; font-size: 3.2rem; }
.vignette.whiteflash { animation: whiteflash .3s; }
@keyframes whiteflash { 0% { box-shadow: inset 0 0 200px #fff3c4cc; background: rgba(255, 243, 196, .18); } 100% { box-shadow: inset 0 0 0 #0000; background: transparent; } }
.nameplate .affix { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; padding: 0 5px; border-radius: 3px; background: #2a1a10; box-shadow: 0 0 0 1px var(--ink), 0 0 0 2px #6e5130; color: #ffd27a; cursor: help; white-space: nowrap; }
.affix.a-shielded { color: #bfe0ff; }
.affix.a-enraged { color: #ff6a4a; }
.affix.a-fellcaller { color: #8fe86a; }
.affix.a-bloodbound { color: #ff8a9a; }
.float.s-emberbolt, .float.s-pyroclasm, .float.s-aimedshot, .float.s-trueshot, .float.s-killshot { font-size: 1.4rem; color: #ffe0b0; }
.float.s-wolf { color: #c9cdd0; font-size: .95rem; }
.keys .gold, .coach .gold { color: #c8901a; }

/* inn rapport */
.rapport { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: .8rem; color: #9c8a6c; cursor: help; flex-wrap: wrap; }
.rapport .rank { font-family: var(--display-sc); color: #c9a063; letter-spacing: .03em; }
.rapport.r2 .rank { color: #e8c27a; }
.rapport.r3 .rank { color: #ffd98a; text-shadow: 0 0 6px rgba(255, 190, 90, .45); }
.rapport .repbar { position: relative; flex: 1; min-width: 150px; max-width: 280px; height: 15px; background: rgba(0, 0, 0, .55); box-shadow: inset 0 0 0 1px rgba(201, 160, 99, .45); border-radius: 2px; overflow: hidden; }
.rapport .repbar > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #e8b04a, #8a5a14); }
.rapport.r3 .repbar > i { background: linear-gradient(180deg, #ffe08a, #c8781e); box-shadow: 0 0 8px #ffb04a; }
.rapport .repbar > b { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(20, 12, 6, .85); }
.rapport .repbar > span { position: relative; display: block; text-align: center; font-size: .72rem; line-height: 15px; color: #fff3d6; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.socket { display: inline-block; vertical-align: middle; width: 22px; height: 22px; margin-left: 8px; padding: 2px; border-radius: 50%; background: radial-gradient(circle, #1a120c, #000); box-shadow: inset 0 0 0 1px rgba(201, 160, 99, .5); cursor: pointer; }
.socket.full { box-shadow: inset 0 0 0 1px #e8c27a, 0 0 6px rgba(255, 210, 120, .5); }
.socket svg { width: 100%; height: 100%; }
.gemrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.gembtn { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; border: 1px solid rgba(201, 160, 99, .35); background: #2a1e14; color: #f0e2c4; font-size: .78rem; cursor: pointer; border-radius: 3px; }
.gembtn.on { border-color: #e8c27a; background: rgba(232, 194, 122, .15); }
.gembtn svg { width: 18px; height: 18px; }
.quest.q-personal .pin { background: radial-gradient(circle at 35% 35%, #ffb08a, #b04a1e 60%, #4a1404); }

/* priest and emberwarden */
.sbar.grace > i { background: linear-gradient(180deg, #fff2c4, #c9a24a); }
.sbar.heat > i { background: linear-gradient(180deg, #ffb35a, #a8360f); }
.sbar.heat.kindled > i { background: linear-gradient(180deg, #ffe08a, #ff6a1a 60%, #b02a08); box-shadow: 0 0 10px #ff7a2a; }
.vignette.in-kindled { box-shadow: inset 0 0 120px #ff8a2a40; }
.vignette.emberflash { animation: emberflash .5s; }
@keyframes emberflash { 0% { box-shadow: inset 0 0 160px #ff9a3acc; } 100% { box-shadow: inset 0 0 0 #0000; } }
.float.healfloat { color: #8aff9a; font-size: 1.05rem; }
.float.s-aura { color: #ff9a4a; font-size: .85rem; }
.float.s-smite, .float.s-penance, .float.s-holyfire, .float.s-lastlight, .float.s-sear { font-size: 1.4rem; color: #fff0c0; }
.fellbox.no { opacity: .6; cursor: not-allowed; }

/* sound panel under the speaker button */
.topbar { position: relative; }
.soundpanel { position: absolute; right: 16px; top: calc(100% + 6px); z-index: 60; display: grid; gap: 10px; padding: 12px 14px; min-width: 220px;
  background: linear-gradient(180deg, #2a1e14, #160f0a); border: 1px solid var(--ink); border-radius: 4px; box-shadow: 0 10px 24px rgba(0, 0, 0, .6); }
.soundpanel .srow:first-child { justify-content: flex-start; }
.soundpanel .srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--gold-text); font-size: .95rem; }
.soundpanel input[type=range] { width: 120px; accent-color: #ff9a3c; }

/* v15: areas, storylines, journal, intro */
.areas { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.area-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: #14100d; border: 1px solid var(--bronze-lo); color: var(--text); padding: 6px 10px; font-family: var(--body); cursor: pointer; text-align: left; max-width: 100%; }
.area-tab b { font-family: var(--display-sc); font-weight: normal; }
.area-tab small { font-size: .74rem; color: var(--text-dim); }
.area-tab.on { border-color: #e6b24a; box-shadow: 0 0 0 1px #e6b24a55, inset 0 0 12px #e6b24a33; color: #fff2b8; }
.area-tab.locked { opacity: .55; cursor: default; border-style: dashed; }
.regions { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px 0 10px; padding-left: 10px; border-left: 2px solid var(--bronze-lo); }
.region-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: #110d0a; border: 1px solid #3a2a1c; color: var(--text); padding: 4px 9px; font-family: var(--body); cursor: pointer; text-align: left; font-size: .9rem; }
.region-tab b { font-weight: 700; }
.region-tab small { font-size: .72rem; color: var(--text-dim); }
.region-tab.on { border-color: #c98a3a; color: #ffe2a8; box-shadow: inset 0 0 10px #c98a3a33; }
.region-tab.locked { opacity: .5; cursor: default; border-style: dashed; }
.quest.q-arc .pin { background: radial-gradient(circle at 35% 35%, #d8b0ff, #6a2ea0 60%, #24093f); }
.quest.locked { filter: saturate(.55) brightness(.86); }
.quest.locked .pin { background: radial-gradient(circle at 35% 35%, #c9c2b6, #6a645c 60%, #2a2622); }
.qlock { font-style: italic; color: #6a3a1a !important; border-top: 1px dashed #a08a62; padding-top: 6px; margin-top: 6px; }
.qwhere { font-style: italic; color: #6a4a2a; }
.journal { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; }
.jact { font-family: var(--display-sc); color: var(--gold-text); margin: 8px 0 0; border-bottom: 1px solid var(--bronze-lo); padding-bottom: 4px; }
.jentry { border-left: 3px solid var(--bronze); padding: 2px 0 2px 10px; }
.jentry.jarc { border-left-color: #8a5ac0; }
.jentry p { margin: 2px 0 0; color: var(--text); line-height: 1.45; }
.jhead { font-family: var(--display-sc); color: var(--gold-text); }
.arcs { list-style: none; margin: 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.arcs small { color: var(--text-dim); }
.spoils .story { padding: 12px 16px; margin: 10px auto 0; max-width: 520px; animation: fadeup .5s var(--d, 0ms) both; }
.spoils .story p { margin: 0 0 4px; font-style: italic; line-height: 1.45; }
.spoils .story small { color: #6a4a2a; }
.linkish { background: none; border: 0; color: var(--ember-hot); font: inherit; text-decoration: underline; cursor: pointer; padding: 0 2px; }

.intro { padding: 0; background: #050403; flex-direction: column; justify-content: flex-end; z-index: 30; }
.il-stage { position: absolute; inset: 0; cursor: pointer; overflow: hidden; }
.il-scene { position: absolute; inset: 0; animation: ilpan 10s ease-out forwards; }
.il-scene > svg.backdrop { position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes ilpan { from { transform: scale(1.12) translateX(-2%); opacity: 0; } 12% { opacity: 1; } to { transform: scale(1) translateX(0); opacity: 1; } }
.il-text { position: relative; z-index: 2; width: 100%; margin: 0; padding: 60px 22px 12px; background: linear-gradient(180deg, rgba(5, 4, 3, 0), rgba(5, 4, 3, .85) 45%); text-align: center; opacity: 0; }
.il-text.in { animation: ilin 1.2s .3s forwards; }
.il-text p { font-family: var(--display); font-size: clamp(1.1rem, 2.6vw, 1.55rem); line-height: 1.45; color: var(--text); margin: 4px auto 0; max-width: 760px; }
.il-who { font-family: var(--display-sc); color: var(--ember-hot); font-size: .85rem; letter-spacing: .08em; }
.il-bar { position: relative; z-index: 2; background: rgba(5, 4, 3, .85); width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px 18px; }
.il-dots { display: flex; gap: 6px; margin-right: 6px; }
.il-dots i { width: 7px; height: 7px; border-radius: 50%; background: #4a3a2a; }
.il-dots i.on { background: var(--ember); box-shadow: 0 0 6px var(--ember); }
.il-fog { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 60%, #6f7a84 0%, #2c3238 55%, #0b0c0d 100%); animation: fogdrift 12s ease-in-out infinite alternate; }
.il-fog.rising { background: linear-gradient(0deg, rgba(142, 154, 166, .85), rgba(142, 154, 166, 0) 70%); animation: fogrise 9s ease-in forwards; }
.il-fog.low { background: linear-gradient(0deg, rgba(142, 154, 166, .55), rgba(142, 154, 166, 0) 45%); }
@keyframes fogdrift { to { transform: translateX(3%) scale(1.04); } }
@keyframes fogrise { from { transform: translateY(60%); } to { transform: translateY(0); } }
.il-sparks i { position: absolute; top: -10px; width: 8px; height: 8px; border-radius: 50%; background: var(--ember-hot); box-shadow: 0 0 14px 6px rgba(255, 143, 58, .7); animation: sparkfall 3.4s ease-in forwards; }
.il-sparks i:nth-child(1) { left: 20%; animation-delay: .6s; } .il-sparks i:nth-child(2) { left: 35%; animation-delay: 1.1s; } .il-sparks i:nth-child(3) { left: 50%; animation-delay: .8s; } .il-sparks i:nth-child(4) { left: 65%; animation-delay: 1.4s; } .il-sparks i:nth-child(5) { left: 80%; animation-delay: 1s; }
@keyframes sparkfall { 0% { top: -10px; } 80% { top: 55%; transform: scale(1); } 100% { top: 55%; transform: scale(3); box-shadow: 0 0 40px 22px rgba(255, 143, 58, .55); } }
.il-map { position: absolute; inset: 8% 6% 28%; background-color: var(--paper); background-image: var(--fibre); background-size: 100% 100%; border-radius: 4px; box-shadow: inset 0 0 60px rgba(60, 35, 10, .7); }
.il-map i { position: absolute; left: var(--x); top: var(--y); width: 12px; height: 12px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 6px rgba(255, 143, 58, .25), 0 0 18px var(--ember); opacity: 0; animation: ilin .6s forwards; }
.il-map i:nth-child(2) { animation-delay: .8s; } .il-map i:nth-child(3) { animation-delay: 1.6s; } .il-map i:nth-child(4) { animation-delay: 2.4s; } .il-map i:nth-child(5) { animation-delay: 3.2s; } .il-map i:nth-child(6) { animation-delay: 4s; }
.il-banner { position: absolute; left: 44%; top: 10%; width: 12%; height: 34%; background: linear-gradient(#7a1a12, #4a0e0a); clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%); animation: bannerfall 3s 2s ease-in forwards; }
@keyframes bannerfall { to { transform: translateY(120%) rotate(18deg); opacity: .4; } }
.il-glint { position: absolute; left: 30%; top: 52%; width: 70px; height: 4px; background: linear-gradient(90deg, transparent, #fff, transparent); transform: rotate(-30deg); opacity: 0; animation: ilin .3s 4.4s forwards; }
.il-burn { position: absolute; inset: 40% 0 0; background: linear-gradient(0deg, rgba(255, 110, 30, .55), transparent); mix-blend-mode: screen; animation: fogdrift 3s ease-in-out infinite alternate; }
.il-green { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 80%, rgba(80, 255, 120, .55), transparent 60%); mix-blend-mode: screen; animation: greenroll 6s ease-in forwards; }
@keyframes greenroll { from { opacity: 0; transform: translateY(20%); } to { opacity: 1; transform: translateY(0); } }
.il-oak { position: absolute; left: 50%; bottom: 14%; width: min(46vh, 60vw); transform: translateX(-50%); filter: brightness(.35) contrast(1.3); }
.il-sarne { position: absolute; left: 50%; bottom: 16%; width: min(60vh, 70vw); transform: translateX(-50%); animation: snuff 7s ease-in forwards; }
@keyframes snuff { 0% { filter: none; } 70% { filter: brightness(.7) saturate(.5); } 100% { filter: brightness(.15) grayscale(1); } }
.il-night { position: absolute; inset: 0; background: rgba(5, 8, 16, .62); }
.il-window { position: absolute; left: 47%; top: 52%; width: 22px; height: 18px; background: var(--ember-hot); box-shadow: 0 0 30px 10px rgba(255, 196, 107, .5); }
.il-title { position: absolute; left: 0; right: 0; top: 18%; text-align: center; font-family: var(--display-sc); font-size: clamp(2.4rem, 8vw, 5rem); color: var(--gold-text); text-shadow: 0 0 30px rgba(255, 143, 58, .5); opacity: 0; animation: ilin 2s 2.5s forwards; }
@keyframes ilin { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .il-scene, .il-sparks i, .il-banner, .il-sarne, .il-fog { animation: none !important; } }

/* v16: acts 3 and 4. Each area tints its scene and the borrowed portraits. */
.tint-weir_lines .backdrop, .stage.tint-weir_lines .foe .ring svg { filter: hue-rotate(70deg) saturate(1.3); }
.tint-orrins_road .backdrop, .stage.tint-orrins_road .foe .ring svg { filter: grayscale(0.7) brightness(1.05); }
.tint-sarne .backdrop, .stage.tint-sarne .foe .ring svg { filter: hue-rotate(190deg) saturate(0.6) brightness(0.95); }
.tint-ember_marches .backdrop, .stage.tint-ember_marches .foe .ring svg { filter: sepia(0.5) saturate(1.8) hue-rotate(-15deg); }
.tint-sylvaine_hollow .backdrop, .stage.tint-sylvaine_hollow .foe .ring svg { filter: hue-rotate(40deg) saturate(1.5) brightness(1.1); }
.tint-heart_of_sarne .backdrop, .stage.tint-heart_of_sarne .foe .ring svg { filter: grayscale(0.85) contrast(1.1); }

/* v17: every profession */
.prof[data-pick] { cursor: pointer; border-radius: 4px; padding-left: 6px; padding-right: 6px; }
.prof[data-pick]:hover { background: rgba(201, 160, 99, .06); }
.prof.picked { background: rgba(201, 160, 99, .12); box-shadow: inset 2px 0 0 var(--gold); }
.recipe .short { color: #c96a5a; }
.recipe .ok { color: #8fc46a; font-size: .8rem; align-self: center; }
.row.flexwrap { flex-wrap: wrap; }
.tierlock { opacity: .75; font-style: italic; }
.tiertabs { display: flex; gap: 3px; flex-wrap: wrap; margin: 14px 0 0; border-bottom: 1px solid var(--bronze-lo); }
.tab.tiertab { font-size: .92rem; padding: 5px 14px 4px; }
.tiertab .tready { margin-left: 7px; font-family: var(--body); font-size: .72rem; font-weight: 800; color: #1b120b; background: var(--gold); border-radius: 8px; padding: 0 6px; vertical-align: 1px; }
.salvage .ware { padding: 6px 0; }
.abtn.belt .count { position: absolute; right: 3px; bottom: 2px; font-size: .78rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.abtn.belt.no { filter: grayscale(1) brightness(.6); }
.prof[data-pick] { grid-template-columns: 150px 1fr 96px; }

.bagfoot { justify-content: flex-end; margin-top: 8px; }

/* ---------- v20 run map: themes, decorations, fog */
.map { --fog: #d8c7a0; --deco: #6b5236; overflow: hidden; }
.map.th-wood { background: var(--fibre), var(--grain), radial-gradient(ellipse at 50% 40%, #e2dcb0 0%, #c3bd8a 55%, #8f8a58 100%); --fog: #d4d2b4; --deco: #3f5a2c; }
.map.th-hollow { background: var(--fibre), var(--grain), radial-gradient(ellipse at 50% 40%, #ded2b6 0%, #b9aa8a 55%, #7d6e56 100%); --fog: #cfc6b4; --deco: #4a3a2a; }
.map.th-mine { background: var(--fibre), var(--grain), radial-gradient(ellipse at 50% 40%, #d9cdb6 0%, #b3a48c 55%, #6f6355 100%); --fog: #8f877c; --deco: #3c352e; }
.map.th-trench { background: var(--fibre), var(--grain), radial-gradient(ellipse at 50% 40%, #d8d2a8 0%, #b1a879 55%, #6f6a45 100%); --fog: #b8c3a2; --deco: #3e3a22; }
.map.th-road { background: var(--fibre), var(--grain), radial-gradient(ellipse at 50% 40%, #eadfc0 0%, #cdbb92 55%, #9a835a 100%); --fog: #e3dccb; --deco: #5a4a34; }
.map.th-city { background: var(--fibre), var(--grain), radial-gradient(ellipse at 50% 40%, #dcd6cc 0%, #b4ab9e 55%, #6e675f 100%); --fog: #c9cdd6; --deco: #3b3a40; }
.map.th-marches { background: var(--fibre), var(--grain), radial-gradient(ellipse at 50% 40%, #e6d0ae 0%, #c8a07a 55%, #8a5a3a 100%); --fog: #b9a596; --deco: #4a2a1a; }
.map.th-heart { background: var(--fibre), var(--grain), radial-gradient(ellipse at 50% 40%, #e8cfae 0%, #c79a72 55%, #7e4630 100%); --fog: #c8b2a2; --deco: #5a1d10; }
.mapsvg .deco { color: var(--deco); fill: var(--deco); opacity: .32; }
.mapsvg .fogbank { fill: #0c0a08; pointer-events: none; }
.mapstage { position: relative; max-width: 380px; margin: 0 auto; }
.mapstage .fogsvg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; will-change: transform; }
.mapstage .fog-b .fogbank { opacity: .6; }
@media (prefers-reduced-motion: no-preference) {
  .mapstage .fog-a { animation: fogdrift-a 11s ease-in-out infinite alternate; }
  .mapstage .fog-b { animation: fogdrift-b 8s ease-in-out infinite alternate; }
}
.mapstage .hearthglow { position: absolute; left: 50%; width: 170%; aspect-ratio: 1.3; transform: translate(-50%, -50%); pointer-events: none; mix-blend-mode: screen; opacity: var(--glow, .5);
  background: radial-gradient(closest-side, rgba(255, 170, 70, .75), rgba(230, 110, 30, .38) 35%, rgba(180, 60, 20, .12) 65%, transparent); }
@media (prefers-reduced-motion: no-preference) { .mapstage .hearthglow { animation: hearthpulse 3.6s ease-in-out infinite; } }
@keyframes hearthpulse { 0%, 100% { transform: translate(-50%, -50%) scale(.92); opacity: calc(var(--glow, .5) * .75); } 45% { transform: translate(-50%, -50%) scale(1.04); opacity: var(--glow, .5); } 60% { transform: translate(-50%, -50%) scale(1); opacity: calc(var(--glow, .5) * .9); } }
@keyframes fogdrift-a { from { transform: translate(-3px, 1px) scale(1); } to { transform: translate(3px, -2px) scale(1.012); } }
@keyframes fogdrift-b { from { transform: translate(4px, -2px) scale(1.01); } to { transform: translate(-4px, 2px) scale(.995); } }
.mapsvg .treeline { color: var(--deco); fill: var(--deco); pointer-events: none; }
.mapsvg .treeline.back { opacity: .7; }
.mapsvg .treeline.front { color: #2b2418; fill: #2b2418; opacity: .8; }
.mapsvg .fogclear { fill: #000; stroke: #000; stroke-width: 52; stroke-linecap: round; }
.sheet [data-stat] { cursor: help; }
