*{box-sizing:border-box}
html{background:#07191e}
body{margin:0;color:#f5ecd5;background:radial-gradient(ellipse at top,#245456,#07191e 75%);font-family:"Segoe UI",Arial,sans-serif}
button,a{-webkit-tap-highlight-color:transparent}
button{font:inherit;cursor:pointer}
button:focus-visible,a:focus-visible{outline:3px solid #fff2b9;outline-offset:2px}
.hunt-page{max-width:480px;min-height:100dvh;margin:auto;padding:0 14px max(28px,env(safe-area-inset-bottom));background:linear-gradient(#09232ec2,#071e28e9 55%,#07191ff5),url("assets/mach-son-cavern-2d.png") center top/auto 1100px no-repeat;box-shadow:0 0 50px #000b}
.hunt-header{padding:calc(16px + env(safe-area-inset-top)) 2px 15px;text-align:center}
.hunt-header>a{display:block;width:max-content;padding:8px 11px;border:1px solid #c5a56b;border-radius:19px;background:#11383b;color:#ffe2ac;font-size:10px;font-weight:800;text-decoration:none}
.hunt-header>small{display:block;margin-top:12px;color:#bce8d8;font-size:9px;font-weight:800;letter-spacing:1.5px}
.hunt-header h1{margin:5px 0;color:#ffe1a4;font-size:clamp(23px,6vw,29px);line-height:1.12;text-shadow:0 2px 6px #021217}
.hunt-header p{margin:3px 0 0;color:#dbe9da;font-size:11px}
.hunt-status{display:grid;grid-template-columns:1fr 62px 62px 1.4fr;gap:5px;padding:7px;border:1px solid #c8ac72;background:#123e40dc}
.hunt-status>div{min-width:0;padding:5px 7px;background:#173b3baa}
.hunt-status small,.hunt-status strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hunt-status small{color:#a8dcca;font-size:8px;font-weight:800}
.hunt-status strong{margin-top:3px;color:#fff1ca;font-size:12px}
.hunt-battle-stats{padding:6px 8px;border:1px solid #719d91;border-top:0;background:#0f3439;color:#e4eedc;font-size:10px;text-align:center}
.beast-section{margin-top:13px}
.section-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:7px;color:#f3d594;font-size:10px;letter-spacing:.5px}
.section-top span{color:#b9dccc;font-size:9px}
.hunt-zones{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.hunt-zone{min-width:0;min-height:44px;padding:5px 2px;border:1px solid #789f91;border-radius:4px;background:#164147;color:#e8f2e4;text-align:center}
.hunt-zone.selected{border-color:#efd093;background:#705736;color:#fff3d0;box-shadow:inset 0 0 0 1px #f7dfa977}
.hunt-zone:disabled{opacity:.45;cursor:default}.hunt-zone b,.hunt-zone small{display:block}.hunt-zone b{font-size:10px}.hunt-zone small{margin-top:2px;font-size:8px}
.beast-subtitle{margin-top:11px}
.beast-list{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
.beast-choice{--tone:#b7d9bc;min-width:0;min-height:82px;padding:3px 1px;border:1px solid #799182;border-bottom:3px solid var(--tone);border-radius:4px;background:linear-gradient(#285451,#12323b);color:#f4edd8;text-align:center}
.beast-choice.selected{border-color:var(--tone);box-shadow:0 0 13px color-mix(in srgb,var(--tone) 55%,transparent);background:linear-gradient(#43726b,#173d42)}
.beast-choice img{display:block;width:100%;height:43px;object-fit:contain;filter:drop-shadow(0 2px 3px #001b22)}
.beast-choice b,.beast-choice small{display:block}
.beast-choice b{font-size:10px}
.beast-choice small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#d7e9db;font-size:8px}
.boss-choice{display:flex;align-items:center;gap:8px;width:100%;min-height:58px;margin-top:8px;padding:4px 8px;border:1px solid #b89a65;border-radius:4px;background:linear-gradient(110deg,#493e2e,#17383a);color:#ffe7b9;text-align:left}
.boss-choice.selected{border-color:#ffe09a;box-shadow:0 0 9px #efc77d88}.boss-choice:disabled{opacity:.55;cursor:default}
.boss-choice img{flex:0 0 49px;width:49px;height:46px;object-fit:contain}.boss-choice span{min-width:0;flex:1}.boss-choice b,.boss-choice small{display:block}.boss-choice b{font-size:11px}.boss-choice small{margin-top:3px;color:#e1d6b6;font-size:9px}.boss-choice strong{font-size:9px;white-space:nowrap}
.monster-note{margin-top:7px;padding:7px 9px;border:1px solid #799e8d;background:#11343a;color:#eaf4e5}.monster-note b,.monster-note small{display:block}.monster-note b{font-size:10px}.monster-note small{margin-top:3px;color:#b9e8d2;font-size:9px}
.battle-card{margin-top:11px;padding:10px;border:1px solid #d4b57d;border-radius:6px;background:linear-gradient(#153d40e8,#0c2832f7);box-shadow:inset 0 0 0 1px #75baaa5d,0 9px 22px #0008}
.battle-title{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.battle-title span{color:#a8e4d3;font-size:9px;font-weight:900;letter-spacing:.8px}
.battle-title strong{color:#ffe1a5;font-size:17px}
.battle-scene{position:relative;display:flex;align-items:end;justify-content:space-between;height:185px;margin-top:7px;overflow:hidden;border:1px solid #5e918c;background:radial-gradient(ellipse at 76% 48%,#328f8b8c,transparent 40%),linear-gradient(#0d303b88,#102b32d9),url("assets/mach-son-cavern-2d.png") center 47%/cover}
.battle-scene:after{content:"";position:absolute;inset:auto 0 0;height:18px;background:linear-gradient(transparent,#071f29dc)}
.fighter{position:relative;z-index:1;width:43%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:end}
.actor-head-up{position:absolute;top:4px;left:50%;z-index:6;width:min(150px,92%);transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:2px;pointer-events:none;text-shadow:0 1px 2px #00151a}
.actor-head-up strong{max-width:100%;padding:2px 6px;border:1px solid #e7d39a;border-radius:8px;background:#0b3037e8;color:#fff1c8;font-size:9px;font-weight:900;line-height:1.15;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.actor-health-bar{display:block;width:100%;height:6px;overflow:hidden;border:1px solid #183d3b;border-radius:5px;background:#142b2e;box-shadow:0 1px 3px #00151a99}
.actor-health-bar i{display:block;width:100%;height:100%;transition:width .2s}
.actor-health-value{color:#fff7d8;font-size:8px;font-weight:900;line-height:1;text-shadow:0 1px 2px #00151a}
.hero-actor-health i{background:linear-gradient(90deg,#58cda1,#c5ffd0)}
.beast-actor-health i{background:linear-gradient(90deg,#d45145,#ffd375)}
.fighter.hero img{width:100%;height:170px;object-fit:contain;object-position:bottom;filter:drop-shadow(0 4px 5px #001318)}
.fighter b{position:absolute;bottom:3px;z-index:2;padding:2px 8px;border:1px solid #e5c98d;border-radius:12px;background:#0d343b;color:#fff0c8;font-size:9px}
.fighter.beast{--tone:#94dba5;justify-content:center}
.fighter.beast:before{content:"";position:absolute;width:108px;height:65px;bottom:8px;border-radius:50%;background:radial-gradient(ellipse,color-mix(in srgb,var(--tone) 38%,transparent),transparent 70%);filter:blur(6px);animation:pulse 2.5s ease-in-out infinite}
.fighter.beast img{position:relative;width:100%;height:142px;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 4px 4px #001318)}
.fighter.beast.elite img{height:152px}.fighter.beast.boss img{height:170px}
.fighter.beast>span:not(.combat-status):not(.wave-enemy-name):not(.wave-enemy-health){position:relative;color:var(--tone);font:700 61px "Segoe UI",Arial,sans-serif;text-shadow:0 2px 5px #00141d,0 0 20px var(--tone)}
.fighter.beast.hit img{animation:beast-hurt-pose .36s ease-out}
.fighter.beast.defeated:before{display:none}
.fighter.beast.defeated img{animation:none;object-position:center bottom}
@keyframes beast-hurt-pose{0%,100%{transform:translateX(0) scaleX(var(--beast-facing,1))}30%{transform:translateX(8px) rotate(3deg) scaleX(var(--beast-facing,1));filter:brightness(1.45)}65%{transform:translateX(3px) rotate(-1deg) scaleX(var(--beast-facing,1))}}
.fighter.beast.attacking img{animation:beast-attack-pose .55s ease-out both}
@keyframes beast-attack-pose{0%{transform:translateX(calc(7px * var(--beast-facing,1))) scale(.94) scaleX(var(--beast-facing,1))}48%{transform:translateX(calc(-18px * var(--beast-facing,1))) scale(1.1) scaleX(var(--beast-facing,1))}100%{transform:translateX(0) scale(1) scaleX(var(--beast-facing,1))}}
@media(prefers-reduced-motion:reduce){.fighter.beast.attacking img{animation:none}}
.battle-flare{position:absolute;left:47%;top:41%;z-index:1;color:#ffe3a2;font-size:26px;text-shadow:0 0 15px #f8c95e}
.health-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:8px 0}
.battle-combo{margin:6px auto 0;padding:5px 12px;width:max-content;max-width:90%;border:1px solid #e0b862;border-radius:999px;background:#3e2630;color:#ffe8a8;font-weight:800;font-size:12px;text-align:center;box-shadow:0 0 12px #df8b3c66}
.health-row>div>span:first-child{display:flex;justify-content:space-between;color:#dceee2;font-size:9px;font-weight:800}
.health-bar{height:9px;margin-top:3px;border:1px solid #a8b798;border-radius:8px;overflow:hidden;background:#1a292c}
.health-bar i{display:block;width:100%;height:100%;background:linear-gradient(90deg,#56bba0,#a8f4ba);transition:width .25s}
.enemy-bar i{background:linear-gradient(90deg,#b35a52,#ffd07e)}
.beast-status-row{display:flex;flex-wrap:wrap;gap:3px;margin-top:4px;min-height:0}
.beast-status-row[hidden]{display:none}
.beast-status-row .beast-status-badge{display:inline-flex;align-items:center;max-width:100%;padding:2px 4px;border:1px solid #be8b70;border-radius:4px;background:#643b35;color:#fff0d4;font-size:8px;font-weight:900;line-height:1.2;white-space:normal}
.beast-status-row .beast-status-badge.timed{border-color:#d7b165;background:#5c492b}
.beast-status-row .beast-status-badge.control{border-color:#82c7d7;background:#24505b}
.beast-status-row .beast-status-badge.defense{border-color:#d89988;background:#693d38}
.enemy-intent{padding:7px 9px;border-left:3px solid #9ecab2;background:#153b3c;color:#e8f4df;font-size:10px;font-weight:800}
.enemy-intent.danger{border-color:#ffad72;background:#603b32;color:#fff0d6;animation:warning 1.2s ease-in-out infinite}
.enemy-state{padding:5px 9px;border:1px solid #517d77;border-top:0;color:#c7e4d6;font-size:9px}
.relation-result{display:flex;align-items:center;gap:8px;padding:8px 10px;border-left:3px solid #81d8be;background:#092e36}
.relation-result span{flex:1;font-size:12px;font-weight:800;color:#ebf5e5}
.relation-result strong{color:#ffe19c;font-size:20px}
.relation-result small{display:block;width:78px;color:#b3d2c8;font-size:8px;text-align:right}
.battle-technique{margin:7px 0;color:#cde5d7;font-size:11px}
.secret-status{margin:7px 0;padding:7px 9px;border:1px solid #70bbaa;background:#103d43;color:#f3ead0;font-size:10px;line-height:1.35}
.advanced-status{margin:6px 0 8px;padding:7px 9px;border:1px solid #917f61;background:#16373d;color:#e8e0c8;font-size:10px;line-height:1.4}
.active-build-status{margin:6px 0 8px;padding:7px 9px;border:1px solid #d0ad62;border-left:3px solid #ffe7a3;background:linear-gradient(90deg,#3e492e,#173d40);color:#fff3cf;font-size:10px;line-height:1.45;font-weight:700}
.active-build-status[hidden]{display:none}
.kim-status{margin:6px 0 8px;padding:8px 10px;border:1px solid #e3bd77;border-left:3px solid #ffe1a4;background:linear-gradient(90deg,#5a4929,#283b3a);color:#fff1ca;font-size:10px;font-weight:800;line-height:1.4}
.kim-status[hidden]{display:none}
.wood-status{margin:6px 0 8px;padding:8px 10px;border:1px solid #80d39b;border-left:3px solid #a7f5aa;background:linear-gradient(90deg,#234b37,#193a3c);color:#e5ffdb;font-size:10px;font-weight:800;line-height:1.4}
.wood-status[hidden]{display:none}
.water-status{margin:6px 0 8px;padding:8px 10px;border:1px solid #8bd9ec;border-left:3px solid #b5f2ff;background:linear-gradient(90deg,#204861,#1b3a47);color:#e7faff;font-size:10px;font-weight:800;line-height:1.4}
.water-status[hidden]{display:none}
.fire-status{margin:6px 0 8px;padding:8px 10px;border:1px solid #ffa17e;border-left:3px solid #ffd29a;background:linear-gradient(90deg,#60332b,#3c2a36);color:#fff0db;font-size:10px;font-weight:800;line-height:1.4}
.fire-status[hidden]{display:none}
.earth-status{margin:6px 0 8px;padding:8px 10px;border:1px solid #e0bc88;border-left:3px solid #ffe0a9;background:linear-gradient(90deg,#59462e,#333b37);color:#fff0cf;font-size:10px;font-weight:800;line-height:1.4}
.earth-status[hidden]{display:none}
.battle-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.battle-actions button{min-height:43px;padding:5px;border:1px solid #d5ad67;border-radius:4px;background:linear-gradient(#ad7c42,#79522e);color:#fff4d7;font-size:11px;font-weight:900}
.battle-actions #attack-beast{--ready-fill:linear-gradient(#dcffcb,#94d7b4)}
.battle-actions #cast-secret{--ready-fill:linear-gradient(#f3e7ff,#d4c6eb);grid-column:1/-1}
.battle-actions #cast-movement{--ready-fill:linear-gradient(#e2fff6,#a7dbd0)}
.battle-actions #cast-ultimate{--ready-fill:linear-gradient(#fff0c1,#f2c480)}
.battle-actions button:disabled{opacity:.48;filter:saturate(.5);cursor:default}
.battle-log{min-height:30px;margin:8px 0 0;color:#f0e2bf;font-size:11px;line-height:1.35}
.rate-card{margin-top:12px;padding:10px 12px;border:1px solid #acb692;background:#11353acb}
.rate-card summary{color:#ffe3ab;font-size:12px;font-weight:800;cursor:pointer}.rate-card[open] summary{margin-bottom:9px}
.rate-card h2{margin:0 0 8px;color:#ffe3ab;font-size:16px}
.rate-grid{display:grid;grid-template-columns:1fr auto;gap:4px 10px;font-size:11px}
.rate-grid span{color:#dceee1}.rate-grid b{color:#ffdf9e;text-align:right}
.rate-card p{margin:9px 0 0;color:#c7e4d7;font-size:10px;line-height:1.4}
.rate-card p b{color:#ffe2a6}
.hunt-links{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin:11px 0}
.hunt-links a{display:grid;place-items:center;min-height:37px;padding:4px;border:1px solid #d0b077;background:#1e4d4c;color:#ffe8b9;font-size:10px;font-weight:800;text-align:center;text-decoration:none}
@keyframes pulse{50%{transform:scale(1.06);opacity:.85}}
@keyframes warning{50%{filter:brightness(1.3)}}
@keyframes hit{50%{transform:translateX(8px);filter:brightness(1.8)}}
@media(max-width:370px){.hunt-page{padding-left:9px;padding-right:9px}.beast-choice{min-height:75px}.beast-choice img{height:38px}.beast-choice small{font-size:7px}.relation-result small{display:none}}
@media(prefers-reduced-motion:reduce){.fighter.beast:before,.fighter.beast.hit img,.enemy-intent.danger{animation:none}.health-bar i{transition:none}}

/* Sơn lâm săn yêu: bản đồ sáng, điểm gặp quái và trận đánh gọn trên điện thoại. */
[hidden]{display:none!important}
html{background:#d9e3d9}
body{color:#273f38;background:linear-gradient(90deg,#b6d3c6,#e6eee0 50%,#b6d3c6)}
.hunt-page{background:linear-gradient(#eaf3e7f2,#f5f0df 410px,#ece8d9);box-shadow:0 0 40px #26463c55}
.hunt-header{padding-bottom:11px}
.hunt-header>a{background:#f8f0d8;color:#315a50;border-color:#9aaf8a;font-size:11px}
.hunt-header>small{color:#527368;font-size:10px}
.hunt-header h1{color:#214c43;text-shadow:none}
.hunt-header p{color:#4e6b5c;font-size:12px;line-height:1.35}
.hunt-status{border-color:#9ab798;border-radius:11px;background:#fffdf1;box-shadow:0 3px 10px #49766024}
.hunt-status>div{background:#e9f1e7;border-radius:7px}
.hunt-status small{color:#56766b;font-size:9px}
.hunt-status strong{color:#244b42;font-size:13px}
.hunt-battle-stats,.hunt-record{padding:6px 8px;background:#dfebdf;color:#345e53;border:1px solid #a5bfae;font-size:11px;text-align:center}
.hunt-battle-stats{border-top:0}.hunt-record{border-top:0;border-radius:0 0 8px 8px;font-weight:700}
.beast-section{margin-top:14px}
.section-top{color:#315d4b;font-size:11px}.section-top span{color:#55756a;font-size:10px}
.hunt-zone{min-height:42px;border-color:#98b7a0;border-radius:8px;background:#f9f5e8;color:#31584e}
.hunt-zone.selected{border-color:#a9894c;background:#ebd8aa;color:#544626;box-shadow:inset 0 0 0 1px #fff6d8}
.hunt-zone:disabled{opacity:.55}.hunt-zone b{font-size:11px}.hunt-zone small{font-size:9px}
.hunt-map{position:relative;height:410px;margin-top:9px;overflow:hidden;border:2px solid #91ae91;border-radius:16px;background:#d6e8d2 url('assets/yeu-thu/san-yeu-lo-trinh.webp') center 51%/cover no-repeat;box-shadow:0 8px 20px #31564833}
.hunt-map:after{content:"";position:absolute;inset:auto 0 0;height:80px;background:linear-gradient(transparent,#173d3790);pointer-events:none}
.map-banner{position:absolute;z-index:2;top:10px;left:11px;right:11px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 9px;border:1px solid #e3d5ae;border-radius:8px;background:#fff9e6e8;box-shadow:0 2px 8px #39543c33}
.map-banner b{color:#365a45;font-size:11px;letter-spacing:.5px}.map-banner span{color:#496d5e;font-size:10px;text-align:right}
.beast-list{position:absolute;inset:0;display:block;pointer-events:none}
.beast-choice{position:absolute;z-index:2;left:var(--marker-x);top:var(--marker-y);width:78px;min-height:82px;padding:3px 3px 5px;transform:translate(-50%,-50%);border:2px solid var(--tone);border-radius:13px;background:#fffdf1e8;color:#244b43;box-shadow:0 4px 10px #193e3677;pointer-events:auto}
.beast-choice.selected{background:#fff7d5;border-width:3px;box-shadow:0 0 0 3px #fff8dfaa,0 5px 15px #1d493c99}
.beast-choice img{height:45px;filter:drop-shadow(0 2px 3px #47675a88)}
.beast-choice b{font-size:11px;color:#24493f}.beast-choice small{font-size:8px;color:#42665b}
.beast-choice:disabled{opacity:.65}.beast-choice:focus-visible{outline-color:#ffe6a0}
.boss-choice{position:absolute;z-index:2;top:56px;left:50%;width:178px;min-height:54px;margin:0;padding:4px 7px;transform:translateX(-50%);border:2px solid #b98e55;border-radius:12px;background:#fff7dcf2;color:#624a2f;box-shadow:0 4px 12px #3e503c77}
.boss-choice:after{content:'THỦ LĨNH';position:absolute;left:50%;top:-10px;transform:translateX(-50%);padding:2px 7px;border-radius:8px;background:#8c6738;color:#fff6da;font-size:8px;font-weight:900;white-space:nowrap}
.boss-choice img{flex-basis:44px;width:44px;height:43px}.boss-choice b{font-size:10px}.boss-choice small{color:#785b3c;font-size:8px}.boss-choice strong{font-size:8px}
.boss-choice:disabled{opacity:.72}.boss-choice.selected{box-shadow:0 0 0 3px #fff2be,0 5px 12px #334b43}
.map-camp{position:absolute;z-index:2;bottom:11px;left:50%;transform:translateX(-50%);padding:6px 12px;border:1px solid #e8dcae;border-radius:20px;background:#174c42db;color:#fff7d6;font-size:10px;font-weight:900;white-space:nowrap;box-shadow:0 2px 8px #19382f77}
.monster-note{margin-top:8px;padding:9px 10px;border:1px solid #9db89d;border-radius:8px;background:#fffdf0;color:#365d4d}.monster-note b{font-size:12px}.monster-note small{font-size:10px;color:#4c765f;line-height:1.3}
.beast-section.in-battle .hunt-map{display:none}.beast-section.in-battle .hunt-zones{display:none}.beast-section.in-battle .section-top{display:none}
.hunt-route{margin-top:10px;padding:10px;border:1px solid #a7bd9f;border-radius:10px;background:#edf4e8;color:#305a4b}
.hunt-route-top{display:flex;justify-content:space-between;gap:8px;align-items:center}.hunt-route-top strong{font-size:11px;letter-spacing:.4px}.hunt-route-top span{font-size:10px;font-weight:800;color:#8b6435}
.hunt-route-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-top:8px}.hunt-route-step{padding:7px 3px;border:1px solid #c1cbb3;border-radius:7px;background:#e0e5d8;color:#718176;font-size:10px;font-weight:800;text-align:center}.hunt-route-step.current{border-color:#c6954c;background:#fff0be;color:#7d5125}.hunt-route-step.done{border-color:#78b09c;background:#c5e8d5;color:#25644e}
.hunt-route p{margin:8px 0 0;color:#4d6c5e;font-size:10px;line-height:1.35}
.battle-card{margin-top:10px;padding:10px;border-color:#bdac7c;border-radius:11px;background:#fff9e9;box-shadow:0 5px 18px #4a644c33}
.battle-title span{color:#447264;font-size:10px}.battle-title strong{color:#694d2b;font-size:17px}
.battle-scene{height:172px;border-color:#b9c5a0;border-radius:7px;background:linear-gradient(#d9f0dc22,#527a6880),url('assets/yeu-thu/san-yeu-lo-trinh.webp') center 65%/cover}
.battle-scene.guarded .fighter.hero img{filter:drop-shadow(0 0 12px #75e7df) drop-shadow(0 4px 3px #385045)}
.fighter.hero img{height:160px}.fighter.beast img{height:137px}.fighter.beast.elite img{height:147px}.fighter.beast.boss img{height:158px}
.health-row>div>span:first-child{color:#38594c;font-size:10px}.health-bar{height:10px;border-color:#9baa94;background:#d8e4d6}
.enemy-intent{border-radius:4px;background:#e4efe4;color:#375b4a;font-size:11px}.enemy-intent.danger{background:#ffe1c7;color:#783c29}
.enemy-state{border-color:#bfd2bb;background:#f3f8ee;color:#4c6d5c;font-size:10px}
.relation-result{margin-top:8px;border-left-color:#479d7c;border-radius:4px;background:#e9f1e7}.relation-result span{color:#355e4d;font-size:11px}.relation-result strong{color:#a26628}.relation-result small{color:#5d7467;font-size:9px}
.battle-technique{color:#4b6859;font-size:11px}.secret-status,.advanced-status{border-radius:6px}
.battle-actions #start-battle{grid-column:1/-1;min-height:48px}.battle-actions #guard-beast{--ready-fill:linear-gradient(#e4f8ff,#b4d8ec)}
.guard-tip{margin:6px 0;color:#567464;font-size:10px;line-height:1.35}.battle-log{color:#445d4e;font-size:11px}
.hunt-result{margin-top:9px;padding:11px;border:1px solid #d1ad67;border-radius:9px;background:linear-gradient(#fff4d4,#f2e1b6);color:#664826;box-shadow:0 4px 10px #5e634033}.hunt-result strong{font-size:15px}.hunt-result p{margin:6px 0 10px;font-size:11px;line-height:1.45}.hunt-result-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}.hunt-result-actions button{min-height:40px;padding:5px;border:1px solid #9e7d4a;border-radius:6px;background:#fff8e5;color:#654d2e;font-size:10px;font-weight:900}.hunt-result-actions #hunt-chase{border-color:#348d70;background:#389c7d;color:white}
.rate-card{border-color:#a9bea2;border-radius:9px;background:#f8f5e8}.rate-card summary{color:#466646;font-size:12px}.rate-grid span,.rate-card p{color:#526b58}.rate-grid b,.rate-card p b{color:#8e5f2a}
.hunt-links a{border-color:#94b0a0;border-radius:7px;background:#e7f0e8;color:#315f4c;font-size:11px}
@media(max-width:370px){.hunt-map{height:375px}.beast-choice{width:70px;min-height:76px}.beast-choice img{height:40px}.boss-choice{width:166px}.map-banner span{font-size:9px}.hunt-route-step{font-size:9px}}

/* Giao chiến liên tục: sân rộng, vòng di chuyển và chiêu ở cạnh tay phải. */
.battle-scene .battle-actions{position:absolute;z-index:6;left:10px;right:10px;bottom:10px;margin:0}
.battle-scene .battle-actions button{box-shadow:0 2px 6px #26443399;text-shadow:0 1px 2px #183b32}
.battle-card.live .battle-scene{height:390px;touch-action:none;user-select:none;background:linear-gradient(#b3e5c933,#3f755e66),url('assets/yeu-thu/san-yeu-lo-trinh.webp') center 60%/cover}
.battle-card.live .battle-scene:after{height:125px;background:linear-gradient(transparent,#173f3c83);pointer-events:none}
.battle-card.live .fighter{position:absolute;z-index:3;display:flex;align-items:center;justify-content:end;transform:translate(-50%,-50%);pointer-events:none}
.battle-card.live .fighter.hero{width:88px;height:120px;left:23%;top:43%}
.battle-card.live .fighter.hero img{width:88px;height:112px;object-fit:contain}
.battle-card.live .fighter.beast{width:105px;height:112px;left:74%;top:43%;transition:left .22s ease-out,top .22s ease-out}
.battle-card.live .fighter.beast img,.battle-card.live .fighter.beast.elite img,.battle-card.live .fighter.beast.boss img{width:105px;height:95px;object-fit:contain}
.battle-card.live .fighter b{bottom:-4px;font-size:8px}
.battle-card.live .fighter.beast:before{width:85px;height:35px;bottom:0}
.battle-card.live .battle-flare{display:none}
.arena-hint{position:absolute;z-index:4;top:8px;left:8px;right:8px;padding:5px 7px;border:1px solid #cbd9ae;border-radius:6px;background:#fff9dfd9;color:#3e5947;font-size:10px;font-weight:800;text-align:center;pointer-events:none}
.arena-warning{position:absolute;z-index:2;border:3px solid #e13d2d;border-radius:50%;background:#f04b3370;box-shadow:0 0 0 4px #fff1bf88,inset 0 0 14px #e53028;transform:translate(-50%,-50%);pointer-events:none;animation:arena-pulse .45s ease-in-out infinite alternate}
.arena-warning[data-attack="melee"]{border-color:#f2a14b;background:#e88a3f70;box-shadow:0 0 0 4px #fff1bf88,inset 0 0 14px #e86d25}
.arena-warning[data-attack="ranged"]{border-color:#5acfc8;border-style:dashed;background:#6bd3cf55;box-shadow:0 0 0 3px #e5fff1a6,inset 0 0 12px #41abae}
.arena-warning.special{border-color:#bb1b23;background:#ec393c91;box-shadow:0 0 0 5px #ffdd9488,inset 0 0 20px #b20013}
.arena-aim-line{position:absolute;z-index:1;height:4px;transform-origin:left center;border-top:2px dashed #f9e6a5;filter:drop-shadow(0 0 3px #123e39);pointer-events:none}
.arena-aim-line[data-attack="ranged"]{border-color:#8bf2e1}
.arena-aim-line[data-attack="skill"]{border-color:#ffb299}
.arena-projectile{position:absolute;z-index:4;width:16px;height:16px;border:2px solid #fff8ca;border-radius:50%;background:#66f3d0;box-shadow:0 0 12px #45e9cd;transform:translate(-50%,-50%);pointer-events:none}
.arena-enemy-projectile{position:absolute;z-index:4;width:19px;height:19px;border:2px solid #fff6d9;border-radius:50%;background:var(--shot-tone,#ff9b7c);box-shadow:0 0 4px #fff,0 0 15px var(--shot-tone,#ff9b7c);transform:translate(-50%,-50%);pointer-events:none}
.arena-enemy-projectile.skill{width:29px;height:29px;box-shadow:0 0 8px #fff,0 0 22px var(--shot-tone,#ff9b7c)}
.enemy-intent[data-attack="melee"]{border-left-color:#e49a4e}
.enemy-intent[data-attack="ranged"]{border-left-color:#52bfbb}
.arena-damage{position:absolute;z-index:5;left:72%;top:32%;color:#fff4ba;font-size:21px;font-weight:900;text-shadow:0 2px 3px #583b28,0 0 7px #0b3931;opacity:0;pointer-events:none}
.arena-damage.show{animation:arena-damage .55s ease-out}
.arena-joystick{position:absolute;z-index:7;left:14px;bottom:17px;width:98px;height:98px;border:3px solid #fff4d0c9;border-radius:50%;background:#12483fc2;box-shadow:0 2px 10px #0c302f88,inset 0 0 10px #8bceb6aa;touch-action:none;cursor:grab}
.arena-joystick:before{content:'DI CHUYỂN';position:absolute;left:50%;top:8px;transform:translateX(-50%);color:#ddf4dc;font-size:8px;font-weight:800;white-space:nowrap}
.arena-stick{position:absolute;left:50%;top:50%;width:39px;height:39px;border:2px solid #fff5d2;border-radius:50%;background:radial-gradient(#bcead3,#4c9e8b);box-shadow:0 2px 8px #0b3b38;transform:translate(-50%,-50%);pointer-events:none}
.battle-card.live .battle-actions{left:auto;right:9px;bottom:8px;width:194px;height:166px;display:block}
.battle-card.live .battle-actions button{position:absolute;display:grid;place-items:center;width:58px;height:58px;min-height:0;padding:5px;border-width:2px;border-radius:50%;font-size:8px;line-height:1.1;text-align:center;box-shadow:0 3px 8px #113b3aab,inset 0 0 0 2px #ffffff38}
.battle-card.live .enemy-intent.danger{animation:none}
@keyframes arena-pulse{to{opacity:.57;transform:translate(-50%,-50%) scale(.96)}}
@keyframes arena-damage{0%{opacity:0;transform:translateY(8px)}20%{opacity:1}100%{opacity:0;transform:translateY(-25px)}}
@media(max-width:370px){.battle-card.live .battle-scene{height:360px}.arena-joystick{width:88px;height:88px;left:8px;bottom:12px}.battle-card.live .battle-actions{right:4px;transform:scale(.86);transform-origin:right bottom}}
@media(prefers-reduced-motion:reduce){.arena-warning,.arena-damage.show{animation:none}}

/* Màn giao chiến riêng: bản đồ nhường toàn bộ khung nhìn cho sân đấu. */
body.battle-mode{overflow:hidden;background:#213f37}
body.battle-mode .hunt-page{max-width:none;min-height:100dvh;padding:0;background:none;box-shadow:none}
body.battle-mode .hunt-page>:not(#battle-card):not(#combat-help-dialog){display:none!important}
body.battle-mode #battle-card{position:fixed;z-index:30;inset:0 auto 0 50%;display:flex;flex-direction:column;gap:5px;width:min(100%,680px);height:100dvh;min-height:0;margin:0;padding:calc(8px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom));transform:translateX(-50%);overflow-y:auto;border:0;border-radius:0;background:linear-gradient(#f7f5e8,#e8f1e5);box-shadow:0 0 32px #102a2788}
body.battle-mode #battle-card .battle-title{order:1;display:grid;grid-template-areas:"exit meta wave" "exit name name";grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:9px;row-gap:1px;min-height:49px}
body.battle-mode #battle-exit{grid-area:exit;align-self:stretch;min-width:76px;padding:4px 8px;border:1px solid #8caf9d;border-radius:8px;background:#fffdf0;color:#315c4c;font-size:10px;font-weight:900}
body.battle-mode #battle-beast-element{grid-area:meta;overflow:hidden;color:#467567;font-size:9px;text-overflow:ellipsis;white-space:nowrap}
body.battle-mode #battle-beast-name{grid-area:name;color:#654827;font-size:18px;line-height:1.05}
body.battle-mode #battle-wave-label{grid-area:wave;padding:4px 7px;border:1px solid #c9ab70;border-radius:20px;background:#fff0ca;color:#77562d;font-size:9px;font-weight:900;white-space:nowrap}
body.battle-mode #battle-card .health-row{order:2;margin:1px 0 3px}
body.battle-mode #battle-card .health-row>div>span:first-child{font-size:11px}
body.battle-mode #battle-card .health-bar{height:12px}
body.battle-mode #battle-card .beast-status-row{gap:3px;margin-top:3px}
body.battle-mode #battle-card .beast-status-row .beast-status-badge{font-size:8px;padding:2px 4px}
body.battle-mode #battle-card .battle-scene{order:3;height:auto;min-height:350px;flex:1 1 auto;margin:0;border:2px solid #9bb99e;border-radius:12px;box-shadow:inset 0 0 0 2px #fff9db88}
body.battle-mode #battle-card .fighter.hero{width:108px;height:145px}
body.battle-mode #battle-card .fighter.hero img{width:108px;height:137px}
body.battle-mode #battle-card .fighter.beast{width:125px;height:135px}
body.battle-mode #battle-card .fighter.beast img,body.battle-mode #battle-card .fighter.beast.elite img,body.battle-mode #battle-card .fighter.beast.boss img{width:125px;height:118px}
body.battle-mode #battle-card .actor-head-up{top:2px;width:min(150px,96%)}
body.battle-mode #battle-card .actor-head-up strong{font-size:9px}
body.battle-mode #battle-card .enemy-intent{order:4;margin:0;padding:7px 9px;font-size:11px}
body.battle-mode #battle-card .enemy-state{order:5;padding:4px 8px}
body.battle-mode #battle-card .active-build-status{order:6;margin:0;padding:5px 8px;font-size:10px}
body.battle-mode #battle-card .relation-result{order:7;margin:0;padding:5px 8px}
body.battle-mode #battle-card .relation-result span{font-size:10px}
body.battle-mode #battle-card .relation-result strong{font-size:15px}
body.battle-mode #battle-card .relation-result small{display:none}
body.battle-mode #battle-card .battle-technique,body.battle-mode #battle-card .secret-status,body.battle-mode #battle-card .advanced-status,body.battle-mode #battle-card .guard-tip{display:none}
body.battle-mode #battle-card .kim-status,body.battle-mode #battle-card .water-status,body.battle-mode #battle-card .wood-status,body.battle-mode #battle-card .fire-status,body.battle-mode #battle-card .earth-status{order:8;margin:0;padding:5px 7px;font-size:10px}
body.battle-mode #battle-card .battle-log{order:9;max-height:2.8em;min-height:0;margin:0;overflow:hidden;font-size:10px;line-height:1.35}
body.battle-mode #battle-card .hunt-result{order:10;margin:0}
body.battle-mode #battle-card.finished .battle-scene{height:min(44dvh,340px);min-height:210px;flex:0 0 auto}
body.battle-mode #battle-card.finished .hunt-result{margin-top:auto}
body.battle-mode #battle-card.won .fighter.beast{opacity:1;filter:none}
body.battle-mode #battle-card.lost .fighter.hero{opacity:.55;filter:grayscale(.8)}
@media(max-height:620px){body.battle-mode #battle-card .battle-scene{min-height:260px}body.battle-mode #battle-card.finished .battle-scene{min-height:180px}}
@media(max-width:370px){body.battle-mode #battle-card{padding-right:7px;padding-left:7px}body.battle-mode #battle-card .fighter.hero{width:88px;height:125px}body.battle-mode #battle-card .fighter.hero img{width:88px;height:116px}body.battle-mode #battle-card .fighter.beast{width:104px;height:116px}body.battle-mode #battle-card .fighter.beast img{width:104px;height:100px}}

/* Chiêu thủ lĩnh: vùng sát thương và số đợt còn lại rõ trên sân đấu. */
.boss-warning-layer{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden}
.boss-danger-zone{position:absolute;transform:translate(-50%,-50%);border:3px solid #ba3f30;border-radius:50%;background:repeating-linear-gradient(135deg,#bd423c22 0 7px,#ffe5c833 7px 14px);box-shadow:inset 0 0 0 2px #fff3cfb0,0 0 10px #bd4e4144;display:grid;place-items:center}
.boss-danger-zone b{position:absolute;bottom:14%;padding:3px 7px;border-radius:10px;font-size:9px;white-space:nowrap;background:#8a3426;color:#fff8e9;box-shadow:0 1px 3px #30251c66}
.boss-danger-zone[data-element=moc]{background-color:#6baf3a38}
.boss-danger-zone[data-element=thuy]{background-color:#76cfe855}
.boss-danger-zone[data-element=tho]{background-color:#ce9c3d55}
.enemy-rage-stats{order:2;padding:6px 9px;border:1px solid #ce7c51;border-radius:5px;background:#fff0d8;color:#8c371e;font-size:10px;font-weight:800;line-height:1.4}
.enemy-rage-stats[hidden]{display:none}
.fighter.beast.enraged>img,.fighter.beast.enraged>.monster-animation{filter:drop-shadow(0 0 7px #ec6a2dcc)}
#battle-card[data-enraged=true] .enemy-bar i{background:linear-gradient(90deg,#ef9a48,#c4482d)}
.battle-scene.boss-impact{animation:boss-ground-shake .26s ease-out}
@keyframes boss-ground-shake{25%{transform:translateY(3px)}50%{transform:translateY(-2px)}75%{transform:translateY(1px)}}
@media(prefers-reduced-motion:reduce){.battle-scene.boss-impact{animation:none}}
@media(max-width:400px){.boss-danger-zone b{font-size:8px}}

/* Chọn ải: ba chương, tuyến ải mở dần và thông tin quái trước trận. */
body:not(.battle-mode) #battle-card{display:none}
.stage-section{margin-top:13px}
.stage-overview{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:9px 11px;border:1px solid #b4c7ad;border-radius:10px;background:#fffdf1;color:#527362;font-size:10px;font-weight:900;letter-spacing:.4px}
.stage-overview strong{color:#a36e2c;font-size:12px;white-space:nowrap}
.stage-zones{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:8px 0}
.stage-menu-toggle{display:block;width:100%;margin:0 0 7px;padding:8px 10px;border:1px solid #a9c2a7;border-radius:7px;background:#e8f1e7;color:#315d46;font-size:11px;font-weight:900;text-align:left;cursor:pointer}
.stage-menu-toggle[aria-expanded="true"]{background:#dcebdc;border-color:#6e9a7a}
.stage-zones[hidden]{display:none!important}
body:not(.battle-mode) .realm-view .stage-zones:not([hidden]){position:absolute;z-index:120;top:52px;left:9px;right:9px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0;padding:9px;border:2px solid #9b7a45;border-radius:10px;background:#fffdf2;box-shadow:0 14px 35px #10251c99}
body:not(.battle-mode) .realm-view .stage-zones:not([hidden]) .stage-zone{min-height:42px}
.stage-zone{min-height:46px;padding:5px 3px;border:1px solid #aac4ac;border-radius:8px;background:#eaf3e7;color:#497163;text-align:center}
.stage-zone.selected{border-color:#ba985a;background:#fff0c6;color:#73522d;box-shadow:inset 0 0 0 1px #fff8e4}
.stage-zone b,.stage-zone small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stage-zone b{font-size:10px}.stage-zone small{margin-top:3px;font-size:9px}
.stage-map-head{display:flex;align-items:end;justify-content:space-between;gap:8px;margin:12px 2px 7px;color:#31594b}
.stage-map-head small{font-size:9px;font-weight:900;letter-spacing:1px}.stage-map-head h2{margin:2px 0 0;font:700 19px "Segoe UI",Arial,sans-serif}
.stage-map-head>span{padding:4px 8px;border-radius:12px;background:#d9e8d5;color:#426a54;font-size:10px;font-weight:800}
.stage-list{position:relative;display:flex;flex-direction:column;gap:11px;height:clamp(230px,calc(100dvh - 500px),330px);padding:14px 12px;overflow-y:auto;scrollbar-color:#9db5a3 #e7ebdc;border:2px solid #a9c2a7;border-radius:15px;background:linear-gradient(#d6ead7b0,#f2f2dbc5),url('assets/yeu-thu/san-yeu-lo-trinh.webp') center 53%/cover;box-shadow:inset 0 0 0 2px #fff8dfaa,0 5px 15px #385a4733}
.stage-list:before{content:"";position:absolute;top:0;bottom:0;left:50%;border-left:3px dashed #b38f5c88;transform:translateX(-50%);pointer-events:none}
.stage-node{position:relative;z-index:1;display:grid;grid-template-columns:28px 44px minmax(0,1fr) 48px;align-items:center;gap:5px;width:82%;min-height:66px;padding:5px 7px;border:2px solid var(--stage-tone,#a9c1a2);border-radius:12px;background:#fffdf0e8;color:#315449;text-align:left;box-shadow:0 3px 8px #25483c55}
.stage-node:nth-child(even){align-self:end}.stage-node.selected{border-color:#d4a451;background:#fff2c8;box-shadow:0 0 0 3px #fff9df,0 5px 12px #31554266}
.stage-node.locked{filter:saturate(.42);background:#e5e9dfe8;color:#6c8072}.stage-node.cleared{border-color:#6ab59a;background:#eff9e9eb}
.stage-node.boss{border-color:#cb9250;background:#fff0cbe9}.stage-node.boss.locked{background:#e8dfcce8}
.stage-node-number{color:#a36e39;font:700 18px "Segoe UI",Arial,sans-serif;text-align:center}.stage-node img{width:44px;height:48px;object-fit:contain;filter:drop-shadow(0 2px 3px #345a4977)}
.stage-node-copy{min-width:0}.stage-node-copy b,.stage-node-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stage-node-copy b{font-size:11px}.stage-node-copy small{margin-top:3px;color:#6b8872;font-size:8px;font-weight:900}
.stage-node-status{color:#498876;font-size:9px;text-align:right;white-space:nowrap}.stage-node.locked .stage-node-status{color:#7a837c}.stage-node.boss .stage-node-status{color:#936437}
.stage-path-note{margin:6px 3px 0;color:#5b7563;font-size:10px;line-height:1.3}
.stage-detail{display:flex;gap:11px;margin:12px 0;padding:10px;border:1px solid #bdab7c;border-radius:13px;background:#fff9e9;box-shadow:0 4px 14px #3e5c4540}
.stage-detail-art{position:relative;flex:0 0 105px;display:grid;place-items:center;min-height:154px;border:1px solid #a7c1a7;border-radius:10px;background:linear-gradient(#e3f2dd,#b8d8c9)}
.stage-detail-art img{width:94px;height:105px;object-fit:contain;filter:drop-shadow(0 3px 4px #47766277)}
.stage-detail-art span{position:absolute;right:3px;bottom:5px;left:3px;padding:3px 2px;border-radius:10px;background:#285849d9;color:#fff7df;font-size:8px;font-weight:900;text-align:center}
.stage-detail-copy{min-width:0;flex:1}.stage-detail-copy>small{color:#2d9271;font-size:9px;font-weight:900;letter-spacing:.6px}
.stage-detail-copy h2{margin:3px 0;color:#56432d;font:700 17px "Segoe UI",Arial,sans-serif}.stage-detail-copy>p{margin:4px 0;color:#577565;font-size:10px;line-height:1.3}
.stage-forge-drop{display:flex;align-items:center;gap:6px;width:fit-content;min-height:44px;font-size:12px;font-weight:700;color:inherit}
.stage-forge-drop img{width:36px;height:36px;object-fit:contain}
.stage-reward{margin-top:6px;padding:5px 6px;border-left:3px solid #d5aa64;background:#f7ecd1;color:#76592e;font-size:10px;line-height:1.35}
.stage-detail-copy .stage-lock-reason{min-height:14px;color:#a16936;font-weight:800}
.stage-detail #start-battle{width:100%;min-height:35px;padding:5px;border:1px solid #d7b473;border-radius:7px;background:linear-gradient(#c8934d,#906132);color:#fff5d7;font-size:11px;font-weight:900;box-shadow:inset 0 1px #ffe8b0}
.stage-detail #start-battle:disabled{border-color:#afb6a8;background:#bfc9b9;color:#67796c;box-shadow:none;cursor:default}
body:not(.battle-mode) .hunt-page{padding-bottom:calc(80px + env(safe-area-inset-bottom))}
body:not(.battle-mode) #start-battle{position:fixed;z-index:20;right:auto;bottom:calc(9px + env(safe-area-inset-bottom));left:50%;width:min(calc(100% - 24px),456px);min-height:48px;transform:translateX(-50%);box-shadow:0 4px 13px #183e3599,inset 0 1px #ffe8b0}
@media(max-width:370px){.stage-list{padding:10px 7px}.stage-node{width:88%;grid-template-columns:24px 38px minmax(0,1fr) 36px;gap:3px;padding:4px}.stage-node img{width:38px;height:43px}.stage-node-copy b{font-size:10px}.stage-node-status{font-size:8px}.stage-detail-art{flex-basis:79px}.stage-detail-art img{width:76px;height:94px}.stage-detail-copy h2{font-size:15px}}

/* Màn chọn ải tối giản: danh sách rõ ràng, một hình quái nhỏ, ít màu. */
body:not(.battle-mode){background:#e9eeeb}
body:not(.battle-mode) .hunt-page{padding:0 9px max(24px,env(safe-area-inset-bottom));background:#f5f7f4;box-shadow:0 0 25px #314c4130}
body:not(.battle-mode) .hunt-header{display:grid;grid-template-columns:34px minmax(0,1fr) 34px;align-items:center;gap:6px;min-height:56px;padding:calc(6px + env(safe-area-inset-top)) 4px 5px;text-align:center}
body:not(.battle-mode) .hunt-header>a{display:grid;place-items:center;width:32px;height:32px;padding:0;border:1px solid #cad4cd;border-radius:7px;background:#fff;color:#38544a;font-size:20px;line-height:1}
body:not(.battle-mode) .hunt-header small{display:block;margin:0;color:#718078;font-size:8px;font-weight:800;letter-spacing:.8px}
body:not(.battle-mode) .hunt-header h1{margin:2px 0 0;color:#2b4b3d;font-size:19px;line-height:1.05}
body:not(.battle-mode) .hunt-header>span{display:none}
body:not(.battle-mode) .hunt-status{grid-template-columns:minmax(0,1fr) 70px 70px;gap:4px;min-height:51px;margin:0 2px 6px;padding:4px;border:1px solid #d1dbd3;border-radius:7px;background:#fff;box-shadow:none}
body:not(.battle-mode) .hunt-status>div{padding:3px 5px;border-radius:4px;background:#f3f6f2}
body:not(.battle-mode) .hunt-status>div:last-child{display:none}
body:not(.battle-mode) .hunt-status .hunt-identity{display:flex;align-items:center;gap:6px;padding:2px 4px}
.hunt-identity img{flex:0 0 35px;width:35px;height:35px;object-fit:cover;border:1px solid #a9b7ab;border-radius:50%;background:#e6ece7}
.hunt-identity span{min-width:0}
body:not(.battle-mode) .hunt-status small{color:#74867b;font-size:8px}
body:not(.battle-mode) .hunt-status strong{margin-top:2px;color:#2d4c3c;font-size:11px}
body:not(.battle-mode) .hunt-battle-stats,body:not(.battle-mode) .hunt-record{display:none}
body:not(.battle-mode) .stage-section{margin:0}
.stage-overview{margin:0 2px 6px;padding:6px 8px;border:1px solid #d2dbd3;border-radius:7px;background:#fff;color:#596f60;font-size:9px;box-shadow:none}
.stage-overview strong{color:#456557;font-size:10px}
.realm-view{position:static;height:auto;min-height:0;padding:9px;overflow:visible;border:1px solid #cbd6ce;border-radius:8px;background:#f8faf7;box-shadow:none;isolation:auto}
.realm-view:before{display:none}
.stage-zones{position:static;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin:0}
.stage-zone{min-height:40px;padding:4px 2px;border:1px solid #ccd7cf;border-radius:6px;background:#fff;color:#536b5d;box-shadow:none}
.stage-zone.selected{border-color:#648e78;background:#e9f1e9;color:#315d46;box-shadow:none}
.stage-zone b{font-size:10px}.stage-zone small{margin-top:2px;font-size:8px}
.stage-map-head{position:static;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:11px 2px 7px;padding:0;border:0;border-radius:0;background:none;box-shadow:none}
.stage-map-head small{color:#718478;font-size:8px;letter-spacing:.6px}.stage-map-head h2{margin:1px 0 0;color:#334f3f;font:700 17px "Segoe UI",Arial,sans-serif}.stage-map-head>span{padding:3px 7px;border-radius:5px;background:#e7eee7;color:#567063;font-size:10px}
.realm-view .stage-list{position:static;display:flex;flex-direction:column;gap:5px;width:100%;height:auto;padding:0;overflow:visible;border:0;border-radius:0;background:none;box-shadow:none;pointer-events:auto}
.realm-view .stage-list:before{display:none}
.realm-view .stage-node{position:static;display:grid;grid-template-columns:34px minmax(0,1fr) 48px;align-items:center;gap:7px;width:100%;height:auto;min-height:47px;margin:0;padding:5px 7px;transform:none;border:1px solid #d0d9d2;border-radius:6px;background:#fff;color:#344d3e;text-align:left;box-shadow:none;filter:none}
.realm-view .stage-node:nth-child(even){align-self:auto}
.realm-view .stage-node-number{display:grid;place-items:center;width:30px;height:30px;border-radius:5px;background:#eff3ef;color:#456251;font:800 12px "Segoe UI",Arial,sans-serif}
.realm-view .stage-node-copy{min-width:0}.realm-view .stage-node-copy b,.realm-view .stage-node-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.realm-view .stage-node-copy b{color:inherit;font-size:11px;font-weight:800}.realm-view .stage-node-copy small{margin-top:2px;color:#78887c;font-size:9px}
.realm-view .stage-node-status{color:#6f8374;font-size:9px;text-align:right;white-space:nowrap}
.realm-view .stage-node.cleared{border-color:#c9d7cc;background:#f4f8f4;color:#4b6953}
.realm-view .stage-node.locked{opacity:1;border-color:#dce2dc;background:#f2f4f2;color:#839088}
.realm-view .stage-node.locked .stage-node-copy small,.realm-view .stage-node.locked .stage-node-status{color:#909b93}
.realm-view .stage-node.selected{border:2px solid #5d8d70;background:#edf5ed;color:#2d5940;box-shadow:none}
.realm-view .stage-node.boss{border-color:#baa889}.realm-view .stage-node.boss.selected{border-color:#5d8d70}
.realm-view .stage-detail{position:static;display:grid;grid-template-columns:58px minmax(0,1fr);align-items:start;gap:7px 9px;min-height:0;margin:10px 0 0;padding:9px;border:1px solid #cdd8ce;border-radius:7px;background:#fff;box-shadow:none}
.realm-view .stage-detail-art{position:static;display:block;width:58px;height:58px;min-height:0;object-fit:contain;padding:3px;border:1px solid #dce5dc;border-radius:6px;background:#f3f6f2}
.realm-view.locked-target .stage-detail-art{opacity:.66;filter:grayscale(.4)}
.realm-view .stage-detail-copy{min-width:0}.realm-view .stage-detail-copy>small{display:block;color:#527963;font-size:9px;font-weight:800}.realm-view #stage-rank{display:block;margin:1px 0 0;color:#778478;font-size:9px;font-weight:800}
.realm-view .stage-detail-copy h2{margin:2px 0;color:#344e3d;font:700 16px "Segoe UI",Arial,sans-serif;line-height:1.1}
.realm-view .stage-detail-copy>p{margin:2px 0;color:#627569;font-size:9px;line-height:1.2}
.realm-view .stage-reward{margin-top:4px;padding:3px 5px;border-left:2px solid #88a694;background:#f2f6f1;color:#4f6854;font-size:9px;line-height:1.2}
.realm-view .stage-detail-copy .stage-lock-reason{min-height:0;margin-top:3px;color:#7a6a50;font-weight:700}
body:not(.battle-mode) .realm-view .stage-detail #start-battle{position:static;grid-column:1/-1;display:block;width:100%;min-height:39px;margin:1px 0 0;padding:6px;transform:none;border:1px solid #397e63;border-radius:6px;background:#377a60;color:#fff;font-size:11px;font-weight:900;box-shadow:none}
body:not(.battle-mode) .realm-view .stage-detail #start-battle:disabled{border-color:#bcc8bf;background:#d2dad3;color:#718074;box-shadow:none}
.stage-path-note{margin:6px 5px 10px;color:#66796b;font-size:10px;text-align:center}
.battle-card.live[data-zone="1"] .battle-scene{background-image:linear-gradient(#b7dfe341,#386b7580),url('assets/yeu-thu/san-yeu-suong-lam.webp')}
.battle-card.live[data-zone="2"] .battle-scene{background-image:linear-gradient(#e5db9a27,#46664b80),url('assets/yeu-thu/san-yeu-co-lam.webp')}
@media(max-width:370px){.realm-view{padding:7px}.realm-view .stage-node{grid-template-columns:30px minmax(0,1fr) 42px;gap:5px;padding:4px}.realm-view .stage-node-copy b{font-size:10px}.realm-view .stage-node-status{font-size:8px}.realm-view .stage-detail{grid-template-columns:48px minmax(0,1fr);padding:7px}.realm-view .stage-detail-art{width:48px;height:48px}.realm-view .stage-detail-copy h2{font-size:14px}}

/* Tranh thủy mặc theo vùng; mười cửa ải nằm trên đường núi. */
.realm-view .stage-list{position:relative;display:block;height:min(78dvh,760px);min-height:650px;overflow:hidden;border:1px solid #b7b7a7;border-radius:5px;background-color:#eeeadd;background-repeat:no-repeat;background-position:center;background-size:cover;box-shadow:inset 0 0 0 3px #fff9e7a0;isolation:isolate}
.realm-view[data-zone="0"] .stage-list{background-image:url('assets/yeu-thu/son-coc-o-dia-hinh.webp')}
.realm-view[data-zone="1"] .stage-list{background-image:url('assets/yeu-thu/suong-lam-o-dia-hinh.webp')}
.realm-view[data-zone="2"] .stage-list{background-image:url('assets/yeu-thu/co-lam-o-dia-hinh.webp')}
.realm-view .stage-list:before{display:none}
.realm-view .stage-node,.realm-view .stage-node:nth-child(even){position:absolute;z-index:2;left:var(--point-x);right:auto;top:var(--point-y);display:grid;place-items:center;width:42px;height:42px;min-height:0;margin:0;padding:0;transform:translate(-50%,-50%);border:2px solid #8d8878;border-radius:50%;background:#f8f3e5ed;color:#3c4a40;text-align:center;box-shadow:0 1px 0 #fff9,0 3px 7px #282a2555;filter:none;cursor:pointer}
.realm-view .stage-node-number{display:block;width:auto;height:auto;border:0;border-radius:0;background:none;color:inherit;font:800 13px "Segoe UI",Arial,sans-serif;line-height:1}
.realm-view .stage-node.cleared{border-color:#668d78;background:#e6f2e6ef;color:#345e49}
.realm-view .stage-node.locked{opacity:.92;border-color:#93978e;background:#e2e2d9e8;color:#696f68}
.realm-view .stage-node.selected{z-index:3;border:3px solid #9b6636;background:#fff5ddeb;color:#714719;box-shadow:0 0 0 3px #fff8e8bd,0 3px 9px #513e2866}
.realm-view .stage-node.boss{border-color:#9b7959;border-radius:38%}.realm-view .stage-node.boss.selected{border-color:#9b6636}
.realm-view .stage-node:focus-visible{outline:3px solid #255e4a;outline-offset:3px}
.stage-select-prompt{margin:9px 2px 0;padding:9px 6px;border:1px solid #d4ddd4;border-radius:5px;background:#fff;color:#526858;font-size:11px;text-align:center}
.stage-select-prompt[hidden],.realm-view .stage-detail[hidden]{display:none}
@media(max-width:370px){.realm-view .stage-node,.realm-view .stage-node:nth-child(even){width:38px;height:38px}.realm-view .stage-node-number{font-size:12px}}
/* Bộ tư thế và hiệu ứng 2D của năm yêu thú. */
.hunt-links{grid-template-columns:repeat(4,minmax(0,1fr))}
.fighter.beast img{transform:scaleX(var(--beast-facing,1));transform-origin:50% 75%}
.fighter.beast[data-pose="move"] img{animation:beast-stride .36s ease-in-out infinite}
.fighter.beast[data-pose="move"][data-element="hoa"] img{animation-duration:.55s}
.fighter.beast[data-pose="move"][data-element="thuy"] img{animation-name:beast-slither;animation-duration:.65s}
.fighter.beast[data-pose="prepare"] img{animation:beast-windup .45s ease-in-out infinite alternate;filter:drop-shadow(0 0 5px var(--tone))}
@keyframes beast-stride{0%,100%{transform:translateY(0) rotate(-2deg) scaleX(var(--beast-facing,1))}50%{transform:translateY(-5px) rotate(2deg) scaleX(var(--beast-facing,1))}}
@keyframes beast-slither{0%,100%{transform:skewX(-3deg) scaleX(var(--beast-facing,1))}50%{transform:skewX(3deg) scaleX(var(--beast-facing,1))}}
@keyframes beast-windup{from{transform:scale(.97) scaleX(var(--beast-facing,1))}to{transform:scale(1.025) scaleX(var(--beast-facing,1))}}
.arena-enemy-projectile.monster-fx-tile{width:90px;height:90px;border:0;border-radius:0;background-color:transparent;box-shadow:none;filter:drop-shadow(0 0 2px #fff9);transform-origin:center}
.arena-enemy-projectile.monster-fx-tile.skill{width:125px;height:125px;border:0;box-shadow:none}
.arena-enemy-projectile.monster-projectile{width:72px;height:72px;border:0;border-radius:0;filter:drop-shadow(0 0 5px #d9f6ff);transform-origin:center}
.arena-enemy-projectile.monster-projectile.skill{width:88px;height:88px}
.beast-shield-effect{position:absolute;z-index:4;width:155px;height:155px;opacity:.6;transform:translate(-50%,-42%);pointer-events:none}
.fighter.hero.struck img{animation:hero-struck .32s ease-out}
@keyframes hero-struck{0%,100%{transform:translateX(0)}30%{transform:translateX(-6px);filter:brightness(1.65)}65%{transform:translateX(3px)}}
@media(prefers-reduced-motion:reduce){.fighter.beast[data-pose="move"] img,.fighter.beast[data-pose="prepare"] img,.fighter.hero.struck img{animation:none}}
.fighter.hero .monster-animation{height:calc(100% - 17px);transform:scaleX(var(--hero-facing,1))}
.fighter.hero>img{transform:scaleX(var(--hero-facing,1));object-fit:contain}
.fighter.hero.has-monster-animation>img{animation:none!important}
.fighter.hero[data-pose=cast] .monster-animation{filter:drop-shadow(0 0 5px #79d9c8aa)}
.fighter.hero[data-pose=defeated] .monster-animation{filter:saturate(.6)}
body.battle-mode #battle-card .fighter.hero{width:clamp(124px,34vw,160px);height:clamp(141px,calc(34vw + 17px),177px)}
body.battle-mode #battle-card .fighter.hero img{width:100%;height:calc(100% - 17px)}
body.battle-mode #battle-card.lost .fighter.hero{opacity:.85;filter:none}

/* Nút chiến đấu: tên chiêu ổn định, trạng thái riêng và vòng hồi chiêu. */
.battle-card.live .battle-actions{width:212px;height:184px;right:10px;bottom:10px;transform:none}
.battle-card.live .battle-actions button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px;padding:4px;border-width:2px;line-height:1.15;touch-action:none;user-select:none;overflow:visible;text-shadow:none}
.battle-card.live .battle-actions .skill-name{font-size:10px;font-weight:900;white-space:nowrap;text-shadow:0 1px 1px #fff8}
.battle-card.live .battle-actions .skill-status{font-size:9px;font-weight:700;white-space:nowrap}
.battle-card.live #attack-beast{right:0;bottom:0;width:76px;height:76px}
.battle-card.live #attack-beast .skill-name{font-size:12px}
.battle-card.live #guard-beast{right:82px;bottom:0;width:60px;height:60px}
.battle-card.live #cast-secret{right:70px;bottom:78px;width:64px;height:64px}
.battle-card.live #cast-movement{right:146px;bottom:60px;width:62px;height:62px}
.battle-card.live #cast-ultimate{right:0;bottom:110px;width:64px;height:64px}
.battle-card.live .battle-actions button:disabled{opacity:1;filter:none;cursor:default}
.battle-card.live .battle-actions button[data-state=ready]{background:var(--ready-fill);color:#254d43;border-color:#e7cb8e;box-shadow:0 0 0 2px #fff6cebb,0 3px 8px #254d4670}
.battle-card.live .battle-actions button[data-state=ready] .skill-status{color:#205a43}
.battle-card.live .battle-actions button[data-state=cooldown],.battle-card.live .battle-actions button[data-state=casting]{background:linear-gradient(#e5eae3,#bbcfc3);border-color:#799786;color:#345147;box-shadow:inset 0 2px 6px #315c4930}
.battle-card.live .battle-actions button[data-state=charging]{background:linear-gradient(#fff4d8,#e0d9bb);border-color:#b39a6a;color:#6b522b}
.battle-card.live .battle-actions button[data-state=missing],.battle-card.live .battle-actions button[data-state=used]{background:linear-gradient(#e3e7df,#cbd4ca);border-color:#94a58e;color:#596956;box-shadow:none}
.battle-card.live .battle-actions button[data-state=cooldown]:before{content:"";position:absolute;inset:-5px;border-radius:50%;pointer-events:none;background:conic-gradient(#f4b957 var(--cooldown-angle),#304c4033 0);mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 0);-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 0)}
.battle-card.live .battle-actions button:focus-visible{outline:3px solid #fff;outline-offset:6px}
.arena-damage{inset:0;z-index:6;opacity:1;transform:none;pointer-events:none;animation:none}
#mind-combat-notices{position:absolute;z-index:7;top:19%;left:8px;max-width:calc(100% - 16px);display:grid;justify-items:start;gap:3px;pointer-events:none}
#mind-combat-notices span{border:1px solid #8cbdb0;border-radius:4px;background:#183932;color:#e4fff2;padding:3px 7px;font:700 13px/1.3 system-ui,sans-serif}
.combat-text{position:absolute;display:block;width:max-content;max-width:150px;white-space:pre;text-align:center;color:#fff9df;font:900 23px/1.08 Arial,sans-serif;text-shadow:-1px -1px 0 #493b22,1px -1px 0 #493b22,-1px 1px 0 #493b22,1px 1px 0 #493b22,0 2px 4px #142921;animation:combat-text-rise .85s ease-out both;pointer-events:none}
.combat-text[data-kind=critical]{color:#ffe166;font-size:23px;text-shadow:-1px -1px 0 #75401a,1px -1px 0 #75401a,-1px 1px 0 #75401a,1px 1px 0 #75401a,0 2px 5px #653216}
.combat-text[data-kind=critical]::first-line{font-size:12px;line-height:1.1}
.combat-text[data-kind=incoming]{color:#ffccbf;text-shadow:-1px -1px 0 #862c24,1px -1px 0 #862c24,-1px 1px 0 #862c24,1px 1px 0 #862c24}
.combat-text[data-kind=miss],.combat-text[data-kind=block],.combat-text[data-kind=dodge]{font-size:16px;letter-spacing:.5px}
.combat-text[data-kind=dodge],.combat-text[data-kind=block],.combat-text[data-kind=heal]{color:#b6ffeb}
.combat-text:is([data-kind=sword-slash],[data-kind=sword-spent]){padding:4px 7px;border:1px solid #ffdd86;border-radius:5px;background:#291f13;color:#ffdf88;font-size:13px;letter-spacing:.25px}
.combat-text[data-kind=sword-spent]{border-color:#cbae7b;color:#fff0c9}
.combat-text[data-kind=sword-bleed]{padding:4px 7px;border:1px solid #ff958c;border-radius:5px;background:#431e26;color:#ffd3ca;font-size:13px;letter-spacing:.25px}
@keyframes combat-text-rise{0%{opacity:0;transform:translate(-50%,0) scale(.8)}12%{opacity:1;transform:translate(-50%,-7px) scale(1.08)}60%{opacity:1}100%{opacity:0;transform:translate(-50%,-56px) scale(1)}}
@media(max-width:370px){
  .battle-card.live .battle-actions{width:188px;height:164px;right:8px;bottom:9px;transform:none}
  .battle-card.live #attack-beast{width:68px;height:68px}
  .battle-card.live #guard-beast{right:74px;width:54px;height:54px}
  .battle-card.live #cast-secret{right:61px;bottom:72px;width:56px;height:56px}
  .battle-card.live #cast-movement{right:131px;bottom:60px;width:54px;height:54px}
  .battle-card.live #cast-ultimate{bottom:103px;width:56px;height:56px}
  .battle-card.live .battle-actions .skill-name{font-size:9px}
  .battle-card.live .battle-actions .skill-status{font-size:8px}
  .arena-joystick{width:78px;height:78px;left:7px}
  .combat-text{font-size:20px}.combat-text[data-kind=critical]{font-size:19px}
}
@media(prefers-reduced-motion:reduce){.combat-text{animation:combat-text-fade 1s linear both;transform:translate(-50%,-10px)}}
@keyframes combat-text-fade{0%,70%{opacity:1}100%{opacity:0}}
/* Cảnh báo thống nhất: tên chiêu, thời điểm ra đòn và cách tránh. */
.battle-scene .arena-hint{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 7px;padding:7px 9px;background:#fffcefef;text-align:left;border-color:#b5c9af;min-height:47px;box-sizing:border-box}
.battle-scene .arena-hint[hidden]{display:none}
body.battle-mode #battle-card.live:not(.finished) .enemy-intent{display:none}
#arena-hint-title{font-size:11px;line-height:1.25}
#arena-hint-time{align-self:start;white-space:nowrap;padding:3px 5px;border-radius:5px;background:#e5edda;font-size:10px;font-variant-numeric:tabular-nums}
#arena-hint-time:empty{display:none}
#arena-hint-copy{grid-column:1/-1;font-size:10px;font-weight:600;line-height:1.3}
.battle-scene .arena-hint[data-tone=warning]{background:#fff3d4f5;border-color:#d1a05b;color:#74431b}
.battle-scene .arena-hint[data-tone=danger]{background:#fff0e3f5;border-color:#c36949;color:#853d25}
.arena-hint[data-tone=danger] #arena-hint-time,.arena-hint.urgent #arena-hint-time{background:#a33f2a;color:#fff8e4}
.battle-scene .arena-hint[data-tone=safe]{background:#eaf9e9f2;border-color:#8fbf9c;color:#315f43}
.combat-help{position:absolute;z-index:7;bottom:127px;left:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:70px;height:44px;padding:3px;border:1px solid #c7bc83;border-radius:10px;background:#fff8deed;color:#405c46;box-shadow:0 2px 6px #23473555;cursor:pointer;touch-action:manipulation}
.combat-help[hidden]{display:none}.combat-help b{font-size:16px;line-height:1}.combat-help span{font-size:9px;font-weight:800;white-space:nowrap}
.combat-help-dialog{box-sizing:border-box;width:min(440px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:16px;border:2px solid #9eb59a;border-radius:15px;background:#faf9ed;color:#304d3b;box-shadow:0 10px 55px #143b3555;font:13px/1.5 Arial,sans-serif;overscroll-behavior:contain}
.combat-help-dialog::backdrop{background:#122a23b8}
.combat-help-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:8px}
.combat-help-dialog>header small{font-size:9px;letter-spacing:1.2px;color:#798260}
.combat-help-dialog h2{font:700 20px/1.25 "Segoe UI",Arial,sans-serif;margin:0}
#combat-help-close{flex:none;width:44px;height:44px;border:1px solid #bcc7ad;border-radius:50%;background:#fffdf2;color:#5a6548;font-size:25px}
.combat-help-note{margin:10px 0;padding:7px 9px;border-radius:6px;background:#e0efda;color:#386346;font-size:11px}
.combat-help-move{margin:10px 0;font-size:12px}
.combat-help-skills{display:grid;gap:7px}
.combat-help-skills section{padding:9px 11px;border:1px solid #d0d9bf;border-radius:8px;background:#fffef6}
.combat-help-skills h3{display:flex;align-items:center;justify-content:space-between;gap:7px;font-size:13px;margin:0 0 3px}
.combat-help-skills h3 small{flex:none;padding:2px 5px;border-radius:4px;background:#e6eedb;color:#456344;font-size:10px;font-weight:600}
.combat-help-skills section>b{display:block;font-size:11px;color:#8c6730}
.combat-help-skills p{font-size:12px;margin:3px 0 0}
.combat-help-skills section>strong{display:block;margin-top:6px;color:#315643;font-size:12px}
.combat-help-skills ul{margin:3px 0 0;padding-inline-start:18px;font-size:12px;line-height:1.45}
.sword-battle-status{grid-column:1/-1;width:fit-content;padding:2px 6px;border-radius:4px;background:#254239;color:#fff4d1;font-size:10px;line-height:1.25}
.sword-battle-status[hidden]{display:none}
.combat-help-skills [data-state=missing]{background:#edf0e6;color:#60705d}
.combat-help-keys{margin:12px 0;font-size:10px;color:#65755b}
.combat-help-resume{width:100%;min-height:44px;border:1px solid #367b5e;border-radius:8px;background:#3f8064;color:#fff9e5;font-size:13px;font-weight:700}
.help-open .battle-scene *{animation-play-state:paused!important}
.combat-help:focus-visible,.combat-help-dialog button:focus-visible{outline:3px solid #eeb754;outline-offset:2px}
@media(max-width:370px){.combat-help{left:7px;bottom:100px;width:58px}.combat-help-dialog{padding:12px}#arena-hint-title{font-size:10px}#arena-hint-copy{font-size:9px}}
.wave-enemies,.wave-enemy-root{position:absolute;inset:0;pointer-events:none}
.wave-enemies[hidden],.wave-enemy-root[hidden]{display:none}
body.battle-mode #battle-card .fighter.beast.wave-beast{width:100px;height:116px;pointer-events:auto;cursor:pointer;touch-action:manipulation;transition:none;--tone:#83a85d}
body.battle-mode #battle-card .fighter.beast.wave-beast img{width:100px;height:99px}
.wave-beast .wave-enemy-name{position:absolute;left:50%;top:-20px;bottom:auto;transform:translateX(-50%);padding:3px 6px;border-radius:5px;background:#fdf8e9ef;color:#415c41;font-size:10px;font-weight:700;white-space:nowrap}
.wave-beast>b{display:none}
.wave-beast .wave-enemy-health{display:none!important;position:absolute;top:2px;left:19px;width:62px;height:6px;overflow:hidden;border:1px solid #556d53;border-radius:5px;background:#e1dbcb;box-shadow:0 1px 3px #27443744}
.wave-enemy-health i{display:block;height:100%;background:#a34f3d;transition:width .15s}
.battle-card.live .wave-beast.selected-target:after{content:'';position:absolute;left:12px;right:12px;bottom:7px;height:23px;border:2px solid #c49537;border-radius:50%;box-shadow:0 0 0 3px #fff3bf99;pointer-events:none}
.wave-beast.selected-target .wave-enemy-name{background:#ffebaf;border:1px solid #bd9141;color:#64481c}
.wave-beast:focus-visible{outline:2px solid #bd9141;outline-offset:3px;border-radius:14px}
.wave-beast.wave-defeated{pointer-events:none}
.wave-defeated .wave-enemy-name,.wave-defeated .wave-enemy-health,.wave-defeated>b{visibility:hidden}
.wave-beast .combat-statuses{bottom:calc(100% + 25px)}
.encounter-progress{order:2;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:1px 0 5px;font-size:10px;color:#4d684b}
.encounter-progress[hidden]{display:none}
.encounter-progress button{min-height:32px;padding:4px 10px;border:1px solid #a3b497;border-radius:7px;background:#f4f8e7;color:#466341;font-size:11px;font-weight:700;cursor:pointer}
.encounter-progress button[aria-pressed=true]{background:#dcebd4}
.stage-preparation{grid-column:1/-1;margin:0;padding:9px;border:1px solid #c2cdb5;border-radius:8px;background:#f5f7ea;color:#38523c}
.stage-detail-footer{grid-column:1/-1}.stage-detail-footer .stage-lock-reason{margin:3px 0 0;color:#7a6a50;font-size:10px;font-weight:700}
.preparation-heading{display:flex;justify-content:space-between;align-items:center;gap:7px;font-size:10px}.preparation-heading>b{font-size:11px;color:#476443}
.stage-preparation[data-tone=warning] .preparation-heading>b{color:#90611c}.stage-preparation[data-tone=danger] .preparation-heading>b{color:#a43d28}
.stage-stat-targets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:7px 0}.stage-stat-targets>span{display:grid;gap:2px;padding:5px;border:1px solid #cbd4bd;background:#fffef6;border-radius:5px;text-align:center}.stage-stat-targets small{font-size:10px}.stage-stat-targets b{font-size:12px;overflow-wrap:anywhere}.stage-stat-targets .below-target{color:#9c432c}.stage-stat-targets .at-target{color:#396c43}
.stage-preparation #stage-growth-hint{font-size:11px;line-height:1.4;margin:5px 0}.stage-preparation>small{display:block;font-size:10px;line-height:1.4;color:#65725d}.stage-growth-links{display:flex;gap:14px;margin-top:7px}.stage-growth-links a{font-size:11px;color:#3d6b50;text-decoration:underline}
body.battle-mode #battle-card.wave-encounter:not(.finished) .enemy-state{display:none}
body.battle-mode #battle-card.wave-encounter .battle-log{max-height:1.35em;white-space:nowrap;text-overflow:ellipsis}
body.battle-mode #battle-card.wave-encounter .relation-result{min-height:0;padding-top:3px;padding-bottom:3px}
@media(max-width:370px){body.battle-mode #battle-card .fighter.beast.wave-beast{width:88px;height:102px}body.battle-mode #battle-card .fighter.beast.wave-beast img{width:88px;height:85px}.wave-beast .wave-enemy-health{left:13px}.wave-beast .wave-enemy-name{font-size:9px}.encounter-progress{font-size:9px}}
/* Chuẩn bị hình trước khi tiêu thể lực và chạy sân đấu. */
.online-battle-resume{padding:14px;margin:10px 0;border:1px solid #bb9963;border-radius:9px;background:#fff2cd;color:#624e2e;font:13px/1.5 "Segoe UI",sans-serif}.online-battle-resume[hidden]{display:none}.online-battle-resume p{margin:6px 0}.online-battle-resume button{min-height:44px;padding:8px 14px;margin:4px 6px 0 0;border:1px solid #6f9575;border-radius:6px;background:#416f55;color:#fff9e5;font:inherit}.online-battle-resume button:last-child{background:#fff8e4;color:#5c6345}
body[data-online=true].battle-mode #battle-card .battle-scene{flex:0 0 auto;align-self:center;width:min(100%,calc((100dvh - 195px)*.833333));aspect-ratio:5/6;height:auto;min-height:0;box-sizing:border-box}
/* Thu nhỏ hình nhân vật và quái khoảng một phần ba, giữ nguyên bảng tên và nút bấm. */
body[data-online=true].battle-mode #battle-card .fighter.hero{width:16%;height:19.5%}body[data-online=true].battle-mode #battle-card .fighter.hero img{width:100%;height:100%}
body[data-online=true].battle-mode #battle-card .fighter.beast,body[data-online=true].battle-mode #battle-card .fighter.beast.wave-beast{width:16.7%;height:18%}body[data-online=true].battle-mode #battle-card .fighter.beast img{width:100%;height:100%}
body[data-online=true].battle-mode #battle-card .actor-head-up{min-width:76px}
.battle-loading{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;padding:20px;background:#102b32d9;color:#2d5147;font:14px/1.5 "Segoe UI",Arial,sans-serif}.battle-loading[hidden]{display:none}.battle-loading section{width:min(100%,390px);padding:24px;background:#fff9e8;border:1px solid #bfa76e;border-radius:12px;box-shadow:0 12px 50px #071c2899}.battle-loading small{color:#947039;letter-spacing:1px;font-size:11px}.battle-loading h2{font-size:21px;margin:8px 0 12px;color:#654d2e}.battle-loading progress{display:block;width:100%;height:13px;accent-color:#3e8a70}.battle-loading .loading-note{font-size:12px;color:#64796a}.battle-loading button{padding:11px 14px;margin:6px 5px 0 0;border:1px solid #648b75;border-radius:5px;background:#296c58;color:#fff9e5;font:inherit;cursor:pointer}.battle-loading button:last-child{background:#f6efd7;color:#365b47}.battle-loading button[hidden]{display:none}

.hunt-notice{margin:10px 0;padding:12px;border:1px solid #b68d55;border-radius:7px;background:#fff4d9;color:#694b2a;font:13px/1.5 'Segoe UI',sans-serif}.hunt-notice[hidden]{display:none}

body[data-online=true].battle-mode #battle-card.finished .battle-scene{width:min(100%,280px,calc(37dvh * .833333));min-height:0;height:auto;aspect-ratio:5/6}
body.battle-mode #battle-card.finished :is(.enemy-intent,.enemy-state,.active-build-status,.relation-result,.battle-technique,.secret-status,.advanced-status,.kim-status,.water-status,.wood-status,.fire-status,.earth-status,.battle-log){display:none}

.realm-view[data-zone="3"] .stage-list{background-image:url('assets/yeu-thu/van-son-o-dia-hinh.webp')}
.battle-scene[data-zone="3"]{background-image:linear-gradient(#dbece48c,#183b3dbd),url('assets/yeu-thu/truc-co/vanson-battle.png');background-position:center 48%;background-size:cover}

@media (max-width:600px){body:not(.battle-mode) .realm-view .stage-detail{position:fixed;z-index:30;left:50%;top:50%;width:min(92vw,390px);max-height:82vh;overflow:auto;margin:0;transform:translate(-50%,-50%);padding:14px;background:#fffdf2;box-shadow:0 18px 60px #10251c99;border:2px solid #a9894c;border-radius:12px}.realm-view .stage-detail-close{position:absolute;right:8px;top:6px;display:grid;place-items:center;width:28px;height:28px;border:0;border-radius:50%;background:#e9e1c8;color:#496556;font-size:20px;line-height:1}.realm-view .stage-detail-copy{padding-right:24px}.realm-view .stage-detail-art{width:64px;height:64px}.realm-view .stage-detail-footer{margin-top:2px}}

@media (max-width:600px){body:not(.battle-mode) .realm-view{position:relative}.realm-view .stage-detail{position:absolute!important;z-index:12;left:50%;top:50%;width:min(84%,350px);max-height:76%;overflow:auto;margin:0!important;transform:translate(-50%,-50%);padding:12px;background:#fffdf2;border:2px solid #a9894c;border-radius:12px;box-shadow:0 16px 50px #10251caa}.realm-view .stage-detail-close{position:absolute;right:7px;top:6px;display:grid;place-items:center;width:28px;height:28px;border:0;border-radius:50%;background:#e9e1c8;color:#496556;font-size:20px;line-height:1}.realm-view .stage-detail-copy{padding-right:24px}.realm-view .stage-detail-art{width:56px;height:56px}.realm-view .stage-detail-footer{margin-top:2px}}

@media (max-width:600px){body:not(.battle-mode) .realm-view .stage-detail{position:absolute!important;z-index:50;left:50%;top:52%;width:min(78%,285px);max-height:none;overflow:visible;display:grid;grid-template-columns:48px minmax(0,1fr);gap:6px 8px;margin:0!important;padding:10px;background:#fffdf2;border:2px solid #9b7a45;border-radius:10px;transform:translate(-50%,-50%);box-shadow:0 12px 35px #10251ccc}.realm-view .stage-detail-art{width:48px;height:48px}.realm-view .stage-detail-copy h2{font-size:14px}.realm-view .stage-detail-copy>p{font-size:8px}.realm-view .stage-preparation{grid-column:1/-1;font-size:9px}.realm-view .stage-detail-footer{grid-column:1/-1;font-size:9px}.realm-view .stage-detail #start-battle{grid-column:1/-1;min-height:34px}.realm-view .stage-detail-close{z-index:2}}

@media (max-width:600px){body:not(.battle-mode) #stage-detail{position:absolute!important;z-index:100;left:50%!important;top:50%!important;width:min(78%,285px)!important;margin:0!important;transform:translate(-50%,-50%)!important;display:grid!important}}

/* Bảng thông tin ải luôn nổi trên bản đồ, không chảy xuống dưới bản đồ. */
body:not(.battle-mode) .realm-view{position:relative!important}
body:not(.battle-mode) .realm-view #stage-detail{position:absolute!important;z-index:100;left:50%!important;top:50%!important;width:min(78%,330px)!important;max-height:78%!important;overflow:auto!important;margin:0!important;transform:translate(-50%,-50%)!important;display:grid!important;grid-template-columns:58px minmax(0,1fr)!important;gap:7px 9px!important;padding:12px!important;border:2px solid #9b7a45!important;border-radius:12px!important;background:#fffdf2!important;box-shadow:0 16px 50px #10251caa!important}
body:not(.battle-mode) .realm-view #stage-detail[hidden]{display:none!important}
body:not(.battle-mode) .realm-view #stage-detail .stage-detail-close{position:absolute;right:7px;top:6px;z-index:2;display:grid;place-items:center;width:28px;height:28px;border:0;border-radius:50%;background:#e9e1c8;color:#496556;font-size:20px;line-height:1;cursor:pointer}
body:not(.battle-mode) .realm-view #stage-detail .stage-detail-copy{padding-right:24px}
body:not(.battle-mode) .realm-view #stage-detail .stage-detail-art{width:58px;height:58px}
body:not(.battle-mode) .realm-view #stage-detail .stage-detail-footer,
body:not(.battle-mode) .realm-view #stage-detail #start-battle{grid-column:1/-1}

/* Khu vực chiến đấu: thứ bậc thông tin rõ như giao diện game thương mại. */
body.battle-mode #battle-card .battle-title{padding:4px 2px 5px;border-bottom:1px solid #cbd8c8}
body.battle-mode #battle-card .health-row{padding:6px 8px;border:1px solid #c8d7c7;border-radius:11px;background:#ffffffd9;box-shadow:0 3px 9px #31564418}
body.battle-mode #battle-card .battle-scene{border-width:2px;border-color:#7da891;border-radius:16px;box-shadow:inset 0 0 0 2px #fff8dc99,0 6px 16px #315b4728}
body.battle-mode #battle-card .enemy-intent{border-radius:9px;box-shadow:0 2px 6px #315b4720}
body.battle-mode #battle-card .battle-actions{filter:drop-shadow(0 5px 8px #22463855)}
body.battle-mode #battle-card .hunt-result{padding:14px;border:2px solid #c89c4c;border-radius:14px;box-shadow:0 8px 24px #315b4738}
body.battle-mode #battle-card .hunt-result strong{display:block;color:#6c4a21;font-size:18px;text-align:center}
body.battle-mode #battle-card .hunt-result p{text-align:center}

/* Bố cục điện thoại: giữ bản đồ, tiến độ và nút vào ải; ẩn thông tin phụ. */
@media (max-width:600px){
  body:not(.battle-mode) .page-guide,
  body:not(.battle-mode) #hunt-battle-stats,
  body:not(.battle-mode) #hunt-record,
  body:not(.battle-mode) .stage-path-note,
  body:not(.battle-mode) .rate-card,
  body:not(.battle-mode) .hunt-links{display:none!important}
  body:not(.battle-mode) .hunt-page{padding-left:8px;padding-right:8px}
  body:not(.battle-mode) .hunt-header{padding-top:calc(4px + env(safe-area-inset-top));padding-bottom:4px}
  body:not(.battle-mode) .hunt-status{margin-bottom:4px}
  body:not(.battle-mode) .stage-overview{margin-top:3px}
  body:not(.battle-mode) .realm-view .stage-list{height:min(54dvh,360px);min-height:280px}
  body:not(.battle-mode) .stage-select-prompt{margin:4px 0 0;font-size:9px}
}

/* Bản đồ chọn ải luôn gọn, kể cả khi mở trên máy tính với khung giả lập điện thoại. */
body:not(.battle-mode) .realm-view .stage-list{
  height:min(54dvh,360px)!important;
  min-height:280px!important;
  overflow-y:auto!important;
}
body:not(.battle-mode) .stage-path-note,
body:not(.battle-mode) .rate-card,
body:not(.battle-mode) .hunt-links{display:none!important}
body:not(.battle-mode) .page-guide{display:none!important}

/* Bỏ bảng Rương hành trình khỏi giao diện vượt ải. */
body:not(.battle-mode) .journey-rewards{display:none!important}
body:not(.battle-mode) #story-banner{display:none!important}

/* Giao diện Vượt Ải kiểu game thương mại trên điện thoại. */
body:not(.battle-mode) .hunt-page{
  max-width:480px;
  padding:0 10px max(18px,env(safe-area-inset-bottom));
  background:linear-gradient(180deg,#f4f7f0 0%,#e7efe5 100%);
  box-shadow:0 0 36px #36544722;
}
body:not(.battle-mode) .hunt-header{
  position:sticky;top:0;z-index:80;
  margin:0 -10px 7px;padding:calc(7px + env(safe-area-inset-top)) 12px 7px;
  background:#f5f8f2ee;border-bottom:1px solid #d4dfd1;
  backdrop-filter:blur(12px);
}
body:not(.battle-mode) .hunt-header h1{font-size:20px;letter-spacing:.8px}
body:not(.battle-mode) .hunt-header small{font-size:8px;letter-spacing:1.2px}
body:not(.battle-mode) .hunt-status{margin:0 0 7px;padding:5px;border:1px solid #d1ddd0;border-radius:11px;background:#fffffff0;box-shadow:0 3px 12px #43644d18}
body:not(.battle-mode) .hunt-status>div{padding:5px 6px;background:#f1f6ef;border-radius:7px}
body:not(.battle-mode) .hunt-status strong{font-size:12px}
body:not(.battle-mode) .stage-overview{margin:0 0 7px;padding:8px 10px;border:0;border-radius:10px;background:#315f4d;color:#fffbe9;box-shadow:0 4px 10px #315f4d2e}
body:not(.battle-mode) .stage-overview strong{color:#ffe3a1;font-size:11px}
body:not(.battle-mode) .realm-view{padding:8px;border:1px solid #c8d7c7;border-radius:14px;background:#f8fbf5;box-shadow:0 5px 16px #355b4820}
body:not(.battle-mode) .stage-menu-toggle{width:100%;min-height:36px;border:1px solid #b5cdb8;border-radius:9px;background:#e5f0e5;color:#315d4b;font-size:11px;font-weight:900;text-align:left}
body:not(.battle-mode) .stage-map-head{padding:8px 2px 6px}
body:not(.battle-mode) .stage-map-head h2{font-size:18px;color:#244f40}
body:not(.battle-mode) .stage-list{border:2px solid #b4cdb0!important;border-radius:12px!important;box-shadow:inset 0 0 0 2px #fff8df99,0 4px 12px #315b4728!important}
body:not(.battle-mode) .stage-select-prompt{padding:7px 8px;border:1px solid #d1ddd0;border-radius:8px;background:#fff;color:#698072;text-align:center}
body:not(.battle-mode) .realm-view #stage-detail:not([hidden]){
  top:auto!important;bottom:10px!important;left:50%!important;
  width:calc(100% - 18px)!important;max-height:70%!important;
  padding:11px!important;border-radius:14px!important;
  background:#fffdf5f7!important;box-shadow:0 12px 30px #173c2d55!important;
  backdrop-filter:blur(8px);
}

/* Đồng bộ bảng chọn ải với sảnh chính màu hang động của game. */
body:not(.battle-mode){background:#07151d}
body:not(.battle-mode) .hunt-page{
  background:linear-gradient(#06151dcc,#09262be8 44%,#06151df5),url('assets/mach-son-cavern-2d.png') center top/cover fixed;
  box-shadow:0 0 70px #000;
}
body:not(.battle-mode) .hunt-header{background:#07171de8;border-color:#8d6b48}
body:not(.battle-mode) .hunt-header h1{color:#f0d39a;text-shadow:0 2px 8px #000}
body:not(.battle-mode) .hunt-header small{color:#9ed8c1}
body:not(.battle-mode) .hunt-header>a{border-color:#9b754d;background:#0a2429;color:#f1d49b}
body:not(.battle-mode) .hunt-status{border-color:#836c4a;background:#0b252be8;box-shadow:0 3px 12px #0008}
body:not(.battle-mode) .hunt-status>div{background:#12363a;border-color:#315c58}
body:not(.battle-mode) .hunt-status small{color:#a9d8c8}
body:not(.battle-mode) .hunt-status strong{color:#f2d9a5}
body:not(.battle-mode) .stage-overview{background:linear-gradient(110deg,#123f40,#0a292f);border:1px solid #9b754d;color:#f0d39a}
body:not(.battle-mode) .realm-view{border-color:#806343;background:#0b242ae8;box-shadow:inset 0 0 0 1px #47706866,0 7px 18px #0009}
body:not(.battle-mode) .stage-menu-toggle{border-color:#638b7b;background:#123a3c;color:#d9e8c7}
body:not(.battle-mode) .stage-map-head small{color:#8ed9bf}
body:not(.battle-mode) .stage-map-head h2{color:#f1d49b}
body:not(.battle-mode) .stage-map-head span{color:#d7b778}
body:not(.battle-mode) .stage-list{border-color:#9b754d!important;box-shadow:inset 0 0 0 2px #f4d89b33,0 4px 14px #0009!important}
body:not(.battle-mode) .stage-select-prompt{border-color:#496e68;background:#0e3035;color:#a9d9c7}
body:not(.battle-mode) .stage-node{transition:filter .16s ease,box-shadow .16s ease}
body:not(.battle-mode) .stage-node:active{transform:translate(-50%,-50%)!important;filter:brightness(1.15)}
#stage-detail-open{display:none}
@media(max-width:759px){
 #stage-detail-open{display:block;flex:none;width:100px;min-height:44px;margin-left:auto;padding:6px;border:1px solid #bc9b62;border-radius:7px;background:#fff0cd;color:#49371e;font:700 12px 'Segoe UI',sans-serif}
 #stage-detail-open:disabled{visibility:hidden}
 .stage-map-head{gap:8px}
}

/* Thanh điều hướng chính cố định như sảnh game thương mại. */
.hunt-bottom-nav{display:none}
body:not(.battle-mode) .hunt-page{padding-bottom:max(76px,calc(58px + env(safe-area-inset-bottom)))}
body:not(.battle-mode) .hunt-bottom-nav{
  position:fixed;z-index:120;left:50%;bottom:0;display:grid;grid-template-columns:repeat(5,1fr);
  width:min(100%,480px);height:62px;padding:5px 10px max(5px,env(safe-area-inset-bottom));gap:4px;
  transform:translateX(-50%);border-top:1px solid #9a744d;background:linear-gradient(#0a2529f2,#061219fc);box-shadow:0 -5px 18px #0008;
}
body:not(.battle-mode) .hunt-bottom-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;border:1px solid transparent;color:#a9c1b6;text-decoration:none}
body:not(.battle-mode) .hunt-bottom-nav a span{font-size:21px;line-height:22px;color:#bc9b63}
body:not(.battle-mode) .hunt-bottom-nav a small{font-size:9px;white-space:nowrap}
body:not(.battle-mode) .hunt-bottom-nav a.active{border-color:#75c9ad;background:linear-gradient(#194542,#0b2a31);color:#fff1c7;clip-path:polygon(9% 0,91% 0,100% 18%,100% 100%,0 100%,0 18%)}
body:not(.battle-mode) .hunt-bottom-nav a.active span{color:#75e3c1}
body.battle-mode .hunt-bottom-nav{display:none!important}

/* Trận đánh dùng cùng chất liệu tối, tránh chuyển đột ngột sang bảng sáng. */
body.battle-mode{background:#07151d;color:#f2e5c7}
body.battle-mode .hunt-page{background:linear-gradient(#06151dcc,#09262be8 44%,#06151df5),url('assets/mach-son-cavern-2d.png') center top/cover fixed;box-shadow:0 0 70px #000}
body.battle-mode .hunt-header{background:#07171de8;border-bottom:1px solid #8d6b48}
body.battle-mode .hunt-header h1{color:#f0d39a;text-shadow:0 2px 8px #000}
body.battle-mode .hunt-header p{color:#afd5c5}
body.battle-mode .hunt-status{border-color:#836c4a;background:#0b252be8;box-shadow:0 3px 12px #0008}
body.battle-mode .hunt-status>div{background:#12363a;border-color:#315c58}
body.battle-mode .hunt-status small{color:#a9d8c8}
body.battle-mode .hunt-status strong{color:#f2d9a5}
body.battle-mode .battle-card{border-color:#bd955d;background:linear-gradient(#153d40ef,#0b252df7);box-shadow:inset 0 0 0 1px #75baaa5d,0 9px 22px #0009}
body.battle-mode .battle-title span{color:#a8e4d3}
body.battle-mode .battle-title strong{color:#ffe1a5}
body.battle-mode .battle-scene{border-color:#6b9c92;background:radial-gradient(ellipse at 76% 48%,#328f8b8c,transparent 40%),linear-gradient(#0d303b88,#102b32d9),url('assets/mach-son-cavern-2d.png') center 47%/cover}
body.battle-mode .health-row>div>span:first-child{color:#dceee2}
body.battle-mode .health-bar{border-color:#718d83;background:#1a292c}
body.battle-mode .enemy-intent{border-color:#9ecab2;background:#153b3c;color:#e8f4df}
body.battle-mode .enemy-intent.danger{border-color:#ffad72;background:#603b32;color:#fff0d6}
body.battle-mode .enemy-state{border-color:#517d77;background:#102f35;color:#c7e4d6}
body.battle-mode .relation-result{background:#092e36}
body.battle-mode .relation-result span{color:#ebf5e5}
body.battle-mode .relation-result small{color:#b3d2c8}
body.battle-mode .battle-technique,body.battle-mode .battle-log{color:#cde5d7}
body.battle-mode .secret-status,body.battle-mode .advanced-status{background:#103d43;color:#f3ead0}
body.battle-mode .battle-actions button{border-color:#d5ad67;background:linear-gradient(#ad7c42,#79522e);color:#fff4d7}
body.battle-mode .hunt-result{border-color:#d1ad67;background:linear-gradient(#4b3b25,#2d2e2a);color:#ffe9b5;box-shadow:0 4px 12px #0008}
body.battle-mode .hunt-result-actions button{border-color:#b59662;background:#18383a;color:#ffe5b2}
body.battle-mode .hunt-result-actions #hunt-chase{border-color:#58b894;background:#267a66;color:#fff}
body.battle-mode .battle-loading{background:#06151de8;color:#f2e5c7}
body.battle-mode .battle-loading section{border-color:#bd955d;background:linear-gradient(#153d40,#0b252d);box-shadow:0 12px 50px #000c}
body.battle-mode .battle-loading h2{color:#f0d39a}
body.battle-mode .battle-loading small{color:#a9d8c8}
body.battle-mode .battle-loading progress{accent-color:#58cda1}
body.battle-mode .battle-loading .loading-note{color:#b3d2c8}




.page-guide{display:none!important}


/* Chỉ dùng thanh máu trên nhân vật; giữ thông báo hiệu ứng độc lập. */
.health-row[hidden]{display:none}
body.battle-mode #battle-card>.beast-status-row{order:2}
.hero-vital-row{display:grid;grid-template-columns:minmax(0,1fr) 4.8em;align-items:center;gap:4px;width:100%;font-size:8px}
.hero-vital-row small{text-align:right;font-size:inherit;font-variant-numeric:tabular-nums;white-space:nowrap}
.hero-actor-spirit[hidden]{display:none}
.hero-actor-spirit small{color:#c3edff;font-weight:900;line-height:1;text-shadow:0 1px 2px #00151a}
.hero-actor-spirit progress{appearance:none;display:block;box-sizing:border-box;width:100%;height:6px;border:1px solid #183a56;border-radius:5px;background:#091b2e;overflow:hidden;box-shadow:0 1px 3px #00151a99}
.hero-actor-spirit progress::-webkit-progress-bar{background:#091b2e}
.hero-actor-spirit progress::-webkit-progress-value{background:linear-gradient(90deg,#4995e0,#9bdefd)}
.hero-actor-spirit progress::-moz-progress-bar{background:linear-gradient(90deg,#4995e0,#9bdefd)}
.battle-item-bar{display:none;order:2;align-self:center;gap:5px}
.fate-practice{margin:8px 0;padding:10px;border:1px solid #9b8050;border-radius:8px;background:#fff2cf;color:#423725}
.fate-practice h2{margin:0;font-size:15px}
.fate-practice p{font-size:12px}
.fate-practice button{margin-right:6px}
.fate-battle-status{order:2;align-self:center;max-width:100%;margin:2px 0;padding:3px 8px;border:1px solid #548178;border-radius:5px;background:#173c3a;color:#e5f7e9;font-size:10px;text-align:center}
.fate-battle-status span{display:inline-block;margin:2px;padding:2px 4px;border-radius:3px;background:#22524c}
.fate-battle-status [data-tone="active"]{background:#513c1d;color:#ffedc0}
#battle-card.finished .fate-battle-status{display:none}
body.battle-mode #battle-card.live:not(.finished)>.battle-item-bar{display:flex}
.battle-potion{position:relative;display:grid;place-items:center;min-width:44px;min-height:41px;padding:3px 5px;border:1px solid #90c9ec;border-radius:5px;background:#d5edff;color:#12334f;font-size:10px;font-weight:800}
.battle-potion kbd{position:absolute;top:2px;left:3px;font:inherit}
.battle-potion:disabled{opacity:.6}
.battle-potion.pill-active{opacity:1;border-color:#eed287;background:#fff0bf;color:#563a15}
.foundation-sites{margin:12px 0;padding:12px;border:1px solid #a5aa83;border-radius:9px;background:#fbf7e9;color:#264d40;scroll-margin-top:12px}
.foundation-sites h2{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;font-size:17px}
.foundation-sites h2 small{font-size:11px;color:#716343}
.foundation-sites h3{margin:10px 0 5px;font-size:12px}
.foundation-sites p{font-size:11px}
.foundation-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.foundation-sites button{min-height:40px;width:100%;padding:6px;border:1px solid #91a994;border-radius:6px;background:#e5efe0;color:#254c40;text-align:left}
.foundation-sites button small,.foundation-sites button b{display:block}
.foundation-sites button small{margin-top:3px;font-size:10px}
.foundation-sites button[aria-pressed="true"]{border-color:#99773e;background:#fff0cd}
.battle-card.live .battle-scene[data-foundation]:not([data-foundation=""]):after{background:linear-gradient(transparent,var(--foundation-tint,#31585199))}
.battle-scene[data-foundation="loiLinhKhi"]{--foundation-tint:#534186aa}
.battle-scene[data-foundation="thuyLinhKhi"]{--foundation-tint:#276788aa}
.battle-scene[data-foundation="hoaLinhKhi"]{--foundation-tint:#7f382aaa}
.battle-scene[data-foundation="thoLinhKhi"]{--foundation-tint:#845d29aa}
.battle-scene[data-foundation="mocLinhKhi"]{--foundation-tint:#265a32aa}
.battle-scene[data-foundation="tangSaCot"]{--foundation-tint:#604323c7}
.battle-scene[data-foundation="trieuTichLo"]{--foundation-tint:#274f6bc7}
.battle-scene[data-foundation="thienNienChungNhu"]{--foundation-tint:#4d475cc7}
.battle-potion img{width:20px;height:20px;object-fit:contain}
.foundation-shortcut{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 6px;align-items:center;margin:5px 0 8px;padding:6px 10px;min-height:44px;border:1px solid #997743;border-radius:7px;background:#fff2cf;color:#523b20;text-decoration:none}
.foundation-shortcut b{font-size:13px}
#foundation-shortcut-progress{grid-column:1;font-size:11px}
.foundation-shortcut>span:last-child{grid-column:2;grid-row:1/3;font-size:22px}
.foundation-shortcut{width:100%;text-align:left;font:inherit}
#foundation-dialog{width:min(720px,calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:0;border:1px solid #a58c58;border-radius:12px;background:#fbf7e9;color:#264d40;overflow:hidden;box-shadow:0 18px 60px #061c2580}
#foundation-dialog:not([open]){display:none}
#foundation-dialog[open]{display:flex;flex-direction:column}
#foundation-dialog::backdrop{background:#071f28a8}
.foundation-dialog-heading{display:flex;flex:none;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:8px 12px;border-bottom:1px solid #cfbd93;background:#fff2d0}
.foundation-dialog-heading h2{margin:0;font-size:20px}
.foundation-dialog-heading button{min-width:44px;min-height:44px;padding:4px;border:1px solid #b69b65;border-radius:7px;background:#fffaf0;color:#365c4e;font:inherit;font-size:24px}
#foundation-dialog .foundation-sites{min-height:0;overflow:auto;overscroll-behavior:contain;margin:0;border:0;border-radius:0}
#foundation-dialog .foundation-collection-count{margin:0 0 8px;font-size:13px}
#foundation-dialog .foundation-sites button{min-height:44px}
@media(max-width:600px){#foundation-dialog .foundation-grid{grid-template-columns:1fr}}
body:not(.battle-mode)>.hunt-page{width:min(100%,480px);max-width:100vw}
body:not(.battle-mode) .stage-overview>strong{min-width:0;white-space:normal;text-align:right}
body.battle-mode #battle-card .arena-vitals{z-index:6;left:clamp(55px,var(--actor-x,50%),calc(100% - 55px));top:max(57px,calc(var(--actor-y,50%) - clamp(46px,9dvh,88px)));width:108px;padding:3px 5px;border:1px solid #9ed1bd;border-radius:5px;background:#082628ef;box-shadow:0 2px 5px #001b1b9c}
.arena-vitals[hidden]{display:none}
body.battle-mode #battle-card .arena-vitals strong{padding:0;border:0;background:transparent}
body.battle-mode #battle-card .arena-vitals .actor-health-value,.arena-vitals .hero-actor-spirit small{font-size:9px}
body.battle-mode #battle-card .arena-hint{z-index:9}
body.battle-mode #battle-card .battle-actions .skill-icon{display:block;font-size:15px;line-height:1}
body.battle-mode #battle-card .battle-actions .skill-name{max-width:100%;font-size:clamp(8px,2.5vw,11px);line-height:1;white-space:nowrap}
body.battle-mode #battle-card .battle-actions .skill-status{font-size:clamp(7px,2.2vw,10px);line-height:1.05}
body.battle-mode #battle-card .battle-item-bar{display:flex;justify-content:center;gap:5px;width:min(100%,310px)}
body.battle-mode #battle-card.finished .battle-item-bar{display:none}
.battle-item-bar .battle-potion{flex:1 1 0;min-height:44px;min-width:0}
.battle-card.live .battle-actions button[data-state=spirit]{background:#d9e6f1;color:#244768;border-color:#7f9ebb}
body:not(.battle-mode)>.hunt-page .hunt-header h1{color:#fff3d5!important;text-shadow:0 2px 4px #38200d!important}
body:not(.battle-mode)>.hunt-page .hunt-status strong{color:#ffe6af!important}
body:not(.battle-mode) .realm-view #stage-detail:not([hidden]){
  position:relative!important;inset:auto!important;width:100%!important;
  max-height:none!important;overflow:visible!important;transform:none!important;
  margin:10px 0 0!important;scroll-margin-top:12px;
}
.realm-view #stage-detail #start-battle,.stage-quick-gear{grid-column:1/-1}
.realm-view #stage-detail #start-battle{min-height:44px}
.stage-quick-gear{display:grid;gap:5px;padding:7px;border:1px solid #baab86;border-radius:8px;background:#faf4e4;color:#433921;font-size:12px}
.stage-quick-gear small:empty{display:none}
.stage-battle-slots{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
.stage-battle-slots button{min-width:0;min-height:44px;display:grid;align-content:center;gap:2px;padding:4px 2px;border:1px solid #a98f61;border-radius:5px;background:#fffdf5;color:#433921;font-size:10px;overflow-wrap:anywhere}
.stage-battle-slots button span{line-height:1.15}
#stage-item-dialog{width:min(92vw,360px);max-height:85dvh;padding:12px;border:1px solid #a98f61;border-radius:10px;background:#fffdf5;color:#433921}
#stage-item-dialog::backdrop{background:#08201db0}
.stage-item-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px}
.stage-item-heading h2{margin:0;font-size:17px}
.stage-item-heading button{min-width:44px;min-height:44px;font-size:20px}
#stage-item-options{display:grid;gap:6px}
#stage-item-options button{display:grid;gap:3px;text-align:left;min-height:44px;padding:7px 9px;border:1px solid #a98f61;border-radius:6px;background:#faf4e4;color:inherit}
#stage-item-options button:disabled{opacity:.65}
#stage-item-options p{margin:4px 0;font-size:13px}
.foundation-sites button[aria-expanded=true],.foundation-sites .foundation-material-detail button{border-color:#99773e;background:#fff0cd}
.foundation-material-detail{scroll-margin-bottom:80px;margin-top:7px;padding:9px;border:1px solid #a5aa83;border-radius:7px;background:#f0f5e8}
body.battle-mode #battle-card .battle-actions .skill-status{max-width:100%;white-space:normal;text-align:center}
.hunt-result-detail{padding:7px;border:1px solid #bca572;border-radius:6px;background:#fff9e8;color:#4b3622}
.hunt-result-actions button{min-height:44px}
.hunt-result-actions #hunt-next-material{grid-column:1/-1;border-color:#348d70;background:#267a66;color:#fff}
/* Màn chọn ải gọn theo chiều cao điện thoại, chừa chỗ cho thanh điều hướng. */
body:not(.battle-mode)>.hunt-page{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right));padding-bottom:calc(78px + env(safe-area-inset-bottom))}
body:not(.battle-mode) .hunt-bottom-nav{height:calc(62px + env(safe-area-inset-bottom));padding-bottom:calc(5px + env(safe-area-inset-bottom))}
body:not(.battle-mode) .realm-view #stage-detail:not([hidden]){scroll-margin-top:72px;scroll-margin-bottom:calc(78px + env(safe-area-inset-bottom))}
@media(max-width:600px) and (orientation:portrait){
  body:not(.battle-mode) .realm-view .stage-list{height:clamp(220px,calc(100dvh - 420px),360px)!important;min-height:220px!important}
  body:not(.battle-mode) .stage-map-head{margin:4px 0 3px;padding:3px 2px}
  body:not(.battle-mode) .stage-map-head h2{font-size:16px;line-height:1.2;margin-top:2px}
}

body:not(.battle-mode) #realm-view .stage-list {
  aspect-ratio:1672/941;
  height:auto!important;
  min-height:0!important;
  overflow:hidden!important;
  background-size:100% 100%;
  align-self:start;
}
body:not(.battle-mode) #realm-view {
  background:#e9e8dc;
  border:1px solid #646756;
  border-radius:3px;
  box-shadow:inset 0 0 0 3px #c4c6b5,0 4px 12px #252d2559;
}
#realm-view .stage-map-head h2 {font-family:"Times New Roman",serif;color:#283a32}
#realm-view .stage-map-head small {color:#516456}
#realm-view #chapter-progress {background:#dbddcf;color:#384c40}
body:not(.battle-mode) #realm-view #stage-select-prompt {color:#f0ede0}
#realm-view .stage-menu-toggle,
#realm-view .stage-select-prompt {
  background:#333d34;color:#f0ede0;border-color:#838374;border-radius:2px;
}
body:not(.battle-mode) #realm-view .stage-list {
  border:1px solid #646958!important;border-radius:1px!important;
  box-shadow:inset 0 0 12px #534f3e55!important;
}
#realm-view .stage-node,
#realm-view .forest-traveler {
  width:max(24px,7.4%);height:12%;border:0;border-radius:0;
  background:transparent;
  box-shadow:none;
  opacity:1;
  overflow:visible;
}
#realm-view .forest-beast,
#realm-view .forest-traveler img {
  position:absolute;bottom:9%;left:0;width:100%;height:104%;object-fit:contain;
  filter:saturate(.72) drop-shadow(0 1px 1px #39392db3);
  pointer-events:none;
}
#realm-view .stage-node.boss img {height:136%;width:140%;left:-20%}
#realm-view .stage-node.locked img {filter:saturate(.32) contrast(.85)}
#realm-view .stage-node:hover,
#realm-view .stage-node.selected,
#realm-view .stage-node:focus-visible {outline:2px solid #916915;background:#ffde6d40}
#realm-view .stage-node:not(.cleared):not(.locked) {box-shadow:inset 0 0 0 2px #d5a33c}
#realm-view .forest-traveler {
  position:absolute;z-index:3;transform:translate(-50%,-50%);pointer-events:none;
  border:2px solid #e4b82e;box-shadow:inset 0 0 0 1px #8b6f1e;background:#f2d96533;
}
#realm-view .forest-traveler img {height:145%;bottom:8%}
#realm-view .stage-node-number {
  position:absolute;right:-1px;bottom:-1px;min-width:16px;padding:1px 3px;
  background:#303a30ec;border:1px solid #b6ab88;color:#fff7de;
  font:700 clamp(10px,1.2vw,14px)/1.1 "Times New Roman",serif;
}
#realm-view .boss .stage-node-number {background:#70352d}
@media(max-width:600px) {
  body:not(.battle-mode) #realm-view .stage-list {aspect-ratio:3/2}
}
@media(max-width:370px) {
  body:not(.battle-mode) #realm-view .stage-list {aspect-ratio:5/4}
}
@media(min-width:760px),(orientation:landscape) and (min-width:520px) and (max-height:520px) {
  body:not(.battle-mode) #realm-view:has(#stage-detail[hidden]) {
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"menu" "zones" "heading" "map" "detail";
  }
}

#realm-view .stage-list {cursor:crosshair;touch-action:manipulation}
#realm-view .forest-traveler {z-index:4}
#realm-view .forest-traveler .monster-animation {top:auto;bottom:8%;left:-20%;width:140%;height:150%}
#realm-view .forest-traveler.walking:not(.has-monster-animation) img {animation:map-walk .24s ease-in-out infinite alternate}
@keyframes map-walk {to{transform:translateY(-4%) rotate(2deg)}}
@media(prefers-reduced-motion:reduce){#realm-view .forest-traveler.walking img{animation:none}}

#stage-monster-skills:not([hidden]){display:flex;flex-wrap:wrap;gap:5px;margin:6px 0}
#stage-monster-skills>span{background:#f2e7c9;color:#382c20;border:1px solid #a58a60;border-radius:4px;padding:3px 7px;font-size:12px;font-weight:650}
#stage-monster-skills>span>small{display:block;color:#65503a;font:500 10px/1.25 system-ui}
#stage-monster-skills>p{flex-basis:100%;margin:0;line-height:1.45}
