:root {
  --navy: #1b2340; --navy2: #243056; --navy3: #2f3d6b; --ink: #1d1a16;
  --parch: #f6ecd6; --parch2: #ecdcb8; --parch3: #dcc596; --line: #b8955a;
  --gold: #f2c14e; --gold2: #d99a1e; --red: #e0504a; --blue: #4d8fe6; --green: #58b368; --violet: #9b7ae8;
  --text: #2b2418; --muted: #7a6a52; --white: #fffaf0;
  --r-common: #d7d0c2; --r-uncommon: #7bd88f; --r-rare: #6db3ff; --r-epic: #c58bff; --r-legendary: #ffb347; --r-mythic: #ff5a78; --r-god: #fff1a0;
  --shadow: 0 6px 24px rgba(10, 12, 30, .45);
  --font-cjk: system-ui;
  --font-px: 'Pixelify Sans', var(--font-cjk), system-ui, sans-serif;
  --font: 'Nunito', var(--font-cjk), system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0f1426; color: var(--text); font-family: var(--font); font-size: 14px; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }

/* ---------- buttons & form ---------- */
.btn { border: 2px solid #0e1430; background: linear-gradient(#3a5fb8, #26448f); color: #fff; font-weight: 800; padding: 9px 16px; border-radius: 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 0 #0e1430; font-size: 14px; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.btn:disabled { filter: grayscale(.7) brightness(.8); cursor: not-allowed; }
.btn.gold { background: linear-gradient(#ffd66b, #e9a321); color: #3a2605; border-color: #5a3a06; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 0 #5a3a06; }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line); box-shadow: none; }
.btn.red { background: linear-gradient(#ef6b62, #c53b35); border-color: #5a1210; }
.btn.green { background: linear-gradient(#6fcf7f, #3f9a52); border-color: #174a22; }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.big { padding: 13px 22px; font-size: 17px; width: 100%; font-family: var(--font-px); letter-spacing: .5px; }
input, select { border: 2px solid var(--line); background: #fffaf0; border-radius: 9px; padding: 9px 11px; color: var(--text); outline: none; }
input:focus, select:focus { border-color: var(--gold2); box-shadow: 0 0 0 3px rgba(242,193,78,.3); }
.stack { display: flex; flex-direction: column; gap: 9px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.fine { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.err { color: var(--red); font-weight: 800; min-height: 18px; margin-top: 8px; font-size: 13px; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; background: rgba(0,0,0,.35); color: #fff; font-size: 11px; font-weight: 800; }
.pill.cls { background: rgba(242,193,78,.25); color: var(--gold); }

/* ---------- front ---------- */
.front { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; overflow-y: auto; }
#frontBg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -3; image-rendering: pixelated; }
/* the page is still loading (game data, code): the login buttons are not wired yet, so they look and act disabled */
#front.booting #loginMain button { opacity: .55; pointer-events: none; cursor: progress; }
/* login background: the cinematic town loop (poster image first, video when it can play) */
.front-video { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: 0; transition: opacity 1.2s ease; background: #1b1633 url(/media/login-loop.jpg) center / cover no-repeat; }
.front-video.on { opacity: 1; }
.front-shade { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at center, rgba(15,12,30,.15) 0%, rgba(15,12,30,.55) 70%, rgba(15,12,30,.75) 100%); }
.front-card { width: min(420px, 100%); background: var(--parch); border: 3px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow), inset 0 0 0 3px var(--parch2); position: relative; }
.front-card.wide { width: min(640px, 100%); }
.logo { text-align: center; font-family: var(--font-px); line-height: .95; margin-bottom: 6px; }
.logo-icon { display: block; width: 112px; height: 112px; margin: -64px auto -8px; image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(90,58,6,.35)); animation: logoBob 3s ease-in-out infinite; }
@keyframes logoBob { 50% { transform: translateY(-4px); } }
.logo-top { display: block; font-size: 64px; letter-spacing: 6px; font-weight: 700; color: var(--navy); text-shadow: 0 3px 0 var(--gold), 0 5px 0 #5a3a06; }
.logo-sub { display: block; font-size: 16px; letter-spacing: 5px; color: var(--gold2); margin-top: 6px; font-weight: 700; }
.tagline { text-align: center; color: var(--muted); margin: 8px 0 18px; font-style: italic; }
.or { text-align: center; margin: 12px 0; color: var(--muted); position: relative; }
.or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--line); }
.or span { background: var(--parch); padding: 0 10px; position: relative; font-size: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-head h2, .front-card h3 { font-family: var(--font-px); color: var(--navy); margin: 0; }
.front-card h3 { font-size: 16px; margin: 14px 0 8px; }
.char-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.char-slot { background: var(--parch2); border: 2px solid var(--line); border-radius: 12px; padding: 10px; display: flex; gap: 10px; align-items: center; cursor: pointer; position: relative; min-height: 84px; }
.char-slot.on { border-color: var(--gold2); background: #fff3d0; box-shadow: 0 0 0 3px rgba(242,193,78,.4); }
.char-slot canvas { width: 56px; height: 56px; image-rendering: pixelated; background: rgba(0,0,0,.06); border-radius: 8px; }
.char-slot .cs-name { font-weight: 800; }
.char-slot .cs-sub { font-size: 12px; color: var(--muted); }
.char-slot .del { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: var(--muted); font-size: 14px; }
.char-slot.empty { justify-content: center; color: var(--muted); font-weight: 800; border-style: dashed; }
.look-pick { display: flex; gap: 8px; margin-bottom: 8px; }
.look-pick canvas { width: 64px; height: 64px; border: 2px solid var(--line); border-radius: 10px; image-rendering: pixelated; cursor: pointer; background: var(--parch2); }
.look-pick canvas.on { border-color: var(--gold2); box-shadow: 0 0 0 3px rgba(242,193,78,.4); }
.create { background: var(--parch2); border-radius: 12px; padding: 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-bottom: 14px; }
.chan { border: 2px solid var(--line); background: #fffaf0; border-radius: 9px; padding: 6px; text-align: center; cursor: pointer; font-weight: 800; font-size: 12px; }
.chan.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chan small { display: block; font-weight: 600; opacity: .75; }
.chan .load { height: 4px; background: rgba(0,0,0,.12); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.chan .load i { display: block; height: 100%; background: var(--green); }
.front-foot { color: #cdd6f4; font-size: 12px; }
.front-foot a { color: var(--gold); }
.front-foot .x-link { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; margin-left: 4px; padding: 5px 12px; border-radius: 999px; background: #0f0f14; color: #fff; text-decoration: none; font-weight: 800; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.front-foot .x-link:hover { background: #26262f; }

/* ---------- game ---------- */
.game { position: fixed; inset: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; }

.hud-card { position: absolute; left: 10px; top: 10px; display: flex; gap: 8px; background: linear-gradient(#26345f, #1a2446); border: 2px solid #c9a24f; border-radius: 12px; padding: 7px; box-shadow: var(--shadow); color: #fff; width: 290px; z-index: 5; }
.portrait { width: 58px; height: 58px; border-radius: 9px; background: #3b4a7a; border: 2px solid #c9a24f; overflow: hidden; flex: none; }
.portrait canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.hud-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hud-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { position: relative; height: 14px; background: #10162c; border-radius: 7px; overflow: hidden; border: 1px solid #0b0f20; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .2s; }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 10px; line-height: 13px; font-weight: 800; text-shadow: 0 1px 1px #000; }
.bar.hp i { background: linear-gradient(#ff7b6e, #d6392f); }
.bar.sp i { background: linear-gradient(#78b4ff, #2f6fd6); }
.bar.mini { height: 6px; flex: 1; }
.bar.exp i { background: linear-gradient(#ffe38a, #e0a82a); }
.bar.jexp i { background: linear-gradient(#b8f08f, #54b047); }
.exp-row { display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; color: #cfd8ff; }
.buff-row { position: absolute; left: 12px; top: 92px; display: flex; flex-wrap: wrap; gap: 5px; max-width: 290px; z-index: 5; }
.bf { position: relative; width: 32px; height: 32px; display: grid; place-items: center; background: rgba(12,16,34,.34); border: 1px solid rgba(255,255,255,.3); border-radius: 8px; backdrop-filter: blur(2px); cursor: help; box-shadow: 0 1px 3px rgba(0,0,0,.3); touch-action: manipulation; }
.bf img, .bf canvas { width: 22px; height: 22px; image-rendering: pixelated; pointer-events: none; }
.bf .e { font-size: 16px; line-height: 1; pointer-events: none; }
.bf .t { position: absolute; right: 1px; bottom: -3px; font: 900 9px var(--font); color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; pointer-events: none; }
.bf.prem { border-color: rgba(255,213,79,.85); box-shadow: 0 0 6px rgba(255,213,79,.35); }
.bf.bad { border-color: rgba(255,100,90,.8); background: rgba(70,12,12,.4); }
.bf.low .t { color: #ffb4ae; }
#buffTip { position: fixed; z-index: 95; display: none; max-width: 240px; background: rgba(18,22,44,.96); color: #fff; border: 1px solid #c9a24f; border-radius: 9px; padding: 7px 10px; font: 700 12px/1.35 var(--font); pointer-events: none; box-shadow: var(--shadow); }
#buffTip b { display: block; color: #ffd54f; font-size: 13px; margin-bottom: 2px; }
#buffTip .tl { display: block; color: #b8c4ff; margin-top: 3px; }
.buff { background: rgba(20,26,50,.85); border: 1px solid #c9a24f; color: #fff; border-radius: 6px; padding: 1px 5px; font-size: 10px; font-weight: 800; }
.buff.bad { border-color: #e0504a; color: #ffb4ae; }

.menu { position: absolute; top: 8px; left: 310px; right: 196px; width: fit-content; margin: 0 auto; flex-wrap: wrap; justify-content: center; display: flex; gap: 2px; z-index: 6; background: rgba(20,26,50,.55); padding: 4px; border-radius: 14px; backdrop-filter: blur(4px); }
.menu button { position: relative; background: none; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; padding: 3px 6px; border-radius: 10px; min-width: 50px; }
.menu button:hover, .menu button.on { background: rgba(242,193,78,.2); }
.menu .ico { font-size: 22px; line-height: 1.1; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
.menu .ico img { display: block; width: 32px; height: 32px; image-rendering: pixelated; margin: 0 auto; }
.menu em { font-style: normal; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; white-space: nowrap; max-width: 64px; overflow: hidden; text-overflow: ellipsis; display: block; }
html:not([lang="en"]) .menu em { font-size: 10px; letter-spacing: -.2px; }
.badge { position: absolute; top: 0; right: 2px; background: var(--red); color: #fff; font-size: 10px; border-radius: 999px; padding: 0 5px; font-weight: 800; }
.badge:empty { display: none; }
.badge.soft { background: #3f9a52; }

.raid-exit { display: block; width: 100%; margin-top: 5px; }
.raid-exit.hidden { display: none; }
.minimap { position: absolute; top: 10px; right: 10px; background: #1a2446; border: 2px solid #c9a24f; border-radius: 12px; padding: 5px; z-index: 5; box-shadow: var(--shadow); }
.minimap canvas { display: block; width: 160px; height: 120px; border-radius: 7px; image-rendering: pixelated; background: #000; }
.mm-foot { display: flex; gap: 6px; align-items: center; color: #fff; font-size: 11px; font-weight: 800; margin-top: 4px; }
.mm-foot #mmName { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pill.ch { background: var(--navy3); border: 1px solid #c9a24f; }

.quest { position: absolute; right: 10px; top: 168px; width: 220px; z-index: 4; }
.quest .q { background: rgba(246,236,214,.94); border: 2px solid var(--line); border-radius: 10px; padding: 7px 9px; font-size: 12px; box-shadow: var(--shadow); }
.quest .q b { color: var(--navy); font-family: var(--font-px); font-size: 13px; }
.quest .q p { margin: 3px 0 0; color: var(--text); }
.quest .daily { margin-top: 6px; }
.dq { margin-top: 5px; }
.dq-t { display: flex; justify-content: space-between; gap: 6px; font-weight: 700; }
.dq.ready .dq-t { color: #2e7d32; } .dq.claimed { opacity: .5; }
.dq-bar { height: 5px; margin-top: 2px; background: #d8c8a4; border: 0; }
.dq-bar i { background: linear-gradient(#ffe38a, #e0a82a); }
.dq .btn { margin-top: 4px; width: 100%; }

.target { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); background: rgba(20,26,50,.88); border: 2px solid #c9a24f; border-radius: 10px; color: #fff; padding: 4px 10px; min-width: 220px; z-index: 5; text-align: center; font-size: 12px; }
.target .bar { margin: 3px 0; height: 9px; }
.target #tLv { margin-left: 6px; opacity: .8; }
.target #tInfo { font-size: 11px; opacity: .8; }

.castbar { position: absolute; left: 50%; bottom: 190px; transform: translateX(-50%); width: 220px; height: 16px; background: #10162c; border: 2px solid #c9a24f; border-radius: 8px; overflow: hidden; z-index: 6; }
.castbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#b89bff, #6f4fd6); }
.castbar span { position: absolute; inset: 0; color: #fff; text-align: center; font-size: 11px; font-weight: 800; line-height: 13px; }

.chat { position: absolute; left: 10px; bottom: calc(10px + var(--safe-b)); width: 420px; max-width: calc(100vw - 20px); background: rgba(16,22,44,.82); border: 2px solid #3d4d80; border-radius: 12px; z-index: 5; color: #e8ecff; display: flex; flex-direction: column; }
.chat.min .chat-log, .chat.min .chat-in { display: none; }
.chat-tabs { display: flex; gap: 2px; padding: 4px 4px 0; overflow-x: auto; }
.chat-tabs button { background: none; border: 0; color: #9fb0e8; font-weight: 800; font-size: 11px; padding: 3px 7px; border-radius: 7px 7px 0 0; white-space: nowrap; }
.chat-tabs button.on { background: #2f3d6b; color: #fff; }
.chat-tabs .chat-min { margin-left: auto; }
.chat-tabs .wb { display: inline-block; margin-left: 3px; background: var(--red); color: #fff; border-radius: 999px; padding: 0 5px; font-size: 10px; line-height: 14px; }
.chat-tabs .wb:empty { display: none; }
.go-oracle { cursor: pointer; pointer-events: auto; } #bexpText.go-oracle { color: #ffd66b; text-decoration: underline dotted; } /* Lv 99 MAX bar: click = walk to Oracle Seraphine */
.chat-log { height: 132px; overflow-y: auto; padding: 4px 8px; font-size: 12px; line-height: 1.45; }
.chat-log div { word-break: break-word; }
.chat-log .who { font-weight: 800; color: #bfe0ff; cursor: pointer; }
.chat-log .who.gm { color: #ffd54f; } .chat-log .c-gm { color: #fff3c4; }
.chat-log .c-crier { color: #fff3c4; background: linear-gradient(90deg, rgba(255,196,60,.22), rgba(255,196,60,.04)); border-left: 3px solid #ffc43c; padding-left: 4px; border-radius: 2px; } .chat-log .c-crier .tag { color: #ffd54f; font-weight: 700; } /* v1.14 Town Crier */
.gm-badge { display: inline-block; background: #ffd54f; color: #2a1d00; font-weight: 900; font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 4px; margin: 0 4px 0 2px; vertical-align: 1px; letter-spacing: .5px; }
.chat-log .c-system { color: #ffb86b; } .chat-log .c-boss { color: #ff7ab6; font-weight: 800; } .chat-log .c-loot { color: #9ee6a8; }
.chat-log .c-world .tag { color: #7fd1ff; } .chat-log .c-party .tag { color: #9dff9d; } .chat-log .c-guild { color: #9fe7ff; } .chat-log .c-guild .tag { color: #6fd0ff; } .chat-log .c-whisper { color: #ffb4ff; } .chat-log .c-map .tag { color: #fff; }
.chat-log .tag { font-weight: 800; margin-right: 4px; }
.chat-in { display: flex; gap: 4px; padding: 5px; }
.chat-in select { padding: 5px; border-radius: 7px; background: #2f3d6b; color: #fff; border-color: #3d4d80; font-size: 12px; }
.chat-in input { flex: 1; min-width: 0; padding: 6px 9px; border-radius: 7px; background: #0f1530; color: #fff; border-color: #3d4d80; font-size: 13px; }
.chat-in #chatTo { flex: none; width: 70px; }

.actions { position: absolute; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 6; display: flex; align-items: flex-end; gap: 10px; }
.hotbar { display: grid; grid-template-columns: repeat(5, 48px); gap: 5px; }
.slot { width: 48px; height: 48px; border-radius: 11px; background: rgba(20,26,50,.8); border: 2px solid #4a5b92; position: relative; display: flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; user-select: none; }
.slot:hover { border-color: #c9a24f; }
.slot canvas, .slot img { width: 36px; height: 36px; image-rendering: pixelated; }
.slot .k { position: absolute; left: 3px; top: 1px; font-size: 10px; font-weight: 800; opacity: 1; text-shadow: 0 1px 2px #000, 0 0 2px #000; color: #fff; }
.slot .n { position: absolute; right: 3px; bottom: 1px; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.slot .cd { position: absolute; inset: 0; background: rgba(0,0,0,.6); border-radius: 9px; transform-origin: bottom; }
.slot.nosp { filter: grayscale(.8) brightness(.7); }
/* v1.14.3 two hotbars: slots 11-20 (.b2) show when the bar is switched (.hb-b2); the 1/2 tab (#hbBar) sits in the action cluster left of the hotbar */
.hotbar .slot.b2 { display: none; } .hotbar.hb-b2 .slot:not(.b2) { display: none; } .hotbar.hb-b2 .slot.b2 { display: flex; }
.hb-bar { align-self: stretch; width: 22px; min-height: 40px; padding: 0; border-radius: 8px; border: 2px solid #4a5b92; background: rgba(20,26,50,.8); color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1; font-family: inherit; }
.hb-bar b { font-size: 13px; font-weight: 900; } .hb-bar small { font-size: 10px; opacity: .8; }
.hb-bar:hover { border-color: #c9a24f; } .hb-bar.on2 { border-color: #c9a24f; background: rgba(70,52,16,.85); }
.slot.b2 .k { color: #ffd66b; }
.hotbar.hb-assigning .slot { border-color: #ffd66b; box-shadow: 0 0 0 2px rgba(255,214,107,.45); }
.hb-assign-bar { position: absolute; left: 50%; top: calc(8px + var(--sa-t, 0px)); transform: translateX(-50%); z-index: 40; display: flex; gap: 10px; align-items: center; justify-content: space-between; width: min(440px, calc(100vw - 24px)); padding: 8px 10px 8px 14px; border-radius: 12px; background: rgba(20,26,50,.92); border: 2px solid #ffd66b; color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.hb-assign-bar .btn { min-height: 44px; min-width: 76px; flex: none; }
body.m-ui.hb-assign-on #panels { visibility: hidden; pointer-events: none; }
.mount-btn { width: 48px; height: 48px; border-radius: 50%; border: 3px solid #c9a24f; background: radial-gradient(#6d4c2f, #3a2616); font-size: 22px; cursor: pointer; align-self: center; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.mount-btn.on { background: radial-gradient(#f2c14e, #b8860b); }
.mount-pic canvas { width: 72px; height: auto; aspect-ratio: auto; image-rendering: pixelated; }
.auto-btn { width: 70px; height: 70px; border-radius: 50%; border: 3px solid #c9a24f; background: radial-gradient(#3b4f8f, #1a2446); color: #fff; font-family: var(--font-px); font-weight: 700; font-size: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--shadow); line-height: 1; }
.auto-btn small { font-size: 10px; font-family: var(--font); font-weight: 800; margin-top: 3px; color: #9fb0e8; max-width: 64px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.auto-btn.on { background: radial-gradient(#ffd66b, #e0901e); color: #3a2605; position: relative; }
/* the 'on' glow ring: transform + opacity only, so the compositor runs it (a box-shadow animation restyled and repainted the
   page every frame while Autopilot was on, which is most of the time on phones) */
.auto-btn.on::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(242,193,78,.6); pointer-events: none; animation: autoRing 1.6s ease-out infinite; will-change: transform, opacity; }
@keyframes autoRing { 0% { transform: scale(1); opacity: 1; } 70%, 100% { transform: scale(1.28); opacity: 0; } }
.auto-btn.on small { color: #3a2605; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(242,193,78,.6), var(--shadow); } 50% { box-shadow: 0 0 0 10px rgba(242,193,78,0), var(--shadow); } }
.atk-btn { width: 84px; height: 84px; border-radius: 50%; border: 3px solid #c9a24f; background: radial-gradient(#e0504a, #7a1c18); color: #fff; font-size: 36px; box-shadow: var(--shadow); display: none; }

.joy { position: absolute; left: 24px; bottom: calc(170px + var(--safe-b)); width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(rgba(255,255,255,.12), rgba(255,255,255,.04)); border: 2px solid rgba(255,255,255,.25); z-index: 6; display: none; touch-action: none; }
.joy-knob { position: absolute; left: 40px; top: 40px; width: 50px; height: 50px; border-radius: 50%; background: radial-gradient(#fff6d8, #c9a24f); box-shadow: 0 3px 10px rgba(0,0,0,.4); }

.toast-box { position: absolute; top: 120px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 30; pointer-events: none; }
.toast { background: rgba(246,236,214,.97); border: 2px solid var(--line); border-radius: 10px; padding: 6px 14px; font-weight: 800; box-shadow: var(--shadow); animation: tin .25s ease-out; font-size: 13px; }
.toast.big { font-family: var(--font); font-weight: 900; font-size: 21px; line-height: 1.25; color: var(--navy); background: linear-gradient(#fff3c4, #ffd66b); text-shadow: 0 0 2px #fff, 0 1px 0 #fff, 0 0 4px rgba(255,255,255,.9); } /* the normal font: Pixelify Sans has no CJK / Thai / accents */
.toast.bad { color: var(--red); }
@keyframes tin { from { transform: translateY(-8px); opacity: 0; } }

.death { position: absolute; inset: 0; background: rgba(40,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 40; }
.death-card { background: var(--parch); border: 3px solid var(--line); border-radius: 16px; padding: 22px; width: min(360px, 90vw); text-align: center; box-shadow: var(--shadow); }
.death-card h2 { font-family: var(--font-px); color: var(--red); margin: 0 0 8px; }
.net-status { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(20,26,50,.9); color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 50; font-weight: 800; }
.hud-foot { position: absolute; left: 440px; bottom: calc(12px + var(--safe-b)); color: #cfd8ff; font-size: 11px; font-weight: 700; z-index: 4; text-shadow: 0 1px 2px #000; opacity: .8; }

/* ---------- panels ---------- */
.panel-layer { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.panel { position: absolute; pointer-events: auto; background: var(--parch); border: 3px solid var(--line); border-radius: 16px; box-shadow: var(--shadow), inset 0 0 0 2px var(--parch2); display: flex; flex-direction: column; max-height: calc(100vh - 110px); width: 440px; max-width: calc(100vw - 16px); left: 50%; top: 84px; transform: translateX(-50%); animation: pin .15s ease-out; }
.panel.wide { width: 620px; }
.panel.side-l { left: 12px; transform: none; }
.panel.side-r { left: auto; right: 12px; transform: none; }
body:not(.m-ui) .panel { top: max(84px, calc((var(--menu-b, 0px) + 8px) / var(--ui, 1))); max-height: calc(100vh - max(110px, var(--menu-b, 0px) + 34px)); } /* never over a menu that wraps to 2-3 rows */
@keyframes pin { from { opacity: 0; margin-top: -6px; } }
.panel-head { display: flex; align-items: center; gap: 8px; background: linear-gradient(#2c3a6a, #1f2a52); color: #fff; padding: 8px 12px; border-radius: 12px 12px 0 0; border-bottom: 3px solid var(--line); cursor: move; user-select: none; }
.panel-head h3 { margin: 0; font-family: var(--font-px); font-size: 18px; flex: 1; letter-spacing: .5px; }
.panel-head .x { background: linear-gradient(#ef6b62, #c53b35); border: 2px solid #5a1210; color: #fff; width: 30px; height: 30px; border-radius: 8px; font-weight: 800; }
.panel-body { padding: 12px; overflow-y: auto; flex: 1; min-height: 0; }
/* live windows redraw in English and are translated right after: with scroll anchoring on, the browser "kept" a line
   that only moved because of the translation and the window crept down on every redraw (v1.14.1, French Gold Shop).
   ScrollKeep (scrollkeep.js) already puts every scroll back by hand, so the browser must not move it too */
.panel-body, .panel-body * { overflow-anchor: none; }
.panel-grip { position: absolute; right: 2px; bottom: 2px; width: 22px; height: 22px; cursor: nwse-resize; touch-action: none; border-radius: 0 0 12px 0;
  background: linear-gradient(135deg, transparent 0 55%, var(--line) 55% 62%, transparent 62% 72%, var(--line) 72% 79%, transparent 79%); opacity: .8; }
.panel-grip:hover { opacity: 1; }
/* Options → Interface size */
.hud-card, .buff-row, .party-hud, .menu, .minimap, .quest-btn, .travel-pill, .quest, .target, .chat, .actions, .toast-box, .panel, .raid-bar, .raid-check { zoom: var(--ui, 1); }
.panel-tabs { display: flex; gap: 4px; padding: 8px 12px 0; flex-wrap: wrap; }
.panel-tabs button { border: 2px solid var(--line); background: var(--parch2); border-radius: 9px 9px 0 0; padding: 5px 10px; font-weight: 800; color: var(--muted); font-size: 12px; }
.panel-tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.sec { background: var(--parch2); border: 2px solid var(--parch3); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.sec h4 { margin: 0 0 8px; font-family: var(--font-px); color: var(--navy); font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.kv { display: flex; justify-content: space-between; font-size: 13px; }
.kv b { color: var(--navy); }
.stat-row { display: grid; grid-template-columns: 44px 1fr 38px 34px; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px dashed var(--parch3); }
.stat-row .sn { font-family: var(--font-px); font-weight: 700; color: var(--navy); }
.stat-row .sv { font-weight: 800; font-size: 15px; }
.stat-row .sv small { color: var(--green); font-size: 12px; }
.stat-row .sc { font-size: 11px; color: var(--muted); text-align: right; }
.plus { width: 30px; height: 26px; border-radius: 7px; border: 2px solid #174a22; background: linear-gradient(#6fcf7f, #3f9a52); color: #fff; font-weight: 800; }
.plus:disabled { filter: grayscale(1) opacity(.5); }
.toggle { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; cursor: pointer; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--gold2); }
.help { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

.skill { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 7px; border-radius: 10px; background: #fffaf0; border: 2px solid var(--parch3); margin-bottom: 6px; }
.skill.locked { opacity: .55; }
.skill .si { width: 40px; height: 40px; border-radius: 9px; background: var(--navy2); display: flex; align-items: center; justify-content: center; }
.skill .si canvas, .skill .si img { width: 32px; height: 32px; image-rendering: pixelated; }
.skill .sname { font-weight: 800; }
.skill .sdesc { font-size: 12px; color: var(--muted); }
.skill .slv { font-family: var(--font-px); font-weight: 700; color: var(--navy); text-align: center; font-size: 13px; }
.skill .sbtns { display: flex; gap: 4px; align-items: center; }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 5px; }
.it { aspect-ratio: 1; background: #fffaf0; border: 2px solid var(--parch3); border-radius: 9px; position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.it:hover, .it.on { border-color: var(--gold2); }
.it canvas, .it img { width: 32px; height: 32px; image-rendering: pixelated; }
.it .q { position: absolute; right: 3px; bottom: 0; font-size: 11px; font-weight: 800; color: var(--text); text-shadow: 0 0 2px #fff; }
.it .rf { position: absolute; left: 3px; top: 1px; font-size: 10px; font-weight: 800; color: var(--gold2); }
/* Fusion Stars: a small violet star badge (gear never shows a quantity in that corner) */
.it .stb { position: absolute; right: 2px; bottom: 0; font-size: 10px; font-weight: 800; color: #8a3ffc; text-shadow: 0 0 2px #fff, 0 0 2px #fff; letter-spacing: -.5px; }
.name-star, .tip-star { color: #8a3ffc; font-weight: 800; white-space: nowrap; }
.it.fz-dim { opacity: .45; }
.fz-box .fz-step { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; margin: 6px 0; } .fz-box .fz-step b { color: #8a3ffc; font-size: 16px; }
.fz-mats { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.fz-mat { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border: 2px solid transparent; border-radius: 9px; cursor: pointer; font-size: 12px; }
.fz-mat.on { border-color: var(--gold2); background: #fff3d6; } .fz-mat .it { width: 40px; flex: none; }
.fz-pay { margin: 6px 0; display: flex; flex-direction: column; gap: 3px; }
.fz-need { color: #b5482a; font-weight: 700; }
.it.r-uncommon { box-shadow: inset 0 0 0 2px var(--r-uncommon); } .it.r-rare { box-shadow: inset 0 0 0 2px var(--r-rare); } .it.r-epic { box-shadow: inset 0 0 0 2px var(--r-epic); } .it.r-legendary { box-shadow: inset 0 0 0 2px var(--r-legendary); }
.it.empty { cursor: default; opacity: .5; }
/* gear this hero cannot equip (class, level, weapon type): red tint + a small ✖ (ui.js itemCell, itemlines.js whyCantUse) */
.it.cant { background: #fbd9d4; border-color: #d9534f; }
.it.cant canvas, .it.cant img { opacity: .7; } .it.cant.on, .it.cant:hover { border-color: var(--gold2); }
.it .cx { position: absolute; left: 50%; top: -1px; transform: translateX(-50%); font-size: 10px; font-weight: 900; color: #d03a2f; text-shadow: 0 0 2px #fff, 0 0 2px #fff; pointer-events: none; }
.dl.cant-why { color: #c0392b; }
.it.eqd::after { content: 'E'; position: absolute; top: 1px; right: 3px; font-size: 10px; font-weight: 800; color: var(--blue); }
.detail { background: #fffaf0; border: 2px solid var(--parch3); border-radius: 12px; padding: 10px; margin-top: 10px; }
.detail .dn { font-weight: 800; font-size: 15px; }
.detail .dt { font-size: 12px; color: var(--muted); }
.detail .dl { font-size: 13px; margin: 6px 0; }
.detail .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rn-common { color: #6b6152; } .rn-uncommon { color: #2e9c48; } .rn-rare { color: #2d78d6; } .rn-epic { color: #8f4fe0; } .rn-legendary { color: #e08a12; } .rn-mythic { color: #d6284c; }
.rn-god { background: linear-gradient(90deg, #e0a000, #ff5a78, #8f4fe0, #2d78d6, #2e9c48, #e0a000); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: godtext 4s linear infinite; font-weight: 900; }
@keyframes godtext { to { background-position: 300% 0; } }
.it.r-mythic { box-shadow: inset 0 0 0 2px var(--r-mythic), 0 0 6px rgba(255,90,120,.45); }
.it.r-god { box-shadow: inset 0 0 0 2px var(--r-god), 0 0 10px rgba(255,230,140,.8); animation: godglow 1.6s ease-in-out infinite alternate; }
@keyframes godglow { to { box-shadow: inset 0 0 0 2px #fff, 0 0 16px rgba(255,200,90,.95); } }
/* item hover card (itemtip.js) */
.item-tip { position: fixed; z-index: 9999; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; font-size: calc(13px * var(--ui, 1)); }
.tip-card { width: calc(270px * var(--ui, 1)); background: #fffaf0; color: #3b3326; border: 2px solid #dcc596; border-radius: 10px; padding: 9px 11px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.tip-card.g-uncommon { border-color: #7bd88f; } .tip-card.g-rare { border-color: #6db3ff; } .tip-card.g-epic { border-color: #c58bff; } .tip-card.g-mythic { border-color: #ff5a78; } .tip-card.g-legendary { border-color: #ffb347; } .tip-card.g-god { border-color: #f2c94c; box-shadow: 0 0 18px rgba(255,210,90,.8), 0 8px 24px rgba(0,0,0,.35); }
.tip-title { font-size: .8em; font-weight: 800; color: #9a8a6a; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.tip-name { font-weight: 900; font-size: 1.1em; line-height: 1.2; }
.tip-grade { display: flex; gap: 8px; align-items: center; margin: 4px 0 6px; }
.tip-pill { font-size: .78em; font-weight: 900; color: #2a2016; padding: 1px 8px; border-radius: 99px; }
.tip-ilv { font-size: .85em; font-weight: 800; color: #7a6a52; }
.tip-line { line-height: 1.35; } .tip-desc { margin-top: 5px; font-style: italic; color: #7a6a52; }
.tip-cmp { margin-top: 8px; padding-top: 7px; border-top: 1px dashed #dcc596; } .tip-cmp.muted { color: #9a8a6a; }
.tip-verdict { font-weight: 900; margin-bottom: 4px; } .tip-verdict.good { color: #2e9c48; } .tip-verdict.bad { color: #d6284c; } .tip-verdict.same { color: #7a6a52; }
.tip-diff > div { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; line-height: 1.4; white-space: nowrap; } .tip-diff span:nth-child(2) { text-align: right; font-size: .92em; } .tip-diff .up b { color: #2e9c48; } .tip-diff .down b { color: #d6284c; } .tip-diff span:nth-child(2) { color: #7a6a52; }
.tip-empty { opacity: .9; }
.gear-score { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 6px 12px; border-radius: 10px; background: linear-gradient(90deg, #2a2350, #3b2f7a); color: #fff; font-weight: 800; }
.gear-score b { color: #ffd54f; font-size: 1.25em; }

.eq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.eq-slot { display: flex; gap: 8px; align-items: center; background: #fffaf0; border: 2px solid var(--parch3); border-radius: 10px; padding: 5px; cursor: pointer; min-height: 52px; }
.eq-slot .it { width: 40px; flex: none; }
.eq-slot small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 800; }

.list { display: flex; flex-direction: column; gap: 5px; }
.lrow { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; background: #fffaf0; border: 2px solid var(--parch3); border-radius: 10px; padding: 5px 8px; }
.lrow .it { width: 40px; }
.lrow .price { font-weight: 800; color: var(--navy); white-space: nowrap; }
.lrow small { color: var(--muted); display: block; font-size: 11px; }
/* market browse filters + price history */
.mk-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.mk-bar select, .mk-bar input { padding: 6px 8px; font-size: 13px; }
.mk-bar .mk-lv { width: 64px; }
.mk-lvs { display: inline-flex; gap: 4px; align-items: center; font-weight: 800; color: var(--muted); font-size: 12px; }
.mk-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.mk-chip { border: 2px solid var(--line); background: var(--parch2); border-radius: 999px; padding: 3px 10px; font-weight: 800; color: var(--muted); font-size: 12px; }
.mk-chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.lrow .mk-buy { text-align: right; }
.lrow small.mk-avg { color: var(--navy3); font-weight: 700; }
.lrow .mk-hist { grid-column: 1 / -1; }
.mk-histbox { background: var(--parch); border: 2px dashed var(--parch3); border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.mk-week { font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.mk-sales { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 10px; }
.mk-sale { display: flex; gap: 6px; align-items: baseline; }
.mk-sale > span:first-child { color: var(--gold2); font-weight: 800; min-width: 0; }
.mk-sale small { color: var(--muted); margin-left: auto; }
.st-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.card-out { margin-top: 8px; }
.card-out .lrow { margin-top: 5px; }
.coin { font-weight: 800; }
.coin.s::before { content: '●'; color: #b8c2d6; margin-right: 3px; }
.coin.g::before { content: '●'; color: var(--gold); margin-right: 3px; }
.wallet { display: flex; gap: 12px; font-weight: 800; }

.book { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12px; }
.book table { width: 100%; border-collapse: collapse; }
.book td { padding: 2px 4px; }
.book .bid td:first-child { color: var(--green); font-weight: 800; }
.book .ask td:first-child { color: var(--red); font-weight: 800; }
.chart { width: 100%; height: 120px; background: var(--navy); border-radius: 10px; display: block; }
.trade-box { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trade-box .sec { margin: 0; }
.trade-box input { width: 100%; margin: 4px 0; }

.wheel-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#wheel { width: 240px; height: 240px; }
.pool { font-family: var(--font-px); font-size: 24px; color: var(--gold2); text-shadow: 0 2px 0 #5a3a06; }

.bot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.bot-grid label { font-size: 12px; font-weight: 700; display: flex; flex-direction: column; gap: 3px; }
.bot-grid label.toggle { flex-direction: row; align-items: center; gap: 8px; text-align: left; font-weight: 700; line-height: 1.25; }
.bot-grid label.toggle input { flex: none; width: 18px; height: 18px; margin: 0; }
.bot-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bot-mode-btn { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 9px 11px; border-radius: 10px; border: 2px solid var(--line, #d8c7a2); background: rgba(255,255,255,.55); cursor: pointer; font: inherit; color: inherit; }
.bot-mode-btn b { font-size: 13px; }
.bot-mode-btn small { font-size: 11px; opacity: .75; line-height: 1.25; }
.bot-mode-btn.on { border-color: var(--gold2, #e0a82e); background: #fff4d6; box-shadow: 0 0 0 2px rgba(224,168,46,.25); }
/* v1.14.3 autopilot skill sets: three big tabs (thumb-sized on phones) */
.bot-sets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bot-set-btn { display: flex; flex-direction: column; gap: 2px; min-height: 48px; padding: 7px 8px; border-radius: 10px; border: 2px solid var(--line, #d8c7a2); background: rgba(255,255,255,.55); cursor: pointer; font: inherit; color: inherit; text-align: left; min-width: 0; }
.bot-set-btn b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-set-btn small { font-size: 11px; opacity: .75; line-height: 1.2; }
.bot-set-btn.empty { border-style: dashed; opacity: .8; }
.bot-set-btn.on { border-color: var(--gold2, #e0a82e); background: #fff4d6; box-shadow: 0 0 0 2px rgba(224,168,46,.25); }
.bot-set-btn.fight { border-color: #c0392b; background: #fde3df; }
.bot-set-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
@media (max-width: 560px) { .bot-grid, .bot-mode { grid-template-columns: 1fr; } }
.bot-grid input[type=range] { width: 100%; accent-color: var(--gold2); border: 0; padding: 0; background: none; }
.bot-state { font-family: var(--font-px); font-size: 16px; color: var(--navy); }
.skill-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.big-toggle { display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: #fff; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.big-toggle .btn { min-width: 110px; }

.npc-intro { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.npc-intro canvas { width: 64px; height: 64px; image-rendering: pixelated; background: var(--parch2); border-radius: 12px; border: 2px solid var(--parch3); }
.npc-intro p { margin: 0; font-style: italic; }
.class-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; background: #fffaf0; border: 2px solid var(--parch3); border-radius: 12px; padding: 8px; margin-bottom: 8px; }
.class-card canvas { width: 56px; height: 56px; image-rendering: pixelated; }
.class-card b { font-family: var(--font-px); font-size: 16px; color: var(--navy); }
.class-card p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.map-list .lrow { grid-template-columns: 1fr auto auto; }
.party-m { display: flex; justify-content: space-between; align-items: center; background: #fffaf0; border: 2px solid var(--parch3); border-radius: 10px; padding: 6px 9px; margin-bottom: 5px; }

/* ---------- mobile ---------- */
@media (max-width: 820px), (pointer: coarse) {
  .joy { display: block; }
  .atk-btn { display: block; }
  .menu { top: auto; bottom: calc(6px + var(--safe-b)); left: 50%; right: auto; width: auto; margin: 0; transform: translateX(-50%); gap: 0; padding: 2px; flex-wrap: nowrap; max-width: calc(100vw - 8px); overflow-x: auto; }
  .menu button { min-width: 40px; padding: 2px 3px; }
  .menu .ico { font-size: 18px; }
  .menu .ico img { width: 24px; height: 24px; }
  .menu em { font-size: 9px; }
  .hud-card { width: 220px; padding: 5px; }
  .portrait { width: 44px; height: 44px; }
  .minimap canvas { width: 110px; height: 82px; }
  .quest { top: 128px; width: 170px; }
  .quest .q { font-size: 11px; }
  .buff-row { top: 76px; }
  .chat { width: min(300px, calc(100vw - 16px)); bottom: auto; top: 136px; left: 8px; background: rgba(16,22,44,.55); }
  .chat-log { height: 64px; font-size: 11px; }
  .chat-tabs button { padding: 2px 5px; font-size: 10px; }
  .chat.min { width: auto; }
  .actions { bottom: calc(62px + var(--safe-b)); right: 8px; flex-direction: column-reverse; align-items: flex-end; }
  .actions-row { display: flex; gap: 8px; align-items: flex-end; }
  .hotbar { grid-template-columns: repeat(5, 42px); }
  .hotbar { grid-template-columns: repeat(5, 40px); gap: 4px; } .hotbar .slot { width: 40px; height: 40px; } .hotbar .slot canvas, .hotbar .slot img { width: 30px; height: 30px; }
  .slot { width: 42px; height: 42px; }
  .joy { bottom: calc(70px + var(--safe-b)); }
  .castbar { bottom: 260px; }
  .panel { top: 8px; max-height: calc(100vh - 80px); }
  .hud-foot { display: none; }
  .target { top: 64px; min-width: 180px; }
}
.quest-btn { display: none; }
@media (max-width: 520px) {
  .hud-card { width: 190px; }
  .hud-name .pill.cls { display: none; }
  .quest { display: none; top: 176px; width: calc(100vw - 24px); left: 12px; right: auto; }
  .quest.show { display: block; z-index: 15; }
  .quest-btn { display: block; position: absolute; right: 12px; top: 130px; z-index: 16; width: 40px; height: 40px; border-radius: 10px; border: 2px solid #c9a24f; background: #1a2446; font-size: 20px; }
  .chat { width: calc(100vw - 150px); }
}

/* quests & crafting */
.quest-card { background: #fffaf0; border: 2px solid var(--parch3); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; }
.quest-card.ready { border-color: #58b368; box-shadow: 0 0 0 2px rgba(88,179,104,.25); }
.quest-card p { margin: 4px 0; font-size: 13px; font-style: italic; color: var(--text); }
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qhead b { font-family: var(--font-px); color: var(--navy); font-size: 14px; }
.qgoal { font-size: 12px; font-weight: 700; color: var(--muted); }
.qgoal.ok { color: #2e7d32; }
.recipe .needs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.need { font-size: 11px; font-weight: 800; background: #f3e3c3; border-radius: 6px; padding: 1px 6px; color: #9a3b2f; }
.need.ok { color: #2e7d32; background: #e3f3df; }

.class-card.pet-out { border-color: #f2c14e; box-shadow: 0 0 0 2px rgba(242,193,78,.35); }

/* guild */
.guild-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.guild-head canvas { width: 56px; height: 56px; image-rendering: pixelated; }
.guild-head h3 { margin: 0; font-family: var(--font-px); color: var(--navy); }
.guild-bar { height: 8px; background: #d9dcef; border-radius: 4px; overflow: hidden; margin: 4px 0; }
.guild-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4fb3ff, #9fe7ff); }
.guild-m { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; padding: 5px 6px; border-bottom: 1px solid rgba(0,0,0,.08); }
.guild-m .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #aab; margin-right: 5px; }
.guild-m .dot.on { background: #3fcf5f; }
.guild-m .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.guild-tabs { display: flex; gap: 4px; margin: 8px 0; }
.guild-tabs button.on { background: var(--navy); color: #fff; }
.em-pick { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.em-pick button { padding: 3px 7px; font-size: 11px; }
.em-pick button.on { outline: 2px solid var(--navy); }
.gskill { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; padding: 6px; border-bottom: 1px solid rgba(0,0,0,.08); }

/* skill tree */
.stree { position: relative; margin: 4px 0 10px; background: radial-gradient(ellipse at top, #fffaf0, #f3e6c8); border: 2px solid var(--parch3); border-radius: 12px; }
.stree svg { position: absolute; inset: 4px 0 0 0; width: 100%; height: calc(100% - 4px); pointer-events: none; }
.stree svg path { fill: none; stroke: #b9a988; stroke-width: 3; stroke-dasharray: 5 4; }
.stree svg path.on { stroke: #3f9a52; stroke-dasharray: none; }
.stree-req { position: absolute; transform: translateX(-50%); font-size: 9px; font-weight: 800; color: #9a8a6a; background: #fffaf0; padding: 0 3px; border-radius: 4px; pointer-events: none; z-index: 1; line-height: 12px; }
.stree-band { position: absolute; left: 8px; right: 8px; height: 16px; font-size: 10px; font-weight: 800; color: #7a6a4a; border-bottom: 1px dashed #c9b88f; pointer-events: none; text-transform: uppercase; letter-spacing: .5px; }
.stree-req.on { color: #2f7a40; }
.snode { position: absolute; width: 74px; margin-left: -37px; top: 0; padding-top: 6px; text-align: center; cursor: pointer; }
.snode .si { position: relative; width: 44px; height: 44px; margin: 0 auto; border-radius: 10px; background: var(--navy2); display: flex; align-items: center; justify-content: center; border: 2px solid #1b2340; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.snode .si canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.snode .slv { position: absolute; bottom: -7px; right: -8px; font-size: 9px; background: #1b2340; color: #fff; border-radius: 6px; padding: 1px 4px; font-family: var(--font-px); }
.snode .spas { position: absolute; top: -6px; left: -6px; font-style: normal; font-size: 9px; font-weight: 800; background: #7a6a4a; color: #fff; border-radius: 50%; width: 15px; height: 15px; line-height: 15px; }
.snode .sn { font-size: 10px; font-weight: 800; line-height: 1.1; margin-top: 8px; color: var(--navy); }
.snode .sx { font-size: 8.5px; color: #a0522d; line-height: 1.1; }
.snode.locked .si { filter: grayscale(1) brightness(.75); }
.snode.locked .sn { color: #9a8a6a; }
.snode.learned .si { border-color: #f2c14e; }
.snode.up .si { animation: snode-glow 1.2s ease-in-out infinite; }
.snode.sel .si { outline: 3px solid #4fb3ff; outline-offset: 2px; }
@keyframes snode-glow { 50% { box-shadow: 0 0 12px 3px #7dff9a; } }
.sdetail .needs { font-size: 11px; margin-top: 3px; }
.sdetail .need { display: inline-block; margin: 1px 3px; padding: 0 5px; border-radius: 5px; background: #f8d7d0; color: #8a2a1a; }
.sdetail .need.ok { background: #d6f2da; color: #20622e; }
.sdetail small { color: var(--muted); font-weight: 600; }
.snode.job2 .si { background: #4a2f6b; }
.snode.job2 .sn { color: #5a2f7a; }

/* in-game dialogs */
.dlg-back { position: fixed; inset: 0; z-index: 200; background: rgba(12, 10, 24, .55); display: flex; align-items: center; justify-content: center; animation: fadein .12s ease-out; backdrop-filter: blur(1px); }
.dlg { width: 340px; max-width: calc(100vw - 32px); background: var(--parch); border: 3px solid var(--line); border-radius: 16px; box-shadow: var(--shadow), inset 0 0 0 2px var(--parch2); animation: pin .15s ease-out; overflow: hidden; }
.dlg-head { background: linear-gradient(#2c3a6a, #1f2a52); color: #fff; padding: 9px 14px; font-family: var(--font-px); font-size: 17px; border-bottom: 3px solid var(--line); }
.dlg.danger .dlg-head { background: linear-gradient(#b8453e, #8a2a25); }
.dlg-body { padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--ink, #2b2418); font-weight: 700; }
.dlg-icon { image-rendering: pixelated; } .dlg-emoji { font-size: 34px; }
.dlg-inrow { display: flex; gap: 6px; align-items: center; justify-content: center; }
.dlg-input { width: 140px; text-align: center; font-weight: 800; font-size: 15px; padding: 6px; border-radius: 8px; border: 2px solid var(--line); background: #fffaf0; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 14px 14px; }
.dlg-foot .btn { min-width: 90px; }
@keyframes fadein { from { opacity: 0; } }
canvas.dlg-icon, img.dlg-icon { width: 56px; height: 56px; }
/* dialogs: newlines in the text, long text scrolls inside the box (never under a phone keyboard), stacked dialogs, phones */
.dlg { display: flex; flex-direction: column; max-height: calc(100% - 24px); }
.dlg.wide { width: 420px; }
.dlg-body { overflow-y: auto; min-height: 0; }
.dlg-text { white-space: pre-line; overflow-wrap: anywhere; }
.dlg-input.wide { width: min(260px, 100%); }
.dlg-foot.one { justify-content: center; }
.dlg-warn { color: #c0392b; font-weight: 800; }
.dlg-check { display: flex; gap: 8px; align-items: center; justify-content: center; font-weight: 800; cursor: pointer; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .45); border: 2px solid var(--line); }
.dlg-check input { width: 20px; height: 20px; accent-color: #8a3ffc; }
.dlg-lines { text-align: left; font-weight: 700; font-size: 13px; margin: 0; padding-left: 18px; }
.dlg-chance { font-size: 30px; font-weight: 900; color: #8a3ffc; line-height: 1; }
.dlg-chance.low { color: #c0392b; }
.dlg-back + .dlg-back { background: rgba(12, 10, 24, .35); }
@media (max-width: 600px), (pointer: coarse) {
  .dlg-back { padding: 12px; align-items: center; }
  .dlg { width: 100%; max-width: 420px; }
  .dlg-foot { padding: 0 12px 12px; }
  .dlg-foot .btn { flex: 1; min-height: 46px; font-size: 16px; }
  .dlg-input { font-size: 16px; min-height: 40px; } /* 16px: iOS does not zoom into the field */
  .dlg-inrow .btn { min-height: 40px; min-width: 40px; }
}

/* world map */
.panel.worldmap { width: 760px; }
.wm-wrap { position: relative; margin: 0 auto; max-width: 100%; box-sizing: border-box; border: 3px solid var(--line); border-radius: 10px; overflow: hidden; background: #1b2340; }
.wm-canvas { width: 100%; display: block; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.wm-tools { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.wm-tools button { width: 30px; height: 30px; border-radius: 8px; border: 2px solid #1b2340; background: #fff6e0; color: #1b2340; font: 900 17px/1 var(--font, sans-serif); cursor: pointer; box-shadow: 0 2px 0 #1b2340; padding: 0; }
.wm-tools button:hover { background: #ffd54f; }
.wm-tools button:active { transform: translateY(2px); box-shadow: none; }
.wm-hint { position: absolute; left: 8px; top: 8px; background: rgba(27,35,64,.82); color: #fff6e0; font: 800 11px var(--font, sans-serif); padding: 3px 8px; border-radius: 8px; pointer-events: none; transition: opacity .6s; }
.wm-hint.gone { opacity: 0; }
@media (max-width: 600px) { .wm-hint { display: none; } }
.wm-info { margin-top: 8px; background: #fffaf0; border: 2px solid var(--parch3); border-radius: 10px; padding: 8px 10px; }
.wm-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .wm-head b { font-family: var(--font-px); font-size: 17px; color: var(--navy); margin-right: 4px; }
.wm-mobs { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; font-size: 12px; color: var(--muted); }
.wm-mob { background: #efe4c8; border-radius: 6px; padding: 1px 6px; color: #5a4a2a; font-weight: 700; } .wm-mob.boss { background: #f8d7d0; color: #8a2a1a; }
.wm-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.travel-pill { position: absolute; top: 118px; left: 50%; transform: translateX(-50%); z-index: 5; pointer-events: auto; background: linear-gradient(#2c3a6a, #1f2a52); color: #fff; border: 2px solid #ffd54f; border-radius: 20px; padding: 5px 12px; font-weight: 800; font-size: 13px; box-shadow: 0 3px 0 rgba(0,0,0,.3); cursor: pointer; }
.travel-pill b { color: #ffd54f; } .travel-pill span { margin-left: 6px; opacity: .7; }

/* hat maker try-on mirror */
.hat-mirror { position: sticky; top: -12px; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 10px; padding: 10px; border-radius: 12px; cursor: pointer;
  background: radial-gradient(ellipse at center, #fff8e6 0%, #f0dcb0 70%); border: 3px solid var(--line); box-shadow: inset 0 0 0 2px #fff3d0; }
.hm-fig { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hm-fig canvas { width: 64px; height: 84px; image-rendering: pixelated; }
.maint-title { text-align: center; margin: 8px 0 4px; color: var(--navy); font-family: var(--font-px); }
.maint-msg { text-align: center; font-weight: 800; margin: 0 0 6px; }
#maintCard { display: flex; flex-direction: column; gap: 10px; }
#maintCard.hidden { display: none; }
#maintCard .fine { text-align: center; }
.x-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #0f0f14 !important; color: #fff !important; text-decoration: none; }
.linkish { background: none; border: 0; color: #8a6d3b; text-decoration: underline; cursor: pointer; font-size: 12px; align-self: center; }
.maint-note { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 30; width: min(520px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.45); border-radius: 12px; background: #3a1f1f; color: #ffe0d6; font-size: 13px; text-align: left; }
.maint-note b { color: #ffb199; font-size: 14px; }
.maint-note a { color: #ffd54f; font-weight: 800; }
.maint-bar { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 8px 16px; border-radius: 999px; background: rgba(58, 31, 31, .92); color: #ffe0d6; font-weight: 800; box-shadow: 0 4px 16px rgba(0,0,0,.4); pointer-events: none; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.new-version { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 999px; background: rgba(27,35,64,.95); color: #fff; font-weight: 800; font-size: 13px; border: 2px solid #c9a24f; box-shadow: 0 4px 16px rgba(0,0,0,.4); max-width: calc(100vw - 24px); }
.new-version .nv-x { background: none; border: 0; color: #9fb0e8; font-weight: 900; font-size: 14px; cursor: pointer; padding: 2px 6px; }
.maint-bar.urgent { background: #b3202a; color: #fff; font-size: 22px; animation: maintPulse 1s infinite; }
@keyframes maintPulse { 50% { transform: translateX(-50%) scale(1.08); } }
.job-warn { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: #fff3cd; border: 2px solid #e0a800; color: #5c4100; }
.bp-hero { position: relative; width: 576px; max-width: 100%; aspect-ratio: 3 / 1; margin: 0 auto 8px; border-radius: 14px; overflow: hidden; border: 3px solid var(--bp); background: linear-gradient(160deg, #0b0822, color-mix(in srgb, var(--bp) 40%, #1b1640)); image-rendering: pixelated; }
.bp-hero.art { background-size: 100% 100%; background-repeat: no-repeat; }
.bp-stage { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.fr-row { display: flex; align-items: center; gap: 6px; padding: 6px 4px; border-bottom: 1px solid #0001; } .fr-row.off { opacity: .6; }
.fr-who { flex: 1; min-width: 0; } .fr-who b { display: block; } .fr-who small { color: #6a5a3a; }
.fr-dot { width: 10px; height: 10px; border-radius: 50%; background: #9e9e9e; flex: none; } .fr-dot.ai { background: #ffb300; } .fr-dot.on { background: #43a047; box-shadow: 0 0 6px #43a047; }
.lang-pick { position: fixed; top: 12px; right: 14px; background: rgba(255,255,255,.85); padding: 4px 8px; border-radius: 10px; font-size: 13px; display: flex; gap: 4px; align-items: center; z-index: 2; }
.lang-pick select { font-size: 13px; padding: 2px 4px; border-radius: 8px; }
.news { border: 2px solid var(--line); border-radius: 12px; margin: 8px 0; background: #fffaf0; overflow: hidden; }
.news-h { display: flex; gap: 8px; align-items: center; padding: 8px 10px; cursor: pointer; flex-wrap: wrap; } .news-h b { flex: 1; min-width: 160px; } .news-h small { color: #8a6d3b; }
.news.open .news-h { background: #f3e2b3; }
.news-v { font-family: var(--font-px); font-size: 13px; background: var(--navy); color: #fff; border-radius: 6px; padding: 0 6px; }
.news-tag { font-size: 11px; font-weight: 800; color: #6a4fd8; background: #ece6ff; border-radius: 999px; padding: 1px 8px; }
.news-new { font-size: 10px; font-weight: 900; color: #fff; background: #e53935; border-radius: 6px; padding: 1px 6px; }
.news-b { padding: 4px 12px 10px; } .news-i { margin: 6px 0; font-size: 13px; line-height: 1.35; } .news-i b { display: block; color: #3a2605; }
.bp-hero .bp-head { position: absolute; left: 12px; top: 10px; display: block; padding: 0; margin: 0; border: 0; background: none; color: #fff; pointer-events: none; max-width: 62%; }
.bp-hero .bp-head small { display: block; color: #d8d4f0; text-shadow: 0 1px 0 #000; font-size: 11px; }
.bp-hero .bp-tier { margin-top: 6px; text-shadow: 0 2px 0 #0009; } .bp-hero .bp-tier span { color: #d8d4f0; font-weight: 800; }
.bp-hero .bp-name { color: color-mix(in srgb, var(--bp) 45%, #ffffff); text-shadow: 0 2px 0 #000, 0 0 10px #000; }
.bp-hero .bp-bar { position: absolute; left: 12px; bottom: 10px; width: 55%; }
.bp-info { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 12px; margin-bottom: 8px; border-radius: 12px; background: #221b48; color: #fff; border: 2px solid #8f7bff; }
.bp-info small { display: block; color: #c9c1f2; font-size: 11px; } .bp-desc { font-size: 12px; color: #e6e1ff; margin-top: 2px; }
.bp-ex { cursor: pointer; } .bp-ex.on { border-color: #8f7bff; box-shadow: 0 0 0 2px #8f7bff; }
.bp-cell { cursor: pointer; } .bp-cell.sel { outline: 3px solid #fff; outline-offset: 1px; }
.bp-head { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 14px 16px; border-radius: 14px; margin-bottom: 10px; color: #fff; background: linear-gradient(120deg, #1b1640, color-mix(in srgb, var(--bp) 45%, #1b1640)); border: 3px solid var(--bp); }
.bp-name { font-family: var(--font-px); font-size: 26px; color: var(--bp); text-shadow: 0 2px 0 #0008; }
.bp-head small { color: #d8d4f0; }
.bp-tier b { font-family: var(--font); font-weight: 900; font-size: 30px; } .bp-tier small { color: #d8d4f0; }
.bp-bar { grid-column: 1 / -1; position: relative; height: 16px; border-radius: 999px; background: #0008; overflow: hidden; }
.bp-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--bp), #fff5); } .bp-bar span { position: relative; font-size: 11px; font-weight: 900; padding-left: 8px; }
.bp-exes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.bp-ex { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 12px; background: #fff8e8; border: 2px solid #e6c47a; } .bp-ex small { display: block; color: #8a6d3b; font-size: 11px; }
.bp-buy { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; background: #3d2f06; color: #fff3cc; border: 3px solid #ffd54f; } .bp-buy small { display: block; color: #ffe9a8; }
.bp-buy small.bp-note { margin-top: 4px; opacity: .9; } .bp-buy small.bp-note.warn { color: #fff; background: rgba(255,120,60,.25); border-radius: 6px; padding: 3px 6px; opacity: 1; } /* v1.14.4: Premium (30 days) is not the Premium pass */
.bp-missions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bp-m { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin: 6px 0; font-weight: 700; } .bp-m > div { flex: 1; } .bp-m small { white-space: nowrap; color: #6a5a3a; }
.bp-m.done { opacity: .6; } .bp-mbar { height: 6px; border-radius: 999px; background: #0002; overflow: hidden; margin-top: 3px; } .bp-mbar i { display: block; height: 100%; background: #e0a800; }
.bp-legend { font-family: var(--font); font-size: 11px; color: #8a6d3b; margin-left: 8px; font-weight: 700; }
.sec h4 { display: flex; align-items: center; }
.bp-track { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.bp-col { display: flex; flex-direction: column; gap: 4px; align-items: center; opacity: .75; } .bp-col.on { opacity: 1; }
.bp-num { font-family: var(--font-px); font-size: 14px; color: #6a5a3a; }
.bp-cell { position: relative; width: 58px; height: 58px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #efe3c8; border: 2px solid #d7c29a; cursor: default; }
.bp-cell.prem { background: #2a2150; border-color: #8f7bff; } .bp-cell.empty { background: transparent; border-style: dashed; opacity: .4; }
.bp-cell.locked { filter: grayscale(.7) brightness(.85); } .bp-cell.ready { cursor: pointer; border-color: #ffd54f; box-shadow: 0 0 0 2px #ffd54f, 0 0 14px #ffd54f; animation: pulse 1.6s infinite; }
.bp-cell.claimed { opacity: .55; } .bp-ok { position: absolute; right: 2px; bottom: 0; font-weight: 900; color: #2e7d32; } .bp-claim { position: absolute; bottom: -2px; font-size: 10px; font-weight: 900; background: #ffd54f; color: #3a2605; padding: 0 4px; border-radius: 6px; }
.bp-cur { font-size: 12px; } .bp-cell.prem .bp-cur { color: #fff; }
.bz-rules { background: rgba(255,200,60,.12); border: 1px solid rgba(200,150,30,.4); border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; }
.bz-rules ul { margin: 4px 0 0 16px; padding: 0; } .bz-rules li { margin: 2px 0; }
.bz-sub { display: flex; gap: 6px; }
.lvb { position: absolute; left: 2px; bottom: 1px; font-size: 9px; font-weight: 900; color: #fff; background: #3949ab; padding: 0 3px; border-radius: 4px; line-height: 12px; }
.hb-assign { display: flex; gap: 4px; align-items: center; } .lvpick { font-size: 12px; padding: 2px; border-radius: 6px; }
.limited { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #c2185b; color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .5px; vertical-align: middle; }
.sell-low { color: #c0392b; font-weight: 800; }
.style-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 4px 0; }
.style-row > small { min-width: 78px; font-weight: 800; }
.store-money { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
.store-money > span { min-width: 220px; }
.hat-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 0 0 8px; }
.hat-pages .btn { min-width: 32px; }
.hm-fig.try canvas { width: 80px; height: 105px; filter: drop-shadow(0 0 8px rgba(255, 213, 79, .7)); }
.hm-fig small { font-weight: 800; color: var(--navy); font-size: 12px; }
.hm-arrow { font-size: 22px; color: #b8860b; font-weight: 800; }
.recipe { cursor: pointer; } .recipe.sel { outline: 3px solid #ffd54f; outline-offset: -2px; background: #fff6d8; }

/* player drop-down menu */
.pmenu { position: fixed; z-index: 150; min-width: 190px; background: var(--parch); border: 2px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; gap: 2px; animation: pin .12s ease-out; }
.pmenu-head { padding: 4px 8px 6px; border-bottom: 1px dashed var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.pmenu-head b { font-size: 15px; } .pmenu-head b.gm { color: #b8860b; } .pmenu-head small { color: var(--muted); font-weight: 700; }
.pmenu-head .gm-badge { align-self: flex-start; margin: 0 0 2px; }
.pmenu button { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; font: 800 14px var(--font, "Nunito", sans-serif); color: var(--ink, #2b2238); cursor: pointer; }
.pmenu button:hover { background: rgba(0,0,0,.07); } .pmenu button.danger { color: #c0392b; }
/* trade window */
.trade-box .tr-side { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 10px; padding: 8px; background: rgba(255,255,255,.35); }
.trade-box .tr-side.locked { border-color: #d4a017; background: rgba(255,213,79,.18); }
.trade-box .tr-side h4 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; }
.tr-state { font-size: 12px; color: var(--muted); } .tr-state.lock { color: #b8860b; } .tr-state.ok { color: #2e9d4a; }
.tr-list { font-size: 12px; margin: 6px 0; min-height: 16px; }

/* server (region) picker on the login card */
.server-pick { margin: 10px 0 12px; } .server-pick h3 { margin: 0 0 6px; font-size: 14px; }
.servers { display: flex; flex-direction: column; gap: 6px; }
.srv { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 8px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.45); cursor: pointer; text-align: left; }
.srv.on { border-color: #d4a017; background: rgba(255,213,79,.25); cursor: default; } .srv.off { opacity: .55; }
.srv b { font-size: 14px; } .srv small { grid-column: 1 / -1; color: var(--muted); font-weight: 700; font-size: 11px; }
.srv .ms { font-weight: 900; font-size: 13px; } .ms.good { color: #2e9d4a; } .ms.mid { color: #c98a00; } .ms.bad { color: #c0392b; }
.srv-load { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; font-size: 10px; font-weight: 900; vertical-align: 1px; }
.srv-load.busy { background: #f6d2cf; color: #a3281d; } .srv-load.rec { background: #d3f0d9; color: #1e7a37; }
.srv-hint { color: #1e7a37; font-weight: 800; }
.srv-tag { font-size: 12px; color: var(--muted); font-weight: 800; margin-left: 6px; }

/* region tag on character slots, server choice for new characters, ban screen */
.char-slot { position: relative; } .char-slot .rg { font-weight: 800; }
.char-slot .mv { position: absolute; right: 6px; top: 30px; background: none; border: 0; font-size: 15px; cursor: pointer; color: var(--muted); } .char-slot .mv:hover { color: #b8860b; }
.region-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 800; font-size: 13px; } .region-row select { flex: 1; }
.ban-title { text-align: center; color: #c0392b; margin: 8px 0; }
.ban-box { background: rgba(192,57,43,.08); border: 2px solid rgba(192,57,43,.35); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.ban-label { font-size: 11px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.ban-reason, .ban-until { font-weight: 800; margin-bottom: 4px; }
#banCard textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px; border-radius: 8px; border: 2px solid var(--line); background: #fffaf0; }

.char-slot > div { padding-right: 22px; min-width: 0; } .char-slot .cs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* party box: clean crystal glass on the left */
.party-hud { position: absolute; left: 10px; top: 150px; width: 190px; display: flex; flex-direction: column; gap: 5px; padding: 8px; border-radius: 14px; z-index: 6;
  background: linear-gradient(160deg, rgba(210,235,255,.22), rgba(140,180,255,.10)); border: 1px solid rgba(255,255,255,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -8px 18px rgba(120,170,255,.12), 0 6px 18px rgba(10,20,50,.35); backdrop-filter: blur(6px) saturate(1.3); -webkit-backdrop-filter: blur(6px) saturate(1.3); }
.ph-head { display: flex; gap: 6px; align-items: center; font: 800 11px "Nunito", sans-serif; color: #eef6ff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.ph-head > span:first-child { flex: 1; letter-spacing: .5px; } .ph-mode { opacity: .85; } .ph-exp.ok { color: #9dff9d; } .ph-exp.bad { color: #ff8a80; cursor: help; }
.ph-m { padding: 4px 6px; border-radius: 9px; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); cursor: pointer; }
.ph-m:hover { background: rgba(255,255,255,.2); } .ph-m.me { border-color: rgba(255,230,140,.6); } .ph-m.away { opacity: .5; } .ph-m.dead { filter: grayscale(1); }
.ph-name { font: 800 12px "Nunito", sans-serif; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-name small { font-weight: 700; color: #cfe3ff; } .ph-flag { color: #ff5a4d; cursor: help; }
.ph-bar { height: 5px; border-radius: 3px; background: rgba(0,0,0,.35); margin-top: 3px; overflow: hidden; } .ph-bar i { display: block; height: 100%; border-radius: 3px; transition: width .4s; }
.ph-bar.hp i { background: linear-gradient(90deg, #4cd964, #9dff9d); } .ph-bar.sp i { background: linear-gradient(90deg, #3b82f6, #8fc7ff); }
@media (max-width: 820px) { .party-hud { top: auto; bottom: 150px; width: 150px; } }
.party-exp { padding: 6px 10px; border-radius: 8px; font-weight: 800; font-size: 13px; margin-bottom: 8px; } .party-exp.ok { background: rgba(46,157,74,.12); color: #2e7d32; } .party-exp.bad { background: rgba(192,57,43,.12); color: #c0392b; }
.party-loot { margin-bottom: 6px; font-size: 13px; } .party-loot select { max-width: 100%; }
/* quest Go button, bound items */
.q-head { display: flex; align-items: center; gap: 8px; } .q-head b { flex: 1; } .q-go { padding: 2px 10px; font-size: 12px; }
.it .bd { position: absolute; left: 1px; bottom: 0; font-size: 9px; }
/* tutorial */
.tut-back { position: fixed; inset: 0; background: rgba(8,10,24,.62); z-index: 300; } .tut-back.clear { background: transparent; }
.tut-spot { position: fixed; z-index: 301; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(8,10,24,.62), 0 0 0 3px #ffd54f, 0 0 24px 6px rgba(255,213,79,.6); pointer-events: none; transition: all .25s; }
.tut-arrow { position: fixed; z-index: 303; font-size: 32px; color: #ffd54f; text-shadow: 0 2px 6px rgba(0,0,0,.6); pointer-events: none; animation: tutbob .8s ease-in-out infinite alternate; }
@keyframes tutbob { from { translate: 0 -4px; } to { translate: 0 4px; } }
.tut-card { position: fixed; z-index: 302; background: var(--parch, #f6ecd6); border: 3px solid var(--line, #b8955a); border-radius: 16px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.tut-card h3 { margin: 2px 0 6px; } .tut-card p { margin: 0 0 12px; line-height: 1.45; font-weight: 600; }
.tut-n { font-size: 11px; font-weight: 900; color: var(--muted, #8a7a60); } .tut-btns { display: flex; gap: 6px; justify-content: flex-end; }

.quest-done-note { background: rgba(46,157,74,.12); color: #2e7d32; border-radius: 8px; padding: 6px 10px; font-weight: 800; font-size: 13px; margin: 6px 0; }

/* login alternatives, wallet picker, account rows */
.login-alt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.wp-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; } .wp-item { display: flex; align-items: center; gap: 10px; justify-content: flex-start; text-decoration: none; }
.wp-item img { width: 24px; height: 24px; border-radius: 6px; } .wp-note { margin-top: 6px; }
.acc-rows > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; }

/* Gold Shop */
.prem-badge { color: #ffd54f; font-weight: 900; margin-right: 3px; }
.dep-rate { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; padding: 8px 12px; border-radius: 8px; background: rgba(255, 213, 79, .12); border: 1px solid rgba(255, 213, 79, .45); } /* v1.14.3: 100 Gold = $1, big */
.dep-rate b { font-size: 18px; color: #ffd54f; }
.dep-rate small { opacity: .8; }
.dep-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.dep-pack { display: flex; flex-direction: column; gap: 2px; padding: 10px; } .dep-pack small { font-weight: 700; opacity: .75; }
.dep-req { display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: start; } .dep-qr svg { width: 180px; height: 180px; background: #fff; border-radius: 10px; }
@media (max-width: 600px) { .dep-req { grid-template-columns: 1fr; } }
.dep-status { font-weight: 900; } .dep-status.credited { color: #2e9d4a; } .dep-status.review { color: #b8860b; } .dep-status.expired { color: #c0392b; }
.dep-manual { margin-top: 10px; } .dep-manual summary { cursor: pointer; font-weight: 800; }

/* ---------- raids ---------- */
.role-ico { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; font-size: 11px; margin-right: 3px; vertical-align: -2px; color: #fff; background: #777; text-shadow: none; }
.role-ico.tank { background: #3f6fd8; } .role-ico.heal { background: #3fa35b; } .role-ico.dps { background: #c94545; } .role-ico.none { background: #999; }
.role-pick { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.role-btn { flex: 1; min-width: 90px; padding: 8px 6px; border-radius: 10px; border: 2px solid var(--line); background: var(--parch2); font: 800 13px var(--font); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text); }
.role-btn .ri { font-size: 18px; }
.role-btn.tank.on { background: #3f6fd8; color: #fff; border-color: #24479a; } .role-btn.heal.on { background: #3fa35b; color: #fff; border-color: #22703a; } .role-btn.dps.on { background: #c94545; color: #fff; border-color: #8a2525; }
.role-pick.small .role-btn { min-width: 0; padding: 4px 8px; font-size: 12px; flex: none; }
.raid-hero { height: 110px; border-radius: 12px; background: #1a1740 url(../assets/gen/ui/raid_bg.png) center/cover; image-rendering: pixelated; display: flex; flex-direction: column; justify-content: flex-end; padding: 10px 12px; margin-bottom: 8px; box-shadow: inset 0 -50px 40px -20px rgba(10,8,40,.85); }
.raid-hero .rh-t { font: 700 24px var(--font-px); color: #fff3c4; text-shadow: 0 2px 0 #2a1f5c, 0 0 12px #8f7bff; }
.raid-hero .rh-s { font: 700 12px var(--font); color: #d9d4ff; }
.raid-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; margin: 6px 0; }
.raid-members .rm { padding: 4px 6px; border-radius: 8px; background: rgba(0,0,0,.06); font-size: 12px; border: 2px solid transparent; }
.raid-members .rm.ready { border-color: var(--green); } .raid-members .rm.notready { border-color: var(--red); opacity: .7; }
.raid-probs { margin: 4px 0; padding-left: 18px; color: var(--red); font-size: 12px; font-weight: 700; }
.raid-prog { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.raid-prog .rp { padding: 3px 8px; border-radius: 99px; background: rgba(0,0,0,.08); font-size: 12px; font-weight: 700; }
.raid-prog .rp.done { background: var(--green); color: #fff; } .raid-prog .rp.fight { background: var(--red); color: #fff; }
.board-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,.05); margin: 4px 0; flex-wrap: wrap; }
.raid-boss { padding: 6px 8px; border-left: 3px solid var(--violet); margin: 6px 0; background: rgba(155,122,232,.08); border-radius: 0 8px 8px 0; }
.raid-boss.looted { opacity: .65; border-left-color: var(--green); }
.rb-loot { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rb-loot .rl { font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: rgba(197,139,255,.2); color: #6a3fb0; }
.raid-check { position: fixed; top: 22%; left: 50%; transform: translateX(-50%); z-index: 90; background: var(--parch); border: 3px solid var(--line); border-radius: 16px; padding: 14px 20px; width: min(340px, 92vw); text-align: center; box-shadow: var(--shadow); animation: tin .25s ease-out; }
.raid-check .rc-title { font: 700 22px var(--font-px); color: var(--navy); }
.raid-check.remind { border-color: #e0a23a; animation: tin .25s ease-out, rc-pulse 1.2s ease-in-out 3; }
@keyframes rc-pulse { 50% { box-shadow: 0 0 0 6px rgba(224, 162, 58, .45), var(--shadow); } }
.raid-check .rc-late { font-size: 12px; margin: 4px 0 8px; }
.raid-checking { margin: 8px 0 4px; padding: 6px 10px; border-radius: 10px; background: rgba(47, 122, 64, .12); }
.raid-start-now[disabled] { opacity: .6; }
.wm-gap { margin: 4px 0 2px; font-size: 12px; }
.dun-rec { margin: 6px 0; padding: 6px 10px; border-radius: 10px; background: rgba(184, 134, 11, .12); font-size: 13px; }
.dun-rec small { display: block; color: var(--muted); margin-top: 2px; }
.raid-check .rc-btns { display: flex; gap: 8px; justify-content: center; }
/* cinematic: letterbox bars slide in, the HUD hides */
.cine { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.cine-bar { position: absolute; left: 0; right: 0; height: 15vh; background: #000; transition: transform .6s ease; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 16px; }
.cine-bar.top { top: 0; transform: translateY(-100%); } .cine-bar.bottom { bottom: 0; transform: translateY(100%); }
.cine.on .cine-bar { transform: none; }
.cine-title { font: 700 clamp(18px, 3.4vw, 34px) var(--font-px); color: #fff3c4; letter-spacing: 2px; text-shadow: 0 0 14px #8f7bff; text-align: center; }
.cine-who { font: 700 clamp(13px, 2vw, 18px) var(--font-px); color: #b8a6ff; }
.cine-line { font: 700 clamp(13px, 2.2vw, 20px) var(--font); color: #fff; text-align: center; max-width: 900px; min-height: 1.4em; }
#game.in-cine .menu, #game.in-cine .minimap, #game.in-cine .chat, #game.in-cine .actions, #game.in-cine .hotbar, #game.in-cine .joy, #game.in-cine .quest, #game.in-cine .quest-btn, #game.in-cine .party-hud, #game.in-cine .hud-card, #game.in-cine .buff-row { opacity: 0; pointer-events: none; transition: opacity .4s; }
.raid-yell { position: fixed; top: 196px; left: 50%; transform: translateX(-50%); z-index: 70; pointer-events: none; font: 800 clamp(13px, 1.8vw, 17px) var(--font); color: #ffe7e7; text-shadow: 0 2px 3px #000, 0 0 8px #c62828; white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; animation: tin .25s ease-out; }
.raid-yell b { color: #ff8a80; }
.raid-yell + .raid-yell { top: 222px; }
.raid-bar { position: fixed; top: 136px; left: 50%; transform: translateX(-50%); z-index: 60; width: min(460px, 70vw); pointer-events: none; }
.raid-bar .rb-name { font: 700 15px var(--font-px); color: #fff3c4; text-align: center; text-shadow: 0 2px 2px #000; }
.raid-bar .rb-timer { color: #ff9e9e; font-size: 12px; }
.raid-bar .rb-bar { position: relative; height: 14px; margin-top: 3px; border-radius: 7px; background: rgba(10,8,30,.8); border: 2px solid #c9a94a; overflow: hidden; }
.raid-bar .rb-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ff6b6b, #b71c1c); transition: width .25s; }
.raid-bar .rb-bar span { position: relative; display: block; text-align: center; font: 800 10px var(--font); color: #fff; line-height: 10px; text-shadow: 0 1px 1px #000; }

/* ---------- Ascension ---------- */
.asc-box { background: rgba(255,248,220,.6); border: 2px solid #e6b93a; border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
.asc-box.done { background: linear-gradient(135deg, #fff6d6, #ffe9a8); text-align: center; }
.asc-box h4 { margin: 0 0 4px; color: #8a5a00; }
.asc-box ul { margin: 0; padding-left: 18px; line-height: 1.55; font-size: 13px; }
.asc-req { list-style: none; padding-left: 0 !important; font-weight: 800; }
.asc-req .ok { color: #2e7d32; } .asc-req .no { color: #c62828; }
.asc-mark { color: #e6b93a; text-shadow: 0 0 4px rgba(255,215,110,.8); }
/* raid & dungeon picker */
.raid-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 8px; }
.raid-pick .rpk { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 10px; border-radius: 10px; border: 2px solid var(--line, #dcc596); background: #fffaf0; cursor: pointer; text-align: left; font: inherit; }
.raid-pick .rpk b { font-weight: 800; } .raid-pick .rpk small { color: #7a6a52; font-weight: 700; }
.raid-pick .rpk.on { border-color: #8f7bff; background: #efeaff; box-shadow: 0 0 0 2px rgba(143,123,255,.25); }
.raid-pick .rpk.low { opacity: .55; }
.raid-hero.dungeon { background-color: #1d2b2a; background-size: cover; background-position: center; }
.sync-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: #3d6bff; color: #fff; font-size: 10px; font-weight: 900; vertical-align: middle; }

/* ================= phone layout (mobile.js: body.m-ui) ================= */
.m-hide { display: none !important; }
.menu .m-more { position: relative; background: none; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; padding: 3px 6px; border-radius: 10px; min-width: 50px; }
.menu .m-more.hidden { display: none; }
.menu .m-more .ico { font-size: 22px; font-weight: 900; } .menu .m-more.on { background: rgba(242,193,78,.25); }
.menu .m-more .m-dot:empty { display: none; }
body.m-ui .menu { overflow: visible; gap: 2px; padding: 3px 4px; }
body.m-ui .menu button { min-width: 56px; padding: 3px 4px; }
body.m-ui .menu .ico img { width: 28px; height: 28px; }
body.m-ui .menu em { font-size: 10px; }
/* the ☰ sheet: every window, big tiles, and "Customize bar" */
.m-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow: auto; z-index: 40; background: #f6ecd6; border-radius: 18px 18px 0 0; border-top: 3px solid #c9a24f; box-shadow: 0 -10px 30px rgba(0,0,0,.45); padding: 10px 12px calc(14px + var(--safe-b)); color: #3b3326; }
.m-sheet.hidden { display: none; }
.m-sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.m-sheet-head b { font-family: var(--font-px); font-size: 18px; color: var(--navy); flex: 1; }
.m-sheet-head .x { width: 34px; height: 34px; border-radius: 10px; border: 2px solid #c9a24f; background: #fffaf0; font-weight: 900; }
.m-sheet-tip { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: #7a6a52; }
.m-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.m-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px 8px; border-radius: 14px; border: 2px solid #dcc596; background: #fffaf0; color: #3b3326; font: inherit; }
.m-tile:active { transform: scale(.96); }
.m-tile .ico { font-size: 28px; } .m-tile .ico img { width: 36px; height: 36px; image-rendering: pixelated; }
.m-tile em { font-style: normal; font-size: 12px; font-weight: 800; }
.m-tile .badge { position: absolute; top: 4px; right: 6px; }
.m-tile.pinned { border-color: #f2c14e; background: #fff4d0; box-shadow: 0 0 0 2px rgba(242,193,78,.35); }
.m-tile .pin { position: absolute; top: 3px; left: 7px; font-style: normal; font-size: 16px; color: #d99a1e; }
/* chat: a grip to resize (desktop: top-right corner, phone: bottom-right) and a 💬 bubble when folded */
.chat { position: absolute; }
.chat-grip { position: absolute; right: -2px; top: -2px; width: 22px; height: 22px; cursor: nesw-resize; touch-action: none; z-index: 2; background: linear-gradient(135deg, transparent 45%, rgba(255,255,255,.55) 45%, rgba(255,255,255,.55) 55%, transparent 55%, transparent 65%, rgba(255,255,255,.55) 65%, rgba(255,255,255,.55) 75%, transparent 75%); border-radius: 0 12px 0 6px; }
body.m-ui .chat-grip { top: auto; bottom: -2px; cursor: nwse-resize; width: 28px; height: 28px; background: linear-gradient(45deg, transparent 45%, rgba(255,255,255,.6) 45%, rgba(255,255,255,.6) 55%, transparent 55%, transparent 65%, rgba(255,255,255,.6) 65%, rgba(255,255,255,.6) 75%, transparent 75%); border-radius: 6px 0 12px 0; }
.chat.min .chat-grip { display: none; }
.chat.min { width: auto !important; }
.chat.min .chat-tabs button:not(.chat-min) { display: none; }
.chat.min .chat-tabs button.has-unread { display: inline-block; } /* a new whisper still shows while the chat is folded */
.chat.min .chat-min { font-size: 18px; padding: 4px 10px; }
.chat.min .chat-min::before { content: '💬 '; }
/* phones in landscape: the short bar goes to the top middle, the joystick to the corner, quests behind the 📜 button */
@media (max-height: 500px) and (orientation: landscape) {
  body.m-ui .menu { top: calc(4px + env(safe-area-inset-top, 0px)); bottom: auto; }
  body.m-ui .menu button { min-width: 48px; padding: 2px 3px; }
  body.m-ui .menu .ico img { width: 24px; height: 24px; }
  body.m-ui .joy { bottom: calc(8px + var(--safe-b)); left: calc(14px + env(safe-area-inset-left, 0px)); width: 116px; height: 116px; }
  body.m-ui .actions { bottom: calc(8px + var(--safe-b)); }
  body.m-ui .chat { top: 100px; }
  body.m-ui .chat-log { height: 46px; }
  body.m-ui .quest { display: none; top: 56px; right: 170px; left: auto; width: 250px; }
  body.m-ui .quest.show { display: block; z-index: 15; }
  body.m-ui .quest-btn { display: block; position: absolute; right: 168px; top: 8px; z-index: 16; width: 40px; height: 40px; border-radius: 10px; border: 2px solid #c9a24f; background: #1a2446; font-size: 20px; }
  body.m-ui .m-grid { grid-template-columns: repeat(6, 1fr); }
  body.m-ui .m-sheet { max-height: 92vh; left: 10%; right: 10%; }
  body.m-ui .castbar { bottom: 150px; }
}
@media (max-height: 500px) and (orientation: landscape) and (max-width: 700px) { body.m-ui .menu em { display: none; } body.m-ui .menu button { min-width: 42px; } }
.chat.min .chat-min { font-size: 0; } .chat.min .chat-min::before { font-size: 18px; }
.gear-score .gs-sync { font-size: .7em; color: #9fd0ff; margin-left: 4px; }
.gs-parts { display: block; margin-top: 4px; text-align: center; }
.chat-in #chatLang { flex: none; width: 96px; }
.gs-need { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 4px 10px; margin: 8px 0; padding: 8px 12px; border-radius: 10px; border: 2px solid; font-weight: 800; }
.gs-need b { font-size: 1.3em; } .gs-need small { color: #7a6a52; } .gs-need i { grid-column: 1 / -1; font-style: normal; font-size: 12px; }
.gs-need.ok { border-color: #58b368; background: #eef8ec; } .gs-need.ok b, .gs-need.ok i { color: #2e7d32; }
.gs-need.mid { border-color: #e6b93a; background: #fff6dc; } .gs-need.mid b, .gs-need.mid i { color: #a36b00; }
.gs-need.bad { border-color: #d6284c; background: #fdecee; } .gs-need.bad b, .gs-need.bad i { color: #c0203f; }

.prize-boards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px}
.prize-boards table{width:100%;font-size:12px}

/* holders only (HOLD_MIN) */
.hold-box{border:2px solid #e0a43a;background:#fff4dc;border-radius:12px;padding:10px 14px;margin:0 0 12px;color:#3a2a12}
.hold-box.ok{border-color:#5cbf7a;background:#ecf9ef}
.hold-box b{display:block;font-size:15px}
.hold-box p{margin:4px 0 8px;font-size:14px}
.hold-box .row2{display:flex;gap:8px;flex-wrap:wrap}
/* character screen: this character's world is Busy, a free move to the Recommended one */
.move-box{border:2px solid #4a8fd6;background:#e9f3ff;border-radius:12px;padding:10px 14px;margin:8px 0 12px;color:#14304f}
.move-box b{display:block;font-size:15px}
.move-box p{margin:4px 0 8px;font-size:14px}
.move-box small{display:block;margin-top:6px;font-size:12px;opacity:.85}
.move-box .row2{display:flex;gap:8px;flex-wrap:wrap}

/* Quests tab */
.q-sec { margin: 10px 0 6px; font-family: var(--font-px); color: var(--navy); font-size: 14px; }
.quest-card.tracked { border-color: #e0a43a; box-shadow: 0 0 0 2px rgba(224,164,58,.25); }
.q-kind { font-size: 11px; color: #7a6a55; white-space: nowrap; }
.q-ready { font-style: normal !important; font-weight: 700; color: #2f8f46 !important; }
.qgoal { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; font-size: 13px; margin: 3px 0; }
.qgoal .bar.mini { grid-column: 1 / -1; height: 5px; background: #eadfca; border: 0; }
.qgoal.ok span { color: #2f8f46; }
.q-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.q-act .btn.on { background: #ffe7b0; }

/* party list: folds to its header; phones get a compact list that never covers more than a third of the screen */
.ph-head { cursor: pointer; user-select: none; }
.ph-fold { flex: 0 0 auto !important; width: 12px; font-size: 12px; }
.party-hud.min { gap: 0; }
.party-hud.min .ph-m { display: none; }
.party-hud.min .ph-mode, .party-hud.min .ph-exp { display: none; }
@media (max-width: 820px) {
  .party-hud { left: auto !important; right: 8px; top: 182px !important; bottom: auto !important; width: 132px; max-height: 34vh; overflow-y: auto; padding: 6px; gap: 3px; -webkit-overflow-scrolling: touch; } /* right side under the minimap: clear of the joystick and the chat */
  .party-hud .ph-m { padding: 2px 5px; }
  .party-hud .ph-name { font-size: 10px; }
  .party-hud .ph-bar { height: 3px; margin-top: 2px; }
  .party-hud .ph-bar.sp { display: none; }
  .party-hud .ph-mode { display: none; }
}

/* ---------- achievements ---------- */
.ach-head { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, #fff6dc, #f3e2b6); border: 2px solid var(--parch3); margin-bottom: 8px; }
.ach-head.fr-bronze, .ach-insp.fr-bronze { border-color: #c98a4b; box-shadow: inset 0 0 0 2px #e7b98a; }
.ach-head.fr-silver, .ach-insp.fr-silver { border-color: #9aa7b8; box-shadow: inset 0 0 0 2px #dfe6ef, 0 0 8px rgba(160,175,200,.5); }
.ach-head.fr-gold, .ach-insp.fr-gold { border-color: #d99a1e; box-shadow: inset 0 0 0 2px #ffe08a, 0 0 10px rgba(242,193,78,.55); }
.ach-head.fr-star, .ach-insp.fr-star { border-color: #8f7bff; background: linear-gradient(135deg, #f3edff, #ffe9f6 55%, #e6f6ff); box-shadow: inset 0 0 0 2px #d9ccff, 0 0 14px rgba(143,123,255,.6); animation: achGlow 3s ease-in-out infinite; }
@keyframes achGlow { 50% { box-shadow: inset 0 0 0 2px #ffd6f0, 0 0 20px rgba(255,140,220,.55); } }
.ach-pts { display: flex; align-items: center; gap: 8px; min-width: 128px; }
.ach-pts b { display: block; font-family: var(--font-px); font-size: 28px; color: var(--navy); line-height: 1; }
.ach-pts small, .ach-sum small { color: var(--muted); font-weight: 700; }
.ach-cup { font-size: 30px; filter: drop-shadow(0 2px 2px #0003); }
.ach-sum { flex: 1; min-width: 0; font-size: 13px; }
.ach-bar { height: 8px; background: #eadfca; border-radius: 6px; overflow: hidden; margin: 5px 0 3px; }
.ach-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ff9f43); border-radius: 6px; }
.ach-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 8px; }
.ach-chip { border: 2px solid var(--line); background: #fffaf0; color: var(--navy); border-radius: 999px; padding: 4px 10px; font: 800 12px var(--font); cursor: pointer; }
.ach-chip small { color: var(--muted); font-weight: 700; }
.ach-chip.on { background: linear-gradient(#ffe7a0, #f2c14e); border-color: var(--gold2); box-shadow: 0 0 0 2px rgba(242,193,78,.35); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 7px; }
.ach-card { display: flex; gap: 8px; align-items: flex-start; background: #fffaf0; border: 2px solid var(--parch3); border-radius: 12px; padding: 7px 9px; opacity: .92; }
.ach-card.got { opacity: 1; border-color: #c9a24a; background: linear-gradient(135deg, #fffbe8, #fff3cf); }
.ach-card.got.t-legend { border-color: #8f7bff; background: linear-gradient(135deg, #f6f1ff, #fff0fa); }
.ach-card.secret { border-style: dashed; }
.ach-card:not(.got) .ach-medal { filter: grayscale(.85); opacity: .65; }
.ach-medal { font-size: 24px; line-height: 1; min-width: 28px; text-align: center; }
.ach-txt { flex: 1; min-width: 0; }
.ach-top { display: flex; justify-content: space-between; gap: 6px; }
.ach-top b { color: var(--navy); font-size: 13px; }
.ach-p { font-size: 11px; font-weight: 800; color: var(--gold2); white-space: nowrap; }
.ach-txt > small { display: block; color: var(--muted); font-size: 12px; line-height: 1.25; }
.ach-prog { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; font-weight: 800; color: var(--muted); }
.ach-prog .bar.mini { height: 5px; background: #eadfca; border: 0; }
.ach-done { margin-top: 3px; font-size: 11px; font-weight: 800; color: #2f8f46; }
.ach-rws { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.ach-rw { font-size: 10.5px; font-weight: 800; color: #6b4f1d; background: #f6e3b3; border-radius: 6px; padding: 1px 6px; display: inline-flex; align-items: center; gap: 4px; }
.ach-sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid #0004; }
.ach-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 10px; }
.ach-cat { display: grid; grid-template-columns: auto 1fr; gap: 2px 6px; align-items: center; text-align: left; background: #fffaf0; border: 2px solid var(--parch3); border-radius: 10px; padding: 6px 8px; cursor: pointer; font: inherit; }
.ach-cat > span { grid-row: span 2; font-size: 20px; }
.ach-cat b { color: var(--navy); font-size: 12px; }
.ach-cat .bar.mini { height: 5px; background: #eadfca; border: 0; }
.ach-cat small { grid-column: 2; color: var(--muted); font-weight: 700; font-size: 11px; }
.ach-ms { display: flex; flex-direction: column; gap: 4px; }
.ach-m { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; background: #fffaf0; border: 1px solid var(--parch3); font-size: 12px; }
.ach-m b { min-width: 40px; font-family: var(--font-px); color: var(--navy); }
.ach-m span { flex: 1; }
.ach-m small { color: var(--muted); font-weight: 800; }
.ach-m.got { background: #f2fbe9; border-color: #9fd18a; }
.ach-insp { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 6px 0; border-radius: 10px; background: #fff6dc; border: 2px solid var(--parch3); }
.ach-insp b { color: var(--navy); font-size: 13px; display: block; }
.ach-insp small { color: var(--muted); font-weight: 700; font-size: 11px; }
.ach-insp .ach-cup { font-size: 24px; }
/* unlock banner */
.ach-toasts { position: absolute; bottom: calc(150px + var(--safe-b)); left: 0; right: 0; padding: 0 16px; z-index: 31; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; zoom: var(--ui, 1); }
.ach-toast { position: relative; pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: min(420px, calc(100vw - 32px)); padding: 9px 16px 9px 12px; border-radius: 14px; background: linear-gradient(135deg, #2a2350, #1b2340); color: #fff6dc; border: 2px solid #f2c14e; box-shadow: 0 8px 28px rgba(10,12,30,.55), 0 0 18px rgba(242,193,78,.35); animation: achIn .45s cubic-bezier(.2,1.4,.4,1); }
.ach-toast.out { animation: achOut .35s ease-in forwards; }
.ach-toast.t-silver { border-color: #c9d3e0; }
.ach-toast.t-bronze { border-color: #d39a62; }
.ach-toast.t-legend { border-color: #c7a6ff; box-shadow: 0 8px 28px rgba(10,12,30,.55), 0 0 26px rgba(199,166,255,.7); }
.ach-toast .ach-medal { font-size: 30px; filter: none; opacity: 1; animation: achSpin .9s ease-out; }
.ach-toast small { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #f2c14e; font-weight: 800; }
.ach-toast b { display: block; font-family: var(--font-px); font-size: 17px; color: #fff; }
.ach-toast span { font-size: 12px; color: #e6dcc4; }
.ach-sparks { position: absolute; left: 30px; top: 50%; width: 0; height: 0; pointer-events: none; }
.ach-sparks i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #ffe58a; box-shadow: 0 0 6px #ffd54f; opacity: 0; transform: rotate(var(--a)) translateX(0); animation: achSpark .9s ease-out var(--d) forwards; }
@keyframes achSpark { 0% { opacity: 1; transform: rotate(var(--a)) translateX(4px) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(46px) scale(.3); } }
@keyframes achIn { from { opacity: 0; transform: translateY(-14px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes achOut { to { opacity: 0; transform: translateY(-10px) scale(.95); } }
@keyframes achSpin { from { transform: scale(.3) rotate(-30deg); } 70% { transform: scale(1.2) rotate(8deg); } to { transform: none; } }
@media (max-width: 820px) {
  .ach-head { flex-wrap: wrap; gap: 6px; }
  .ach-grid { grid-template-columns: 1fr; }
  .ach-toasts { bottom: calc(200px + var(--safe-b)); }
  .ach-toast { min-width: 0; width: 100%; max-width: 360px; }
}

/* ================= HUD layout v2 (hudlayout.js): settings, phone HUD, Edit layout ================= */
:root { --sa-t: env(safe-area-inset-top, 0px); --sa-r: env(safe-area-inset-right, 0px); --sa-l: env(safe-area-inset-left, 0px); }
/* settings that also work on desktop (only set when the player changed them) */
.minimap { opacity: var(--mm-op, 1); width: calc(var(--mm-w, 160px) + 14px); } /* a long World Boss line no longer widens it under the menu */
.menu { right: calc(var(--mm-w, 160px) + 36px); }
.minimap canvas { width: var(--mm-w, 160px); height: var(--mm-h, 120px); }
.chat { background: rgba(16,22,44,var(--chat-a,.82)); }
.mm-fold, .mm-open { display: none; }
body.hud-mm-off .minimap canvas, body.hud-mm-off .mm-foot, body.hud-mm-off .mm-fold { display: none; }
body.hud-mm-off .mm-open { display: block; width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(255,255,255,.08); font-size: 20px; margin-left: auto; }
body.hud-mm-off .minimap { padding: 3px; }
body.hud-trk-off #quest, body.hud-trk-off #questBtn { display: none !important; }
.hb-page { display: none; }
/* the quest tracker folds to one line */
.q-fold { flex: none; border: 0; background: none; color: var(--navy); font-size: 14px; font-weight: 900; width: 22px; height: 22px; padding: 0; margin: -2px 0 -2px -4px; border-radius: 6px; }
.q-fold:hover { background: rgba(0,0,0,.08); }
.quest .q-head b { min-width: 0; }
.dq-sum { float: right; font-weight: 800; color: var(--navy); font-size: 12px; }
.quest:not(.qmin) .dq-sum { display: none; }
.quest.qmin .q > p, .quest.qmin .q .help, .quest.qmin .dq { display: none; }
.quest.qmin .q { padding: 4px 8px; }
.quest.qmin .q-head b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quest.qmin .daily { margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the login screen: a card taller than the screen (phones in landscape) scrolls from its top instead of losing it */
.front { justify-content: flex-start; padding-top: max(56px, calc(16px + var(--sa-t))); }
.front::before, .front::after { content: ''; flex: 1 0 0; }
@media (max-width: 420px) { .lang-pick { top: 6px; right: 6px; padding: 2px 6px; } .logo-top { font-size: 52px; } }
/* HUD layout window */
.hud-slider { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; margin: 6px 0; font-weight: 700; font-size: 13px; }
.hud-slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--gold2); border: 0; padding: 0; background: none; height: 28px; }
.hud-chips { margin: 2px 0 6px; } .hud-chips .mk-chip { min-height: 36px; padding: 4px 14px; font-size: 13px; }
.hud-tick { margin: 8px 0; min-height: 30px; } .hud-tick small { font-weight: 600; }
/* Options -> HUD layout -> Hide or dim (hudlayout.js): dimmed boxes light up on hover / focus / press */
.hud-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; font-weight: 700; font-size: 13px; }
.hud-row .hud-chips { margin: 2px 0 4px; }
body.hud-q-dim #quest, body.hud-q-dim #questBtn,
body.hud-act-dim #veilHud, body.hud-act-dim #cruHud, body.hud-act-dim #sgHud, body.hud-act-dim #raidBar,
body.hud-mmx-dim #minimapBox .mm-foot, body.hud-mmx-dim #wbPill, body.hud-mmx-dim #egHud, body.hud-mmx-dim #skyZone, body.hud-mmx-dim #zenBadge { opacity: .4; transition: opacity .15s; }
body.hud-q-dim #quest:is(:hover, :focus-within, :active), body.hud-q-dim #questBtn:is(:hover, :active),
body.hud-act-dim :is(#veilHud, #cruHud, #sgHud, #raidBar):is(:hover, :focus-within, :active),
body.hud-mmx-dim :is(#minimapBox .mm-foot, #wbPill, #egHud, #skyZone, #zenBadge):is(:hover, :focus-within, :active) { opacity: 1; }
body.hud-mmx-off #minimapBox .mm-foot, body.hud-mmx-off #wbPill, body.hud-mmx-off #skyZone, body.hud-mmx-off #zenBadge { display: none !important; }
body.hud-calm .auto-btn.on::after { content: none; animation: none; }
/* v1.14.3 the PvP HP bar (pvpbar-ui.js) dims with the activity boxes, like the boss bar */
body.hud-act-dim #pvpBar { opacity: .4; transition: opacity .15s; }
.hud-edit-cta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.hud-reset { display: flex; justify-content: flex-end; margin-top: 4px; }
.m-sheet-hud { display: flex; gap: 8px; margin-top: 10px; } .m-sheet-hud .btn { flex: 1; min-height: 42px; }
/* Edit layout */
.hud-moved { position: fixed !important; margin: 0 !important; transform: none !important; }
.hud-edit-layer { position: absolute; inset: 0; z-index: 4; background: rgba(10,12,30,.35); }
.hud-edit-bar { position: absolute; left: 50%; top: calc(50% - 60px); transform: translateX(-50%); z-index: 70; width: min(340px, calc(100vw - 24px)); background: var(--parch); border: 3px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; text-align: center; }
.hud-edit-bar b { font-family: var(--font-px); color: var(--navy); font-size: 18px; } .hud-edit-bar span { font-size: 13px; font-weight: 700; color: var(--muted); }
.hud-edit-btns { display: flex; gap: 8px; justify-content: center; } .hud-edit-btns .btn { min-height: 40px; min-width: 110px; }
body.hud-edit .hud-w { outline: 2px dashed #ffd54f; outline-offset: 2px; cursor: move; touch-action: none; z-index: 65 !important; }
body.hud-edit .joy.hud-w { display: block; }
body.hud-edit .hud-w * { pointer-events: none !important; }
body.hud-edit .hud-w.hud-drag { outline-style: solid; }
body.hud-dragging .hud-edit-bar { opacity: .15; pointer-events: none; }
body.hud-edit .actions, body.hud-edit .hud-right { z-index: 65; }
.hud-edit-tag { position: absolute; z-index: 66; pointer-events: none; background: #ffd54f; color: #3a2605; font: 800 11px var(--font); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }

/* ---------- phones and tablets (mobile.js: body.m-ui) ---------- */
body.m-ui { --slot: calc(44px * var(--hb, 1)); --joyS: var(--joy, 112px); }
/* character card: compact, top left */
body.m-ui .hud-card { left: calc(6px + var(--sa-l)); top: calc(6px + var(--sa-t)); width: 196px; padding: 3px 6px 3px 3px; gap: 6px; border-radius: 10px; }
body.m-ui .portrait { width: 40px; height: 40px; border-radius: 8px; }
body.m-ui .hud-name { font-size: 12px; }
body.m-ui .hud-card .bar { height: 11px; } body.m-ui .hud-card .bar span { font-size: 9px; line-height: 11px; }
body.m-ui .hud-info { gap: 2px; }
body.m-ui .hud-card .exp-row { font-size: 9px; line-height: 10px; } body.m-ui .hud-card .bar.mini { height: 5px; }
/* the right column: minimap, quest tracker, party (stacked, never on top of each other) */
.hud-right { display: flex; position: absolute; top: 10px; right: 10px; z-index: 5; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; max-height: calc(100% - 150px - var(--safe-b)); }
.hud-right > * { pointer-events: auto; }
.hud-right > .minimap { position: relative; top: auto; right: auto; flex: none; }
#hudRight > #quest { position: relative; top: auto; right: auto; margin-top: 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; } /* (the old World Boss "move down 30px" is not needed in a column) */
.hud-right > .hud-moved { position: fixed !important; }
body.m-ui .hud-right { display: flex; position: absolute; top: calc(6px + var(--sa-t)); right: calc(6px + var(--sa-r)); z-index: 5; flex-direction: column; align-items: flex-end; gap: 5px; pointer-events: none; max-height: calc(100% - 200px - var(--safe-b)); }
body.m-ui .hud-right > * { pointer-events: auto; }
body.m-ui .hud-right > .minimap { position: relative; top: auto; right: auto; padding: 3px; border-radius: 10px; width: calc(var(--mm-w, 96px) + 10px); }
body.m-ui.hud-mm-off .hud-right > .minimap { width: 110px; }
body.m-ui .minimap canvas { width: var(--mm-w, 96px); height: var(--mm-h, 72px); border-radius: 6px; }
body.m-ui .mm-foot { font-size: 10px; gap: 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; }
body.m-ui .mm-foot .pill.ch { padding: 0 5px; font-size: 9px; }
body.m-ui .mm-foot #mmPos { display: none; }
body.m-ui .mm-fold { display: block; position: absolute; left: -6px; top: -6px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #c9a24f; background: #1a2446; color: #fff; font: 900 16px/1 var(--font); padding: 0; }
body.m-ui .mm-fold::before { content: ''; position: absolute; inset: -8px; } /* a bigger finger target than it looks */
body.m-ui .minimap .wb-pill, body.m-ui .minimap .eg-hud { margin-top: 3px; padding: 3px 6px; min-height: 34px; font-size: 10px; }
body.m-ui #game.wb-on .quest { margin-top: 0; }
body.m-ui .hud-right > .quest { position: relative; top: auto; right: auto; left: auto; display: block; width: min(176px, 46vw); z-index: 5; max-height: 46vh; overflow-y: auto; }
body.m-ui .hud-right > .quest:not(.qmin) { width: min(240px, 64vw); }
body.m-ui #hudRight > #quest { min-height: 36px; } /* a short screen: the party list scrolls first, the quest keeps its first line */
body.m-ui .quest .q { font-size: 11px; padding: 5px 8px; border-radius: 9px; }
body.m-ui .quest .q b { font-size: 12px; }
body.m-ui .quest .q-go { padding: 3px 8px; min-height: 32px; font-size: 11px; }
body.m-ui .quest .q-fold { width: 32px; height: 32px; font-size: 16px; }
body.m-ui .quest.qmin .q:first-child { padding: 2px 6px; }
body.m-ui .quest-btn { display: none !important; }
body.m-ui .hud-right > .party-hud { min-height: 34px; flex-shrink: 3; overflow-y: auto; overscroll-behavior: contain; position: relative; top: auto !important; right: auto; left: auto !important; bottom: auto !important; width: 136px; max-height: 30vh; }
/* the menu dock: a short column under the character card (the 5 buttons you pin + ☰ for everything) */
body.m-ui .menu { top: calc(72px + var(--sa-t)); left: calc(6px + var(--sa-l)); bottom: auto; right: auto; transform: none; margin: 0; flex-direction: column; flex-wrap: nowrap; width: auto; max-width: none; padding: 2px; gap: 2px; border-radius: 12px; overflow: visible; background: rgba(20,26,50,.5); }
body.m-ui .menu button { min-width: 42px; width: 42px; min-height: 42px; padding: 2px 0 1px; border-radius: 9px; justify-content: center; }
body.m-ui .menu .ico { font-size: 20px; } body.m-ui .menu .ico img { width: 24px; height: 24px; }
body.m-ui .menu em { font-size: 9px; max-width: 42px; letter-spacing: -.2px; }
body.m-ui .menu .badge { top: -2px; right: -2px; }
/* buffs, target, travel: in the free strip right of the dock */
body.m-ui .buff-row { left: calc(56px + var(--sa-l)); top: calc(72px + var(--sa-t)); max-width: calc(100vw - 58px - var(--mm-w, 96px) - 30px); gap: 3px; }
body.m-ui .bf { width: 26px; height: 26px; } body.m-ui .bf img, body.m-ui .bf canvas { width: 18px; height: 18px; }
body.m-ui .target { top: calc(102px + var(--sa-t)); left: calc(56px + var(--sa-l)); transform: none; min-width: 0; width: min(190px, calc(100vw - 58px - var(--mm-w, 96px) - 30px)); padding: 3px 7px; font-size: 11px; }
@media (orientation: portrait) { body.m-ui .target #tInfo { display: none !important; } }
body.m-ui .target #tInfo { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
body.m-ui .travel-pill { top: calc(140px + var(--sa-t)); left: calc(58px + var(--sa-l)); transform: none; max-width: calc(100vw - 58px - var(--mm-w, 96px) - 30px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; min-height: 36px; }
body.m-ui .raid-bar { top: calc(176px + var(--sa-t)); width: min(300px, 62vw); }
body.m-ui .toast-box { top: calc(40% - 40px); width: calc(100vw - 24px); }
body.m-ui .toast { max-width: 100%; text-align: center; }
body.m-ui .ach-toasts { bottom: auto; top: calc(22% + var(--sa-t)); }
/* joystick: bottom left (right when left-handed); the zone around the ring catches a thumb that lands a bit off */
body.m-ui .joy { display: block; left: calc(10px + var(--sa-l)); bottom: calc(10px + var(--safe-b)); width: var(--joyS); height: var(--joyS); opacity: .7; transition: opacity .15s; }
body.m-ui .joy.on { opacity: 1; }
body.m-ui .joy-knob { left: 50%; top: 50%; width: calc(var(--joyS) * .4); height: calc(var(--joyS) * .4); margin: calc(var(--joyS) * -.2) 0 0 calc(var(--joyS) * -.2); }
.joy-zone { position: absolute; inset: -22%; border-radius: 30%; }
/* actions: the hotbar (5 slots + ⇅ page, or all 10), Autopilot and Attack in thumb reach, bottom right */
body.m-ui .actions { right: calc(8px + var(--sa-r)); bottom: calc(8px + var(--safe-b)); display: grid; grid-template-columns: auto auto; grid-template-areas: ". mt" "hb ai" "hb at"; gap: 6px 8px; align-items: end; justify-items: center; flex-direction: unset; }
body.m-ui .actions .hotbar { grid-area: hb; align-self: end; }
body.m-ui .mount-btn { grid-area: mt; width: calc(44px * var(--hb, 1)); height: calc(44px * var(--hb, 1)); font-size: 20px; }
body.m-ui .auto-btn { grid-area: ai; width: calc(58px * var(--hb, 1)); height: calc(58px * var(--hb, 1)); font-size: 15px; }
body.m-ui .atk-btn { grid-area: at; display: block; width: calc(76px * var(--hb, 1)); height: calc(76px * var(--hb, 1)); font-size: calc(32px * var(--hb, 1)); }
body.m-ui .hotbar { grid-template-columns: repeat(3, var(--slot)); gap: 5px; }
body.m-ui .hotbar .slot { width: var(--slot); height: var(--slot); border-radius: 10px; }
body.m-ui .hotbar .slot canvas, body.m-ui .hotbar .slot img { width: calc(var(--slot) * .7); height: calc(var(--slot) * .7); }
/* phones, 5 at a time: four pages (data-pg 0-3: 1-5, 6-0, bar 2 1-5, bar 2 6-0), the ⇅ button pages; the 1/2 tab only with 10 at a time */
body.m-ui:not(.hud-hb-all) .hotbar .slot.slot { display: none; }
body.m-ui:not(.hud-hb-all) .hotbar[data-pg="0"] .slot.slot:nth-child(-n+5),
body.m-ui:not(.hud-hb-all) .hotbar[data-pg="1"] .slot.slot:nth-child(n+6):nth-child(-n+10),
body.m-ui:not(.hud-hb-all) .hotbar[data-pg="2"] .slot.slot:nth-child(n+11):nth-child(-n+15),
body.m-ui:not(.hud-hb-all) .hotbar[data-pg="3"] .slot.slot:nth-child(n+16):nth-child(-n+20) { display: flex; }
body.m-ui:not(.hud-hb-all) .hb-bar { display: none; }
body.m-ui .hb-bar { grid-area: tb; align-self: end; width: var(--slot); height: var(--slot); min-height: 0; flex-direction: row; gap: 4px; border-radius: 10px; } body.m-ui .hb-bar b { font-size: 16px; }
body.m-ui .hb-page.on2 { border-color: #ffd66b; border-style: solid; background: rgba(70,52,16,.85); }
body.m-ui .hb-page { display: flex; flex-direction: column; align-items: center; justify-content: center; width: var(--slot); height: var(--slot); border-radius: 10px; border: 2px dashed #6a7bb2; background: rgba(20,26,50,.6); color: #fff; padding: 0; font-weight: 900; line-height: 1; }
body.m-ui .hb-page span { font-size: 16px; } body.m-ui .hb-page small { font-size: 11px; opacity: .9; margin-top: 2px; }
body.m-ui.hud-hb-all .hotbar { grid-template-columns: repeat(5, var(--slot)); }
body.m-ui.hud-hb-all .hb-page { display: none; }
body.m-ui.hud-lefty .joy { left: auto; right: calc(10px + var(--sa-r)); }
body.m-ui.hud-lefty .actions { right: auto; left: calc(8px + var(--sa-l)); grid-template-areas: "mt ." "ai hb" "at hb"; }
/* 10 at a time: the 1/2 tab sits left of AI in the bottom row (no extra height or width); tight gaps on 360px phones keep it off the joystick */
body.m-ui.hud-hb-all .actions { grid-template-columns: auto auto auto; grid-template-areas: ". . mt" "hb hb hb" "tb ai at"; }
@media (max-width: 379px) { body.m-ui.hud-hb-all .hotbar { gap: 2px; } }
body.m-ui.hud-hb-all .actions .hotbar { justify-self: end; }
body.m-ui.hud-hb-all.hud-lefty .actions { grid-template-areas: "mt . ." "hb hb hb" "at ai tb"; }
body.m-ui.hud-hb-all.hud-lefty .actions .hotbar { justify-self: start; }
/* phones on their side, 10 at a time: AI and Attack beside the slots (not under them), the 1/2 tab between, so the cluster stays low */
@media (orientation: landscape) {
  body.m-ui.hud-hb-all .actions { grid-template-areas: ". . mt" "hb tb ai" "hb tb at"; }
  body.m-ui.hud-hb-all.hud-lefty .actions { grid-template-areas: "mt . ." "ai tb hb" "at tb hb"; }
  body.m-ui.hud-hb-all .actions .hb-bar { align-self: stretch; height: auto; flex-direction: column; }
  body.m-ui.hud-hb-all .actions .hotbar { align-self: end; }
  body.m-ui.hud-hb-all.hud-lefty .chat { left: calc(var(--hb, 1) * 384px + 16px + var(--sa-l)); bottom: calc(6px + var(--safe-b)); }
}
/* chat: folded into a 💬 bubble with an unread count by default; open, it sits above the joystick */
body.m-ui .chat { top: auto; left: calc(6px + var(--sa-l)); bottom: calc(var(--joyS) + 24px + var(--safe-b)); width: min(320px, calc(100vw - 140px)); background: rgba(16,22,44,var(--chat-a,.55)); }
body.m-ui.hud-lefty .chat { bottom: calc(var(--hb, 1) * 150px + 22px + var(--safe-b)); }
@media (orientation: portrait) { body.m-ui.hud-hb-all .chat { bottom: calc(max(var(--joyS) + 24px, var(--hb, 1) * 186px + 22px) + var(--safe-b)); } } /* 10 at a time: the open chat clears the two rows of slots on its right too */
@media (orientation: portrait) { body.m-ui.hud-lefty.hud-hb-all .chat { bottom: calc(var(--hb, 1) * 186px + 22px + var(--safe-b)); } } /* 10 at a time: the cluster is two rows of slots tall */
body.m-ui .chat-tabs button { min-height: 32px; padding: 4px 8px; font-size: 11px; }
body.m-ui .chat-tabs { scrollbar-width: none; } body.m-ui .chat-tabs::-webkit-scrollbar { display: none; }
body.m-ui .chat-log { height: 72px; }
body.m-ui .chat-in select, body.m-ui .chat-in input { min-height: 38px; font-size: 16px; } /* 16px: iOS does not zoom the page on focus */
body.m-ui .chat-in select { font-size: 13px; }
body.m-ui .chat.min { background: rgba(16,22,44,.75); border-radius: 22px; }
body.m-ui .chat.min .chat-tabs { padding: 2px; }
body.m-ui .chat.min .chat-min { min-width: 44px; min-height: 40px; position: relative; }
.chat-unread { top: -4px; right: -4px; font-size: 10px; }
.chat:not(.min) .chat-unread { display: none; }
body.m-ui.chat-typing .chat { top: calc(4px + var(--sa-t)) !important; bottom: auto !important; left: calc(4px + var(--sa-l)) !important; right: auto !important; width: calc(100vw - 8px) !important; z-index: 60; background: rgba(16,22,44,.94); }
/* windows: tablets keep floating windows with bigger buttons; phones get near full-screen sheets (swipe the title down to close) */
body.m-ui .panel-head .x { width: 40px; height: 40px; font-size: 16px; }
body.m-ui .panel-head { padding: 6px 8px 6px 12px; }
body.m-ui .panel-tabs button, body.m-ui .panel .btn.small { min-height: 34px; }
body.m-ui .panel-grip { display: none; }
body.m-ui .panel { top: calc(8px + var(--sa-t)); max-height: calc(100% - 16px - var(--sa-t) - var(--safe-b)); }
body.m-phone .panel { left: 0 !important; right: 0 !important; top: calc(6px + var(--sa-t)) !important; bottom: 0 !important; width: auto !important; max-width: none !important; height: auto !important; max-height: none !important; transform: none !important; margin: 0 auto; border-radius: 16px 16px 0 0; border-bottom: 0; animation: sheetIn .18s ease-out; }
body.m-phone .panel-head { cursor: grab; touch-action: none; position: relative; border-radius: 13px 13px 0 0; }
body.m-phone .panel-head::before { content: ''; position: absolute; left: 50%; top: 3px; width: 36px; height: 4px; margin-left: -18px; border-radius: 3px; background: rgba(255,255,255,.35); }
body.m-phone .panel-body { padding-bottom: calc(14px + var(--safe-b)); overscroll-behavior: contain; }
@keyframes sheetIn { from { translate: 0 40px; opacity: .3; } }
body.m-ui .m-sheet { z-index: 45; }

/* ---------- phones in landscape: dock along the top, chat in the bottom middle ---------- */
@media (orientation: landscape) {
  body.m-ui .menu { top: calc(4px + var(--sa-t)); left: calc(212px + var(--sa-l)); flex-direction: row; transform: none; }
  body.m-ui .menu button { width: auto; min-width: 46px; min-height: 44px; padding: 2px 3px; }
  body.m-ui .buff-row { left: calc(6px + var(--sa-l)); top: calc(62px + var(--sa-t)); max-width: 200px; }
  body.m-ui .target { left: 50%; transform: translateX(-50%); top: calc(56px + var(--sa-t)); width: 220px; }
  body.m-ui .travel-pill { left: 50%; transform: translateX(-50%); top: calc(96px + var(--sa-t)); max-width: 44vw; }
  body.m-ui .raid-bar { top: calc(96px + var(--sa-t)); }
  body.m-ui .chat { left: calc(var(--joyS) + 26px + var(--sa-l)); bottom: calc(6px + var(--safe-b)); width: min(380px, calc(100vw - var(--joyS) - 290px)); }
  body.m-ui.hud-lefty .chat { left: calc(250px + var(--sa-l)); bottom: calc(6px + var(--safe-b)); }
  body.m-ui .chat-log { height: 56px; }
  body.m-ui .hud-right { max-height: calc(100% - 170px - var(--safe-b)); }
  body.m-ui .hud-right > .quest { max-height: 40vh; }
  body.m-ui .ach-toasts { top: calc(18% + var(--sa-t)); }
  body.m-phone .panel { width: min(720px, 100%) !important; top: calc(4px + var(--sa-t)) !important; }
}
@media (orientation: landscape) and (max-height: 500px) { body.m-ui .menu em { display: none; } body.m-ui .menu button { min-width: 44px; } }
@media (orientation: landscape) and (max-width: 700px) { body.m-ui .menu { left: calc(206px + var(--sa-l)); } body.m-ui .menu button { min-width: 40px; } }
body.m-ui .quest.show { z-index: 5; }
/* narrow windows: nothing wider than the window (Battle Pass rewards, long selects) */
.panel-body select, .panel-body input:not([type=checkbox]):not([type=radio]):not([type=range]) { max-width: 100%; }
@media (max-width: 560px) { .bp-exes { grid-template-columns: repeat(2, 1fr); } .bp-missions { grid-template-columns: 1fr; } }
/* desktop: when the menu wraps to two rows, the target frame sits under it */
@media (min-width: 821px) and (max-width: 1600px) and (pointer: fine) { body:not(.m-ui) .target { top: 128px; } }

/* the menu and the character card always stay on top of moved HUD parts (the joystick could cover the menu) */
body.m-ui .menu, body.m-ui .hud-card { z-index: 8; }

/* Options → Notifications (notify.js). Compact: one-line rows at the very top edge, never over the middle; they fade
   by themselves (opacity/transform only: no layout work while they animate) */
.n-strip { position: fixed; top: calc(var(--sa-t, 0px) + 2px); left: 50%; transform: translateX(-50%); z-index: 34; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; max-width: calc(100vw - 16px); contain: layout style; }
.n-row { max-width: min(560px, calc(100vw - 16px)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 800 11px/16px var(--font); color: #fff6dc; background: rgba(18,14,34,.78); border: 1px solid rgba(255,214,107,.45); border-radius: 8px; padding: 0 9px; text-shadow: 0 1px 1px #000; animation: nFade 2.5s linear forwards; will-change: opacity; }
.n-row.n-boss, .n-row.n-mvp { border-color: #ff8a65; color: #ffe2b8; }
.n-row.n-ach, .n-row.n-level { border-color: #f2c14e; }
.n-row.n-team { border-color: #8fb8ff; }
.n-row.bad, .n-row.n-crit { border-color: #ff6b6b; color: #ffd6d6; }
.n-row.more { color: #d8cfb8; border-style: dashed; }
@keyframes nFade { 0% { opacity: 0; transform: translateY(-4px); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
.toast.more { font-size: 12px; padding: 3px 12px; opacity: .9; }
.n-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed rgba(0,0,0,.12); }
.n-opt:last-child { border-bottom: 0; }
.n-lbl { min-width: 0; } .n-lbl b { display: block; font-size: 13px; } .n-lbl small { display: block; font-size: 11px; line-height: 1.25; }
.n-seg { display: flex; gap: 3px; flex-shrink: 0; } .n-seg .btn { padding: 3px 7px; min-width: 0; }
.n-seg .btn[disabled] { opacity: .35; }
@media (max-width: 480px) { .n-opt { gap: 6px; } .n-lbl b { font-size: 12px; } .n-lbl small { font-size: 10px; } .n-seg { gap: 2px; } .n-seg .btn { padding: 2px 5px; font-size: 11px; } }
/* Gold Shop: a limited collection on sale (ui.js cash) — banner with the time left and a try-on mirror */
.limited-banner { display: flex; gap: 12px; align-items: center; margin: 6px 0 10px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--lb, #ffd54f); background: linear-gradient(110deg, rgba(59, 37, 82, .92), rgba(120, 40, 20, .85)); color: #fff4e0; }
.limited-banner .lb-stage { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.limited-banner .lb-mirror { width: 64px; height: 84px; image-rendering: pixelated; cursor: pointer; background: radial-gradient(ellipse at 50% 70%, rgba(255, 210, 140, .35), transparent 70%); border-radius: 8px; }
.limited-banner .lb-stage small { font-size: 10px; opacity: .85; max-width: 90px; text-align: center; }
.limited-banner .lb-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.limited-banner .lb-text b { font-size: 16px; color: var(--lb, #ffd54f); text-shadow: 0 1px 2px #0008; }
.limited-banner .lb-text .limited { margin-left: 0; align-self: flex-start; }
.limited-banner .lb-text small { font-size: 12px; opacity: .9; }
.btn.small.ghost.on { outline: 2px solid var(--lb, #ff8a2a); }

/* Money history (Options > Money history): one line per move, two rows on phones too */
.mh-list { display: flex; flex-direction: column; gap: 4px; }
.mh-row { background: #00000012; border-radius: 6px; padding: 6px 8px; }
.mh-row.open { outline: 1px dashed #ffd54f66; }
.mh-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mh-what { min-width: 0; overflow-wrap: anywhere; }
.mh-amt { white-space: nowrap; }
.mh-amt.mh-in { color: #2e9e4f; } .mh-amt.mh-out { color: #d84b3f; }
.mh-sub { font-size: 11px; margin-top: 2px; overflow-wrap: anywhere; }
.mh-so { color: #a86b00; }
.mh-pages { justify-content: center; align-items: center; gap: 10px; margin-top: 8px; }
.gx-quote { min-height: 1.2em; color: #a86b00; font-weight: 700; }
.gx-confirm { text-align: left; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.gx-confirm .warn { color: #ffb74d; }
.gx-confirm .gx-fills { color: var(--green); font-weight: 800; }
/* the Banker (treasury desk) vs players in the Gold Exchange book, and the Banker's release line (v1.12) */
.book .gx-who { font-size: 11px; opacity: .8; white-space: nowrap; }
.book tr.desk td { background: rgba(255, 213, 79, .12); }
.book tr.desk .gx-who { color: #a86b00; opacity: 1; font-weight: 800; }
.banker-box { padding: 6px 8px; border: 1px solid rgba(255, 213, 79, .35); border-radius: 8px; background: rgba(255, 213, 79, .06); }
.banker-line { font-size: 13px; }
.banker-why { color: #b54708; font-size: 12px; margin-top: 2px; font-weight: 700; }
/* party HUD: open the Party window / leave, right in the header (works folded too) */
.ph-btn { flex: none; min-width: 26px; height: 24px; padding: 0 5px; border-radius: 7px; border: 1px solid #ffffff40; background: #0005; color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }
.ph-btn:hover { background: #ffffff22; } .ph-btn.leave:hover { background: #c62828; }
.ph-head > span { white-space: nowrap; }
@media (max-width: 820px) { .party-hud .ph-head { gap: 3px; } .party-hud .ph-exp { display: none; } .party-hud .ph-btn { min-width: 22px; height: 22px; padding: 0 2px; font-size: 12px; } .party-hud .ph-head > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; } }

/* storage: how much of a stack a click moves (All / Half / Amount) */
.st-move { display: flex; gap: 6px; align-items: center; margin: 4px 0 8px; flex-wrap: wrap; }
/* Master Aldric: change class for Gold (ui.js classChangeUi) */
.cc-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: #f3ecff; border: 2px solid #b9a3e3; border-radius: 12px; padding: 8px 10px; margin: 0 0 10px; }
.cc-row b { font-family: var(--font-px); color: var(--navy); }
.cc-row p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.cc-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.cc-head b { font-family: var(--font-px); font-size: 16px; color: var(--navy); }
.cc-head .wallet { margin-left: auto; }
.cc-err { margin: 0 0 8px; color: #b3261e; font-weight: 700; }
.cc-filter { width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 6px 8px; border: 2px solid var(--parch3); border-radius: 8px; }
.cc-line { font-size: 11px !important; color: #7a5cc0 !important; }
@media (max-width: 520px) { .cc-row { grid-template-columns: 1fr; } }
.char-slot .rn { display: block; margin-top: 4px; font-size: 11px; padding: 3px 8px; } /* v1.14.5 free name change after a GM rename */
