/* Ahelena — navy shield, gold lettering, cyan gems */
.sk.pot { position: relative; overflow: hidden; }
.sk.pot.oncd::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--pcd, 0) * 100%); background: rgba(10, 14, 24, .62); pointer-events: none; }
:root {
  /* Ahelena: navy shield, gold lettering, cyan gems, wood */
  --ink: #172030;
  --ink-2: #212b3d;
  --slate: #2a3950;
  --slate-2: #33455e;
  --slate-3: #445a7a;
  --parch: #f4ead6;
  --parch-dim: #b4ad9b;
  --brass: #eab54a;
  --brass-dk: #9a6a22;
  --gem: #3fd0dc;
  --gem-dk: #13808f;
  --wood: #8b5a2b;
  --hp: #e34a3c;
  --hp-dk: #7a1f1b;
  --mp: #3d8ee0;
  --mp-dk: #1b3f73;
  --xp: #a77bff;
  --ok: #5fd068;
  --bad: #ff6a5b;
  --r0: #c9cdd6; --r1: #5fd068; --r2: #b06cff; --r3: #ffad2e; --r4: #ff4d4d;
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --ui: 'Alegreya Sans', system-ui, sans-serif;
  --bevel: inset 0 2px 0 rgba(255,255,255,.13), inset 0 -3px 0 rgba(0,0,0,.28);
  --lift: 0 4px 0 var(--ink), 0 10px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--parch); font-family: var(--ui); font-size: 15px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible, input:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
canvas { display: block; }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
.hidden { display: none !important; }

/* ---------- enamel plaque ---------- */
.plaque {
  background: linear-gradient(180deg, var(--slate-2), var(--slate));
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--bevel), var(--lift);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 6px 16px; border: 3px solid var(--ink); border-radius: 12px;
  background: linear-gradient(180deg, #f2c25a, #d48f24); color: #2b1a05; font-weight: 800; letter-spacing: .01em;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(0,0,0,.25), 0 3px 0 var(--ink);
  transition: transform .06s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255,255,255,.4), inset 0 -2px 0 rgba(0,0,0,.25), 0 1px 0 var(--ink); }
