/* ============ NỮ SINH LOẠN CHIẾN ============ */
:root {
  --gold: #ffd23f; --gold2: #ffb300; --ink: #0d0f1a; --panel: rgba(16, 19, 34, .94); --line: rgba(255, 210, 63, .35);
  --txt: #f4f1e8; --dim: #9aa3b8; --red: #ff4b4b; --green: #6fe36f; --blue: #4fb6ff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #05060b; overflow: hidden; font-family: 'Baloo 2', 'Segoe UI', Arial, sans-serif; color: var(--txt); user-select: none; -webkit-user-select: none; touch-action: none; }
#stage { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; transform-origin: 50% 50%; overflow: hidden; background: #0d0f1a; }
#canvasHost, #canvasHost canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#fxOverlay, #ui { position: absolute; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui > #hud, #ui > #toasts, #ui > #fade, #ui > #panelHost, #ui > #modalHost, #ui > #storyHost, #ui > #loadMsg { pointer-events: none; }
#hud > *, #panelHost > *, #modalHost > *, #storyHost > * { pointer-events: auto; }
.hide { display: none !important; }
img { -webkit-user-drag: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }


/* ---------- loading ---------- */
#loading { position: absolute; inset: 0; z-index: 50; background: radial-gradient(ellipse at center, #232845 0%, #0b0d17 70%); display: flex; align-items: center; justify-content: center; transition: opacity .5s; }
#loading.hide { opacity: 0; pointer-events: none; display: flex !important; }
.ld-box { text-align: center; }
.ld-cat { width: 150px; animation: bob 1.2s ease-in-out infinite; }
.ld-title { font-size: 52px; font-weight: 800; color: var(--gold); text-shadow: 0 4px 0 #6b3a00, 0 0 24px rgba(255, 180, 0, .5); letter-spacing: 2px; }
.ld-bar { width: 520px; height: 18px; border-radius: 9px; background: #000; border: 2px solid var(--gold); margin: 18px auto 8px; overflow: hidden; }
.ld-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff7a00, var(--gold)); transition: width .2s; }
.ld-text { color: var(--dim); font-size: 18px; }
@keyframes bob { 50% { transform: translateY(-10px); } }

/* ---------- title ---------- */
#title { position: absolute; inset: 0; z-index: 40; overflow: hidden; }
.t-bg { position: absolute; inset: -20px; background: url(../assets/bg/ashram_background.png) center 30%/cover; filter: brightness(.55) saturate(1.2); animation: pan 30s linear infinite alternate; }
@keyframes pan { to { transform: translateX(-60px) scale(1.05); } }
#title::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 6, 12, .88) 0%, rgba(5, 6, 12, .45) 45%, rgba(5, 6, 12, 0) 70%); pointer-events: none; }
.t-hero { position: absolute; right: 30px; bottom: -10px; z-index: 2; animation: heroIn .9s ease-out both; }
.t-hero img { height: 640px; filter: drop-shadow(0 0 30px rgba(255, 50, 50, .45)); }
@keyframes heroIn { from { transform: translateX(120px); opacity: 0; } }
.t-logo { position: absolute; left: 80px; top: 70px; z-index: 3; transform: rotate(-4deg); }
.t-l1 { font-size: 64px; font-weight: 800; color: #fff; line-height: .9; text-shadow: 0 5px 0 #b3001b, 0 0 30px rgba(255, 0, 60, .5); }
.t-l2 { font-size: 96px; font-weight: 800; color: var(--gold); line-height: .95; text-shadow: 0 6px 0 #7a3a00, 4px 10px 0 #000; letter-spacing: 2px; }
.t-sub { margin-top: 10px; font-size: 20px; color: #ffe9b0; background: rgba(0, 0, 0, .55); display: inline-block; padding: 2px 14px; border-left: 4px solid var(--gold); }
.t-box { position: absolute; left: 90px; top: 380px; z-index: 3; width: 440px; display: flex; flex-direction: column; gap: 14px; }
.t-new { display: flex; gap: 10px; }
.t-new input { flex: 1; font-size: 20px; padding: 10px 14px; border-radius: 8px; border: 2px solid var(--gold); background: rgba(0, 0, 0, .7); color: #fff; outline: none; }
.t-tip { color: #bfc6da; font-size: 15px; }

/* ---------- buttons ---------- */
.btn { position: relative; border: 2px solid #4a5170; background: linear-gradient(#2c3352, #1a1f36); color: #fff; font-weight: 700; font-size: 17px; padding: 6px 16px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .08s, filter .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.2); } .btn:active { transform: scale(.95); }
.btn img { height: 22px; }
.btn.gold { background: linear-gradient(#ffe36a, #ffae00); color: #3a1d00; border-color: #fff3b0; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); box-shadow: 0 3px 0 #8a4f00; }
.btn.red { background: linear-gradient(#ff6b6b, #c41d1d); border-color: #ffb0b0; }
.btn.big { font-size: 24px; padding: 10px 28px; }
.btn.big small { font-size: 15px; opacity: .8; margin-left: 6px; }
.btn.sm { font-size: 15px; padding: 3px 10px; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.dis { filter: grayscale(1) brightness(.7); pointer-events: none; }
.pill { position: absolute; border: 2px solid rgba(255, 255, 255, .25); background: rgba(10, 14, 30, .75); color: #fff; font-weight: 700; font-size: 16px; padding: 4px 14px; border-radius: 20px; }
.pill.red { border-color: #ff8a8a; color: #ffd0d0; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; }
#hudTL { position: absolute; left: 10px; top: 8px; display: flex; align-items: center; gap: 8px; }
.av-wrap { position: relative; width: 82px; height: 82px; cursor: pointer; }
.av { width: 82px; height: 82px; border-radius: 50%; border: 3px solid var(--gold); object-fit: cover; object-position: top; background: #2a2f4a; box-shadow: 0 0 0 3px #000, 0 4px 10px rgba(0, 0, 0, .6); }
.lvbadge { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); background: #000; color: var(--gold); font-weight: 800; font-size: 16px; padding: 0 9px; border-radius: 10px; border: 2px solid var(--gold); }
.hud-info { width: 300px; }
.hud-name { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 19px; text-shadow: 0 2px 0 #000; }
.power { display: flex; align-items: center; gap: 3px; color: #ffcf6a; font-size: 17px; } .power img { height: 22px; }
.bar { position: relative; height: 18px; background: rgba(0, 0, 0, .75); border: 2px solid #000; border-radius: 4px; overflow: hidden; margin-top: 3px; transform: skewX(-12deg); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .15s; }
.bar.hp i { background: linear-gradient(#ff8080, #e41e1e 60%, #a00); }
.bar.xp { height: 11px; } .bar.xp i { background: linear-gradient(#a6f0ff, #22a8e0); }
.bar span { position: absolute; inset: 0; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 2px #000; transform: skewX(12deg); line-height: 1; }
.bar.xp span { font-size: 10px; }
#hudTC { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); text-align: center; }
#zoneName { font-size: 22px; font-weight: 800; color: #fff; text-shadow: 0 2px 0 #000, 0 0 8px #000; }
#zoneSub { font-size: 15px; color: var(--gold); text-shadow: 0 1px 2px #000; }
#hudTR { position: absolute; right: 10px; top: 8px; display: flex; gap: 6px; }
.cur { display: flex; align-items: center; gap: 4px; background: rgba(0, 0, 0, .65); border: 1px solid rgba(255, 255, 255, .15); border-radius: 16px; padding: 1px 12px 1px 4px; font-size: 16px; }
.cur img { height: 26px; }
#menuBar { position: absolute; right: 8px; top: 46px; display: grid; grid-template-columns: repeat(6, 62px); gap: 4px; }
.mbtn { position: relative; width: 62px; height: 62px; border: 2px solid rgba(255, 210, 63, .5); border-radius: 12px; background: linear-gradient(rgba(40, 46, 78, .9), rgba(14, 17, 32, .92)); color: #fff; padding: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mbtn img { height: 34px; max-width: 46px; object-fit: contain; filter: drop-shadow(0 2px 2px #000); }
.mbtn span { font-size: 12px; font-weight: 700; line-height: 1; margin-top: 2px; text-shadow: 0 1px 1px #000; }
.mbtn:hover { border-color: var(--gold); transform: translateY(-1px); }
.dot { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: #ff2b2b; border: 2px solid #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.25); } }

.qt { background: linear-gradient(90deg, rgba(8, 10, 22, .85), rgba(8, 10, 22, .45)); border-left: 4px solid var(--gold); padding: 5px 10px; border-radius: 0 8px 8px 0; cursor: pointer; transition: background .15s; }
.qt:hover { background: linear-gradient(90deg, rgba(40, 34, 10, .9), rgba(8, 10, 22, .5)); }
.qt.ready { border-left-color: var(--green); box-shadow: inset 0 0 12px rgba(111, 227, 111, .25); }
.qt.side { border-left-color: #ff8a3a; } .qt.daily { border-left-color: var(--blue); }
.qt-h { font-weight: 800; font-size: 16px; line-height: 1.2; }
.qt-d { font-size: 14px; color: #d6dbe8; line-height: 1.25; }
.qt-d b { color: var(--gold); } .qt-d u { color: var(--green); text-decoration: none; }
.qt-go { font-size: 12px; color: var(--gold); opacity: .9; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; background: var(--gold); color: #000; border-radius: 4px; padding: 0 5px; margin-right: 6px; vertical-align: 2px; }
.tag.side { background: #ff8a3a; } .tag.daily { background: var(--blue); } .tag.ult { background: #ff3b5c; color: #fff; }

.tog { position: relative; width: 170px; height: 46px; border: none; background: none; padding: 0; color: #fff; text-align: left; }
.tog img { position: absolute; inset: 0; width: 100%; height: 100%; }
.tog span { position: relative; z-index: 1; margin-left: 54px; font-weight: 800; font-size: 15px; text-shadow: 0 1px 2px #000; }
.tog small { color: var(--dim); }
.tog.on span { color: var(--gold); }
.tog.on { filter: drop-shadow(0 0 8px rgba(255, 210, 63, .8)); animation: glow 1.4s infinite; }
@keyframes glow { 50% { filter: drop-shadow(0 0 2px rgba(255, 210, 63, .4)); } }
#btnTown { left: 300px; top: 14px; } #btnExit { left: 300px; top: 14px; }
#goArrow { position: absolute; right: 60px; top: 300px; display: flex; align-items: center; gap: 6px; animation: go .7s infinite; }
#goArrow img { height: 70px; } .go-b { position: relative; } .go-b b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; color: #2a1600; transform: skewX(-10deg); } #goArrow span { font-size: 46px; font-weight: 800; color: var(--gold); text-shadow: 0 3px 0 #000; }
@keyframes go { 50% { transform: translateX(16px); } }
#talkBtn { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); background: linear-gradient(#ffe36a, #ffae00); color: #3a1d00; font-weight: 800; font-size: 17px; padding: 5px 16px; border-radius: 22px; border: 2px solid #fff3b0; box-shadow: 0 3px 0 #8a4f00, 0 0 14px rgba(255, 200, 0, .45); cursor: pointer; white-space: nowrap; z-index: 3; }
#talkBtn::after { content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 7px solid transparent; border-top-color: #ffae00; border-bottom: 0; }
#talkBtn small { background: #000; color: var(--gold); border-radius: 5px; padding: 0 6px; margin-left: 8px; font-size: 14px; }
#bossBar { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); width: 560px; text-align: center; }
.bb-name { font-size: 22px; font-weight: 800; color: #ffdddd; text-shadow: 0 2px 0 #500, 0 0 10px #f00; }
.bb-name small { color: var(--gold); font-size: 16px; }
.bb-bar { position: relative; height: 22px; background: #000; border: 2px solid #ffb0b0; border-radius: 4px; overflow: hidden; transform: skewX(-15deg); box-shadow: 0 0 14px rgba(255, 0, 0, .5); }
.bb-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#ff5050, #b00000); z-index: 2; transition: width .1s; }
.bb-bar b { position: absolute; left: 0; top: 0; bottom: 0; background: #fff3b0; z-index: 1; }
.bb-bar span { position: absolute; inset: 0; z-index: 3; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; transform: skewX(15deg); text-shadow: 0 1px 2px #000; }

/* joystick */
#joy { position: absolute; left: 0; bottom: 0; width: 460px; height: 330px; }
#joyBase { position: absolute; left: 150px; top: 200px; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; background: url(../assets/ui/rockerBg.png) center/contain no-repeat; opacity: .55; }
#joyBase.on { opacity: .9; }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; background: url(../assets/ui/joystick.png) center/contain no-repeat; }

/* nút kỹ năng */
#ctrl { position: absolute; right: 0; bottom: 0; width: 420px; height: 330px; }
#ctrl.desk { transform: scale(.72); transform-origin: right bottom; opacity: .92; }
.sk { position: absolute; width: 80px; height: 80px; border-radius: 50%; cursor: pointer; touch-action: none; }
.sk > img:first-child { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); border-radius: 50%; object-fit: cover; border: 3px solid rgba(255, 255, 255, .7); box-shadow: 0 0 0 3px #000, 0 4px 10px rgba(0, 0, 0, .6); background: #222; }
.sk.down { transform: scale(.92); }
.sk .cd { position: absolute; inset: 6px; border-radius: 50%; pointer-events: none; }
.sk .cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; text-shadow: 0 2px 2px #000; pointer-events: none; }
.sk .key { position: absolute; right: 2px; bottom: 2px; background: #000; color: var(--gold); font-size: 12px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--gold); }
.sk .lockov { position: absolute; inset: 6px; border-radius: 50%; background: rgba(0, 0, 0, .75); display: none; flex-direction: column; align-items: center; justify-content: center; }
.sk .lockov img { height: 28px; } .sk .lockov small { font-size: 12px; color: var(--gold); }
.sk.locked .lockov { display: flex; }
.sk.atk { width: 136px; height: 136px; right: 34px; bottom: 30px; }
.sk.atk > img:first-child { border: none; box-shadow: 0 6px 14px rgba(0, 0, 0, .6); object-fit: contain; background: none; inset: 0; width: 100%; height: 100%; }
.sk.atk .atk-ic { position: absolute; left: 30%; top: 26%; width: 42%; filter: drop-shadow(0 2px 2px #000); }
.sk.s1 > img:first-child { background: radial-gradient(circle at 35% 30%, #ff8a8a, #b3001b 70%); }
.sk.s2 > img:first-child { background: radial-gradient(circle at 35% 30%, #9ee7ff, #1b5fb3 70%); }
.sk.s3 > img:first-child { background: radial-gradient(circle at 35% 30%, #d9a8ff, #5b1bb3 70%); }
.sk.s4 > img:first-child { background: radial-gradient(circle at 35% 30%, #ffd27a, #c25400 70%); }
.sk.dodge > img:first-child { background: radial-gradient(circle at 35% 30%, #a8ffb8, #1b8a3a 70%); }
.skic.c0 img { background: radial-gradient(circle at 35% 30%, #ff8a8a, #b3001b 70%); } .skic.c1 img { background: radial-gradient(circle at 35% 30%, #9ee7ff, #1b5fb3 70%); }
.skic.c2 img { background: radial-gradient(circle at 35% 30%, #d9a8ff, #5b1bb3 70%); } .skic.c3 img { background: radial-gradient(circle at 35% 30%, #ffd27a, #c25400 70%); } .skic.c4 img { background: radial-gradient(circle at 35% 30%, #ff5a7a, #600 70%); }
.sk.s1 { right: 180px; bottom: 28px; } .sk.s2 { right: 176px; bottom: 120px; } .sk.s3 { right: 112px; bottom: 192px; } .sk.s4 { right: 20px; bottom: 196px; }
.sk.dodge { width: 66px; height: 66px; right: 265px; bottom: 30px; }
.sk.pot { width: 62px; height: 62px; right: 270px; bottom: 112px; }
.sk.pot > img:first-child { object-fit: contain; padding: 6px; background: rgba(0, 0, 0, .6); }
.sk .cnt { position: absolute; left: -2px; bottom: -2px; background: #000; border: 1px solid #fff; border-radius: 8px; font-size: 13px; font-weight: 800; padding: 0 5px; }
.sk.ult { width: 96px; height: 96px; right: 200px; bottom: 214px; }
.sk.ult > img:first-child { border: none; box-shadow: none; object-fit: contain; background: none; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); filter: grayscale(.8) brightness(.7); }
.sk.ult.ready > img:first-child { filter: none; animation: pulse 0.8s infinite; }
.sk.ult svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(0, 0, 0, .7); stroke-width: 7; }
.ring { fill: none; stroke: #ff3b5c; stroke-width: 7; stroke-dasharray: 289; stroke-dashoffset: 289; stroke-linecap: round; transition: stroke-dashoffset .2s; }
.sk.ult.ready .ring { stroke: var(--gold); }

/* toast */
#toasts { position: absolute; right: 14px; top: 190px; width: 380px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.toast { background: rgba(8, 10, 22, .88); border-left: 4px solid var(--gold); padding: 5px 12px; border-radius: 6px; font-size: 16px; font-weight: 600; animation: tin .25s ease-out; transition: opacity .5s, transform .5s; display: flex; align-items: center; gap: 6px; max-width: 380px; }
.toast.out { opacity: 0; transform: translateX(30px); }
.toast.good { border-color: var(--green); } .toast.bad { border-color: var(--red); color: #ffd0d0; } .toast.quest { border-color: #ff8a3a; color: #ffe0b0; font-size: 18px; } .toast.dim { border-color: #556; color: #c8cede; font-size: 14px; } .toast.item { border-color: #c27bff; }
.toast .ti .ic { display: inline-flex; vertical-align: middle; }
@keyframes tin { from { opacity: 0; transform: translateX(40px); } }

/* fade & loading */
#fade { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity .25s; z-index: 30; }
#fade.on { opacity: 1; }
#loadMsg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 31; font-size: 22px; color: var(--gold); }

/* ---------- FX overlay ---------- */
.banner { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); animation: bannerIn 1.6s ease-out forwards; }
.banner img { height: 120px; }
.banner.shake img { animation: shk .12s infinite; height: 110px; }
@keyframes bannerIn { 0% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; } 12% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); } }
@keyframes shk { 25% { transform: translate(3px, -2px); } 75% { transform: translate(-3px, 2px); } }
.banner-text { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; animation: btIn 2s ease-out forwards; white-space: nowrap; }
.bt-main { font-size: 46px; font-weight: 800; color: #fff; text-shadow: 0 4px 0 #000, 0 0 16px rgba(0, 0, 0, .8); letter-spacing: 1px; }
.bt-sub { font-size: 22px; color: var(--gold); text-shadow: 0 2px 0 #000; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .7), transparent); padding: 0 60px; }
.banner-text.lvup .bt-main { color: var(--gold); font-size: 64px; text-shadow: 0 5px 0 #7a3a00, 0 0 30px rgba(255, 200, 0, .8); }
@keyframes btIn { 0% { opacity: 0; transform: translateX(-50%) translateY(20px); } 15% { opacity: 1; transform: translateX(-50%); } 80% { opacity: 1; } 100% { opacity: 0; } }
.flash { position: absolute; inset: 0; animation: flashA .25s ease-out forwards; }
@keyframes flashA { from { opacity: 1; } to { opacity: 0; } }
.cutin { position: absolute; inset: 0; animation: cutA 1.3s ease-out forwards; }
.cutin-bg { position: absolute; left: 0; right: 0; top: 200px; height: 260px; background: linear-gradient(90deg, rgba(120, 0, 10, .0), rgba(160, 0, 20, .92) 20%, rgba(20, 0, 0, .92) 80%, rgba(0, 0, 0, 0)); transform: skewY(-6deg); }
.cutin img { position: absolute; left: 300px; top: 140px; height: 380px; animation: cutImg 1.3s ease-out forwards; }
.cutin-name { position: absolute; left: 640px; top: 300px; font-size: 64px; font-weight: 800; color: #fff; text-shadow: 0 5px 0 #600, 0 0 20px #f00; transform: skewY(-6deg); animation: cutImg 1.3s .05s ease-out both; }
@keyframes cutA { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cutImg { from { transform: translateX(-200px); } 30% { transform: translateX(0); } to { transform: translateX(40px); } }

/* ---------- PANEL ---------- */
.panel-wrap { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; z-index: 20; animation: fin .15s; }
@keyframes fin { from { opacity: 0; } }
.panel { width: 1120px; height: 640px; background: var(--panel); border: 3px solid var(--gold); border-radius: 14px; box-shadow: 0 0 0 4px #000, 0 20px 50px rgba(0, 0, 0, .7); display: flex; flex-direction: column; overflow: hidden; animation: pin .2s ease-out; }
@keyframes pin { from { transform: scale(.92); } }
.p-head { display: flex; align-items: center; gap: 16px; padding: 8px 14px; background: linear-gradient(90deg, #2a1d00, #12162a 60%); border-bottom: 2px solid var(--line); }
.p-title { font-size: 28px; font-weight: 800; color: var(--gold); text-shadow: 0 2px 0 #000; transform: skewX(-8deg); }
.p-cur { display: flex; gap: 12px; margin-left: auto; font-size: 16px; }
.p-cur span { display: flex; align-items: center; gap: 3px; background: rgba(0, 0, 0, .5); padding: 0 10px 0 2px; border-radius: 12px; }
.p-cur img { height: 24px; }
.p-close { background: none; border: none; padding: 0; width: 44px; height: 44px; }
.p-close img { width: 100%; }
.m-close { position: absolute; right: -14px; top: -14px; z-index: 2; }
.p-body { flex: 1; overflow: auto; padding: 14px; }
.p-body::-webkit-scrollbar, .qlist::-webkit-scrollbar, .bag-grid::-webkit-scrollbar, .forge-l::-webkit-scrollbar { width: 8px; }
.p-body::-webkit-scrollbar-thumb, .qlist::-webkit-scrollbar-thumb, .bag-grid::-webkit-scrollbar-thumb, .forge-l::-webkit-scrollbar-thumb { background: #4a5170; border-radius: 4px; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; align-items: center; }
.tab { border: 2px solid #3c4363; background: #1a1f36; color: #cfd5e6; font-weight: 700; font-size: 16px; padding: 4px 16px; border-radius: 8px 8px 0 0; }
.tab.on { background: var(--gold); color: #2a1600; border-color: #fff3b0; }
.isec { font-weight: 800; color: var(--gold); font-size: 16px; margin: 10px 0 4px; border-bottom: 1px solid var(--line); }
.sl { display: flex; justify-content: space-between; font-size: 15px; padding: 1px 0; color: #d7dcea; }
.sl b { color: #fff; } .up { color: var(--green); font-style: normal; } .down { color: var(--red); } .no { color: var(--red); }
.hint { margin-top: 12px; font-size: 14px; color: var(--dim); background: rgba(255, 255, 255, .04); padding: 6px 10px; border-radius: 6px; }
.empty-msg { color: var(--dim); padding: 40px; text-align: center; grid-column: 1/-1; }
.center { text-align: center; margin-top: 14px; }
.maxed { color: var(--gold); font-weight: 800; }

/* icon item */
.ic { position: relative; background-size: 100% 100%; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; flex-shrink: 0; }
.ic img { max-width: 76%; max-height: 76%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.ic.empty { background: rgba(255, 255, 255, .05); border: 2px dashed #3c4363; cursor: default; }
.ic .ghost { opacity: .35; filter: grayscale(1); }
.ic .plus { position: absolute; right: 2px; top: 0; font-size: 13px; font-weight: 800; color: #7dff7d; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
.ic .ilv { position: absolute; left: 3px; bottom: 0; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }

/* nhân vật */
.char { display: grid; grid-template-columns: 110px 330px 110px 1fr; gap: 14px; height: 100%; }
.char-l { display: flex; flex-direction: column; justify-content: space-around; align-items: center; }
.eslot { text-align: center; } .eslot small { display: block; color: var(--dim); font-size: 13px; }
.char-c { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; background: radial-gradient(ellipse at 50% 70%, rgba(255, 210, 63, .18), transparent 65%); }
.char-img { height: 400px; max-width: 330px; object-fit: contain; filter: drop-shadow(0 6px 10px #000); }
.char-pow { position: absolute; top: 0; font-size: 18px; font-weight: 800; color: #ffcf6a; } .char-pow b { font-size: 30px; color: #fff; text-shadow: 0 0 10px #f80; }
.char-name { font-size: 22px; font-weight: 800; } .char-name small { color: var(--gold); }
.skins { display: flex; gap: 6px; margin-top: 6px; }
.char-r { background: rgba(0, 0, 0, .3); border-radius: 10px; padding: 4px 14px; overflow: auto; }

/* túi đồ */
.bag { display: flex; flex-direction: column; height: 100%; }
.bag-cnt { margin-left: auto; color: var(--dim); }
.bag-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, 78px); gap: 8px; align-content: start; padding: 4px; }
.bcell { position: relative; } .bcell.better::after { content: '▲'; position: absolute; right: 2px; bottom: 2px; color: var(--green); font-size: 14px; text-shadow: 0 0 3px #000; pointer-events: none; }
.bag-foot { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.pots { display: flex; gap: 14px; margin-right: auto; } .pots span { display: flex; align-items: center; gap: 4px; } .pots img { height: 28px; }
.idet { min-width: 300px; }
.idet-h { display: flex; gap: 12px; align-items: center; }
.iname { font-size: 22px; font-weight: 800; text-shadow: 0 2px 0 #000; } .isub { font-size: 14px; color: var(--dim); } .ipow { font-size: 15px; } .ipow b { color: var(--gold); }
.ipop { display: flex; gap: 20px; } .ipop-col { width: 340px; } .ipop-col.cmp { opacity: .8; border-right: 1px solid var(--line); padding-right: 20px; }
.cmp-t { color: var(--dim); font-weight: 700; margin-bottom: 4px; }
.ibtns { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* lò rèn */
.forge { display: grid; grid-template-columns: 1fr 420px; gap: 16px; height: 100%; }
.forge-l { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, 70px); gap: 8px; align-content: start; }
.fcell { position: relative; border-radius: 8px; padding: 2px; } .fcell.sel { box-shadow: 0 0 0 3px var(--gold); }
.eqm { position: absolute; left: 0; top: 0; background: var(--gold); color: #000; font-size: 11px; font-weight: 800; padding: 0 4px; border-radius: 4px; font-style: normal; }
.forge-r { background: rgba(0, 0, 0, .3); border-radius: 10px; padding: 12px; overflow: auto; }
.cost { display: flex; gap: 20px; justify-content: center; margin-top: 12px; font-size: 20px; font-weight: 700; }
.cost span { display: flex; align-items: center; gap: 4px; } .cost img { height: 30px; } .cost .no { color: var(--red); }

/* kỹ năng */
.skrow { display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, .04); border: 1px solid #2c3352; border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.skrow.locked { opacity: .55; }
.skic { position: relative; width: 76px; height: 76px; flex-shrink: 0; } .skic img { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--gold); object-fit: cover; }
.skic .lockov { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); border-radius: 50%; display: flex; align-items: center; justify-content: center; } .skic .lockov img { width: 34px; height: 34px; border: none; }
.skinfo { flex: 1; } .skname { font-size: 20px; font-weight: 800; } .skname small { color: var(--gold); font-size: 15px; } .skdesc { color: #c8cede; font-size: 15px; } .skst { font-size: 14px; color: var(--dim); } .skst b { color: #fff; }
.skup { width: 150px; text-align: center; }

/* thiên phú */
.talents { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.tal { background: rgba(255, 255, 255, .04); border: 1px solid #2c3352; border-radius: 12px; padding: 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tal-ic { position: relative; } .tal-ic img { width: 84px; height: 84px; } .tal-ic span { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); background: #000; color: var(--gold); font-size: 13px; font-weight: 800; padding: 0 8px; border-radius: 8px; }
.tal-n { font-size: 18px; font-weight: 800; } .tal-d { font-size: 13px; color: var(--dim); min-height: 52px; } .tal-d b { color: var(--green); }

/* nhiệm vụ */
.quests { display: flex; flex-direction: column; height: 100%; } .qlist { flex: 1; overflow: auto; }
.qrow { display: grid; grid-template-columns: 220px 1fr 300px 130px; align-items: center; gap: 10px; background: rgba(255, 255, 255, .04); border: 1px solid #2c3352; border-radius: 8px; padding: 6px 12px; margin-bottom: 6px; }
.qrow.done { opacity: .5; } .qrow.cur { border-color: var(--gold); background: rgba(255, 210, 63, .08); } .qrow.lock { opacity: .4; }
.qn { font-weight: 800; font-size: 16px; } .qd { font-size: 14px; color: #c8cede; } .qd b { color: var(--gold); } .qs { text-align: right; color: var(--green); font-weight: 700; }
.rw { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; } .rw span { display: inline-flex; align-items: center; gap: 2px; background: rgba(0, 0, 0, .4); border-radius: 10px; padding: 0 8px 0 2px; } .rw img { height: 22px; }
.dchests { position: relative; display: flex; justify-content: space-around; align-items: flex-end; padding: 10px 40px 34px; margin-bottom: 10px; }
.dch { text-align: center; cursor: pointer; z-index: 1; } .dch img { height: 70px; filter: grayscale(.7); } .dch.can img { filter: none; animation: bob 1s infinite; } .dch.got img { filter: grayscale(1) brightness(.5); } .dch b { display: block; color: var(--gold); }
.dbar { position: absolute; left: 40px; right: 40px; bottom: 6px; height: 18px; background: #000; border-radius: 9px; overflow: hidden; border: 1px solid #555; }
.dbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #22a8e0, #a6f0ff); } .dbar span { position: absolute; inset: 0; text-align: center; font-size: 13px; font-weight: 700; line-height: 16px; }

/* phó bản */
.dungeons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dg { display: flex; flex-direction: column; background: rgba(255, 255, 255, .04); border: 2px solid #2c3352; border-radius: 12px; overflow: hidden; } .dg.locked { opacity: .5; }
.dg-img { height: 110px; background-size: cover; background-position: center 60%; position: relative; } .dg-img span { position: absolute; left: 12px; bottom: 6px; font-size: 26px; font-weight: 800; text-shadow: 0 3px 0 #000, 0 0 10px #000; }
.dg-info { padding: 8px 12px; } .dg-boss b { color: #ff7a7a; } .dg-desc { font-size: 14px; color: #c8cede; } .dg-req { font-size: 13px; color: var(--dim); }
.dg-btns { display: flex; gap: 8px; margin-top: 6px; }

/* boss */
.bosses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.wb { background: rgba(255, 255, 255, .04); border: 2px solid #5a2a2a; border-radius: 12px; overflow: hidden; text-align: center; padding-bottom: 10px; }
.wb-img { height: 120px; background-size: cover; background-position: center 60%; position: relative; } .wb-lv { position: absolute; right: 8px; top: 6px; background: #b00; font-weight: 800; padding: 0 8px; border-radius: 8px; }
.wb-n { font-size: 20px; font-weight: 800; color: #ffd0d0; margin-top: 4px; } .wb-t { font-size: 13px; color: var(--dim); margin-bottom: 6px; }

/* tháp */
.tower { display: grid; grid-template-columns: 380px 1fr; gap: 20px; height: 100%; }
.tw-l { text-align: center; background: radial-gradient(ellipse at 50% 30%, rgba(79, 182, 255, .2), transparent 70%); padding: 10px; }
.tw-l > img { height: 220px; } .tw-best { font-size: 24px; font-weight: 800; } .tw-best b { color: var(--gold); } .tw-next { font-size: 18px; margin-bottom: 8px; }
.tw-desc { font-size: 14px; color: var(--dim); margin-bottom: 12px; } .tw-coin { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; } .tw-coin img { height: 28px; }
.srow { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .04); border: 1px solid #2c3352; border-radius: 10px; padding: 6px 10px; margin-bottom: 6px; }
.sic { width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .4); border-radius: 8px; } .sic img { max-width: 52px; max-height: 52px; }
.sinfo { flex: 1; display: flex; flex-direction: column; } .sinfo small { color: var(--dim); }
.owned { color: var(--green); font-weight: 800; }

/* cửa hàng */
.shop { display: flex; flex-direction: column; height: 100%; } .shop-body { flex: 1; display: flex; gap: 16px; overflow: hidden; }
.shop-cat { width: 240px; text-align: center; } .shop-cat img { width: 220px; }
.bubble { background: #fff; color: #222; font-weight: 700; border-radius: 14px; padding: 8px 12px; position: relative; margin: 6px 0; }
.slist { flex: 1; overflow: auto; }
.signin { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; width: 100%; }
.sday { position: relative; background: rgba(255, 255, 255, .05); border: 2px solid #2c3352; border-radius: 12px; padding: 10px 6px; text-align: center; min-height: 150px; }
.sday.today { border-color: var(--gold); box-shadow: 0 0 16px rgba(255, 210, 63, .4); } .sday.got { opacity: .55; }
.sd-n { font-weight: 800; color: var(--gold); margin-bottom: 6px; } .sday .rw { justify-content: center; } .sd-ok { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 60px; color: var(--green); text-shadow: 0 0 10px #000; }
.shop-body > .signin + .center { position: absolute; }
.shop-body:has(.signin) { flex-direction: column; }

/* bản đồ */
.wmap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center; padding-top: 20px; }
.wz { position: relative; width: 210px; border: 3px solid #3c4363; border-radius: 12px; overflow: hidden; cursor: pointer; background: #000; transition: transform .1s; }
.wz:hover { transform: translateY(-3px); border-color: var(--gold); } .wz.curz { border-color: var(--green); } .wz.locked { filter: grayscale(1) brightness(.5); }
.wz-img { height: 110px; background-size: cover; background-position: center 65%; } .wz-n { font-size: 19px; font-weight: 800; padding: 2px 8px; } .wz-l { font-size: 13px; color: var(--gold); padding: 0 8px 6px; }
.here { position: absolute; top: 6px; left: 6px; background: var(--green); color: #000; font-weight: 800; font-size: 12px; padding: 0 6px; border-radius: 6px; }
.wz-arrow { font-size: 26px; color: var(--gold); }

/* heal */
.heal { display: flex; gap: 20px; align-items: flex-start; } .heal > img { width: 260px; } .heal > div { flex: 1; }

/* settings */
.settings { max-width: 760px; margin: 0 auto; }
.set { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #2c3352; font-size: 18px; } .set > span { width: 260px; color: #d7dcea; }
.set input[type=range] { width: 300px; accent-color: var(--gold); } .set input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--gold); }
.set select, .set input[type=number] { background: #1a1f36; color: #fff; border: 1px solid #4a5170; border-radius: 6px; padding: 3px 8px; font-size: 16px; }
.keys { margin-top: 14px; font-size: 14px; color: var(--dim); line-height: 1.6; }

/* ---------- MODAL ---------- */
.modal-wrap { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; z-index: 25; animation: fin .15s; }
.modal { position: relative; background: var(--panel); border: 3px solid var(--gold); border-radius: 14px; padding: 18px 22px; box-shadow: 0 0 0 4px #000, 0 20px 50px rgba(0, 0, 0, .7); max-width: 900px; animation: pin .2s ease-out; }
.mbox { min-width: 380px; text-align: center; position: relative; }
.mt { font-size: 28px; font-weight: 800; color: var(--gold); text-shadow: 0 2px 0 #000; margin-bottom: 8px; } .mt.red { color: #ff6060; }
.mm { font-size: 18px; color: #d7dcea; }
.rlist { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 10px 0; max-width: 680px; }
.rit { display: flex; flex-direction: column; align-items: center; width: 90px; animation: pop .35s ease-out backwards; } .rit small { font-size: 13px; font-weight: 700; text-align: center; line-height: 1.1; margin-top: 2px; }
.rit:nth-child(2) { animation-delay: .06s; } .rit:nth-child(3) { animation-delay: .12s; } .rit:nth-child(4) { animation-delay: .18s; } .rit:nth-child(5) { animation-delay: .24s; } .rit:nth-child(6) { animation-delay: .3s; }
@keyframes pop { from { transform: scale(0); opacity: 0; } 70% { transform: scale(1.15); } }
.reward .rw-light { position: absolute; left: 50%; top: 50%; width: 520px; transform: translate(-50%, -50%); opacity: .35; animation: spin 8s linear infinite; pointer-events: none; z-index: -1; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.result .res-img { height: 90px; } .res-time { color: #d7dcea; margin-bottom: 6px; }
.code { width: 560px; height: 160px; background: #0a0c16; color: #9fe8ff; border: 1px solid #4a5170; border-radius: 8px; font-size: 12px; padding: 8px; word-break: break-all; }

/* ---------- story ---------- */
.story { position: absolute; left: 0; right: 0; bottom: 0; height: 260px; z-index: 22; display: flex; align-items: flex-end; cursor: pointer; background: linear-gradient(transparent, rgba(0, 0, 0, .75) 40%); animation: fin .2s; }
.st-av { width: 300px; height: 300px; display: flex; align-items: flex-end; justify-content: center; margin-left: 40px; }
.st-av img { max-height: 290px; max-width: 290px; filter: drop-shadow(0 6px 10px #000); animation: heroIn .3s ease-out; }
.st-box { flex: 1; margin: 0 40px 24px 0; background: rgba(10, 12, 24, .92); border: 3px solid var(--gold); border-radius: 14px; padding: 12px 20px 26px; position: relative; min-height: 130px; }
.st-name { position: absolute; top: -20px; left: 20px; background: var(--gold); color: #2a1600; font-weight: 800; font-size: 20px; padding: 0 16px; border-radius: 8px; transform: skewX(-8deg); }
.st-text { font-size: 22px; line-height: 1.4; margin-top: 8px; }
.st-next { position: absolute; right: 16px; bottom: 4px; font-size: 14px; color: var(--gold); animation: bob 1s infinite; }

/* ---------- gộp menu / ẩn nhiệm vụ ---------- */
#menuToggle { position: absolute; right: 8px; top: 46px; }
#menuToggle .burger { font-size: 30px; line-height: 34px; color: var(--gold); text-shadow: 0 2px 0 #000; font-style: normal; }
#menuToggle.on { border-color: var(--gold); background: linear-gradient(#4a3a10, #1a1608); }
#menuBar { right: 76px; transition: opacity .15s, transform .15s; transform-origin: right top; }
#menuBar.collapsed { opacity: 0; transform: scale(.6); pointer-events: none; }

/* ================= MÀN HÌNH DỌC ================= */
body.portrait #hudTL { left: 8px; top: 8px; }
body.portrait .hud-info { width: 250px; }
body.portrait #hudTR { right: auto; left: 8px; top: 98px; }
body.portrait #hudTC { top: 140px; }
body.portrait #menuToggle { top: 8px; }
body.portrait #menuBar { right: 8px; top: 78px; grid-template-columns: repeat(4, 74px); gap: 6px; padding: 10px; background: rgba(8, 10, 22, .92); border: 2px solid var(--gold); border-radius: 14px; z-index: 5; box-shadow: 0 10px 30px rgba(0, 0, 0, .7); }
body.portrait .mbtn { width: 74px; height: 74px; } body.portrait .mbtn span { font-size: 13px; }
body.portrait #btnTown, body.portrait #btnExit { left: auto; right: 82px; top: 18px; }



body.portrait #toasts { top: 196px; width: 330px; right: 8px; } body.portrait .toast { max-width: 330px; font-size: 15px; }
body.portrait #bossBar { width: 680px; top: 186px; z-index: 2; }
body.portrait #goArrow { top: 46%; right: 20px; }

body.portrait #joy { width: 340px; height: 360px; } body.portrait #joyBase { left: 140px; top: 220px; }
body.portrait #ctrl { height: 360px; }
/* bảng */
body.portrait .panel { width: 704px; height: calc(100% - 150px); }
body.portrait .p-head { flex-wrap: wrap; row-gap: 4px; }
body.portrait .p-cur { order: 3; width: 100%; margin-left: 0; font-size: 14px; gap: 6px; }
body.portrait .p-close { margin-left: auto; }
body.portrait .char { grid-template-columns: 100px 1fr 100px; grid-template-rows: auto auto; }
body.portrait .char-r { grid-column: 1 / -1; }
body.portrait .char-img { height: 320px; max-width: 300px; }
body.portrait .forge { grid-template-columns: 1fr; grid-template-rows: 220px 1fr; }
body.portrait .talents { grid-template-columns: repeat(3, 1fr); }
body.portrait .qrow { grid-template-columns: 1fr auto; } body.portrait .qrow .qd, body.portrait .qrow .rw { grid-column: 1 / -1; }
body.portrait .qrow .qs { grid-row: 1; grid-column: 2; }
body.portrait .dungeons, body.portrait .tower { grid-template-columns: 1fr; }
body.portrait .bosses { grid-template-columns: repeat(2, 1fr); }
body.portrait .shop-cat { display: none; }
body.portrait .signin { grid-template-columns: repeat(4, 1fr); }
body.portrait .set { flex-wrap: wrap; } body.portrait .set > span { width: 200px; } body.portrait .set input[type=range] { width: 260px; }
body.portrait .heal { flex-direction: column; align-items: center; } body.portrait .heal > img { width: 180px; }
body.portrait .skup { width: 120px; }
body.portrait .bag-foot { flex-wrap: wrap; } body.portrait .pots { width: 100%; }
body.portrait .modal { max-width: 690px; padding: 16px; }
body.portrait .ipop { flex-direction: column; gap: 10px; } body.portrait .ipop-col { width: 620px; }
body.portrait .ipop-col.cmp { border-right: none; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
body.portrait .mbox { min-width: 0; } body.portrait .code { width: 600px; }
/* hội thoại */
body.portrait .story { height: 420px; flex-direction: column; align-items: stretch; justify-content: flex-end; }
body.portrait .st-av { width: 240px; height: 240px; margin: 0 0 -30px 20px; position: relative; z-index: 0; }
body.portrait .st-av img { max-height: 230px; max-width: 230px; }
body.portrait .st-box { margin: 0 16px 24px; z-index: 1; }
/* tiêu đề */
body.portrait .t-logo { left: 40px; top: 120px; }
body.portrait .t-l1 { font-size: 56px; } body.portrait .t-l2 { font-size: 84px; }
body.portrait .t-box { left: 40px; right: 40px; width: auto; top: auto; bottom: 90px; }
body.portrait #title::after { background: linear-gradient(180deg, rgba(5, 6, 12, .85) 0%, rgba(5, 6, 12, .2) 35%, rgba(5, 6, 12, 0) 55%, rgba(5, 6, 12, .85) 85%); }
/* hiệu ứng */
body.portrait .cutin-bg { top: 380px; height: 300px; }
body.portrait .cutin img { left: 0; top: 340px; height: 300px; }
body.portrait .cutin-name { left: 250px; top: 560px; font-size: 46px; }
body.portrait .bt-main { font-size: 38px; } body.portrait .banner-text.lvup .bt-main { font-size: 50px; }
body.portrait .banner { top: 40%; }
body.portrait #loading .ld-bar { width: 560px; }

/* ---------- ngọc thạch / khảm ---------- */
.jw { position: relative; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; border-radius: 10px; background: radial-gradient(circle, rgba(255,255,255,.12), rgba(0,0,0,.35)); }
.jw img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 2px 2px #000); }
.jw .jlv { position: absolute; left: 2px; bottom: 0; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.jw .jn { position: absolute; right: 1px; top: -2px; font-size: 12px; font-weight: 800; color: var(--gold); text-shadow: 0 1px 2px #000; }
.ic .socks { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); display: flex; gap: 2px; }
.ic .socks i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid #fff; box-shadow: 0 0 2px #000; }
.sock-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sock { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.sock.open, .sock.lock { width: 40px; height: 40px; border-radius: 50%; border: 2px dashed #6a7290; justify-content: center; color: #888; }
.sock.open { border-color: var(--gold); }
.forge-wrap { height: calc(100% - 44px); }
.forge-wrap .forge { height: 100%; }
.gsocks { display: flex; gap: 12px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.gsock { width: 112px; min-height: 104px; border-radius: 12px; border: 2px dashed #4a5170; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; padding: 4px; background: rgba(0,0,0,.3); }
.gsock span { font-size: 30px; line-height: 1; } .gsock small { font-size: 12px; line-height: 1.1; } .gsock em { font-size: 11px; color: var(--dim); font-style: normal; }
.gsock.open { border-color: var(--gold); cursor: pointer; color: var(--gold); } .gsock.open.sel { background: rgba(255,210,63,.18); box-shadow: 0 0 12px rgba(255,210,63,.5); }
.gsock.full { border-style: solid; border-color: #7d6cff; cursor: pointer; } .gsock.lock { opacity: .5; }
.jgrid { display: grid; grid-template-columns: repeat(auto-fill, 92px); gap: 8px; max-height: 210px; overflow: auto; }
.jgrid.big { flex: 1; max-height: none; align-content: start; grid-template-columns: repeat(auto-fill, 110px); }
.jcell { display: flex; flex-direction: column; align-items: center; text-align: center; background: rgba(255,255,255,.04); border-radius: 8px; padding: 4px; }
.jcell small { font-size: 11px; line-height: 1.15; } .jcell.dim { opacity: .45; }
.fuse { display: flex; flex-direction: column; gap: 6px; }
.fuse-h { display: flex; align-items: center; gap: 10px; color: #d7dcea; font-size: 15px; } .fuse-h img { height: 34px; }
.fzrow { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.03); border-radius: 8px; padding: 3px 8px; }
.fzn { width: 112px; font-weight: 800; display: flex; flex-direction: column; line-height: 1.1; } .fzn small { color: var(--dim); font-weight: 600; font-size: 12px; }
.fzcells { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; }
.fz { position: relative; display: flex; flex-direction: column; align-items: center; border: 2px solid transparent; border-radius: 8px; }
.fz b { font-size: 12px; line-height: 1; } .fz.none { opacity: .25; } .fz.can { border-color: var(--gold); cursor: pointer; animation: glow 1.2s infinite; }
.tag.sub { background: #6fd0ff; color: #002; }
.qt.sub { border-left-color: #6fd0ff; }
.qnpc { display: block; color: #6fd0ff; font-size: 12px; font-weight: 600; }
.qrow.hid.lockh { opacity: .75; background: repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 10px, transparent 10px 20px); }
.mbox.subq { max-width: 600px; } .mbox.subq .rw { justify-content: center; }
body.portrait .fzn { width: 84px; } body.portrait .gsock { width: 96px; }

/* ---------- cột trái: nhiệm vụ + AUTO (xếp dọc, tự co giãn) ---------- */
#leftCol { position: absolute; left: 10px; top: 108px; width: 290px; display: flex; flex-direction: column; gap: 5px; max-height: calc(100% - 108px - 250px); }
#qtToggle { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid rgba(255, 210, 63, .45); border-radius: 13px; background: rgba(8, 10, 22, .78); color: #ffe9b0; font-weight: 800; font-size: 14px; align-self: flex-start; flex-shrink: 0; }
#qtToggle b { background: var(--gold); color: #000; border-radius: 9px; padding: 0 6px; font-size: 12px; line-height: 17px; }
#qtToggle .arr { font-style: normal; transition: transform .15s; } #qtToggle:not(.on) .arr { transform: rotate(-90deg); }
#questTrack { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overflow-x: hidden; min-height: 0; flex-shrink: 1; max-height: 260px; padding-right: 2px; scrollbar-width: thin; }
#questTrack::-webkit-scrollbar { width: 4px; } #questTrack::-webkit-scrollbar-thumb { background: rgba(255, 210, 63, .5); border-radius: 2px; }
#questTrack.collapsed { display: none; }
.qt.line { display: flex; align-items: center; gap: 6px; padding: 3px 8px; font-size: 14px; font-weight: 700; min-height: 28px; flex-shrink: 0; }
.qt.line .tag { margin: 0; flex-shrink: 0; }
.qt.line .qn1 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qt.line .qp { color: var(--gold); flex-shrink: 0; font-size: 13px; }
.qt.line.ready .qp { color: var(--green); }
.qt.line.on { box-shadow: inset 3px 0 0 #fff; } .qt.line.on .qn1::after { content: ' ⟳'; color: var(--gold); }
.qt.line.more { color: #9fd8ff; font-size: 13px; justify-content: center; border-left-color: #6fd0ff; }
.qt.main { flex-shrink: 0; }
.qt.main .qt-d { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#autoBox { display: flex; flex-direction: row; gap: 6px; flex-shrink: 0; margin-top: 2px; }
#autoBox .tog { width: 142px; height: 40px; }
#autoBox .tog span { margin-left: 44px; font-size: 13px; }
body.portrait #leftCol { top: 192px; width: 330px; max-height: calc(100% - 192px - 380px); }
body.portrait #questTrack { max-height: 300px; }
body.portrait #autoBox .tog { width: 160px; height: 44px; } body.portrait #autoBox .tog span { margin-left: 50px; font-size: 14px; }
/* ---------- tài khoản ---------- */
.t-box.acc { width: 460px; background: rgba(8, 10, 22, .82); border: 2px solid var(--line); border-radius: 14px; padding: 14px 18px; gap: 10px; }
.t-box.acc .tabs { margin: 0; }
.t-box.acc form { display: flex; flex-direction: column; gap: 9px; }
.t-box.acc input { font-size: 18px; padding: 9px 12px; border-radius: 8px; border: 2px solid #4a5170; background: rgba(0, 0, 0, .6); color: #fff; outline: none; }
.t-box.acc input:focus { border-color: var(--gold); }
.t-err { color: #ff8080; font-weight: 700; min-height: 20px; font-size: 15px; }
.t-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.t-row a { color: #9fd8ff; font-weight: 700; font-size: 15px; text-decoration: none; }
.t-hello { font-size: 20px; } .t-hello b { color: var(--gold); } .t-hello small { color: var(--dim); }
.t-online, #onlineN { color: #7dff7d; font-weight: 700; font-size: 14px; text-shadow: 0 1px 2px #000; }
body.portrait .t-box.acc { width: auto; }

/* ---------- tổ đội / chat / boss thế giới ---------- */
#partyHud { display: flex; flex-direction: column; gap: 3px; flex-shrink: 0; }
.ph { background: rgba(8, 10, 22, .8); border-left: 3px solid #6fd0ff; border-radius: 0 6px 6px 0; padding: 2px 8px; font-size: 13px; font-weight: 700; }
.ph small, .pmem small { color: var(--gold); }
.pm-hp { position: relative; height: 7px; background: #000; border-radius: 4px; overflow: hidden; margin-top: 2px; }
.pm-hp i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#7dff7d, #2fa82f); }
.pm-hp.big { height: 20px; margin: 6px 0; } .pm-hp.big i { background: linear-gradient(#ff7070, #b00000); }
.pm-hp.big span { position: absolute; inset: 0; text-align: center; font-size: 13px; font-weight: 800; line-height: 20px; }
.party { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; height: 100%; }
.pcol { overflow: auto; } .pcol.chat { display: flex; flex-direction: column; }
.pmem { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 8px; background: rgba(255, 255, 255, .05); border-radius: 8px; padding: 6px 10px; margin-bottom: 5px; }
.pmem.me { border: 1px solid var(--line); } .pmem .pm-n { font-weight: 800; } .pmem .pm-hp { grid-column: 1 / 2; } .pm-z { grid-column: 1 / 2; color: var(--dim); font-size: 12px; }
.prow { display: flex; gap: 6px; margin: 6px 0; } .prow input, .pdg select, .prow select { flex: 1; font-size: 16px; padding: 6px 10px; border-radius: 8px; border: 1px solid #4a5170; background: #0a0c16; color: #fff; }
.prow select { flex: 0 0 auto; }
.pnear { display: flex; justify-content: space-between; align-items: center; padding: 3px 8px; background: rgba(255, 255, 255, .04); border-radius: 6px; margin-bottom: 3px; }
.pdg { display: flex; gap: 6px; flex-wrap: wrap; }
.chatlog { flex: 1; min-height: 200px; overflow-y: auto; background: rgba(0, 0, 0, .35); border-radius: 8px; padding: 6px 8px; font-size: 14px; }
.cl { margin-bottom: 3px; word-break: break-word; } .cl b { color: #9fd8ff; margin-right: 4px; }
.wbcard { background: linear-gradient(135deg, rgba(120, 10, 20, .55), rgba(20, 10, 40, .7)); border: 2px solid #ff6a6a; border-radius: 12px; padding: 10px 16px; margin-bottom: 8px; text-align: center; }
.wbcard.on { box-shadow: 0 0 18px rgba(255, 60, 60, .5); animation: glow 1.6s infinite; }
.wbc-t { font-size: 20px; font-weight: 800; color: #ffb0b0; } .wbc-n { font-size: 22px; font-weight: 800; } .wbc-i { color: #d7dcea; font-size: 14px; }
#wbRank { position: absolute; right: 10px; top: 200px; width: 230px; background: rgba(8, 10, 22, .82); border: 1px solid #ff8080; border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.wr-t { font-weight: 800; color: #ffb0b0; margin-bottom: 3px; } .wr { display: flex; gap: 6px; } .wr span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .wr em { color: var(--gold); font-style: normal; } .wr.me { color: #7dff7d; }
body.portrait .party { grid-template-columns: 1fr; } body.portrait #wbRank { top: 330px; width: 220px; }

/* khung đăng nhập/đăng ký: neo đáy màn hình để luôn thấy nút xác nhận */
.t-box.acc { top: auto; bottom: 16px; max-height: calc(100% - 290px); overflow-y: auto; gap: 7px; padding: 12px 16px; }
.t-box.acc form { gap: 7px; }
.t-box.acc input { font-size: 17px; padding: 7px 12px; }
.t-box.acc .btn.big { font-size: 21px; padding: 8px 20px; }
.t-box.acc .t-err { min-height: 0; }
.t-box.acc .t-err:empty { display: none; }
body.portrait .t-box.acc { bottom: 40px; max-height: calc(100% - 420px); }

.t-hint { font-size: 13px; font-weight: 700; margin-top: -4px; } .t-hint:empty { display: none; } .t-hint.ok { color: #7dff7d; } .t-hint.no { color: #ff8080; }

/* truyền tống */
.tlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.tcard { border: 3px solid #3c4363; border-radius: 12px; overflow: hidden; background: #000; text-align: center; padding-bottom: 8px; }
.tcard.curz { border-color: var(--green); } .tcard.locked { filter: grayscale(1) brightness(.5); }
.tcard .wz-n { font-size: 18px; font-weight: 800; } .tcard .wz-l { font-size: 13px; color: var(--gold); margin-bottom: 6px; }