.btn.ghost { background: linear-gradient(180deg, var(--slate-3), var(--slate-2)); color: var(--parch); box-shadow: var(--bevel), 0 3px 0 var(--ink); }
.btn.red { background: linear-gradient(180deg, #ff7a62, #c7382b); color: #2a0703; }
.btn.small { min-height: 30px; padding: 3px 10px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }

/* ---------- crest (character banner) ---------- */
#crest { position: absolute; left: 6px; top: 88px; transform: scale(var(--cs, 1)); transform-origin: top left; pointer-events: auto; filter: drop-shadow(0 4px 6px rgba(10,14,24,.45)); }
#crest .cv { position: absolute; left: 0; top: 0; width: 500px; height: 132px; }
#crest .hit { position: absolute; display: block; }
#crest .who { position: absolute; top: 126px; left: 20px; width: 200px; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--brass); text-shadow: 0 2px 0 var(--ink), 0 0 4px var(--ink), 0 0 2px var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#crest .line { position: absolute; top: 128px; right: 20px; width: 220px; text-align: right; font-size: 14px; font-weight: 900; color: #bff3f7; text-shadow: 0 1px 0 var(--ink), 0 0 3px var(--ink), 0 0 2px var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#crest .buffs { position: absolute; top: 152px; left: 20px; display: flex; gap: 4px; }
.buff { position: relative; width: 26px; height: 26px; border: 2px solid var(--ink); border-radius: 7px; background: var(--slate-3); overflow: hidden; }
.buff canvas { width: 100%; height: 100%; }
.buff em { position: absolute; right: 1px; bottom: 0; font-style: normal; font-size: 10px; font-weight: 900; text-shadow: 0 1px 0 var(--ink); }

/* ---------- menu belt ---------- */
#belt { position: absolute; left: 10px; right: 292px; top: 8px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px; padding: 5px 8px; border-radius: 20px; }
#belt::-webkit-scrollbar { display: none; }
.mbtn { position: relative; width: 58px; height: 56px; border: 0; background: none; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0 0 4px; }
.mbtn canvas { width: 32px; height: 32px; filter: drop-shadow(0 2px 0 var(--ink)); transition: transform .12s; }
.mbtn span { font-size: 11px; font-weight: 800; color: var(--parch-dim); line-height: 1.1; white-space: nowrap; }
.mbtn:hover { background: rgba(255,255,255,.06); }
.mbtn:hover canvas { transform: translateY(-2px) scale(1.06); }
.mbtn:hover span, .mbtn.on span { color: var(--parch); }
.mbtn.on { background: rgba(224,168,58,.16); box-shadow: inset 0 0 0 2px rgba(224,168,58,.5); }
.mbtn .dot { position: absolute; right: 9px; top: 5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); border: 2px solid var(--ink); font-size: 11px; font-weight: 900; color: #fff; display: grid; place-items: center; padding: 0 3px; }
#belt .sep { width: 3px; height: 38px; margin: 0 4px; border-radius: 2px; background: var(--ink); opacity: .7; }
#belt .acct { display: flex; flex-direction: column; gap: 3px; margin-left: 6px; }
#belt .acct button { border: 2px solid var(--ink); border-radius: 9px; padding: 1px 8px; font-weight: 900; font-size: 12px; background: var(--slate-2); color: var(--parch); }
#belt .acct .diab { color: #9fe8ff; }
#belt .acct .vipb { color: var(--parch-dim); }
#belt .acct .vipb.on { background: linear-gradient(180deg, #ffd75a, #e0a93a); color: #2b1a05; }

/* ---------- hunt card ---------- */
#huntcard { position: absolute; right: 14px; top: 12px; width: 262px; padding: 10px 14px 12px; }
#huntcard .rg { font-size: 13px; color: var(--parch-dim); }
#huntcard .hn { font-family: var(--display); font-weight: 800; font-size: 23px; line-height: 1.05; color: var(--brass); text-shadow: 0 2px 0 var(--ink); margin: 1px 0 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 8px; border: 2px solid var(--ink); font-size: 12px; font-weight: 800; }
.tag.exp { background: #6d4bd1; color: #fff; }
.tag.loot { background: #d99a2b; color: #2b1a05; }
.tag.boss { background: #c7382b; color: #fff; }
#huntcard dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 8px 0 0; font-size: 13.5px; }
#huntcard dt { color: var(--parch-dim); }
#huntcard dd { margin: 0; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
#huntcard .actions { display: flex; gap: 6px; margin-top: 10px; }
#huntcard .collapse { position: absolute; right: 8px; top: 6px; border: 0; background: none; color: var(--parch-dim); font-size: 18px; padding: 2px 6px; }

/* ---------- feed ---------- */
#feed { position: absolute; left: 14px; bottom: 96px; width: 330px; display: flex; flex-direction: column-reverse; gap: 4px; pointer-events: none !important; }
#feed .f { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 5px; border-radius: 10px; background: rgba(29,27,38,.78); border: 2px solid rgba(29,27,38,.95); font-size: 13.5px; font-weight: 700;
  animation: feedin .25s ease-out; max-width: 100%; }
#feed .f canvas { width: 26px; height: 26px; flex: none; }
#feed .f span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 0 var(--ink); }
@keyframes feedin { from { transform: translateX(-12px); opacity: 0; } }

/* ---------- skill bar ---------- */
#skills { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 8px; padding: 9px 10px; border-radius: 22px; }
.sk { position: relative; width: 60px; height: 60px; border: 3px solid var(--ink); border-radius: 14px; background: var(--ink-2); padding: 0; overflow: hidden; box-shadow: 0 3px 0 var(--ink); }
.sk canvas.ic { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); }
.sk canvas.cd { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sk .key { position: absolute; left: 4px; top: 2px; font-size: 11px; font-weight: 900; color: var(--parch-dim); text-shadow: 0 1px 0 var(--ink); }
.sk .mp { position: absolute; right: 3px; bottom: 2px; font-size: 11px; font-weight: 900; color: #9ccaff; text-shadow: 0 1px 0 var(--ink), 0 0 2px var(--ink); }
.sk .cdt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-weight: 900; text-shadow: 0 2px 0 var(--ink); }
.sk.empty { background: repeating-linear-gradient(45deg, var(--ink-2), var(--ink-2) 6px, #24222f 6px, #24222f 12px); }
.sk.nomana canvas.ic { filter: saturate(.3) brightness(.7); }
.sk.flash { animation: skflash .3s; }
@keyframes skflash { 50% { box-shadow: 0 0 0 4px var(--brass), 0 3px 0 var(--ink); } }
.pot { width: 52px; height: 52px; border-radius: 50%; }
.pot .cnt { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font-size: 12px; font-weight: 900; text-shadow: 0 1px 0 var(--ink), 0 0 3px var(--ink); }
#autobtn { width: 74px; height: 60px; border: 3px solid var(--ink); border-radius: 14px; font-weight: 900; font-size: 15px; line-height: 1.05; box-shadow: var(--bevel), 0 3px 0 var(--ink);
  background: linear-gradient(180deg, #4b5577, #343b58); color: var(--parch-dim); }
#autobtn small { display: block; font-size: 11px; font-weight: 700; }
#autobtn.on { background: linear-gradient(180deg, #7ee08a, #3aa34b); color: #0e2a12; }
#xpbar { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; background: var(--ink); }
#xpbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #7a49e0, var(--xp)); box-shadow: 0 0 8px rgba(167,123,255,.7); }
#xpbar b { position: absolute; right: 14px; bottom: 9px; font-size: 12px; font-weight: 800; color: var(--parch-dim); text-shadow: 0 1px 0 var(--ink); pointer-events: none; white-space: nowrap; }

/* ---------- boss hud ---------- */
#bosshud { position: absolute; left: 50%; bottom: 104px; transform: translateX(-50%); width: min(560px, 92vw); padding: 6px 14px 8px; text-align: center; }
#bosshud .bar.waves > i { background: linear-gradient(180deg, #ffd76a, #c98a1c) !important; }
#bosshud .bn { font-family: var(--display); font-weight: 800; font-size: 20px; color: #ffb59c; text-shadow: 0 2px 0 var(--ink); }
#bosshud .bt { font-size: 13px; color: var(--parch-dim); margin-left: 6px; font-family: var(--ui); }
#bosshud .bar { position: relative; height: 24px; margin-top: 4px; border: 3px solid var(--ink); border-radius: 10px; background: var(--ink-2); overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.4); }
#bosshud .bar > i { position: absolute; inset: 0 auto 0 0; transition: width .2s; box-shadow: inset 0 3px 0 rgba(255,255,255,.3); }
#bosshud .bar > b { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 10px; font-size: 13px; font-weight: 900; text-shadow: 0 1px 0 var(--ink), 0 0 3px var(--ink); }
#bosshud .bar > i { background: linear-gradient(180deg, #ff7a62, #b3241a); }
#bosshud .timer { font-size: 13px; color: var(--parch-dim); margin-top: 4px; }

/* ---------- panels ---------- */
#veil { position: fixed; inset: 0; background: rgba(12,10,18,.55); backdrop-filter: blur(2px); z-index: 20; }
.panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 21; width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  animation: panelin .16s ease-out; }
@keyframes panelin { from { transform: translate(-50%, -47%); opacity: 0; } }
.panel > header { display: flex; align-items: center; gap: 12px; padding: 12px 14px 10px 18px; border-bottom: 3px solid var(--ink); background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,0)); border-radius: 13px 13px 0 0; }
.panel > header canvas { width: 40px; height: 40px; }
.panel > header h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; color: var(--brass); text-shadow: 0 2px 0 var(--ink); }
.panel > header p { margin: 2px 0 0; font-size: 13.5px; color: var(--parch-dim); }
.panel > header .x { margin-left: auto; width: 40px; height: 40px; border: 3px solid var(--ink); border-radius: 12px; background: var(--slate-3); font-size: 20px; font-weight: 900; box-shadow: var(--bevel), 0 3px 0 var(--ink); }
.panel .body { padding: 14px 18px 18px; overflow: auto; min-height: 0; }
.panel .body::-webkit-scrollbar { width: 10px; } .panel .body::-webkit-scrollbar-thumb { background: var(--slate-3); border-radius: 6px; border: 2px solid var(--slate); }
.cols { display: grid; gap: 16px; }
.well { background: rgba(29,27,38,.55); border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; box-shadow: inset 0 2px 6px rgba(0,0,0,.25); }
h3 { margin: 0 0 8px; font-family: var(--display); font-weight: 800; font-size: 21px; color: var(--brass); text-shadow: 0 1px 0 var(--ink); }
.muted { color: var(--parch-dim); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* item slots */
.slot { position: relative; width: 58px; height: 58px; border: 3px solid var(--ink); border-radius: 12px; padding: 0; background: radial-gradient(circle at 50% 40%, #3d4462, #262a3e);
  box-shadow: inset 0 0 0 2px var(--rc, #4b5370), 0 2px 0 var(--ink); }
.slot canvas { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); }
.slot[data-r="1"] { --rc: var(--r1); } .slot[data-r="2"] { --rc: var(--r2); box-shadow: inset 0 0 0 2px var(--rc), inset 0 0 14px rgba(176,108,255,.35), 0 2px 0 var(--ink); }
.slot[data-r="3"] { --rc: var(--r3); box-shadow: inset 0 0 0 2px var(--rc), inset 0 0 16px rgba(255,173,46,.4), 0 2px 0 var(--ink); }
.slot[data-r="4"] { --rc: var(--r4); box-shadow: inset 0 0 0 2px var(--rc), inset 0 0 18px rgba(255,77,77,.45), 0 2px 0 var(--ink); animation: ancient 2.4s ease-in-out infinite; }
@keyframes ancient { 50% { box-shadow: inset 0 0 0 2px #ff8a5b, inset 0 0 22px rgba(255,90,60,.6), 0 2px 0 var(--ink); } }
.slot[data-r="0"] { --rc: #6c7186; }
.slot .ench { position: absolute; left: 2px; top: 2px; min-width: 20px; height: 16px; padding: 0 4px; border-radius: 6px; display: grid; place-items: center; font-size: 10.5px; font-weight: 900; line-height: 1; color: #fff; border: 1.5px solid var(--ink); background: linear-gradient(180deg, #8b98ad, #4f5b70); text-shadow: 0 1px 0 var(--ink); z-index: 2; }
.slot .ench.t2 { background: linear-gradient(180deg, #6fd3ff, #2a7fc0); }
.slot .ench.t3 { background: linear-gradient(180deg, #d59bff, #7a3bd0); }
.slot .ench.max { background: linear-gradient(180deg, #ffe58a, #e09a1c); color: #3a2208; text-shadow: none; }
.slot .ebar { position: absolute; left: 5px; right: 5px; bottom: 2px; height: 3px; border-radius: 2px; background: rgba(0,0,0,.55); overflow: hidden; z-index: 2; }
.slot .ebar i { display: block; height: 100%; background: #8b98ad; }
.slot .ebar.t2 i { background: #4fc3ff; } .slot .ebar.t3 i { background: #b46bff; } .slot .ebar.max i { background: #ffd34a; }
.slot.maxench { box-shadow: 0 0 0 2px #ffd34a, 0 0 14px 3px rgba(255,200,60,.75); animation: maxaura 1.6s ease-in-out infinite; }
.slot.maxench::after { content: ''; position: absolute; inset: -3px; border-radius: 13px; pointer-events: none; background: conic-gradient(from var(--a, 0deg), transparent 0 70%, rgba(255,240,170,.9) 80%, transparent 90%); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); animation: maxspin 2.4s linear infinite; }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes maxspin { to { --a: 360deg; } }
@keyframes maxaura { 50% { box-shadow: 0 0 0 2px #ffe58a, 0 0 22px 6px rgba(255,200,60,.95); } }
.slot .sock { bottom: 7px !important; }
.slot .qty { position: absolute; right: 4px; bottom: 1px; font-size: 12px; font-weight: 900; text-shadow: 0 1px 0 var(--ink), 0 0 3px var(--ink); }
.slot .lv { position: absolute; right: 4px; top: 1px; font-size: 10.5px; font-weight: 800; color: var(--parch-dim); text-shadow: 0 1px 0 var(--ink); }
.slot .sock { position: absolute; left: 4px; bottom: 3px; display: flex; gap: 2px; }
.slot .sock i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink); background: #20202c; }
.slot .sock i.f { background: #ffd75a; }
.slot .new { position: absolute; right: -4px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid var(--ink); }
.slot .lock { position: absolute; left: 2px; bottom: 0; font-size: 12px; }
.slot .up { position: absolute; right: 3px; bottom: 1px; color: var(--ok); font-weight: 900; font-size: 15px; text-shadow: 0 1px 0 var(--ink); }
.slot .bad { position: absolute; inset: 0; background: rgba(160,20,20,.28); border-radius: 9px; }
.slot.empty canvas { opacity: .25; filter: grayscale(1); }
.slot.sel { outline: 3px solid var(--brass); outline-offset: 1px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, 58px); gap: 7px; }

/* equipment */
.doll { display: grid; grid-template-columns: 58px 1fr 58px; gap: 10px; align-items: center; }
.doll .side { display: flex; flex-direction: column; gap: 10px; }
.doll .stage { height: 290px; border-radius: 14px; border: 2px solid var(--ink); background: radial-gradient(ellipse at 50% 85%, rgba(224,168,58,.25), rgba(0,0,0,0) 55%), radial-gradient(circle at 50% 40%, #4b5682, #22263a); position: relative; overflow: hidden; }
.doll .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.doll .bottom { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: center; }
.statlist { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.statlist dt { color: var(--parch-dim); } .statlist dd { margin: 0; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.power { font-family: var(--display); font-weight: 800; font-size: 28px; color: #ffd75a; text-shadow: 0 2px 0 var(--ink); }
.setline { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; padding: 4px 0; border-top: 1px dashed rgba(241,228,198,.15); }
.setline:first-child { border-top: 0; }

/* item card */
.icard { position: fixed; z-index: 200; width: 300px; padding: 12px 14px 12px; pointer-events: none; }
.icard.sticky { pointer-events: auto; }
.icard .nm { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.05; text-shadow: 0 2px 0 var(--ink); }
.icard .sub { font-size: 13px; color: var(--parch-dim); margin: 2px 0 8px; }
.icard .st { font-size: 14px; line-height: 1.45; }
.icard .st .b { font-weight: 800; }
.icard .st .aff { color: #9fd3ff; }
.icard .st .rn { color: #ffd75a; }
.icard .delta { font-size: 12.5px; margin-left: 4px; font-weight: 800; }
.icard .delta.up { color: var(--ok); } .icard .delta.dn { color: var(--bad); }
.icard hr { border: 0; border-top: 2px solid rgba(0,0,0,.35); margin: 8px 0; }
.icard .setb { font-size: 13px; color: var(--parch-dim); } .icard .setb .on { color: var(--ok); }
.icard .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.icard .req.bad { color: var(--bad); }

/* toasts */
#toasts { position: fixed; left: 50%; top: var(--toastY, 96px); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { padding: 8px 16px; border-radius: 12px; background: var(--slate-2); border: 3px solid var(--ink); font-weight: 800; box-shadow: var(--bevel), 0 3px 0 var(--ink); animation: feedin .2s; }

/* talents */
.branches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.branch { padding: 10px 10px 12px; }
.branch h3 { display: flex; justify-content: space-between; align-items: baseline; }
.branch h3 small { font-family: var(--ui); font-size: 13px; color: var(--parch-dim); }
.node { width: 100%; display: grid; grid-template-columns: 46px 1fr auto; gap: 8px; align-items: center; text-align: left; padding: 6px 8px; margin-top: 6px; border-radius: 12px; border: 2px solid var(--ink);
  background: rgba(255,255,255,.04); }
.node canvas { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--ink); background: var(--ink-2); }
.node b { display: block; font-size: 14px; } .node small { display: block; font-size: 12.5px; color: var(--parch-dim); line-height: 1.25; }
.node .rk { font-weight: 900; font-size: 14px; color: var(--parch-dim); font-variant-numeric: tabular-nums; }
.node.locked { opacity: .45; }
.node.can { border-color: var(--brass); background: rgba(224,168,58,.1); }
.node.max .rk { color: var(--ok); }
.node.skill canvas { border-color: var(--brass); }
.node .tierb { font-size: 11px; color: var(--parch-dim); }

/* map */
.regions { display: grid; gap: 10px; }
.region { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px; border-radius: 14px; border: 2px solid var(--ink); background: rgba(0,0,0,.18); }
.region .thumb { height: 100%; min-height: 104px; border-radius: 10px; border: 2px solid var(--ink); background-size: 128px; position: relative; overflow: hidden; }
.region .thumb b { position: absolute; left: 6px; bottom: 4px; font-family: var(--display); font-weight: 800; font-size: 20px; text-shadow: 0 2px 0 var(--ink), 0 0 6px var(--ink); }
.region .hunts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hunt { text-align: left; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--ink); background: var(--slate-2); box-shadow: var(--bevel); }
.hunt:hover { background: var(--slate-3); }
.hunt.cur { box-shadow: inset 0 0 0 2px var(--brass), var(--bevel); }
.hunt b { display: block; font-size: 15px; } .hunt small { display: block; color: var(--parch-dim); font-size: 12.5px; line-height: 1.3; margin-top: 2px; }
.region.locked { opacity: .55; }
.region.soon .thumb { filter: grayscale(.85) brightness(.6); }
.soonbadge { display: inline-block; font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 8px; background: var(--ink); color: var(--brass); border: 1px solid var(--brass-dk); }

/* forms */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px dashed rgba(241,228,198,.12); }
.toggle:first-of-type { border-top: 0; }
.switch { position: relative; width: 52px; height: 30px; border-radius: 15px; border: 3px solid var(--ink); background: #3b3f55; flex: none; padding: 0; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--parch-dim); border: 2px solid var(--ink); transition: left .12s; }
.switch.on { background: #3aa34b; } .switch.on::after { left: 23px; background: #fff; }
input[type=range] { accent-color: var(--brass); width: 160px; }
.chip { padding: 4px 10px; border-radius: 10px; border: 2px solid var(--ink); background: var(--slate-2); font-weight: 800; font-size: 13px; }
.chip.on { background: var(--brass); color: #2b1a05; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }

/* loading / title */
#loading { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #33395a, #15131d 75%); }
#loading .ld { text-align: center; }
#loading h1, .title h1 { font-family: var(--display); font-weight: 800; font-size: clamp(56px, 10vw, 104px); margin: 0; line-height: .9; color: var(--brass);
  text-shadow: 0 4px 0 var(--ink), 0 8px 0 rgba(0,0,0,.3), 0 0 40px rgba(224,168,58,.35); letter-spacing: .02em; }
#loading .lbar { width: 280px; height: 18px; margin: 24px auto 0; border: 3px solid var(--ink); border-radius: 9px; background: var(--ink-2); overflow: hidden; }
#loading .lbar i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #f2c25a, #d48f24); transition: width .2s; }
#loading p { color: var(--parch-dim); margin-top: 10px; }
#maploading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 10; font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--brass); text-shadow: 0 2px 0 var(--ink); }

/* creation */
#create { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(380px, 560px); background: radial-gradient(ellipse at 30% 50%, #3b4570, #171522 70%); overflow: auto; }
#create .stage { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; }
#create .stage canvas { width: min(460px, 90%, 52vh); aspect-ratio: 460 / 506; }
#create .stage h1 { font-size: clamp(54px, 7vw, 92px); margin-bottom: 0; }
#create .stage .tagline { color: var(--parch-dim); font-size: 16px; margin-top: 6px; text-align: center; max-width: 34ch; }
#create .pedestal { width: min(320px, 70%); height: 26px; margin-top: -40px; border-radius: 50%; background: radial-gradient(ellipse, rgba(224,168,58,.45), rgba(224,168,58,0) 70%); }
#create .form { padding: 22px 22px 30px; margin: 18px 18px 18px 0; display: flex; flex-direction: column; gap: 14px; }
#create .step h3 { display: flex; align-items: baseline; gap: 10px; }
#create .step h3 small { font-family: var(--ui); font-size: 13px; color: var(--parch-dim); }
#create input[type=text] { width: 100%; height: 46px; border-radius: 12px; border: 3px solid var(--ink); background: var(--ink-2); color: var(--parch); font: 700 18px var(--ui); padding: 0 14px; box-shadow: inset 0 3px 6px rgba(0,0,0,.35); }
.classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ccard { display: grid; grid-template-columns: 38px 1fr; gap: 8px; align-items: center; text-align: left; padding: 7px 8px; border-radius: 12px; border: 2px solid var(--ink); background: var(--slate-2); box-shadow: var(--bevel); }
.ccard canvas { width: 38px; height: 38px; }
.ccard b { display: block; font-size: 15px; } .ccard small { display: block; font-size: 11.5px; color: var(--parch-dim); line-height: 1.2; }
.ccard.on { background: linear-gradient(180deg, #5b4a2a, #3f3420); box-shadow: inset 0 0 0 2px var(--brass), var(--bevel); }
.picks { display: grid; grid-template-columns: repeat(auto-fill, 58px); gap: 7px; }
.pick { width: 58px; height: 58px; border-radius: 12px; border: 2px solid var(--ink); background: radial-gradient(circle at 50% 40%, #4a5478, #262a3e); padding: 0; position: relative; }
.pick canvas { width: 100%; height: 100%; }
.pick.on { box-shadow: inset 0 0 0 3px var(--brass); }
.classdesc { font-size: 14px; color: var(--parch-dim); margin-top: 8px; min-height: 2.6em; }

/* modal */
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 50; width: min(440px, calc(100vw - 32px)); padding: 18px 20px 18px; text-align: center; animation: panelin .16s ease-out; }
.modal h2 { font-family: var(--display); font-weight: 800; font-size: 34px; margin: 0 0 6px; color: var(--brass); text-shadow: 0 2px 0 var(--ink); }
.modal .gains { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.modal .gains div { padding: 8px; border-radius: 12px; border: 2px solid var(--ink); background: rgba(0,0,0,.2); }
.modal .gains b { display: block; font-size: 20px; } .modal .gains small { color: var(--parch-dim); }
.modal .loot { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }

/* responsive */
@media (max-width: 1180px) {
  #huntcard { width: 220px; }
  #belt { right: 246px; }
  .mbtn { width: 52px; }
  .mbtn span { font-size: 10px; }
}
@media (max-width: 920px) {
  #belt { max-width: none; top: auto; bottom: 96px; left: 8px; right: 8px; transform: none; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; border-radius: 16px; padding: 4px; }
  .mbtn { flex: none; width: 56px; height: 54px; } .mbtn canvas { width: 32px; height: 32px; }
  #belt .sep { display: none; }
  #feed { bottom: 166px; width: 260px; }
  #huntcard { top: 120px; right: 8px; width: 200px; padding: 8px 10px; }
  #huntcard.min dl, #huntcard.min .actions { display: none; }
  .branches { grid-template-columns: 1fr; }
  .region { grid-template-columns: 1fr; } .region .thumb { min-height: 64px; }
  #create { grid-template-columns: 1fr; }
  #create .form { margin: 0 12px 18px; }
  #create .stage { padding: 16px 16px 0; position: relative; height: auto; } #create .stage canvas { width: min(300px, 70%); }
}
@media (max-width: 560px) {
  #skills { left: 6px; right: 6px; transform: none; justify-content: center; gap: 4px; padding: 5px; bottom: 12px; border-radius: 16px; }
  .sk { width: 37px; height: 40px; border-radius: 10px; border-width: 2px; } .pot { width: 36px; height: 36px; }
  .sk .key { display: none; } .sk .mp { font-size: 10px; } .sk .cdt { font-size: 14px; }
  #autobtn { width: 48px; height: 40px; font-size: 12px; border-width: 2px; } #autobtn small { font-size: 9px; }
  #xpbar b { display: none; }
  #huntcard.min { width: auto; max-width: 190px; }
  #huntcard.min .hn { font-size: 16px; padding-right: 18px; }
  #belt { bottom: 74px; }
  #feed { bottom: 140px; width: 220px; } #feed .f { font-size: 12px; }
  #huntcard { top: 112px; width: 168px; }
  #huntcard .hn { font-size: 18px; }
  .panel { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; top: 0; left: 0; transform: none; }
  @keyframes panelin { from { opacity: 0; } }
  .panel .body { padding: 12px; }
  .doll .stage { height: 220px; }
  .region .hunts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

#deadmsg { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 800; font-size: 34px; color: #ffb59c; text-shadow: 0 3px 0 var(--ink), 0 0 20px rgba(0,0,0,.6); pointer-events: none !important; white-space: nowrap; }

/* logo */
#loading .logo { width: min(420px, 80vw); height: auto; filter: drop-shadow(0 10px 24px rgba(0,0,0,.45)); }
#create .stage .logo { width: min(380px, 70%); height: auto; filter: drop-shadow(0 10px 24px rgba(0,0,0,.45)); margin-bottom: -20px; position: relative; z-index: 1; }
#loading { background: radial-gradient(ellipse at 50% 40%, #33476a, #111827 75%); }
#create { background: radial-gradient(ellipse at 30% 45%, #34507a, #121a2a 72%); }
/* mastery */
.lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lineb { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: center; text-align: left; padding: 6px 8px; border-radius: 12px; border: 2px solid var(--ink); background: var(--slate-2); box-shadow: var(--bevel); }
.lineb canvas { width: 40px; height: 40px; border-radius: 9px; border: 2px solid var(--ink); }
.lineb b { display: block; font-size: 14px; } .lineb small { display: block; font-size: 12px; color: var(--parch-dim); }
.lineb .mbar { display: block; height: 6px; margin-top: 4px; border-radius: 3px; background: var(--ink); overflow: hidden; }
.lineb .mbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gem-dk), var(--gem)); }
.lineb.on { box-shadow: inset 0 0 0 2px var(--brass), var(--bevel); background: linear-gradient(180deg, #4a5f82, #33455e); }
.lineb em { position: absolute; right: 6px; top: 4px; font-style: normal; font-size: 10.5px; font-weight: 900; color: var(--gem); }
.skillrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.skc { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: start; text-align: left; padding: 7px; border-radius: 12px; border: 2px solid var(--ink); background: rgba(255,255,255,.04); }
.skc canvas { width: 52px; height: 52px; border-radius: 10px; border: 2px solid var(--ink); }
.skc b { display: block; font-size: 14.5px; } .skc small { display: block; font-size: 12px; color: var(--gem); } .skc small.d { color: var(--parch-dim); line-height: 1.3; margin-top: 2px; }
.skc.locked { position: relative; } .skc.locked b, .skc.locked small { opacity: .62; } .skc.locked canvas { filter: saturate(.75) brightness(.85); }
.skc.locked::after { content: '🔒'; position: absolute; left: 40px; top: 40px; font-size: 13px; filter: drop-shadow(0 1px 0 #000); }
.branch .skc.locked::after { left: 34px; top: 34px; }
.skc.on { box-shadow: inset 0 0 0 2px var(--brass); }
/* market */
.mk .price { color: #ffd76a; font-variant-numeric: tabular-nums; }
.mk .up { color: var(--ok); font-weight: 800; } .mk .dn { color: var(--bad); font-weight: 800; }

/* minimap */
#huntcard .mmwrap { position: relative; margin: 8px 0 2px; border: 3px solid var(--ink); border-radius: 8px; box-shadow: 0 0 0 2px var(--brass-dk), 0 3px 0 2px var(--ink); overflow: visible; background: var(--ink); }
#huntcard .mm { display: block; width: 100%; border-radius: 5px; cursor: pointer; touch-action: none; }
#huntcard .mmtip { position: absolute; transform: translate(-50%, calc(-100% - 10px)); background: var(--ink); color: var(--parch); border: 2px solid var(--gem); border-radius: 6px; padding: 3px 8px; font-size: 12px; font-weight: 800; white-space: nowrap; pointer-events: none; z-index: 2; }
#huntcard .mmwrap::after { content: 'Clique para caminhar · portais levam a outras caçadas'; display: block; font-size: 10.5px; color: var(--parch-dim); padding: 3px 6px 2px; background: var(--ink-2); border-radius: 0 0 5px 5px; }
#huntcard.min .mmwrap::after { display: none; }

/* ---------- books (world map, bestiary) ---------- */
.book { position: fixed; left: 50%; top: 52%; transform: translate(-50%, -50%); z-index: 21; width: min(1000px, calc(100vw - 40px), calc((100vh - 70px) * 1.344)); aspect-ratio: 246 / 183; container-type: inline-size; --q: 1cqw; color: #4a2f1a; filter: drop-shadow(0 18px 30px rgba(8,10,20,.55)); }
.book .bk { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; }
.book .ribbon { position: absolute; left: 50%; top: -6.8%; width: 72%; transform: translateX(-50%); pointer-events: none; z-index: 2; }
.book .ribbon img { width: 100%; display: block; }
.book .ribbon h2 { position: absolute; left: 0; width: 49%; top: 41%; height: 40%; margin: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: calc(2.1 * var(--q)); line-height: 1; color: #f4ead6; text-shadow: 0 calc(.25 * var(--q)) 0 rgba(10,20,50,.7); white-space: nowrap; }
.book .ribbon h2.r { left: 51%; }
.book.bs .ribbon { width: 46%; top: -7.5%; }
.book.bs .ribbon h2 { left: 5.8%; width: 40.4%; top: 1.5%; height: 32%; font-size: calc(2.5 * var(--q)); text-shadow: 0 calc(.25 * var(--q)) 0 rgba(80,20,10,.7); }
.book.bs .ribbon h2.r { left: 74%; width: 22.4%; top: 21%; height: 17.5%; font-family: inherit; font-size: calc(1.3 * var(--q)); font-weight: 900; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.book > .x { position: absolute; right: -1.4%; top: -2.2%; z-index: 3; width: calc(4.4 * var(--q)); height: calc(4.4 * var(--q)); min-width: 34px; min-height: 34px; border: 3px solid var(--ink); border-radius: 12px; background: var(--slate-3); color: var(--parch); font-size: calc(2.2 * var(--q)); font-weight: 900; box-shadow: var(--bevel), 0 3px 0 var(--ink); }
.book .pg { position: absolute; top: 7%; height: 80%; width: 40.5%; display: flex; flex-direction: column; align-items: center; gap: calc(.9 * var(--q)); overflow: hidden auto; scrollbar-width: none; font-size: calc(1.45 * var(--q)); }
.book .pg::-webkit-scrollbar { display: none; }
.book .pg.l { left: 6%; } .book .pg.r { left: 53.6%; }
.book.flipR .pg, .book.flipL .pg { animation: pgin .38s ease-out; }
.book.flipR .pg.r, .book.flipL .pg.l { animation-delay: .06s; }
@keyframes pgin { 0% { opacity: 0; transform: translateX(var(--fx, calc(2 * var(--q)))) } 100% { opacity: 1; transform: none } }
.book.flipL .pg { --fx: calc(-2 * var(--q)); }
.book .rt { margin: 0; font-family: var(--display); font-weight: 800; font-size: calc(2.6 * var(--q)); line-height: 1.05; color: #6b3518; text-align: center; }
.book .sub { margin: calc(-.4 * var(--q)) 0 0; font-size: calc(1.3 * var(--q)); color: #7a5a3a; text-align: center; display: flex; align-items: center; gap: calc(.6 * var(--q)); justify-content: center; }
.book .sub .tag { font-size: calc(1.15 * var(--q)); }
.book .warn { margin: 0; color: #a8322a; font-weight: 800; font-size: calc(1.3 * var(--q)); }
.book .island { position: relative; width: 108%; flex: none; aspect-ratio: 596 / 424; margin-top: calc(.4 * var(--q)); }
.book .island .art { width: 100%; height: 100%; display: block; }
.book .island.soon { background: radial-gradient(ellipse at 50% 50%, rgba(120,90,60,.25), rgba(0,0,0,0) 70%); }
.book .island .fog { position: absolute; inset: 18% 10%; display: grid; place-content: center; text-align: center; gap: calc(.5 * var(--q)); border: calc(.3 * var(--q)) dashed rgba(107,68,36,.5); border-radius: 50%; color: #7a5a3a; }
.book .island .fog b { font-family: var(--display); font-size: calc(1.8 * var(--q)); color: #6b3518; }
.book .pin { position: absolute; transform: translate(-50%, -50%); border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: calc(.2 * var(--q)); cursor: pointer; }
.book .pin .disc { width: calc(5.2 * var(--q)); height: calc(5.2 * var(--q)); border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 40%, #f6e7c3, #c9a46c); border: calc(.38 * var(--q)) solid #d9a441; box-shadow: 0 0 0 calc(.2 * var(--q)) #5a3a1c, 0 calc(.5 * var(--q)) calc(.8 * var(--q)) rgba(40,20,5,.45); transition: transform .15s; }
.book .pin .disc canvas { width: 100%; height: 100%; }
.book .pin.l .disc { border-color: #e9c46a; } .book .pin.b .disc { border-color: #c0392b; background: radial-gradient(circle at 50% 40%, #f3c7b5, #9c4a3a); }
.book .pin b { font-size: calc(1.15 * var(--q)); font-weight: 900; color: #fff3d6; background: rgba(74,47,26,.85); padding: calc(.15 * var(--q)) calc(.6 * var(--q)); border-radius: calc(.6 * var(--q)); white-space: nowrap; }
.book .pin:hover .disc, .book .pin.on .disc { transform: scale(1.12); }
.book .pin.on .disc { box-shadow: 0 0 0 calc(.2 * var(--q)) #5a3a1c, 0 0 0 calc(.6 * var(--q)) rgba(63,208,220,.65), 0 calc(.5 * var(--q)) calc(.8 * var(--q)) rgba(40,20,5,.45); }
.book .pin.here::before { content: 'Você está aqui'; position: absolute; top: calc(-1.9 * var(--q)); font-size: calc(1 * var(--q)); font-weight: 900; color: #fff; background: #13808f; padding: calc(.1 * var(--q)) calc(.5 * var(--q)); border-radius: calc(.5 * var(--q)); white-space: nowrap; }
.book .nav { margin-top: auto; width: 86%; aspect-ratio: 104 / 12; background: url(../assets/ui/wm_bar.webp) center / 100% 100% no-repeat; display: flex; align-items: center; justify-content: space-between; color: #f4ead6; font-weight: 900; font-size: calc(1.35 * var(--q)); }
.book .nav.top { margin-top: 0; }
.book .nav span { flex: 1; text-align: center; text-shadow: 0 calc(.15 * var(--q)) 0 rgba(10,20,50,.7); }
.book .nav .arr { width: 7%; height: 100%; border: 0; background: none; color: transparent; cursor: pointer; }
.book .nav .arr:disabled { opacity: .3; cursor: default; }
.book .medal { position: relative; width: 52%; aspect-ratio: 61 / 60; margin-top: calc(.4 * var(--q)); flex: none; }
.book .medal .fr { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.book .medal .scene { position: absolute; left: 8.2%; top: 13.3%; width: 70.5%; height: 70%; border-radius: 50%; overflow: hidden; background: #c9a46c; }
.book .medal .scene canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.book .medal .scene.boss { background: radial-gradient(circle at 50% 45%, #a85a4a, #3a1a1a); display: grid; place-items: center; }
.book .desc { width: 100%; padding: calc(1 * var(--q)) calc(1.4 * var(--q)) calc(1 * var(--q)) calc(1.8 * var(--q)); background: url(../assets/ui/wm_desc.webp) center / 100% 100% no-repeat; font-size: calc(1.32 * var(--q)); line-height: 1.35; color: #4a2f1a; padding-left: 8%; min-height: calc(5.6 * var(--q)); display: flex; flex-direction: column; justify-content: center; }
.book .divw { position: relative; width: 46%; flex: none; } .book .divw > img { width: 100%; display: block; }
.book .divw .em { position: absolute; left: 50%; top: 50%; width: 19%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; }
.book .divw .em img, .book .divw .em canvas { width: 100% !important; height: 100% !important; object-fit: contain; }
.book .mons { display: flex; flex-wrap: wrap; gap: calc(.5 * var(--q)); justify-content: center; }
.book .mon { display: flex; flex-direction: column; align-items: center; width: calc(7.2 * var(--q)); text-align: center; }
.book .mon canvas { width: calc(4.4 * var(--q)); height: calc(4.4 * var(--q)); border-radius: 50%; background: radial-gradient(circle at 50% 40%, #f6e7c3, #c9a46c); border: calc(.25 * var(--q)) solid #b07a3a; }
.book .mon small { font-size: calc(1 * var(--q)); line-height: 1.1; color: #6b4424; font-weight: 700; }
.book .info { margin: 0; font-size: calc(1.25 * var(--q)); color: #7a5a3a; }
.book .bkbtn { margin-top: auto; flex: none; width: 46%; aspect-ratio: 40 / 12; border: 0; background: url(../assets/ui/wm_button.webp) center / 100% 100% no-repeat; color: #f4ead6; font-family: var(--display); font-weight: 800; font-size: calc(1.6 * var(--q)); text-shadow: 0 calc(.15 * var(--q)) 0 rgba(10,20,50,.8); cursor: pointer; transition: transform .1s, filter .1s; display: flex; align-items: center; justify-content: center; padding: 0 6% 2.5%; line-height: 1; white-space: nowrap; }
.book .bkbtn:hover:not(:disabled) { transform: translateY(calc(-.15 * var(--q))); filter: brightness(1.12); }
.book .bkbtn:disabled { filter: grayscale(.7) brightness(.85); cursor: default; font-size: calc(1.3 * var(--q)); }
.book .tabs { position: absolute; right: -3.6%; top: 9%; display: flex; flex-direction: column; gap: calc(.5 * var(--q)); z-index: 0; }
.book .tab { width: calc(4.4 * var(--q)); height: calc(4 * var(--q)); border: calc(.25 * var(--q)) solid #3a2414; border-left: 0; border-radius: 0 calc(1 * var(--q)) calc(1 * var(--q)) 0; background: linear-gradient(90deg, #2f4f8f, #3e66b0); color: #f4ead6; font-family: var(--display); font-weight: 800; font-size: calc(1.5 * var(--q)); padding-left: calc(.8 * var(--q)); cursor: pointer; box-shadow: 0 calc(.3 * var(--q)) 0 rgba(30,15,5,.4); }
.book.bs .tab { background: linear-gradient(90deg, #8b2420, #b8352b); }
.book .tab.on { width: calc(5.4 * var(--q)); filter: brightness(1.2); } .book .tab.here::after { content: '•'; color: var(--gem); margin-left: calc(.2 * var(--q)); }
.book .tab.soon { background: linear-gradient(90deg, #6b5a46, #8a7660); }
.book.wm .pg { top: 12.5%; height: 75%; }
/* bestiary */
.book.bs .pg { top: 9%; height: 79%; }
.book.bs .pg.l { left: 5.4%; } .book.bs .pg.r { left: 54%; }
.book.bs .nav { background-image: url(../assets/ui/bs_bar2.webp); width: 90%; aspect-ratio: 82 / 12; }
.book.bs .nav .arr { color: #f4ead6; font-size: calc(1.3 * var(--q)); width: 10%; }
.book .sub.c { margin: 0; }
.book .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(.8 * var(--q)); width: 94%; }
.book .cell { position: relative; aspect-ratio: 1; border: 0; padding: 7%; background: url(../assets/ui/bs_cell.webp) center / 100% 100% no-repeat; cursor: pointer; transition: transform .12s; }
.book .cell.done { background-image: url(../assets/ui/bs_cell_done.webp), url(../assets/ui/bs_cell.webp); }
.book .cell canvas { width: 100%; height: 100%; display: block; }
.book .cell.unk canvas { filter: brightness(0) opacity(.45); }
.book .cell em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-family: var(--display); font-weight: 800; font-size: calc(2.6 * var(--q)); color: #f4ead6; text-shadow: 0 calc(.2 * var(--q)) 0 #4a2f1a; }
.book .cell.on { transform: scale(1.08); filter: drop-shadow(0 0 calc(.5 * var(--q)) rgba(255,200,90,.9)); }
.book .cell.boss::after { content: '☠'; position: absolute; right: 4%; top: 2%; font-size: calc(1.3 * var(--q)); color: #a8322a; }
.book .cell .pips { position: absolute; left: 0; right: 0; bottom: -4%; display: flex; justify-content: center; gap: 6%; }
.book .cell .pips i { width: 14%; aspect-ratio: 1; transform: rotate(45deg); background: #c9b08a; border: calc(.15 * var(--q)) solid #6b4424; }
.book .cell .pips i.f { background: #e0a43a; box-shadow: 0 0 calc(.3 * var(--q)) #ffd76a; }
.book .sum { margin-top: auto; width: 94%; text-align: center; display: grid; gap: calc(.3 * var(--q)); padding: calc(.8 * var(--q)); border-top: calc(.2 * var(--q)) solid rgba(107,68,36,.35); }
.book .sum b { font-family: var(--display); color: #6b3518; font-size: calc(1.5 * var(--q)); } .book .sum small { font-size: calc(1.15 * var(--q)); color: #7a5a3a; }
.book .namebar { position: relative; width: 104%; flex: none; }
.book .namebar img { width: 100%; display: block; }
.book .namebar b { position: absolute; left: 5.8%; width: 40.4%; top: 1.5%; height: 32%; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: calc(1.6 * var(--q)); color: #fff3d6; text-shadow: 0 calc(.2 * var(--q)) 0 rgba(80,20,10,.8); white-space: nowrap; overflow: hidden; }
.book .namebar small { position: absolute; left: 74%; width: 22.4%; top: 21%; height: 17.5%; display: flex; align-items: center; justify-content: center; font-size: calc(1.1 * var(--q)); font-weight: 900; color: #f4ead6; white-space: nowrap; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.book .portrait { width: 44%; aspect-ratio: 1; flex: none; margin-top: calc(-1 * var(--q)); border-radius: 50%; background: radial-gradient(circle at 50% 45%, #f6e7c3, #d9bf8e 60%, rgba(217,191,142,0) 72%); display: grid; place-items: center; }
.book .portrait canvas { width: 100%; height: 100%; }
.book .portrait.unk canvas { filter: brightness(0) opacity(.5); }
.book .stats { width: 94%; display: grid; grid-template-columns: 1fr 1fr; gap: calc(.5 * var(--q)) calc(.9 * var(--q)); }
.book .srow { display: flex; align-items: center; gap: calc(.6 * var(--q)); padding: calc(.35 * var(--q)) calc(.8 * var(--q)); background: url(../assets/ui/bs_bar.webp) center / 100% 100% no-repeat; font-size: calc(1.25 * var(--q)); }
.book .srow img { width: calc(1.7 * var(--q)); height: calc(1.7 * var(--q)); }
.book .srow b { margin-left: auto; font-variant-numeric: tabular-nums; }
.book .hab { margin: 0; font-size: calc(1.22 * var(--q)); color: #6b4424; text-align: center; }
.book .stages { width: 94%; display: grid; gap: calc(.55 * var(--q)); }
.book .stage { display: grid; gap: calc(.2 * var(--q)); }
.book .stage .sh { display: flex; justify-content: space-between; font-size: calc(1.2 * var(--q)); }
.book .stage .sh b { color: #6b3518; }
.book .stage .bar { height: calc(1.2 * var(--q)); background: url(../assets/ui/bs_bar2.webp) center / 100% 100% no-repeat; position: relative; overflow: hidden; border-radius: calc(.3 * var(--q)); }
.book .stage .bar i { position: absolute; inset: 18% auto 18% 1.5%; max-width: 97%; background: linear-gradient(180deg, #ffd76a, #e0a43a 55%, #b8782a); border-radius: calc(.2 * var(--q)); }
.book .stage .rw { font-size: calc(1.1 * var(--q)); color: #7a5a3a; }
.book .stage.ok .sh small, .book .stage.ok .rw { color: #2f7a3a; font-weight: 800; }
@media (max-width: 700px) {
  .book { --q: 8.6px; top: 50%; width: calc(100vw - 12px); height: calc(100vh - 110px); aspect-ratio: auto; overflow: auto; background: linear-gradient(180deg, #f3e6c4, #e9d6a8); border: 4px solid #6b4424; border-radius: 14px; padding: 46px 12px 16px; display: flex; flex-direction: column; gap: 14px; filter: none; }
  .book .bk, .book .ribbon img { display: none; }
  .book .ribbon { position: absolute; top: 8px; left: 12px; right: 56px; width: auto; transform: none; }
  .book .ribbon h2 { position: static; width: auto; text-align: left; color: #6b3518; text-shadow: none; font-size: 20px; }
  .book .ribbon h2.r { display: none; }
  .book .pg, .book.wm .pg, .book.bs .pg { position: static; width: auto; height: auto; overflow: visible; }
  .book .tabs { position: static; flex-direction: row; flex-wrap: wrap; order: -1; }
  .book .tab { border-left: calc(.25 * var(--q)) solid #3a2414; border-radius: 8px; padding: 0; width: 38px; height: 32px; font-size: 14px; } .book .tab.on { width: 38px; }
  .book > .x { right: 8px; top: 6px; }
}

.book .legend { width: 100%; display: grid; gap: calc(.5 * var(--q)); }
.book .leg { display: grid; grid-template-columns: calc(2.2 * var(--q)) 1fr; grid-template-rows: auto auto; column-gap: calc(.8 * var(--q)); align-items: center; text-align: left; padding: calc(.5 * var(--q)) calc(.9 * var(--q)); border: calc(.2 * var(--q)) solid rgba(107,68,36,.35); border-radius: calc(.9 * var(--q)); background: rgba(255,248,225,.45); cursor: pointer; color: #4a2f1a; }
.book .leg i { grid-row: span 2; width: calc(1.9 * var(--q)); height: calc(1.9 * var(--q)); border-radius: 50%; border: calc(.3 * var(--q)) solid #5a3a1c; background: #8a5cff; }
.book .leg.l i { background: #e9c46a; } .book .leg.b i { background: #c0392b; }
.book .leg b { font-size: calc(1.35 * var(--q)); } .book .leg small { font-size: calc(1.1 * var(--q)); color: #7a5a3a; }
.book .leg.on { background: rgba(255,240,200,.9); border-color: #d9a441; box-shadow: 0 0 0 calc(.2 * var(--q)) rgba(217,164,65,.4); }

@media (max-width: 560px) { #feed .f:nth-child(n+4) { display: none; } }

/* ---------- phones & small screens (layout tuned with --cs / --crestH set by the HUD) ---------- */
@media (max-width: 920px) and (min-height: 501px) {
  #huntcard { top: calc(var(--crestH, 120px) + 6px); right: 6px; width: 200px; }
  #toasts { top: calc(var(--crestH, 120px) + 8px); }
  #bosshud { bottom: auto; top: calc(var(--crestH, 120px) + 4px); width: min(560px, 94vw); }
}
@media (max-width: 560px) and (min-height: 501px) {
  #huntcard { width: 152px; padding: 6px 8px 8px; border-radius: 14px; }
  #huntcard.min .rg, #huntcard.min .tag { display: none; }
  #huntcard .hn { font-size: 14px; margin: 0 0 2px; padding-right: 20px; }
  #huntcard.min .hn { font-size: 14px; }
  #huntcard .collapse { top: 2px; right: 2px; }
  #huntcard .mmwrap { margin: 4px 0 0; }
  #huntcard .mmwrap::after { display: none; }
  #huntcard:not(.min) { width: 200px; }
  #huntcard.min { width: 152px; max-width: none; }
  #toasts { left: 8px; transform: none; align-items: flex-start; top: calc(var(--crestH, 120px) + 8px); }
  .toast { padding: 5px 12px; font-size: 13px; }
  #belt { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  #feed { left: 6px; bottom: 138px; width: 58vw; gap: 3px; }
  #feed .f { padding: 2px 8px 2px 3px; } #feed .f canvas { width: 20px; height: 20px; }
  #feed .f:nth-child(n+4) { display: none; }
  #belt { bottom: 64px; left: 6px; right: 6px; padding: 3px; gap: 0; }
  .mbtn { width: 52px; height: 50px; padding-bottom: 3px; } .mbtn canvas { width: 28px !important; height: 28px !important; } .mbtn span { font-size: 9.5px; }
  .mbtn .dot { right: 4px; top: 2px; min-width: 15px; height: 15px; font-size: 9px; }
  #skills { bottom: 8px; }
  #deadmsg { font-size: 22px; }
  .book > .x { width: 36px; height: 36px; font-size: 18px; }
}
/* landscape phones: menu becomes a column on the right */
@media (max-height: 500px) {
  #belt { max-width: none; top: 4px; bottom: 4px; right: 4px; left: auto; width: 62px; flex-direction: column; overflow-y: auto; overflow-x: hidden; justify-content: flex-start; padding: 3px; border-radius: 14px; transform: none; }
  #belt .sep { display: none; }
  .mbtn { flex: none; width: 54px; height: 46px; padding-bottom: 2px; } .mbtn canvas { width: 26px !important; height: 26px !important; } .mbtn span { font-size: 8.5px; letter-spacing: -.2px; }
  #toasts { left: 50%; top: 8px; } .toast { padding: 4px 12px; font-size: 13px; }
  #huntcard { top: 4px; right: 72px; width: 160px; padding: 6px 8px 8px; }
  #huntcard.min .rg, #huntcard.min .tag, #huntcard .mmwrap::after { display: none; }
  #huntcard .hn { font-size: 14px; margin: 0 0 2px; }
  #huntcard:not(.min) { max-height: calc(100vh - 10px); overflow: auto; }
  #skills { bottom: 6px; left: 50%; transform: translateX(-50%); gap: 4px; padding: 4px 6px; border-radius: 14px; }
  .sk { width: 40px; height: 40px; border-radius: 10px; border-width: 2px; } .pot { width: 36px; height: 36px; }
  .sk .key { display: none; } .sk .cdt { font-size: 14px; }
  #autobtn { width: 50px; height: 40px; font-size: 12px; border-width: 2px; } #autobtn small { font-size: 9px; }
  #feed { left: 6px; bottom: 58px; width: 240px; } #feed .f { font-size: 11.5px; padding: 2px 8px 2px 3px; } #feed .f canvas { width: 18px; height: 18px; }
  #feed .f:nth-child(n+4) { display: none; }
  #toasts { top: 8px; }
  #xpbar b { display: none; }
  .panel { max-height: 100vh; top: 0; transform: translateX(-50%); border-radius: 0 0 14px 14px; }
  .book { width: min(1000px, calc(100vw - 80px), calc((100vh - 24px) * 1.344)); top: 50%; }
  .book .ribbon { top: -4%; }
}

/* ---------- title / login screen ---------- */
#login { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; overflow: auto; background: radial-gradient(ellipse at 50% 35%, #2f4766, #172030 70%); transition: opacity .35s; }
#login.out { opacity: 0; }
#login .bg { position: fixed; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s; }
#login .bg.ready { opacity: 1; }
#login .veil { position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(23,32,48,.35), rgba(23,32,48,.82) 75%); backdrop-filter: blur(1.5px); }
#login main { position: relative; width: min(420px, calc(100vw - 28px)); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 0; }
#login .logo { width: min(400px, 92%); filter: drop-shadow(0 8px 16px rgba(0,0,0,.5)); animation: logoin .9s ease-out; }
@keyframes logoin { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
#login .col { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; }
#login .card { width: 100%; padding: 16px 18px 18px; border-radius: 20px; }
#login .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin-bottom: 12px; border-radius: 14px; background: var(--ink-2); border: 2px solid var(--ink); }
#login .tabs button { height: 38px; border: 0; border-radius: 10px; background: none; color: var(--parch-dim); font: 800 16px var(--display); }
#login .tabs button.on { background: linear-gradient(180deg, var(--slate-3), var(--slate-2)); color: var(--brass); box-shadow: var(--bevel), 0 2px 0 var(--ink); }
#login form { display: flex; flex-direction: column; gap: 10px; }
#login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 800; color: var(--parch-dim); }
#login input[type=text], #login input[type=password] { height: 46px; border-radius: 12px; border: 3px solid var(--ink); background: var(--ink-2); color: var(--parch); font: 700 17px var(--ui); padding: 0 14px; box-shadow: inset 0 3px 6px rgba(0,0,0,.35); }
#login input:focus { outline: none; border-color: var(--gem-dk); box-shadow: inset 0 3px 6px rgba(0,0,0,.35), 0 0 0 2px var(--gem); }
#login label.chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 700; color: var(--parch); cursor: pointer; }
#login label.chk input { width: 20px; height: 20px; accent-color: var(--brass); }
#login .err { margin: 0; min-height: 18px; color: #ff9a7a; font-weight: 800; font-size: 14px; }
#login .go { height: 52px; font-size: 19px; }
#login .note { margin: 10px 0 0; font-size: 13px; color: var(--gem); }
#login .known { margin-top: 14px; padding-top: 12px; border-top: 2px solid rgba(255,255,255,.08); }
#login .known small { color: var(--parch-dim); font-weight: 800; }
#login .known > div { display: grid; gap: 6px; margin-top: 6px; }
#login .known button { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--ink); background: rgba(0,0,0,.2); color: var(--parch); text-align: left; }
#login .known button:hover { border-color: var(--brass-dk); background: rgba(234,181,74,.08); }
#login .known em { font-style: normal; font-size: 13px; color: var(--parch-dim); }
#login .foot { margin: 0; text-align: center; font-size: 12.5px; color: var(--parch-dim); max-width: 36ch; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
@media (max-width: 700px) {
  .panel .cols { grid-template-columns: 1fr !important; }
  .panel > header { padding: 10px 10px 8px 12px; gap: 8px; }
  .panel > header h2 { font-size: 24px; }
  .panel > header p { font-size: 12px; }
  .doll { grid-template-columns: 54px 1fr 54px; gap: 8px; }
}
@media (max-height: 560px) {
  #login main { flex-direction: row; width: min(860px, calc(100vw - 24px)); gap: 20px; align-items: center; padding: 12px 0; }
  #login .logo { width: 42%; max-height: 86vh; object-fit: contain; }
  #login main > div { flex: 1; }
  #login .card { padding: 10px 14px 12px; }
  #login .tabs { margin-bottom: 8px; } #login .tabs button { height: 32px; }
  #login form { gap: 6px; } #login input[type=text], #login input[type=password] { height: 38px; }
  #login .go { height: 44px; }
  #login .foot { display: none; }
}
@media (min-height: 561px) { #login .logo { max-height: 34vh; object-fit: contain; } }
/* notches / home indicator */
html, body { overscroll-behavior: none; }
#game { touch-action: none; }
@supports (padding: env(safe-area-inset-top)) {
  #crest { top: calc(2px + env(safe-area-inset-top)); }
  @media (max-width: 560px) and (min-height: 501px) {
    #skills { bottom: calc(8px + env(safe-area-inset-bottom)); }
    #belt { bottom: calc(64px + env(safe-area-inset-bottom)); }
    #feed { bottom: calc(138px + env(safe-area-inset-bottom)); }
    #huntcard { top: calc(var(--crestH, 120px) + 6px + env(safe-area-inset-top)); }
  }
  @media (max-height: 500px) {
    #belt { right: calc(4px + env(safe-area-inset-right)); }
    #crest { left: calc(6px + env(safe-area-inset-left)) !important; }
    #huntcard { right: calc(72px + env(safe-area-inset-right)); }
  }
}
/* mastery: specializations */
.skillrow.two { grid-template-columns: repeat(2, 1fr) !important; }
.branch .skillrow { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 8px 0; }
.branch .skc { padding: 6px 8px; }
.branch .skc canvas { width: 40px !important; height: 40px !important; }
.spechead { display: grid; grid-template-columns: 50px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.spechead canvas { width: 46px; height: 46px; border-radius: 12px; border: 3px solid var(--sc, var(--brass)); box-shadow: 0 0 12px color-mix(in srgb, var(--sc, #eab54a) 45%, transparent); }
.spechead h3 { margin: 0 0 2px; color: var(--sc, var(--brass)); }
.branch.mine { border-color: var(--sc, var(--brass)) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--sc, #eab54a) 50%, transparent), 0 0 24px color-mix(in srgb, var(--sc, #eab54a) 20%, transparent); }
.branch.other { opacity: .88; }
.branch .mine { display: inline-block; padding: 3px 10px; border-radius: 9px; font-size: 12px; font-weight: 900; color: var(--ink); background: var(--sc, var(--brass)); }
.branch > .btn { width: 100%; }
@media (max-width: 900px) { .branches { grid-template-columns: 1fr; } }
.eqinv .tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.eqinv .tab { padding: 4px 10px; border-radius: 9px; border: 2px solid var(--ink); background: rgba(0,0,0,.2); color: var(--parch-dim); font-weight: 800; font-size: 12.5px; }
.eqinv .tab small { margin-left: 4px; color: var(--gem); }
.eqinv .tab.on { background: var(--brass); color: var(--ink); } .eqinv .tab.on small { color: var(--ink); }
.eqinv .grid { display: grid; grid-template-columns: repeat(auto-fill, 54px); gap: 6px; max-height: 250px; overflow: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border-radius: 10px; border: 2px solid var(--ink); background: rgba(0,0,0,.25); color: var(--parch-dim); font-weight: 800; }
.chip.on { background: var(--slate-3); color: var(--parch); border-color: var(--gem-dk); }
.mk { padding: 8px 10px; }
.mk.sel { border-color: var(--brass-dk) !important; background: rgba(234,181,74,.07); }
.qty { margin-top: 8px; padding-top: 8px; border-top: 2px solid rgba(255,255,255,.06); display: grid; gap: 8px; }
.qty .presets { display: flex; flex-wrap: wrap; gap: 5px; }
.qty .chip { padding: 4px 10px; font-size: 13px; } .qty .chip:disabled { opacity: .35; }
.qty input[type=number] { width: 92px; height: 36px; border-radius: 10px; border: 2px solid var(--ink); background: var(--ink-2); color: var(--parch); font: 800 16px var(--ui); padding: 0 8px; }
.qty input[type=range] { flex: 1; min-width: 80px; accent-color: var(--brass); }
.qty .btn { white-space: nowrap; }
/* character select */
#login.select { background: radial-gradient(ellipse at 50% 30%, #2f4766, #121925 75%); }
#login .logo.small { width: min(240px, 60%); }
#login.select main { width: min(560px, calc(100vw - 24px)); flex-direction: column !important; }
.selhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.selhead h2 { margin: 0; font-family: var(--display); color: var(--brass); font-size: 26px; }
.selhead small { color: var(--parch-dim); font-weight: 700; }
.chars { display: grid; gap: 8px; }
.charcard { position: relative; display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 6px 12px 6px 6px; border-radius: 16px; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--slate-2), var(--ink-2)); color: var(--parch); box-shadow: var(--bevel), 0 3px 0 var(--ink); cursor: pointer; transition: transform .1s, border-color .1s; }
.charcard:hover { transform: translateY(-2px); border-color: var(--brass-dk); }
.charcard canvas { width: 84px; height: 84px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, #5b7fa6, #1d2a40); border: 2px solid var(--ink); }
.charcard b { display: block; font-family: var(--display); font-size: 20px; color: var(--brass); }
.charcard small { color: var(--parch-dim); font-weight: 700; }
.charcard .go { font-weight: 900; color: var(--gem); }
.charcard .del { position: absolute; right: 8px; top: 6px; border: 0; background: none; color: var(--parch-dim); font-weight: 900; font-size: 13px; padding: 2px 6px; border-radius: 8px; }
.charcard .del:hover, .charcard .del.armed { color: #fff; background: #b8352b; }
.charcard.new { grid-template-columns: 84px 1fr; border-style: dashed; background: rgba(0,0,0,.2); }
.charcard .plus { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 14px; border: 2px dashed var(--slate-3); font-size: 42px; font-weight: 900; color: var(--gem); }
/* ---------- books v2 (vector art, game style) ---------- */
.book { aspect-ratio: 1000 / 744; width: min(1040px, calc(100vw - 40px), calc((100vh - 80px) * 1.344)); }
.book .pg, .book.wm .pg, .book.bs .pg { top: 11%; height: 80%; width: 39.6%; }
.book .pg.l, .book.bs .pg.l { left: 7.6%; } .book .pg.r, .book.bs .pg.r { left: 52.8%; }
.book .ribbon, .book.bs .ribbon { top: -5.6%; width: 88%; }
.book .ribbon h2, .book.bs .ribbon h2 { left: 3.5%; width: 44.5%; top: 20%; height: 62%; font-size: calc(2.3 * var(--q)); text-shadow: 0 calc(.25 * var(--q)) 0 rgba(10,20,40,.75); font-family: var(--display); font-weight: 800; }
.book .ribbon h2.r, .book.bs .ribbon h2.r { left: 52%; width: 44.5%; top: 20%; height: 62%; font-size: calc(2.1 * var(--q)); font-family: var(--display); font-weight: 800; }
.book > .x { right: -1.2%; top: -1.6%; }
.book .tabs { right: -3.4%; top: 12%; }
.book .tab { background: linear-gradient(90deg, #2a4f95, #4f7fd0); border-color: var(--ink); }
.book.bs .tab { background: linear-gradient(90deg, #a52a22, #d84a3c); }
.book .tab.on { filter: none; box-shadow: inset 0 0 0 2px #ffe08a, 0 calc(.3 * var(--q)) 0 rgba(30,15,5,.4); }
.book .rt { color: #5a2e14; }
.book .sub { color: #7a5a3a; }
/* navigation pill */
.book .nav, .book.bs .nav { background: linear-gradient(180deg, #4f7fd0, #2a4f95); border: calc(.28 * var(--q)) solid var(--ink); border-radius: 999px; box-shadow: inset 0 0 0 calc(.18 * var(--q)) #eab54a, 0 calc(.3 * var(--q)) 0 rgba(40,25,10,.35); aspect-ratio: auto; height: calc(3.6 * var(--q)); }
.book.bs .nav { background: linear-gradient(180deg, #d84a3c, #a52a22); }
.book .nav .arr, .book.bs .nav .arr { color: #fff3d6; font-size: calc(1.3 * var(--q)); width: 12%; }
/* description box */
.book .desc { background: rgba(255,250,235,.7); border: calc(.18 * var(--q)) solid #c9a46c; border-left: calc(.45 * var(--q)) solid #c98a1c; border-radius: calc(.8 * var(--q)); padding: calc(.9 * var(--q)) calc(1.2 * var(--q)); min-height: 0; }
/* buttons */
.book .bkbtn { background: linear-gradient(180deg, #ffd76a, #e0a03a 60%, #b8782a); border: calc(.28 * var(--q)) solid var(--ink); border-radius: calc(1 * var(--q)); box-shadow: inset 0 calc(.2 * var(--q)) 0 rgba(255,255,255,.5), 0 calc(.35 * var(--q)) 0 var(--ink); color: #2a1a08; text-shadow: none; aspect-ratio: auto; height: calc(4.2 * var(--q)); padding: 0 1em; width: auto; min-width: 46%; }
.book .bkbtn:disabled { background: linear-gradient(180deg, #c8bba0, #9f9077); color: #4a3f30; }
/* medallion */
.book .medal { width: 44%; aspect-ratio: 1; border-radius: 50%; padding: calc(.7 * var(--q)); background: conic-gradient(from 200deg, #ffe08a, #c98a1c, #ffe08a, #9a6a22, #ffe08a); border: calc(.3 * var(--q)) solid var(--ink); box-shadow: 0 calc(.4 * var(--q)) calc(1 * var(--q)) rgba(60,35,10,.35); }
.book .medal .scene { position: static; width: 100%; height: 100%; border: calc(.25 * var(--q)) solid var(--ink); }
/* divider */
.book .divw { width: 44%; } .book .divw .em { width: 15%; }
.book .divw .em canvas { border-radius: 50%; }
/* bestiary cells */
.book .cell, .book .cell.done { background: radial-gradient(circle at 50% 40%, #fbf3df, #e3cfa4); border: calc(.28 * var(--q)) solid #8b5a2b; border-radius: calc(1.1 * var(--q)); box-shadow: inset 0 0 0 calc(.15 * var(--q)) #f6e7c3, 0 calc(.3 * var(--q)) 0 rgba(60,35,10,.3); }
.book .cell.done { border-color: #e0a43a; box-shadow: inset 0 0 0 calc(.15 * var(--q)) #ffe08a, 0 0 calc(.8 * var(--q)) rgba(255,200,80,.6); }
.book .cell.boss { border-color: #a52a22; }
.book .cell em { color: #8b5a2b; text-shadow: none; }
.book .cell .pips { bottom: -7%; }
/* name plate */
.book .namebar { width: 100%; height: calc(4.4 * var(--q)); display: flex; align-items: center; justify-content: space-between; padding: 0 calc(1.4 * var(--q)); background: linear-gradient(180deg, #d84a3c, #a52a22); border: calc(.28 * var(--q)) solid var(--ink); border-radius: calc(1 * var(--q)); box-shadow: inset 0 0 0 calc(.18 * var(--q)) #eab54a; }
.book .namebar b { position: static; width: auto; height: auto; font-size: calc(1.9 * var(--q)) !important; }
.book .namebar small { position: static; width: auto; height: auto; padding: calc(.3 * var(--q)) calc(.8 * var(--q)); border-radius: calc(.6 * var(--q)); background: rgba(0,0,0,.28); font-size: calc(1.1 * var(--q)); }
.book .portrait { margin-top: 0; }
/* stat rows and stage bars */
.book .srow { background: rgba(255,250,235,.7); border: calc(.18 * var(--q)) solid #c9a46c; border-radius: calc(.7 * var(--q)); }
.book .srow canvas { width: calc(1.9 * var(--q)); height: calc(1.9 * var(--q)); }
.book .stage .bar { background: #e3cfa4; border: calc(.2 * var(--q)) solid #8b5a2b; border-radius: 999px; height: calc(1.3 * var(--q)); }
.book .stage .bar i { inset: 0 auto 0 0; max-width: 100%; border-radius: 999px; }
/* possible drops */
.book .drops { width: 100%; }
.book .drops h4 { margin: 0 0 calc(.4 * var(--q)); font-family: var(--display); color: #6b3518; font-size: calc(1.4 * var(--q)); text-align: center; }
.book .drops .dl { display: flex; flex-wrap: wrap; gap: calc(.5 * var(--q)); justify-content: center; }
.book .drops .slot { width: calc(4.4 * var(--q)) !important; height: calc(4.4 * var(--q)) !important; border-width: calc(.22 * var(--q)); border-radius: calc(.8 * var(--q)); }
.book .drops .slot .lv, .book .drops .slot .bad, .book .drops .slot .new { display: none; }
.book .drops .slot .ch { position: absolute; left: -4px; right: -4px; bottom: -2px; text-align: center; white-space: nowrap; font-size: calc(.85 * var(--q)); font-weight: 900; color: #fff; text-shadow: 0 1px 0 var(--ink), 0 0 2px var(--ink); }
.spechead .role { display: inline-block; padding: 1px 8px; border-radius: 7px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; }
.role.r-dano { background: #e2483a; color: #fff; } .role.r-equilibrado { background: #eab54a; color: var(--ink); } .role.r-suporte { background: #3e8ad6; color: #fff; }
@media (max-width: 700px) { .skillrow.two { grid-template-columns: 1fr !important; } }
#crest .clsball { position: absolute; top: -9px; width: 32px; height: 32px; margin-left: -16px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 38%, #fff6dc, #e3c88f 70%, #b8925a); border: 3px solid var(--ink); box-shadow: 0 0 0 2px var(--lc, #eab54a), 0 0 0 4.5px var(--ink), 0 0 8px color-mix(in srgb, var(--lc, #eab54a) 50%, transparent); z-index: 2; pointer-events: auto; }
#crest .clsball canvas { width: 24px; height: 24px; filter: drop-shadow(0 1px 0 rgba(23,32,48,.6)); }
/* zoom setting: full-width slider */
.zoomrow > .row { width: 100%; flex-wrap: nowrap; }
.zoomrow input[type=range] { flex: 1; width: auto; min-width: 90px; }
.zoomrow b { min-width: 104px !important; white-space: nowrap; }
/* developer-tools guard */
#guard { display: none; }
html.guarded #guard { display: flex; position: fixed; inset: 0; z-index: 2147483647; align-items: center; justify-content: center; text-align: center; padding: 24px; background: #0e1420; color: #f1e4c6; font: 700 18px/1.6 'Alegreya Sans', system-ui, sans-serif; white-space: pre-line; }
html.guarded body > :not(#guard) { visibility: hidden !important; }
/* online status */
#netdot { position: fixed; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 60; padding: 3px 9px; border-radius: 999px; font: 700 11px 'Alegreya Sans', sans-serif; color: #f1e4c6; background: rgba(23,32,48,.82); border: 1px solid rgba(241,228,198,.18); pointer-events: none; opacity: 0; transition: opacity .3s; }
#netdot.show { opacity: 1; }
#netdot.bad { color: #ffb4a6; border-color: rgba(255,120,100,.5); }
#toasts.early { z-index: 9000; top: 24px; }
/* ancestral blessings on Anciã items */
.card .anc { color: #ff8a7a; font-weight: 800; font-size: 13px; }
.card .anc .anct { color: #ff4d4d; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; }
/* area-skill threshold strip above the skill bar */
#skills .aoebar { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 3px 12px; border-radius: 999px; background: rgba(23,32,48,.88); border: 2px solid var(--ink, #172030); box-shadow: 0 2px 0 rgba(0,0,0,.25); font: 800 12px 'Alegreya Sans', sans-serif; color: #f1e4c6; white-space: nowrap; }
#skills .aoebar span { color: #eab54a; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
#skills .aoebar input { width: 96px; height: 14px; accent-color: #eab54a; }
#skills .aoebar b { min-width: 84px; font-size: 12px; }
@media (max-width: 720px) { #skills .aoebar { top: -26px; padding: 2px 10px; } #skills .aoebar input { width: 70px; } }
/* books: scrolling chapter tabs, chapter heading, drop captions */
.book .tabs { max-height: 80%; overflow-y: auto; overflow-x: visible; scrollbar-width: none; padding-right: calc(1.2 * var(--q)); padding-bottom: calc(.4 * var(--q)); }
.book .tabs::-webkit-scrollbar { display: none; }
.book .chap { margin: calc(.6 * var(--q)) auto calc(.2 * var(--q)); display: flex; align-items: baseline; justify-content: center; gap: calc(.4 * var(--q)); color: #7a5a3a; font-size: calc(1.3 * var(--q)); }
.book .chap b { font-family: var(--display); color: #6b3518; font-size: calc(1.55 * var(--q)); letter-spacing: .03em; }
.book .chap em { font-style: normal; margin-left: calc(.6 * var(--q)); padding: calc(.15 * var(--q)) calc(.8 * var(--q)); border-radius: 999px; background: rgba(201,164,108,.25); color: #6b3518; font-weight: 800; font-size: calc(1.15 * var(--q)); }
.book .drops .dl { gap: calc(.7 * var(--q)) calc(.5 * var(--q)); }
.book .drops .dr { display: flex; flex-direction: column; align-items: center; gap: calc(.15 * var(--q)); min-width: calc(5 * var(--q)); }
.book .drops .dr .ch { position: static; font-size: calc(.95 * var(--q)); font-weight: 900; text-shadow: none; letter-spacing: .02em; white-space: nowrap; }
.book .drops .dr .ch.c0 { color: #7a6a55; } .book .drops .dr .ch.c1 { color: #2f8f3a; } .book .drops .dr .ch.c2 { color: #2a63c0; } .book .drops .dr .ch.c3 { color: #a63fd0; }
/* drops on the Dungeons panel (same captions as the books, on the dark panel) */
.dgdrops { margin-top: 8px; --q: 9px; }
.dgdrops .drops h4 { margin: 0 0 4px; font: 800 12px 'Alegreya Sans', sans-serif; color: #eab54a; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
.dgdrops .dl { display: flex; flex-wrap: wrap; gap: 6px 4px; }
.dgdrops .dr { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 46px; }
.dgdrops .slot .lv, .dgdrops .slot .bad, .dgdrops .slot .new { display: none; }
.dgdrops .ch { font: 800 10px 'Alegreya Sans', sans-serif; white-space: nowrap; }
.dgdrops .ch.c0 { color: #b8ad98; } .dgdrops .ch.c1 { color: #6fdc7a; } .dgdrops .ch.c2 { color: #7fb2ff; } .dgdrops .ch.c3 { color: #d59bff; }
.book .tabs { flex-wrap: nowrap; }
@media (max-width: 700px) {
  .book .tabs { flex-direction: row; flex-wrap: nowrap; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 0 0 4px; gap: 6px; min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
  .book .tab { flex: 0 0 38px; }
}
.book .desc { flex-shrink: 0; height: auto; }
@media (max-width: 700px) {
  .book .pg, .book.wm .pg, .book.bs .pg { width: 100% !important; align-self: stretch; box-sizing: border-box; }
  .book .tabs { margin-top: 34px; }
  .book .tab { background: linear-gradient(180deg, #4f7fd0, #2a4f95); color: #f4ead6; border: 2px solid var(--ink, #172030); }
  .book.bs .tab { background: linear-gradient(180deg, #d84a3c, #a52a22); }
  .book .tab.on { box-shadow: inset 0 0 0 2px #ffe08a; }
}
@media (max-width: 700px) {
  .book .tabs { flex: 0 0 auto; height: 44px; align-items: center; overflow-y: visible; }
  .book .tab { height: 32px; }
  .book .ribbon { z-index: 3; }
  .book .ribbon h2 { display: block !important; color: #6b3518 !important; }
}

/* ---------------------------------------------------------------- multiplayer HUD */
#social { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#social > * { pointer-events: auto; }
#chat { position: absolute; left: 12px; bottom: 16px; width: 380px; max-width: calc(100vw - 24px); padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 4px; }
#chat .chead { display: flex; align-items: center; gap: 4px; }
#chat .ctabs { display: flex; gap: 3px; flex: 1; overflow-x: auto; scrollbar-width: none; }
#chat .ct { position: relative; padding: 3px 8px; border-radius: 8px; border: 2px solid var(--ink); background: rgba(0,0,0,.25); color: var(--parch-dim); font-weight: 800; font-size: 12px; white-space: nowrap; }
#chat .ct.on { background: var(--slate-3); color: var(--parch); }
#chat .ct i { position: absolute; right: -5px; top: -7px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; font-style: normal; line-height: 16px; border: 1.5px solid var(--ink); }
#chat .ctog { border: 0; background: none; color: var(--parch-dim); font-size: 16px; padding: 0 6px; }
#chat .clog, #chat .cin { display: none; }
#chat .cprev { font-size: 12.5px; max-height: 38px; overflow: hidden; opacity: .9; }
#chat.open .cprev { display: none; }
#chat.open .clog { display: block; height: 230px; overflow-y: auto; font-size: 13px; padding: 2px 4px; background: rgba(0,0,0,.2); border-radius: 8px; }
#chat.open .cin { display: flex; gap: 6px; }
#chat .cin input { flex: 1; min-width: 0; }
#chat .cm { line-height: 1.35; word-break: break-word; }
#chat .cm time { color: var(--parch-dim); font-size: 11px; }
#chat .cm b { cursor: pointer; }
#chat .cm.w span { color: #f0a6ff; }
#chat .cm.gm b { color: #ffd75a !important; }
#partyf { position: absolute; left: 10px; top: 290px; width: 210px; padding: 6px 8px; border-radius: 12px; background: rgba(23,32,48,.82); border: 2px solid var(--ink); font-size: 12.5px; }
#partyf .pt { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
#partyf .pt em { margin-left: auto; color: #ffd75a; font-style: normal; font-weight: 800; }
#partyf .pm { display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto auto; column-gap: 6px; padding: 3px 2px; border-radius: 8px; cursor: pointer; }
#partyf .pm:hover { background: rgba(255,255,255,.06); }
#partyf .pm canvas { grid-row: span 2; }
#partyf .pm .nm { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#partyf .pm small { color: var(--parch-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#partyf .pm.off { opacity: .5; }
#invites { position: absolute; left: 50%; top: 118px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 30; }
#invites .invite { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; animation: panelin .2s ease-out; min-width: 260px; }
#banner { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); padding: 6px 16px; border-radius: 12px; background: linear-gradient(180deg, #ffd75a, #e0a93a); color: #2b1a05; font-weight: 900; border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); max-width: 80vw; text-align: center; pointer-events: none; }
#banner.hidden, #partyf.hidden { display: none; }
.pmenu { position: fixed; z-index: 45; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 210px; }
.pmenu .pmh { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; border-bottom: 2px solid var(--ink); margin-bottom: 2px; }
.pmenu .pmh small { display: block; color: var(--parch-dim); }
.pmenu button { text-align: left; padding: 6px 10px; border-radius: 8px; border: 2px solid var(--ink); background: var(--slate-2); color: var(--parch); font-weight: 800; }
.pmenu button:hover { background: var(--slate-3); }
.pmenu button[disabled] { opacity: .45; }
#trade { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 35; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
#trade .tcols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#trade .tside.ok { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(95,208,104,.35); }
#trade .okb { color: var(--ok); font-weight: 900; }
#trade .grid { grid-template-columns: repeat(auto-fill, 48px); margin: 6px 0; }
#trade .tbag { grid-template-columns: repeat(auto-fill, 44px); max-height: 160px; overflow: auto; }
/* city panels */
.npcsay { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 10px; }
.npcsay canvas { flex: none; }
.npcsay p { margin: 4px 0 0; font-style: italic; }
.recipe { display: grid; grid-template-columns: 50px minmax(160px, 1.3fr) minmax(160px, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; }
.recipe.locked { opacity: .55; }
.recipe .rmats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.recipe .rgo { display: flex; gap: 6px; }
.recipe .gold { color: #ffd76a; font-weight: 800; font-size: 13px; }
.mat { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 800; }
.mat.lack span { color: var(--bad); }
.mat .slot { width: 30px; height: 30px; }
.pbar { display: grid; gap: 2px; min-width: 220px; }
.bar { height: 8px; border-radius: 5px; background: rgba(0,0,0,.45); border: 1.5px solid var(--ink); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #4fb35a, #9ff0a6); }
.contract { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; }
.well.off { opacity: .6; }
.well.banned { border-color: var(--bad); }
.well.prof { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 24px; font-family: var(--display); color: var(--brass); }
.alog { max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 3px; font-variant-numeric: tabular-nums; }
.alog code { color: var(--parch-dim); font-size: 11.5px; word-break: break-all; }
.slot.sel { box-shadow: 0 0 0 3px var(--brass); }
@media (max-width: 920px) {
  .recipe { grid-template-columns: 50px 1fr; }
  .recipe .rmats, .recipe .rgo { grid-column: 1 / -1; }
  #trade .tcols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  #chat { width: calc(100vw - 24px); bottom: 104px; }
  #chat:not(.open) .cprev { display: none; }
  #partyf { top: auto; bottom: 160px; width: 170px; }
}

/* ---------------------------------------------------------------- diamonds, VIP, pass, rankings, world boss */
.dia { color: #9fe8ff; font-weight: 900; }
.shopitem { gap: 10px; }
.donate { position: relative; }
.donate.blocked > .cols { filter: grayscale(.7) blur(1px); opacity: .55; pointer-events: none; }
.donate .lock { position: relative; z-index: 1; margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255,154,122,.15); border: 2px solid #ff9a7a; font-weight: 800; color: #ffd0c0; }
.pack { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.pack b { font-size: 20px; }
.vipbox { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.vipbox.on { border-color: #e0a93a; box-shadow: 0 0 0 2px rgba(234,181,74,.3); }
.vipbadge { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 22px; color: #2b1a05; background: linear-gradient(180deg, #ffe08a, #e0a93a); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.perk b { color: #ffd75a; }
.petcard { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.petcard.sel { border-color: var(--brass); }
.bar.big { height: 12px; margin: 4px 0; }
.passlvl { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 24px; color: #2b1a05; background: radial-gradient(circle at 50% 35%, #fff2bf, #e0a93a); border: 3px solid var(--ink); }
.col { display: flex; flex-direction: column; gap: 6px; }
.task { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.task.done { opacity: .55; }
.okb { color: var(--ok); font-weight: 900; }
.passtrack { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.pcol { display: flex; flex-direction: column; gap: 4px; min-width: 104px; text-align: center; opacity: .65; }
.pcol.reached { opacity: 1; }
.pcol > b { font-family: var(--display); color: var(--brass); }
.pr { min-height: 54px; padding: 4px; border-radius: 10px; border: 2px solid var(--ink); background: var(--slate-2); color: var(--parch); font-size: 11.5px; font-weight: 800; line-height: 1.15; }
.pr.p { background: linear-gradient(180deg, #4a3a6e, #2f2550); }
.pr.can { box-shadow: 0 0 0 2px var(--brass); cursor: pointer; }
.pr.got { opacity: .45; text-decoration: line-through; }
.rank .rr { padding: 5px 8px; border-radius: 8px; }
.rank .rr:nth-child(odd) { background: rgba(255,255,255,.03); }
.rank .rr.top1 .pos { color: #ffd75a; } .rank .rr.top2 .pos { color: #d8dde6; } .rank .rr.top3 .pos { color: #e09a5a; }
.rank .rr.me { box-shadow: inset 0 0 0 2px var(--brass); }
.rank .pos { width: 34px; }
.rtag, #chat .cb { display: inline-block; padding: 0 6px; border-radius: 6px; background: rgba(150,60,140,.9); color: #ffe6fb; font-weight: 900; font-size: 11px; font-style: normal; margin-right: 3px; }
#chat .cb.vip { background: linear-gradient(180deg, #ffd75a, #e0a93a); color: #2b1a05; }
.fight .flog { max-height: 220px; overflow: auto; margin-top: 6px; color: var(--parch-dim); font-variant-numeric: tabular-nums; }
#wblive { position: fixed; right: 14px; top: 120px; width: 250px; z-index: 6; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
#wblive .me { color: var(--brass); }
.btn.discord { background: linear-gradient(180deg, #7b8cff, #5865f2); color: #fff; text-decoration: none; display: inline-flex; justify-content: center; }
#chat .dmini { position: absolute; left: 6px; top: -26px; padding: 2px 10px; border-radius: 9px 9px 0 0; background: #5865f2; color: #fff; font-weight: 900; font-size: 12px; text-decoration: none; border: 2px solid var(--ink); border-bottom: 0; }
#chat { position: absolute; }
.sellbox { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.vipbtn { border-color: #e0a93a !important; color: #ffd75a !important; }
.gbox h3 { margin-top: 14px; }
.npcfig { flex: none; width: 86px; height: 104px; border-radius: 12px; background: radial-gradient(circle at 50% 70%, rgba(255,255,255,.08), transparent 70%); }
@media (max-width: 920px) { #wblive { top: auto; bottom: 230px; right: 8px; width: 200px; } }
.prar { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; background: rgba(0,0,0,.25); }
.petodds { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.chip.tchip { border: 1px solid rgba(20,16,28,.6); font-weight: 900; opacity: .75; }
.chip.tchip.on { opacity: 1; box-shadow: 0 0 0 2px var(--brass); }

/* ---------- live fight viewer (arena and guild wars) ---------- */
#fightv { position: fixed; inset: 0; z-index: 60; background: rgba(8,10,18,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
#fightv .fvbox { width: min(1000px, 100%); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
#fightv header { display: flex; align-items: center; gap: 8px; font-family: var(--display); color: var(--brass); font-size: 18px; }
#fightv .fvst { font-family: inherit; font-size: 13px; color: #ff8a7a; font-weight: 900; letter-spacing: .02em; }
#fightv .fvcv { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; border: 2px solid var(--ink); background: #1d2436; display: block; }
.livetag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: #d8352b; color: #fff; font-weight: 900; font-size: 11px; animation: livepulse 1.4s ease-in-out infinite; }
@keyframes livepulse { 50% { opacity: .55; } }
.livelist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.livelist .well.live { border-color: #d8352b; }
#chat .cm .btn.tiny, .btn.tiny { padding: 1px 8px; font-size: 11px; min-height: 0; line-height: 1.5; }

/* ---------- World Boss warnings ---------- */
#bignews { position: fixed; top: 150px; left: 50%; transform: translateX(-50%); z-index: 55; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 26px 12px; border-radius: 14px; border: 3px solid var(--ink); background: linear-gradient(180deg, rgba(120,24,30,.96), rgba(60,10,18,.96)); box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 2px #ff9a2e inset;
  animation: bignews .45s cubic-bezier(.2,1.4,.4,1); max-width: min(640px, calc(100vw - 32px)); text-align: center; }
#bignews b { font-family: var(--display); font-size: 26px; color: #ffcf6a; text-shadow: 0 2px 0 var(--ink); letter-spacing: .04em; }
#bignews span { font-weight: 800; font-size: 16px; color: #fff3e0; }
#bignews.out { transition: opacity .6s, transform .6s; opacity: 0; transform: translateX(-50%) translateY(-14px); }
@keyframes bignews { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
#skills .tgtbar { position: absolute; left: 50%; top: -60px; transform: translateX(-50%); display: flex; align-items: center; gap: 3px; padding: 3px 6px 3px 12px; border-radius: 999px; background: rgba(23,32,48,.88); border: 2px solid var(--ink, #172030); box-shadow: 0 2px 0 rgba(0,0,0,.25); font: 800 12px 'Alegreya Sans', sans-serif; color: #f1e4c6; white-space: nowrap; }
#skills .tgtbar span { color: #eab54a; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; margin-right: 4px; }
#skills .tgtbar button { font: 800 11.5px 'Alegreya Sans', sans-serif; color: #c9d3e3; background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 1px 9px; cursor: pointer; }
#skills .tgtbar button:hover { color: #fff; background: rgba(255,255,255,.07); }
#skills .tgtbar button.on { color: #2b1a05; background: linear-gradient(180deg, #ffe082, #d9a033); border-color: #172030; }
@media (max-width: 720px) { #skills .tgtbar { top: -52px; padding: 2px 4px 2px 8px; } #skills .tgtbar button { padding: 1px 6px; font-size: 10.5px; } }
.well.boost { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.boostbtns { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.boostbtns .btn { display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.15; padding: 4px 6px; }
.boostbtns .btn span { font-size: 11.5px; opacity: .9; }
/* active boosts under the level diamond */
#crest .boosts { position: absolute; top: 150px; transform: translateX(-50%); display: flex; gap: 5px; pointer-events: auto; white-space: nowrap; }
#crest .boosts .bst { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px 1px 7px; border-radius: 999px; border: 2px solid var(--ink); font: 800 12.5px 'Alegreya Sans', sans-serif; color: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.3); text-shadow: 0 1px 0 rgba(0,0,0,.45); }
#crest .boosts .bst b { font-weight: 900; }
#crest .boosts .bst.exp { background: linear-gradient(180deg, #4fb3ff, #1d5fae); }
#crest .boosts .bst.loot { background: linear-gradient(180deg, #42d27c, #167a44); }
#crest .buffs.low { top: 176px; }
#chat .ctag { color: #7fe8c8; font-weight: 900; }
#chat .clv { color: #ffd75a; font-weight: 900; font-size: 11.5px; }
#login .linkbtn { background: none; border: 0; color: #9fd3ff; font-weight: 800; cursor: pointer; padding: 6px 0 0; text-decoration: underline; font-size: 13.5px; align-self: center; }
#login .rectitle { margin: 0 0 4px; font-family: var(--display); color: var(--brass); }
#login .reccode { display: flex; flex-direction: column; gap: 10px; }
#login .reccode h3 { margin: 0; font-family: var(--display); color: var(--brass); }
#login .reccode code { display: block; text-align: center; font: 900 22px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; padding: 12px; border-radius: 10px; background: #172030; color: #ffe082; border: 2px solid #eab54a; user-select: all; }
#invites .invleft { display: inline-block; min-width: 26px; padding: 0 6px; border-radius: 6px; background: rgba(255,255,255,.1); color: #ffd75a; font-weight: 900; font-size: 12px; }

/* new-version notice */
.updnote { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(8, 6, 14, .62); padding: 16px; }
.updnote .updcard { max-width: 380px; width: 100%; padding: 18px 20px; text-align: center; }
.updnote h3 { margin: 0 0 8px; color: #ffd75a; }
.updnote p { margin: 0 0 14px; }

/* movable HUD (Ajustes > Posição da interface) */
body.layout-edit .movable { outline: 3px dashed #ffd75a; outline-offset: 2px; cursor: move; touch-action: none; }
body.layout-edit .movable * { pointer-events: none !important; }
body.layout-edit .movable::after { content: attr(data-lbl); position: absolute; left: 6px; top: -14px; z-index: 3; font: 800 12px/1 var(--ui); color: #2a1500; background: #ffd75a; padding: 3px 7px; border-radius: 6px; pointer-events: none; }
body.layout-edit #crest.movable::after { top: 0; }
body.layout-edit #social { pointer-events: none; }
.layoutbar { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 9000; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; max-width: calc(100vw - 32px); }
.eqfilter { margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.eqfilter select { max-width: 160px; }
#manbtn { width: 74px; height: 60px; border: 3px solid var(--ink); border-radius: 14px; font-weight: 900; font-size: 15px; line-height: 1.05; box-shadow: var(--bevel), 0 3px 0 var(--ink); background: linear-gradient(180deg, #4a5878, #2c3550); color: var(--parch); cursor: pointer; }
#manbtn small { display: block; font-size: 11px; font-weight: 700; }
#manbtn.on { background: linear-gradient(180deg, #8fd4ff, #3a8fd0); color: #0b2235; }
@media (max-width: 920px) { #manbtn { width: 48px; height: 40px; font-size: 11px; border-width: 2px; } #manbtn small { font-size: 9px; } }

/* interface size (Ajustes > Tamanho da interface) */
#ui, #social { zoom: var(--hud, 1); }
/* wiki buttons (next to Discord) */
#chat .wmini { left: 82px; background: linear-gradient(180deg, #ffe58a, #e8a42c); color: #2a1500; }
.linkrow { display: flex; gap: 8px; }
.linkrow .btn { flex: 1; }
.btn.wikibtn { background: linear-gradient(180deg, #ffe58a, #ffc23a 55%, #e8901c); color: #2a1500; text-decoration: none; display: inline-flex; justify-content: center; }
/* drops list: top-right corner, under the map card (14/10) */
#feed { left: auto !important; bottom: auto !important; right: 14px; top: var(--feed-top, 340px); flex-direction: column; align-items: flex-end; width: 300px; }
#feed .f { animation-name: feedinr; }
@keyframes feedinr { from { transform: translateX(12px); opacity: 0; } }
@media (max-width: 700px) { #feed { right: 6px; width: 58vw; } }
/* DROP ANCIÃO banner (whole server, 15 s) */
#ancnews { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; justify-content: center; align-items: center; gap: 14px; padding: 10px 16px; pointer-events: none;
  background: linear-gradient(90deg, rgba(90,0,0,0), rgba(150,10,20,.95) 20%, rgba(200,30,30,.98) 50%, rgba(150,10,20,.95) 80%, rgba(90,0,0,0)); border-bottom: 2px solid #ff8a6a;
  box-shadow: 0 6px 30px rgba(255,60,40,.5); animation: ancin .5s ease-out; }
#ancnews b { font-family: var(--display); font-size: 22px; color: #ffe1a0; letter-spacing: .08em; text-shadow: 0 2px 0 #3a0505, 0 0 14px #ff4d4d; white-space: nowrap; }
#ancnews span { font-weight: 800; font-size: 16px; color: #fff; text-shadow: 0 1px 2px #000; }
#ancnews.out { transition: opacity .6s, transform .6s; opacity: 0; transform: translateY(-100%); }
@keyframes ancin { from { transform: translateY(-100%); } }
@media (max-width: 700px) { #ancnews { flex-direction: column; gap: 2px; padding: 8px; } #ancnews b { font-size: 17px; } #ancnews span { font-size: 13px; } }
/* chest opening (14/10) */
.chestbox { position: relative; width: 150px; height: 130px; margin: 4px auto 6px; display: flex; align-items: center; justify-content: center; }
.chestbox .chestglow { position: absolute; inset: -20px; border-radius: 50%; animation: chestpulse 1.6s ease-in-out infinite; }
.chestbox .chesticon { position: relative; width: 110px; height: 110px; animation: chestpop .6s cubic-bezier(.2,1.6,.4,1); }
.chestgold { font-weight: 900; font-size: 18px; color: #ffd76a; text-align: center; text-shadow: 0 2px 0 var(--ink); }
.chestloot > * { animation: chestitem .45s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes chestpop { 0% { transform: scale(.3) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.15) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes chestpulse { 0%, 100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes chestitem { from { transform: translateY(-30px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.recipe.locked { filter: grayscale(.55); }
.recipe .lockmsg { color: #e8a25c; }
.recipe .lockbadge { font-size: 12px; padding: 4px 8px; border-radius: 6px; background: rgba(0,0,0,.35); border: 1px solid rgba(232,162,92,.4); color: #e8a25c; white-space: nowrap; }
.chip.locked { opacity: .55; }
#pvpq { position: fixed; left: 50%; top: 150px; transform: translateX(-50%); z-index: 60; display: flex; gap: 12px; align-items: center; padding: 8px 14px; font-size: 14px; }
.season .seasonme { margin-top: 8px; gap: 10px; align-items: center; }
.tierbadge { font-weight: 800; font-size: 12px; padding: 2px 8px; border: 1px solid; border-radius: 999px; background: rgba(0,0,0,.3); letter-spacing: .03em; }
.warboard { flex-basis: 100%; margin-top: 6px; padding: 6px 8px; background: rgba(0,0,0,.22); border-radius: 8px; display: flex; flex-direction: column; gap: 2px; }
.warboard .wscore { font-size: 15px; color: #ffd75a; }
.slot.mystery { position: relative; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.08), rgba(0,0,0,.25)); }
.slot.mystery .qmark { font-family: Cinzel, serif; font-weight: 900; font-size: 24px; line-height: 1; color: var(--rc, #cfd6e4); text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 10px var(--rc, transparent); }
