*{box-sizing:border-box}body{margin:0;background:#201f22;color:#eee3cd;font:15px/1.6 'Microsoft YaHei',sans-serif}button{font:inherit;cursor:pointer;color:#f8eacb;background:#544235;border:1px solid #95744b;border-radius:5px;padding:9px 16px}button:hover{filter:brightness(1.2)}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible{outline:3px solid #76ded0;outline-offset:2px}main{max-width:1080px;margin:auto;padding:26px}header{display:flex;align-items:center;gap:25px;margin-bottom:22px}h1{font:32px Georgia,'KaiTi',serif;letter-spacing:5px;margin:0;color:#e7c487}header span,.intro,small{color:#bcb09d}.layout{display:grid;grid-template-columns:480px 1fr;gap:48px}.game{border:7px solid #604a39;outline:2px solid #9b7a51;background:#302b29;box-shadow:0 15px 45px #0006}.scene{height:240px;position:relative;overflow:hidden;background:radial-gradient(ellipse at 50% 100%,#bea361,#635446 42%,#272733 72%)}.hud,.scene-bottom{position:absolute;z-index:3;left:16px;right:16px;display:flex;justify-content:space-between;align-items:center}.hud{top:12px}.hud b{background:#d5ba7c;color:#392d23;padding:4px 12px}.scene-bottom{bottom:12px;font-size:13px}.entrance{position:absolute;inset:45px 65px 0;border:22px solid #574135;border-bottom:0;border-radius:80px 80px 0 0;box-shadow:inset 0 0 0 5px #302c2d,0 0 0 5px #312829;background:radial-gradient(ellipse at bottom,#ffe5a0,#b59863 60%,#544638)}.gate{text-align:center;position:relative;top:-27px;background:#77543a;color:#f3cd8b;font:24px 'KaiTi',serif;transform:rotate(-4deg);padding:5px;box-shadow:0 4px 10px #0005}.rail{position:absolute;bottom:-35px;left:23%;width:54%;height:100px;border:9px solid #73685c;transform:perspective(80px) rotateX(35deg);background:repeating-linear-gradient(0deg,transparent 0 18px,#58483c 18px 25px)}.crystal{position:absolute;width:22px;height:60px;background:#73c9c2;clip-path:polygon(50% 0,100% 30%,80% 100%,15% 90%,0 30%);transform:rotate(25deg);left:-47px;top:45px}.c2{left:auto;right:-45px;top:85px;transform:rotate(-20deg);background:#d9a456}.stats{display:flex;justify-content:space-around;background:#e9dbb9;color:#513c29;padding:12px 3px;font-weight:bold}.stats small{display:block;color:#735b45;font-size:11px}.mine-head{display:flex;justify-content:space-between;padding:8px 13px;font-size:12px;color:#d6bd8a}#grid{display:grid;grid-template-columns:repeat(6,1fr);gap:3px;padding:7px;background:#1e1b1b;border:5px solid #705a43}.tile{padding:0;aspect-ratio:1;border:3px solid #493a2e;border-radius:2px;background:#a4805c;box-shadow:inset 3px 3px #c6a27a,inset -4px -4px #785c44;position:relative;color:#faedc8;font-size:22px}.tile span{position:relative;text-shadow:0 2px 3px #000;font-size:12px}.tile.empty{background:#393335;box-shadow:none;border-color:#393335;color:#968575}.tile.locked{filter:brightness(.6)}.tile:active{transform:scale(.94)}.loot{min-height:60px;padding:12px;text-align:center;color:#edd08c;background:#292525}.actions{display:flex;gap:8px;padding:10px}.actions button{flex:1}.actions button:first-child{background:#69735a}aside{padding:8px 0}h2{font:26px 'KaiTi',serif;margin:0 0 18px}h3{font-size:16px;color:#d9bd88;border-bottom:1px solid #514739;padding-bottom:12px;margin-top:26px}ol{padding-left:22px;color:#c2b6a2;font-size:13px;line-height:2.2}.ledger{display:grid;grid-template-columns:1fr auto;gap:10px;border-block:1px solid #514739;padding:20px 0;margin-top:25px}.ledger strong{color:#dfc282}#log{height:165px;overflow:auto;font-size:13px;color:#c7b99d}#log p{margin:0 0 8px}small{font-size:11px}dialog{width:min(470px,94vw);max-height:88vh;background:#eee1c5;color:#443629;border:5px solid #7e6244;padding:24px}dialog::backdrop{background:#000a}dialog h2{color:#443629}dialog button{margin:5px 4px 5px 0}dialog .row{border-bottom:1px solid #ccb998;padding:10px 0}#battle{display:none;position:absolute;inset:45px 0 50px;background:#24232aee;z-index:2;text-align:center;padding:10px}#battle strong{display:block;color:#e1a28b;font-size:22px}#battle p{margin:4px} @media(max-width:800px){main{padding:14px}.layout{grid-template-columns:minmax(0,480px);justify-content:center;gap:25px}header{justify-content:center}header span{display:none}aside{padding:5px 12px}.scene{height:215px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

.actions button:first-child{background:#505e42}dialog small{color:#68553e}
/* Reveals are temporary presentation only; rewards are saved independently. */
.tile.empty:disabled{opacity:1}.tile-reveal{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none;animation:reveal-fade 4.2s linear both;color:#ffe3a7;line-height:1.3}.tile-reveal strong{font-size:11px;white-space:nowrap}.tile-reveal small{font-size:9px;color:#e2d2af}.revealed-crystal{display:block;width:21px;height:25px;margin-bottom:3px;background:#9ae4dc;clip-path:polygon(50% 0,100% 30%,80% 85%,30% 100%,0 50%)}.tile-reveal.enemy{color:#ffb2a1}.tile-reveal.trap{color:#ffc48b}.chest-art{display:block;position:relative;width:38px;height:29px;flex-shrink:0;margin:2px auto 5px}.chest-base{position:absolute;bottom:0;left:2px;width:34px;height:20px;background:#87552d;border:3px solid #d7aa58;border-radius:2px}.chest-base:after{content:'';position:absolute;width:6px;height:9px;left:11px;top:1px;background:#ffe099;border:1px solid #715028}.chest-lid{position:absolute;top:1px;left:0;width:38px;height:12px;background:#ad723b;border:3px solid #e4b862;border-radius:7px 7px 1px 1px;transform-origin:left bottom}.chest-light{position:absolute;inset:-15px -12px 5px;background:radial-gradient(ellipse,#ffde87aa,transparent 70%);opacity:0}.chest-opening{display:flex;align-items:center;gap:24px;padding:22px 12px;min-height:105px;background:#392e28;color:#ffe4a6;border-radius:5px}.chest-opening .chest-art{transform:scale(1.7);margin:10px 24px}.chest-opening .chest-lid{animation:chest-open 1.1s ease-out both}.chest-opening .chest-light{animation:chest-glow 1.4s ease-out both}.chest-reward{font-size:14px;animation:reward-rise 1.4s ease-out both}@keyframes reveal-fade{0%{opacity:0;transform:scale(.8)}8%,52%{opacity:1;transform:scale(1)}100%{opacity:0;transform:translateY(-9px)}}@keyframes chest-open{0%,25%{transform:rotate(0)}40%{transform:rotate(-8deg)}100%{transform:translateY(-6px) rotate(-32deg)}}@keyframes chest-glow{0%,25%{opacity:0}70%,100%{opacity:1}}@keyframes reward-rise{0%,45%{opacity:0;transform:translateY(8px)}100%{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.tile-reveal{animation-name:reveal-quiet}.chest-opening .chest-lid{animation:none;transform:translateY(-6px) rotate(-32deg)}.chest-reward,.chest-opening .chest-light{animation:none;opacity:1}@keyframes reveal-quiet{0%,60%{opacity:1}100%{opacity:0}}}
.hero-sprite{display:inline-block;width:100px;height:140px;background-repeat:no-repeat;background-size:500% 100%;image-rendering:pixelated;flex-shrink:0}.hero-0{background-position:0% 0}.hero-1{background-position:25% 0}.hero-2{background-position:50% 0}.hero-3{background-position:75% 0}.hero-4{background-position:100% 0}#hero-display{position:absolute;bottom:22px;left:calc(50% - 50px);z-index:2;pointer-events:none}.combat-actors{height:105px;display:flex;align-items:center;justify-content:center;gap:35px}.combat-actors .hero-sprite{width:75px;height:105px}.enemy-sprite{width:96px;height:96px;object-fit:contain;image-rendering:pixelated}.combat-vs{color:#e1c490;font:16px Georgia,serif}#battle{inset:42px 0 0;padding:0 10px 5px;background:#24232af5}#battle strong{font-size:16px}#battle p{font-size:12px;margin:0}#battle button{padding:3px 14px;margin-top:3px}.scene:has(#battle[style*="block"]) .scene-bottom{display:none}.hero-gallery{display:grid;grid-template-columns:repeat(2,1fr);gap:15px}.hero-gallery article{text-align:center;border-bottom:1px solid #c5b590;padding:12px 0}.hero-gallery b{display:block;font-size:14px}.hero-gallery p{font-size:12px;text-align:left}.enemy-gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.enemy-gallery article{text-align:center;padding:10px 2px;background:#d8c7a6}.enemy-gallery img{display:block;width:80px;height:80px;image-rendering:pixelated;margin:auto}.enemy-gallery b,.enemy-gallery small{display:block;font-size:12px}#modal:has(.enemy-gallery){width:min(760px,94vw)}@media(min-width:650px){.hero-gallery{grid-template-columns:repeat(5,1fr)}.enemy-gallery{grid-template-columns:repeat(5,1fr)}}
.hero-sprite{background-size:contain;background-position:center bottom;image-rendering:auto}.hero-0{background-image:url('assets/hero-0.webp')}.hero-1{background-image:url('assets/hero-1.webp')}.hero-2{background-image:url('assets/hero-2.webp')}.hero-3{background-image:url('assets/hero-3.webp')}.hero-4{background-image:url('assets/hero-4.webp')}
.scene:has(#battle[style*="block"]){height:270px}.hero-gallery .hero-sprite{width:100px;height:170px}
.treasure-card{padding:20px;margin:16px 0;background:radial-gradient(ellipse at 50% 0%,color-mix(in srgb,var(--rarity) 42%,transparent),transparent 75%),#28252b;color:#f6edde;border:1px solid var(--rarity);border-radius:8px}.treasure-card h3{color:var(--rarity);margin:10px 0;border:0;padding:0}.treasure-card small{display:block;color:#dbd0c4}.treasure-card p{font-size:14px}.treasure-card button{display:block;margin-top:12px}.treasure-list{max-height:48vh;overflow:auto}#panel details{padding:12px 0;border-bottom:1px solid #c5b590}#panel summary{cursor:pointer;font-weight:bold}#panel details p{font-size:13px}.odds-scroll{overflow:auto}.odds-scroll table{font-size:12px;border-collapse:collapse;min-width:480px}.odds-scroll th,.odds-scroll td{padding:8px;border-bottom:1px solid #c5b590}.chest-opening+.treasure-card{animation:reward-rise 1.4s ease-out both}@media(prefers-reduced-motion:reduce){.chest-opening+.treasure-card{animation:none}}
.chest-popup{text-align:center;animation:chest-popup-in .38s ease-out both}.chest-stage{height:160px;display:flex;align-items:center;justify-content:center}.chest-stage .chest-art{margin:0;transform:scale(3);transform-origin:center}.chest-stage.is-opening .chest-art{animation:chest-shake-bounce 1.45s ease-in-out both}.chest-stage.is-opening .chest-lid{animation:chest-lid-reveal .45s 1.45s ease-out both}.chest-stage.is-opening .chest-light{animation:chest-glow .5s 1.3s ease-out both}.chest-popup #chest-caption{min-height:52px}@keyframes chest-popup-in{0%{opacity:0;transform:translateY(14px) scale(.88)}75%{opacity:1;transform:translateY(-3px) scale(1.02)}100%{transform:none}}@keyframes chest-shake-bounce{0%,8%{transform:scale(3)}15%{transform:scale(3) rotate(-5deg)}23%{transform:scale(3) rotate(5deg)}30%{transform:scale(3) rotate(-3deg)}37%{transform:scale(3)}48%{transform:translateX(-18px) scale(3.25,2.8)}60%{transform:translateX(16px) scale(2.8,3.2)}70%{transform:translateX(-8px) scale(3.1,2.9)}80%{transform:scale(2.9,3.05)}88%,100%{transform:scale(3)}}@keyframes chest-lid-reveal{0%{transform:none}100%{transform:translateY(-10px) rotate(-38deg)}}@media(prefers-reduced-motion:reduce){.chest-popup,.chest-stage.is-opening .chest-art,.chest-stage.is-opening .chest-lid,.chest-stage.is-opening .chest-light{animation:none}}
.stairs-mark{display:block;color:#f5d290!important;font-size:13px!important;line-height:1.3}.tile.empty:has(.stairs-mark){background:#655039;border-color:#d2ac6c;cursor:pointer}.actions button[hidden]{display:none}
.item-art{display:block;width:120px;height:120px;margin:5px auto 14px;filter:drop-shadow(0 4px 6px #0005)}.item-thumb{width:68px;height:68px;object-fit:contain;float:left;margin:0 14px 8px 0;background:#393236;border-radius:8px}.item-entry{min-height:85px;display:flow-root}.art-credit{font-size:11px}.art-credit a{color:#604217}.mineral-gallery{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.mineral-gallery article{text-align:center;font-size:12px}.mineral-gallery img{width:100%;aspect-ratio:1;object-fit:contain}.mineral-icon{width:38px;height:34px;object-fit:contain}.chest-art.premium-chest{width:70px;height:60px}.premium-chest img{width:100%;height:100%;object-fit:contain;position:relative}.chest-stage{height:235px}.chest-stage .premium-chest{width:82px;height:72px}.tile-reveal .premium-chest{width:40px;height:34px;margin:0}.premium-chest.bound .chest-light{opacity:.65;background:radial-gradient(ellipse,#bd75ef99,transparent 72%);inset:-20px}.is-opening .premium-chest img{animation:chest-art-release .6s 1.45s ease-in both}@keyframes chest-art-release{0%{filter:brightness(1);transform:scale(1)}65%{filter:brightness(2.5);transform:scale(1.08)}100%{filter:brightness(4);opacity:0;transform:scale(1.18) translateY(-5px)}}#grid{background:linear-gradient(#171519a6,#171519c9),url('assets/rock-texture.webp') center/310px;border-color:#5a493c;box-shadow:inset 0 10px 26px #0008}.tile:not(.empty){background-image:linear-gradient(135deg,#b19b7433,#211c2055),url('assets/rock-texture.webp');background-size:cover,190px;box-shadow:inset 2px 2px 2px #dbc19b66,inset -3px -4px 3px #1e171b88;border-color:#4f4238}.tile.texture-1{background-position:center,40px 70px}.tile.texture-2{background-position:center,100px 10px}.tile.texture-3{background-position:center,10px 130px}.tile.empty{background:transparent;border-color:transparent}.tile.diggable{border-color:#c5aa79;filter:brightness(1.12)}.tile.locked{filter:brightness(.63)}.tile.diggable:hover{filter:brightness(1.35)}.tile:not(.empty) span{background:#201a1bc9;border-radius:3px;font-size:10px}.tile:not(.empty) span:empty{display:none}@media(prefers-reduced-motion:reduce){.is-opening .premium-chest img{animation:none}}
.premium-chest .box-bottom{clip-path:inset(53% 0 0 0)}.premium-chest .box-top{position:absolute;inset:0;clip-path:inset(0 0 47% 0);transform-origin:15% 53%}.is-opening .premium-chest .box-bottom{animation:chest-art-release .6s 1.45s ease-in both}.is-opening .premium-chest .box-top{animation:premium-lid .6s 1.45s ease-out both}@keyframes premium-lid{0%{transform:none;opacity:1}80%{transform:translateY(-12px) rotate(-17deg);filter:brightness(1.6);opacity:1}100%{transform:translateY(-16px) rotate(-20deg);opacity:0}}@media(prefers-reduced-motion:reduce){.is-opening .premium-chest .box-top,.is-opening .premium-chest .box-bottom{animation:none}}
/* Dark presentation lets the jade and gold treasure materials read clearly. */
dialog:has(.chest-popup){background:#24212c;border-color:#9c7a49;color:#e9dcc6}dialog .chest-popup h2{color:#edcf91}dialog .chest-popup p{color:#cbbda6}.chest-popup .chest-stage{background:radial-gradient(ellipse,#74604133,transparent 68%)}dialog h3{color:#695034}.treasure-card h3{color:var(--rarity)}
/* Portrait play surface */
:root{color-scheme:dark;--safe-bottom:env(safe-area-inset-bottom,0px)}body{background:#191817}button{touch-action:manipulation;-webkit-tap-highlight-color:transparent;min-height:44px}::selection{background:#aa874b;color:#fff}main{max-width:490px;padding:12px 20px 90px}header{margin-bottom:12px;justify-content:center}header h1{font-size:24px;letter-spacing:4px}header>span{display:none}.layout{display:block}.game{border-width:4px;outline:1px solid #9b7a51;border-radius:10px;overflow:hidden}.layout>aside{display:none}.scene{height:155px}.entrance{inset:28px 80px 0;border-width:14px}.gate{font-size:18px;top:-18px;padding:2px}.hud{top:8px;left:12px;right:12px;font-size:12px}.hud b{padding:3px 9px}.scene-bottom{bottom:5px;left:12px;right:12px;font-size:11px;background:#211c1ba8;border-radius:4px;padding:2px 5px}#hero-display{bottom:14px;left:calc(50% - 36px)}#hero-display .hero-sprite{width:72px;height:104px}.stats{padding:8px 10px;gap:12px;align-items:center;font-size:15px}.stats>div{text-align:center;flex:1}.stats .health-stat{flex:1.5;text-align:left}.stats small{font-size:10px;margin-bottom:1px}.health-stat meter{display:block;width:100%;height:6px;margin-top:3px}.health-stat meter::-webkit-meter-bar{background:#cab891;border:0}.health-stat meter::-webkit-meter-optimum-value{background:#647d48}.mine-head{padding:5px 10px;font-size:11px}#realm{padding:5px 10px;text-align:center;display:block;background:#302921;color:#e7c894;font-size:11px}#grid{gap:3px;padding:5px;border-width:3px;grid-template-rows:repeat(7,minmax(44px,1fr));height:clamp(330px,43dvh,410px)}.tile{aspect-ratio:auto;min-height:0;border-width:2px}.tile span{font-size:10px}.loot{min-height:45px;font-size:12px;padding:8px 12px;line-height:1.5;display:flex;justify-content:center;align-items:center}.actions{padding:7px;gap:7px}.actions button{padding:7px 10px;font-size:13px;min-height:42px}.mobile-nav{position:fixed;z-index:5;bottom:0;left:50%;transform:translateX(-50%);width:min(490px,100%);display:flex;gap:1px;padding:8px 14px calc(8px + var(--safe-bottom));background:#27231f;border-top:1px solid #65543d}.mobile-nav button{flex:1;background:transparent;border:0;color:#e8d1a3;font-size:13px}.mobile-nav button:hover{background:#3b3228}.scene:has(#battle[style*="block"]){height:230px}#battle{top:34px;padding:0 8px}.combat-actors{height:94px;gap:30px}.combat-actors .hero-sprite{height:94px;width:67px}.enemy-sprite{width:84px;height:84px}#battle button{min-height:42px;padding:7px 12px;font-size:13px}#battle strong{font-size:14px}dialog{color-scheme:light;max-height:calc(100dvh - 32px - var(--safe-bottom));padding:20px;border:3px solid #8b6b43;border-radius:12px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#99774e transparent}dialog #close{position:sticky;bottom:-20px;width:100%;margin:15px 0 0;background:#544235;min-height:46px;z-index:3}dialog .row{padding:13px 0;font-size:14px}dialog .row button{font-size:13px;padding:9px 12px}dialog p{font-size:14px}dialog h2{font-size:24px}dialog ol{color:#554534;font-size:13px}.journal-entries{font-size:13px;color:#65503b}.journal-entries p{padding-bottom:8px;border-bottom:1px solid #d4c3a2}.chest-stage{height:210px}.treasure-card{padding:16px}.item-art{width:100px;height:100px}.hero-gallery p{font-size:12px}#modal:has(.enemy-gallery){width:min(760px,94vw)}@media(max-width:520px){main{padding:8px 8px calc(82px + var(--safe-bottom))}header{margin:0 0 8px}header h1{font-size:20px}.game{border-width:3px}.scene{height:140px}#grid{height:clamp(322px,43dvh,390px)}dialog{width:calc(100% - 16px);padding:16px;max-width:none}dialog #close{bottom:-16px}.hero-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.enemy-gallery{gap:7px}.enemy-gallery img{width:70px;height:70px}.chest-stage .premium-chest{width:76px;height:68px}.chest-stage{height:200px}.mineral-gallery{gap:6px}.loot{min-height:45px}.stats{padding:7px 10px}}@media(max-width:350px){#grid{gap:2px;padding:3px}.hud{font-size:11px}.stats{font-size:13px}.enemy-gallery img{width:60px;height:60px}}
[hidden]{display:none!important}#town-home{max-width:490px;margin:0 auto;min-height:100dvh;padding-bottom:calc(82px + env(safe-area-inset-bottom));background:#272821}.home-scene{height:330px;position:relative;background:linear-gradient(0deg,#272821 0%,transparent 45%),url('assets/town-background.webp') center 40%/cover}.home-top{display:flex;align-items:center;justify-content:space-between;padding:20px 20px;color:#fff0c9;text-shadow:0 2px 5px #000}.home-top h1{font:25px 'KaiTi',serif;letter-spacing:3px}.home-top span{font-size:13px;background:#242920ad;padding:5px 10px;border-radius:5px}.home-character{position:absolute;bottom:67px;left:calc(50% - 60px)}.home-character .hero-sprite{width:120px;height:186px;filter:drop-shadow(0 8px 5px #0005)}.home-realm{position:absolute;bottom:8px;left:15px;right:15px;text-align:center}.home-realm h2{margin:0;font-size:23px;color:#f2d595}.home-realm p{font-size:12px;margin:4px 0;color:#d5c7a5}.home-body{padding:0 18px}.home-stats{display:flex;justify-content:space-between;padding:12px 0 17px;border-bottom:1px solid #585443;font-size:11px;color:#bfbba8}.home-stats b{font-size:15px;color:#ede6cf;margin-left:6px}.home-training{display:flex;align-items:center;justify-content:space-between;padding:18px 0}.home-body h3{margin:0;border:0;padding:0;color:#e9d29d;font:19px 'KaiTi',serif}.home-body p{font-size:12px;color:#beb7a1;margin:5px 0}.home-training button{background:#657056;min-width:150px;border-color:#8c9670;font-size:14px}.home-training button small{display:block;color:#efe5cb;font-size:10px}.home-tools{display:grid;grid-template-columns:1fr 1fr;gap:12px}.home-tools>section{position:relative;border:1px solid #5b5542;border-radius:8px;padding:17px 12px;background:#323329;overflow:hidden}.home-tools button{font-size:12px;padding:6px 10px;width:100%;margin-top:10px;background:#4a4937}.home-chests img{position:absolute;width:65px;height:65px;object-fit:contain;right:-4px;top:0;opacity:.8}.home-chests h3,.home-chests p{position:relative}.home-tools .quiet-button{background:none;border:0;margin-top:2px;font-size:10px;min-height:30px;padding:2px}.home-arts{margin-top:18px;border-block:1px solid #55513e;padding:14px 0}.home-arts summary{color:#dec89b;font-size:14px;cursor:pointer}.home-art-row{display:flex;justify-content:space-between;align-items:center;padding-top:12px;font-size:12px}.home-art-row small{display:block}.home-art-row button{font-size:12px}.home-body #townmsg{min-height:24px;margin:12px 0;text-align:center;color:#d9c59f}.enter-mine{width:100%;display:flex;align-items:center;justify-content:space-between;background:#b38b4c;border-color:#dfb875;color:#231c13;font-weight:bold;font-size:17px;min-height:54px}.enter-mine span{font-weight:normal;font-size:11px}@media(max-width:350px){.home-scene{height:290px}.home-body{padding:0 12px}.home-training button{min-width:135px}.home-tools{gap:8px}.home-tools>section{padding:14px 9px}}
.home-top{background:linear-gradient(#172018b8,transparent)}.home-top h1{color:#fff0c9;margin:0}.home-scene{height:280px}.home-character{bottom:65px}.home-character .hero-sprite{height:160px;width:110px}.home-training{padding:14px 0}.home-tools>section{padding-top:14px;padding-bottom:12px}@media(max-width:350px){.home-scene{height:240px}}
#modal:has(.treasure-grid){width:min(560px,calc(100% - 16px))}.treasure-header h2{margin-bottom:8px}.treasure-header p{margin:0 0 16px}.treasure-tabs{display:flex;gap:8px}.treasure-tabs button{flex:1;background:#d7c8a8;color:#4a3926;border-color:#af9670;font-size:13px}.treasure-tabs button[aria-pressed=true]{background:#514731;color:#fff0cb}.treasure-filters{display:flex;gap:4px;margin-top:13px;flex-wrap:wrap}.treasure-filters button{flex:1;padding:5px 6px;font-size:12px;background:transparent;color:#604b32;border:1px solid #b5a17d;min-height:36px}.treasure-filters button[aria-pressed=true]{background:#796540;color:#fff}.treasure-hint{font-size:12px!important;color:#6b5840}.treasure-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:14px 0}.treasure-slot{position:relative;padding:5px 4px 7px;background:radial-gradient(ellipse at top,color-mix(in srgb,var(--rarity) 20%,transparent),transparent 80%),#302c2b;border:1px solid color-mix(in srgb,var(--rarity) 70%,#514732);min-width:0;min-height:103px;border-radius:7px;display:flex;flex-direction:column;align-items:center}.treasure-slot img{width:100%;height:60px;object-fit:contain}.slot-name{font-size:10px;line-height:1.3;color:#f3e7cd;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.slot-count,.slot-found{position:absolute;right:3px;top:3px;font-size:10px;background:#201c19e6;color:#f9e6b9;padding:0 3px;border-radius:3px}.slot-found{font-size:8px}.treasure-empty{text-align:center;padding:40px 15px;color:#665239}.treasure-empty p{font-size:12px}.detail-back{background:transparent;color:#55402a;border-color:#b59b73}.sell-item{width:100%;background:#5b6543}.treasure-notes{margin-top:20px}@media(min-width:500px){.treasure-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(max-width:350px){.treasure-grid{gap:5px}.treasure-slot{min-height:94px}.treasure-slot img{height:51px}.slot-name{font-size:9px}}
#modal:has(.stairs-dialog){width:min(460px,calc(100% - 24px));padding:7px;background:#242b28;color:#e8dfc9;border:2px solid #b2945c;border-radius:17px;box-shadow:0 18px 65px #000a,inset 0 0 0 3px #17221f;overflow:auto;scrollbar-width:thin}#modal:has(.stairs-dialog)::backdrop{background:#080d0bd9}.stairs-dialog{border:1px solid #66775b;border-radius:10px;overflow:hidden;position:relative}.stairs-illustration{height:205px;background:linear-gradient(0deg,#202c27 0%,transparent 48%),url('assets/stairs-choice.webp') center 48%/cover;position:relative}.stairs-floor{position:absolute;top:12px;left:50%;transform:translateX(-50%);white-space:nowrap;background:#1b2924dd;border:1px solid #a68a52;border-radius:3px;color:#e8d2a1;font-size:11px;padding:4px 13px;letter-spacing:2px}.stairs-content{padding:0 20px 18px;background:linear-gradient(#202c27,#242724)}.stairs-ornament{display:flex;align-items:center;justify-content:center;gap:10px;margin:-3px auto 8px;position:relative}.stairs-ornament span{height:1px;width:75px;background:linear-gradient(90deg,transparent,#a68e5c)}.stairs-ornament span:last-child{transform:rotate(180deg)}.stairs-ornament i{width:8px;height:8px;border:1px solid #c3a56c;background:#43635b;transform:rotate(45deg)}.stairs-dialog h2{text-align:center;color:#f2d9a0;font:29px 'KaiTi',serif;letter-spacing:5px;margin:0 0 8px}.stairs-description{text-align:center;color:#b8c5b8;font-size:12px!important;line-height:1.9;margin:0 0 17px}.stairs-haul{display:flex;align-items:center;justify-content:center;gap:34px;padding:12px 0;margin-bottom:18px;border-block:1px solid #63705a66;background:#131c1738}.stairs-haul>div{text-align:center;min-width:80px}.stairs-haul span{display:block;font-size:11px;color:#bac1ac}.stairs-haul strong{display:block;color:#f0d9a5;font-size:23px;font-weight:500;font-variant-numeric:tabular-nums}.stairs-haul>i{height:34px;width:1px;background:#69735980}.stairs-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px}.stairs-choices button{width:100%;margin:0;padding:12px 5px;border-radius:7px;min-height:67px}.stairs-choices b{display:block;font:18px 'KaiTi',serif}.stairs-choices small{display:block;font-size:9px;margin-top:5px;color:inherit;opacity:.86}.stairs-return{background:linear-gradient(#d5bb83,#ae8d52);border-color:#f0d7a0;color:#30291e}.stairs-descend{background:linear-gradient(#49796b,#2d5348);border-color:#7da78d;color:#f4ebcd}.stairs-bonus{display:block;width:100%;margin:12px 0 0!important;background:transparent;border:1px solid #6f7153;color:#dbcb9d;font-size:11px;min-height:40px;padding:7px 4px}.stairs-bonus span{font-size:9px;border:1px solid #7d7957;border-radius:3px;padding:2px 4px;margin-right:5px;color:#b4bda4}#modal:has(.stairs-dialog) #close{position:static;background:transparent;border:0;color:#b8bdac;font-size:12px;margin:3px 0 0;padding:5px;min-height:40px}#modal:has(.stairs-dialog) #close:hover{background:#ffffff08}@media(max-width:350px){.stairs-illustration{height:165px}.stairs-content{padding:0 12px 12px}.stairs-choices{gap:7px}.stairs-choices small{font-size:8px}.stairs-dialog h2{font-size:25px}.stairs-haul{margin-bottom:12px;padding:8px 0}}
#pick{min-height:28px;font-size:11px;padding:2px 8px;background:#41382c;border-color:#807051;text-decoration:underline;text-underline-offset:3px}
#battle{background:linear-gradient(0deg,#121b20ed 0%,#17202838 60%,#17202866),url('assets/battle-background.webp') center/cover}#battle strong{color:#ffe2be;text-shadow:0 2px 3px #000}#battle p{color:#f1e6ce;text-shadow:0 1px 3px #000}.combat-actors .hero-sprite,.combat-actors .enemy-sprite{filter:drop-shadow(0 6px 4px #0009)}.combat-vs{background:#152423bb;border:1px solid #a08c5d;padding:4px 8px;border-radius:3px}.entry-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:20px 0}.entry-grid button{padding:13px 5px;min-height:70px;background:#4d6554;border-color:#85966e}.entry-grid button:disabled{background:#746b5b;border-color:#a99a80;opacity:.55}.entry-grid b{font-size:14px}.entry-grid small{display:block;font-size:10px;color:#f1e4c8;margin-top:5px}
.chest-stage{position:relative;isolation:isolate}.chest-stage.is-opening:before{content:'';position:absolute;inset:10px 0;background:radial-gradient(ellipse at center,var(--loot-glow) 0%,color-mix(in srgb,var(--loot-glow) 55%,transparent) 25%,transparent 68%);pointer-events:none;z-index:-1;animation:loot-burst 2.1s ease-out both}.chest-stage.is-opening .premium-chest .chest-light{background:radial-gradient(ellipse,var(--loot-glow),transparent 70%);animation:loot-burst 2.1s ease-out both;inset:-25px}.chest-stage.is-opening .premium-chest .box-top{filter:drop-shadow(0 0 6px var(--loot-glow))}@keyframes loot-burst{0%,50%{opacity:0;transform:scale(.35)}65%{opacity:.6;transform:scale(.65)}82%{opacity:1;transform:scale(1.1)}100%{opacity:.5;transform:scale(1.3)}}@media(prefers-reduced-motion:reduce){.chest-stage.is-opening:before,.chest-stage.is-opening .premium-chest .chest-light{animation:none;opacity:.6}}
#modal:has(.reward-panel){width:min(430px,calc(100% - 24px));padding:7px;background:#202923;border:2px solid #b39660;border-radius:16px;box-shadow:0 18px 65px #000a,inset 0 0 0 3px #121c17;color:#e9dfc8}#modal:has(.reward-panel)::backdrop{background:#090e0cdd}#modal:has(.reward-panel) #close{display:none}.reward-panel{position:relative;border:1px solid #6d785b;border-radius:9px;padding:20px;text-align:center;background:radial-gradient(ellipse at 50% 25%,color-mix(in srgb,var(--rarity) 10%,transparent),transparent 55%),#242c27}.reward-crown{color:#d2b16f;font-size:16px;display:flex;align-items:center;justify-content:center;gap:12px}.reward-crown:before,.reward-crown:after{content:'';height:1px;width:65px;background:linear-gradient(90deg,transparent,#b0945b)}.reward-crown:after{transform:rotate(180deg)}.reward-panel h2{color:#f0d69d;font:27px 'KaiTi',serif;letter-spacing:4px;margin:7px 0}.reward-subtitle{color:#bdc4af;font-size:11px!important;margin:0}.reward-display{position:relative;margin:14px auto 12px;width:170px;height:172px;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse,color-mix(in srgb,var(--rarity) 30%,transparent),transparent 70%)}.reward-display:before{content:'';position:absolute;inset:14px;border:1px solid color-mix(in srgb,var(--rarity) 45%,transparent);transform:rotate(45deg);border-radius:16px}.reward-display img{width:136px;height:136px;object-fit:contain;position:relative;filter:drop-shadow(0 8px 8px #0008)}.reward-display span{position:absolute;bottom:-2px;padding:4px 12px;background:#202820;border:1px solid color-mix(in srgb,var(--rarity) 65%,#555);border-radius:4px;color:var(--rarity);font-size:11px}.reward-panel h3{font:21px 'KaiTi',serif;color:var(--rarity);margin:18px 0 10px;border:0;padding:0;line-height:1.5}.reward-description{font-size:13px!important;line-height:1.8;color:#d6d6c6;text-align:left;margin:0 0 16px}.reward-value{border-block:1px solid #65705780;padding:10px 0;display:flex;justify-content:space-between;align-items:center}.reward-value>span{font-size:12px;color:#bac3b3}.reward-value strong{font-size:25px;color:#f2d79b;font-weight:500}.reward-value small{font-size:12px;color:#dbc38f}.reward-extra{font-size:12px!important;color:#d4c7a6;line-height:1.8;margin:12px 0 18px}.reward-extra b{color:#ebd29d}.reward-extra small{display:block;color:#aebaa9;font-size:10px}.reward-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px}.reward-actions button{margin:0;padding:9px 4px;min-height:46px;font-size:13px;background:linear-gradient(#d3b77b,#ae8d52);color:#30271b;border-color:#e1c78e}.reward-actions button+button{background:linear-gradient(#477365,#2f5146);color:#f2e7c8;border-color:#86a58b}@media(max-width:350px){.reward-panel{padding:15px}.reward-display{height:137px;width:137px}.reward-display img{width:108px;height:108px}.reward-panel h3{font-size:18px}.reward-description{font-size:12px!important}}
.scene:has(#battle[style*="block"]){height:367px;background:#172421}.scene:has(#battle[style*="block"]) .entrance{visibility:hidden}#battle{inset:37px 0 0;padding:8px 12px 12px;background:linear-gradient(0deg,#121e1cf5 0%,#16262320 65%,#14201aba),url('assets/battle-background.webp') center/cover;text-align:left;border-top:1px solid #85704888}.battle-heading{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#dac393;margin:0 0 9px}.battle-heading b{font-weight:normal;color:#abbdb0}.battle-health{display:grid;grid-template-columns:1fr 1fr;gap:28px}.battle-health b{font-size:12px;font-weight:500;color:#f0e5c6;text-shadow:0 1px 4px #000}.battle-health small{font-size:10px;color:#d2dfd3;display:block;margin-top:2px}.battle-health meter{display:block;width:100%;height:9px;margin-top:5px}.battle-health meter::-webkit-meter-bar{border:1px solid #91a48777;background:#17211d;border-radius:3px}.battle-health meter::-webkit-meter-optimum-value{background:linear-gradient(90deg,#4c8e72,#a4c890)}.battle-health .enemy-health meter::-webkit-meter-optimum-value{background:linear-gradient(90deg,#a44946,#dc9b6c)}.enemy-health{text-align:right}.battle-stage{height:151px;display:flex;align-items:flex-end;justify-content:space-around;position:relative}.fighter{width:40%;display:flex;flex-direction:column;align-items:center;position:relative}.fighter:before{content:'';position:absolute;bottom:20px;width:95px;height:14px;border-radius:50%;background:#0a1213a0;filter:blur(4px)}.fighter .hero-sprite{width:90px;height:130px;filter:drop-shadow(0 5px 4px #0008)}.fighter img{width:112px;height:120px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 5px 4px #0008)}.fighter>span:not(.hero-sprite){font-size:10px;color:#e2d6b7;position:relative;background:#12201bbd;border-radius:3px;padding:2px 5px;white-space:nowrap}.battle-divider{align-self:center;color:#cdb276;font:26px 'KaiTi',serif;opacity:.8}#battle .battle-note{text-align:center;font-size:11px;margin:11px 0 9px;color:#e6c99a;min-height:18px}.battle-controls{display:grid;grid-template-columns:1.15fr 1fr;gap:10px}#battle .battle-controls button{margin:0;min-height:51px;padding:5px;border-radius:7px}.battle-controls small{display:block;font-size:9px;margin-top:3px;color:inherit}.battle-controls .battle-attack{background:linear-gradient(#d7b979,#a98343);border-color:#e3c68b;color:#302719}.battle-controls .battle-retreat{background:#233e35;border-color:#698c79;color:#dbe5ce}.battle-controls b{font-size:15px;font-weight:500}.striking .hero-sprite{animation:hero-strike .35s ease-out}.struck img{animation:enemy-struck .4s ease-out}@keyframes hero-strike{0%,100%{transform:translateX(0)}40%{transform:translateX(16px) rotate(5deg)}}@keyframes enemy-struck{0%,100%{transform:none}40%{transform:translateX(10px);filter:brightness(1.8)}}@media(prefers-reduced-motion:reduce){.striking .hero-sprite,.struck img{animation:none}}@media(max-width:350px){.scene:has(#battle[style*="block"]){height:357px}.battle-health{gap:18px}.fighter img{width:95px}.fighter>span:not(.hero-sprite){font-size:9px}}


.battle-controls{grid-template-columns:1fr}.battle-controls .battle-attack{width:100%}
.mobile-nav button{min-width:0;padding:8px 4px;white-space:nowrap}#sound-toggle{display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap}#sound-toggle svg{flex:none}#sound-toggle .sound-slash{display:none}#sound-toggle.is-muted .sound-waves{display:none}#sound-toggle.is-muted .sound-slash{display:block}#sound-toggle.is-muted{color:#b5aa96}#sound-toggle:disabled{opacity:.55}

/* One viewport for exploration; secondary pages scroll inside the app. */
:root{--nav-height:calc(61px + env(safe-area-inset-bottom,0px))}
html,body{height:100%;overscroll-behavior:none}body{height:100dvh;overflow:hidden}
#town-home{height:100dvh;min-height:0;overflow-y:auto;overscroll-behavior:contain}
#mine-screen{height:calc(100dvh - var(--nav-height));max-width:490px;padding:6px 8px;overflow:hidden}
#mine-screen>header{display:none}#mine-screen .layout{height:100%;min-height:0}
#mine-screen .game{height:100%;display:grid;grid-template-rows:clamp(76px,13dvh,118px) 22px 48px 34px minmax(0,1fr) 36px;border-width:3px;box-shadow:none}
#mine-screen .scene{height:auto;min-height:0}.scene .entrance{inset:23px 95px 0;border-width:10px}.scene .gate{font-size:15px;top:-15px}.scene .rail{height:65px}.scene .crystal{height:40px;top:10px}.scene .c2{top:25px}
#mine-screen #hero-display{bottom:10px;left:calc(50% - 26px)}#mine-screen #hero-display .hero-sprite{width:52px;height:73px}
#mine-screen .hud{top:6px;font-size:11px}#mine-screen .hud b{padding:1px 7px}#mine-screen .scene-bottom{bottom:3px;font-size:10px;line-height:1.5}
#mine-screen #realm{padding:2px 6px;font-size:10px;line-height:18px}#mine-screen .stats{padding:4px 10px;font-size:14px}#mine-screen .stats small{font-size:10px;line-height:1.4}
#mine-screen .mine-head:not(#realm){padding:3px 8px;align-items:center}#mine-screen #grid{height:auto;min-height:0;grid-template-rows:repeat(7,minmax(0,1fr));padding:4px;gap:3px;touch-action:manipulation}
#mine-screen .tile{min-height:0;overflow:hidden}#mine-screen .tile .stairs-mark{font-size:9px;line-height:1.2}
#mine-screen .loot{height:36px;min-height:0;padding:3px 9px;font-size:11px;line-height:15px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#mine-screen .actions{display:none}.mobile-nav{height:var(--nav-height)}
@media(max-height:650px){#mine-screen .game{grid-template-rows:66px 20px 42px 30px minmax(0,1fr) 32px}#mine-screen .loot{height:32px}#mine-screen #hero-display .hero-sprite{height:55px;width:40px}#mine-screen #hero-display{left:calc(50% - 20px)}}

/* Battle is protected focus, without changing the mine's height. */
#battle-modal{width:min(450px,calc(100% - 24px));padding:6px;border:2px solid #b49862;background:#172620;color:#ede4cf;border-radius:14px;max-height:calc(100dvh - 24px);overflow:auto;box-shadow:0 16px 55px #000b}
#battle-modal::backdrop{background:#070d0be3}#battle-modal #battle{position:relative;inset:auto;display:block;padding:18px 16px 16px;border:1px solid #738067;border-radius:8px;background:linear-gradient(0deg,#14231ff5,#16262318 65%,#14201aab),url('assets/battle-background.webp') center/cover}
#battle-modal .battle-heading{font-size:12px;margin-bottom:21px}#battle-modal .battle-health{gap:20px}#battle-modal .battle-health b{font-size:13px}#battle-modal .battle-stage{height:clamp(160px,25dvh,220px)}
#battle-modal .fighter .hero-sprite{width:105px;height:152px}#battle-modal .fighter img{height:140px;width:125px}#battle-modal .battle-note{margin:22px 0 16px;font-size:12px;line-height:1.6}
#battle-modal .battle-controls button{min-height:56px}#battle-modal .battle-controls b{font-size:18px}#battle-modal .battle-controls small{font-size:11px}
@media(max-height:620px){#battle-modal .battle-stage{height:140px}#battle-modal .fighter .hero-sprite{height:120px;width:85px}#battle-modal .fighter img{height:112px;width:100px}#battle-modal .battle-heading{margin-bottom:12px}#battle-modal .battle-note{margin:15px 0}}

#travel-modal{width:min(300px,calc(100% - 50px));border:1px solid #a58c58;border-radius:13px;background:#202e28;padding:27px;text-align:center;color:#e6d5ad;overflow:hidden}
#travel-modal::backdrop{background:#0a100ef2}#travel-modal h2{font:25px 'KaiTi',serif;color:#efd7a0;margin:8px 0}#travel-modal p{font-size:12px;color:#c4ccb8;margin:0 0 18px}
.travel-steps{position:relative;height:112px;width:145px;margin:auto}.travel-steps svg{position:absolute;width:130px;height:96px;left:8px;bottom:0;fill:none;stroke:#8a956f;stroke-width:2.5;stroke-linejoin:round}.travel-walker{position:absolute;top:-15px;left:3px;animation:walk-down 1s linear both}.travel-walker .hero-sprite{width:49px;height:72px}
.travel-progress{height:2px;background:#536044;overflow:hidden}.travel-progress i{display:block;height:100%;background:#dfc78c;transform-origin:left;animation:travel-fill 1s linear both}
@keyframes walk-down{0%{transform:translate(0,0)}25%{transform:translate(24px,14px)}50%{transform:translate(52px,31px)}75%{transform:translate(80px,49px)}100%{transform:translate(95px,60px);opacity:.25}}
@keyframes travel-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media(prefers-reduced-motion:reduce){.travel-walker{animation:none;left:45px;top:10px}.travel-progress i{animation:none;width:100%}}

#chest-vault{height:100dvh;max-width:490px;margin:auto;overflow:auto;padding:0 17px calc(82px + env(safe-area-inset-bottom));background:#222a25;overscroll-behavior:contain}
.vault-header{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:15px;background:#222a25;padding:15px 0;border-bottom:1px solid #5b654e}
.vault-header button{padding:8px;display:flex;align-items:center;gap:5px;background:transparent;border-color:#667159;font-size:12px}.vault-header h1{font:25px 'KaiTi',serif;color:#ecd29b;letter-spacing:3px}
.vault-intro{padding:19px 0 13px;display:flex;align-items:center;gap:15px}.vault-intro>img{width:88px;height:100px;object-fit:contain}.vault-intro h2{font:20px 'KaiTi',serif;color:#e6cf9f;margin:0 0 8px}.vault-intro p{font-size:12px;color:#bfc9b7;line-height:1.8;margin:0}
.vault-list{display:grid;gap:13px}.vault-chest{padding:16px 13px;border:1px solid #677158;border-radius:9px;background:#2a322b;display:grid;grid-template-columns:80px minmax(0,1fr);gap:10px 13px}
.vault-chest>img{width:80px;height:100px;object-fit:contain}.vault-chest h3{font:18px 'KaiTi',serif;margin:3px 0 7px;padding:0;border:0;color:#ebd2a1}.vault-chest p{font-size:11px;color:#bfc9b7;margin:4px 0}.vault-chest .vault-countdown{font-size:20px;letter-spacing:1px;color:#e1d4b4;font-variant-numeric:tabular-nums;margin:6px 0}.vault-chest .is-ready{color:#c2dda9}
.vault-meter{height:3px;display:block;width:100%;background:#1b241e;border:0;overflow:hidden}.vault-meter i{display:block;height:100%;background:#9eac79}.vault-chest .vault-open,.vault-chest .vault-speed{grid-column:1/-1;width:100%;margin:3px 0 0;min-height:45px;font-size:14px}
.vault-open{background:#b89a5d;color:#231f17;border-color:#dbc48e}.vault-speed{background:#3d5c4c;border-color:#819b76;color:#e9e6d2}.vault-footnote{font-size:11px;color:#b8c3af;line-height:1.8;padding-top:14px}.vault-empty{text-align:center;color:#c5cbb6;padding:30px 10px;font-size:14px}

/* Home uses the same available screen height as exploration. */
#town-home{height:calc(100dvh - var(--nav-height));padding-bottom:0;overflow:hidden;display:grid;grid-template-rows:minmax(0,1fr) 352px}
#town-home .home-scene{height:auto;min-height:0;display:grid;grid-template-rows:44px minmax(0,1fr) 54px;background-position:center 40%}
#town-home .home-top{padding:8px 16px;gap:8px;min-width:0}#town-home .home-top h1{font-size:23px;white-space:nowrap}#town-home .home-top span{font-size:12px;padding:3px 8px;white-space:nowrap}
#town-home .home-character{position:static;display:flex;align-items:flex-end;justify-content:center;min-height:0;overflow:hidden}#town-home .home-character .hero-sprite{height:100%;max-height:170px;width:115px}
#town-home .home-realm{position:static;padding:0 8px;align-self:center}#town-home .home-realm h2{font-size:20px;line-height:1.4}#town-home .home-realm p{margin:2px 0;font-size:11px;line-height:1.5}
#town-home .home-body{display:grid;grid-template-rows:36px 64px 112px 48px 28px 54px;min-height:0;padding:0 16px 10px}
#town-home .home-stats{padding:4px 0 8px;align-items:center;font-size:11px}#town-home .home-stats b{font-size:14px;margin-left:4px}
#town-home .home-training{padding:7px 0;gap:8px}#town-home .home-training h3{font-size:18px}#town-home .home-training p{margin:2px 0}#town-home .home-training button{min-width:138px;min-height:46px;padding:4px 10px}
#town-home .home-tools{gap:10px}#town-home .home-tools>section{padding:9px 10px;display:flex;flex-direction:column;justify-content:space-between}#town-home .home-tools h3{font-size:18px}#town-home .home-tools p{margin:0;font-size:11px}#town-home .home-tools button{margin:3px 0 0;min-height:44px;padding:5px;font-size:12px}#town-home .home-chests img{width:54px;height:54px;right:0;top:0;opacity:.6}
#town-home .home-arts{display:flex;align-items:center;justify-content:space-between;margin:6px 0 0;padding:5px 9px;min-height:42px;background:#30372b;border:1px solid #666b50;border-radius:6px;color:#e6d2a7;text-align:left;font-size:14px}#town-home .home-arts small{font-size:10px;color:#c3c6ae}#town-home .home-arts i{font-style:normal;margin-left:7px}
#town-home .home-body #townmsg{margin:0;align-self:center;min-height:0;font-size:11px;line-height:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#town-home .enter-mine{min-height:50px;margin:0 0 4px;padding:7px 12px;font-size:17px}#town-home .enter-mine span{font-size:10px}
@media(max-height:620px){#town-home{grid-template-rows:minmax(0,1fr) 330px}#town-home .home-body{grid-template-rows:32px 59px 106px 46px 25px 52px;padding-inline:12px}#town-home .home-scene{grid-template-rows:38px minmax(0,1fr) 48px}#town-home .home-top{padding:4px 12px}#town-home .home-realm h2{font-size:18px}#town-home .home-training button{min-width:132px}#town-home .home-tools h3{font-size:17px}}

/* Contact poses deliberately hold for 140 ms before the recoil. */
#battle-modal .battle-feedback{height:82px;display:flex;align-items:center;justify-content:center;text-align:center}#battle-modal .battle-feedback .battle-note{margin:0;font-size:13px}
.damage-number{position:absolute;top:12px;right:12%;z-index:2;font:bold 29px Georgia,serif;color:#ffe2a5;text-shadow:0 2px 4px #10120b,1px 0 #543819;pointer-events:none}.hero-damage{color:#ffc4ab;right:auto;left:12%}
.hero-fighter.windup .hero-sprite{animation:attack-approach .2s ease-in both}.hero-fighter.impact .hero-sprite{transform:translateX(24px) rotate(5deg)}.enemy-fighter.impact img{transform:translateX(6px);filter:brightness(1.8) drop-shadow(0 4px 4px #0008)}
.hero-fighter.recoil .hero-sprite{animation:attack-return .22s ease-out both}.enemy-fighter.recoil img{animation:contact-recoil .22s ease-out both}
.enemy-fighter.counter img{animation:enemy-approach .18s ease-in both}.enemy-fighter.counter-hit img{transform:translateX(-23px)}.hero-fighter.counter-hit .hero-sprite{transform:translateX(-5px);filter:brightness(1.5) sepia(.5)}
.hero-fighter.recover .hero-sprite{animation:hero-recoil .24s ease-out both}.enemy-fighter.recover img{animation:enemy-return .24s ease-out both}
.enemy-fighter.victory img{animation:monster-fall .65s ease-out both}.hero-fighter.defeat .hero-sprite{opacity:.5;filter:grayscale(.6)}
.hit-spark{position:absolute;left:23%;top:42%;width:35px;height:35px;border:2px solid #fff0bb;border-radius:50%;box-shadow:0 2px 12px #f5c26d88}.hit-spark:before,.hit-spark:after{content:'';position:absolute;left:15px;top:-8px;width:2px;height:46px;background:#ffe9aa;transform:rotate(45deg)}.hit-spark:after{transform:rotate(-45deg)}
.battle-result{display:flex;flex-direction:column;gap:6px;color:#efd59e}.battle-result>b{font:27px 'KaiTi',serif;letter-spacing:3px}.battle-result>span{font-size:14px;color:#e9d7ad}.battle-result strong{font-size:22px;color:#ffe3a1;margin-left:2px}#battle-modal .battle-attack:disabled{opacity:.85;filter:none}
#mine-screen .game{grid-template-rows:clamp(76px,13dvh,118px) 22px 48px 34px minmax(0,1fr) 48px}#mine-screen .loot{height:48px}
#mine-screen .victory-message{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:4px 8px;color:#f2d9a6;line-height:18px;background:#302c20}#mine-screen .victory-message>strong{font-size:14px;color:#f1ddac}#mine-screen .victory-message>span{font-size:13px;color:#e6d4af}#mine-screen .victory-message b{font-size:16px;color:#ffe5a2;margin-left:1px}
@media(max-height:650px){#mine-screen .game{grid-template-rows:66px 20px 42px 30px minmax(0,1fr) 44px}#mine-screen .loot{height:44px}}
@keyframes attack-approach{from{transform:none}to{transform:translateX(24px) rotate(5deg)}}@keyframes attack-return{from{transform:translateX(24px) rotate(5deg)}to{transform:none}}@keyframes contact-recoil{0%{transform:translateX(6px)}40%{transform:translateX(12px) rotate(4deg)}100%{transform:none}}
@keyframes enemy-approach{from{transform:none}to{transform:translateX(-23px)}}@keyframes enemy-return{from{transform:translateX(-23px)}to{transform:none}}@keyframes hero-recoil{from{transform:translateX(-5px)}40%{transform:translateX(-10px) rotate(-3deg)}to{transform:none}}
@keyframes monster-fall{from{opacity:1;transform:none}to{opacity:.16;transform:translateY(8px) rotate(9deg) scale(.92)}}
@media(prefers-reduced-motion:reduce){.hero-fighter .hero-sprite,.enemy-fighter img{animation:none!important;transform:none!important}.enemy-fighter.victory img{opacity:.25}}
#town-home .home-realm{display:flex;flex-direction:column;align-items:center;justify-content:center;border:0;border-radius:0;background:transparent;color:#f2d595;min-height:48px;margin:0;line-height:1.4;width:100%;padding:0 8px}
#town-home .realm-name{font:20px/1.4 'KaiTi',serif}#town-home .realm-detail{font-size:10px;color:#d5c7a5;margin-top:3px}#town-home .realm-detail i{font-style:normal;color:#e6ce96;margin-left:5px;text-decoration:underline;text-underline-offset:3px}
@media(max-height:620px){#town-home .realm-name{font-size:18px}#town-home .realm-detail{font-size:9px}}
.cultivation-rules table{width:100%;border-collapse:collapse;font-size:14px}.cultivation-rules th,.cultivation-rules td{text-align:left;padding:9px 5px;border-bottom:1px solid #bdab85}.cultivation-rules th{color:#644d30}.cultivation-rules h3{margin:20px 0 10px}.cultivation-rules p{line-height:1.8}.breakthrough-list{border-block:1px solid #b5a079;padding:5px 0}.breakthrough-list>div{display:flex;align-items:center;justify-content:space-between;padding:8px 0;gap:9px;font-size:12px}.breakthrough-list b{font-size:14px;white-space:nowrap}.breakthrough-list strong{color:#745322;font-size:16px}
#battle-modal .battle-result>b{font:27px/1.2 'KaiTi',serif}#battle-modal .battle-result>span{display:block;white-space:nowrap;font-size:14px;line-height:1.5}#battle-modal .battle-result strong{display:inline;font-size:22px;color:#ffe3a1}

/* Saved name sits before the three attributes without adding a row. */
#town-home .home-stats{display:grid;grid-template-columns:minmax(60px,1.2fr) minmax(68px,1.3fr) minmax(40px,.8fr) minmax(40px,.8fr);gap:5px;padding:2px 0}
#town-home .home-player-name{min-width:0;color:#e8cf98;line-height:14px;overflow:hidden}#town-home .home-player-name b{font:14px/14px 'KaiTi',serif;color:#efd49b;margin:0;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#town-home .home-stat{display:flex;flex-direction:column;align-items:flex-start;font-size:10px;line-height:12px;min-width:0}#town-home .home-stat b{font-size:14px;line-height:16px;margin:0;font-variant-numeric:tabular-nums;white-space:nowrap}

dialog.identity-dialog{width:min(390px,calc(100% - 24px));padding:6px;background:#1f2d27;color:#e9ddc1;border:2px solid #b09662;border-radius:14px;max-height:calc(100dvh - 24px);box-shadow:0 16px 55px #000b;overflow:auto}
dialog.identity-dialog::backdrop{background:#08110de8}.identity-frame{border:1px solid #718263;border-radius:8px;padding:18px 21px 22px;text-align:center;background:radial-gradient(ellipse at 50% 8%,#73835b26,transparent 60%)}
.identity-dialog h2{font:26px/1.4 'KaiTi',serif;color:#efd59e;margin:5px 0 11px;overflow-wrap:anywhere}.name-portrait{height:120px;display:flex;justify-content:center;align-items:flex-end}.name-portrait .hero-sprite{width:82px;height:120px}
.identity-dialog .name-opening{font-size:13px;color:#c6cbb6;margin:0 0 21px}.identity-dialog form{text-align:left}.identity-dialog label{font-size:13px;color:#e2cfaa;display:block;margin-bottom:7px}
.name-input-wrap{position:relative}.identity-dialog input{display:block;width:100%;height:48px;padding:10px 62px 10px 12px;border:1px solid #95a079;border-radius:6px;background:#14231c;color:#f0e3c8;font:16px 'Microsoft YaHei',sans-serif;caret-color:#f0d498}.identity-dialog input::placeholder{color:#a8b19b}.identity-dialog input:focus{outline:2px solid #d3b77b;outline-offset:2px}.identity-dialog input[aria-invalid=true]{border-color:#e8a78b}
#name-count{position:absolute;right:11px;top:14px;color:#afbaa1;font-size:12px;pointer-events:none}#name-help{font-size:11px;color:#bfc9b2;line-height:1.7;margin:8px 0 0}#name-error{min-height:34px;font-size:12px;color:#f1ba9b;line-height:1.4;margin:6px 0}
.identity-dialog button{width:100%;min-height:48px;margin:0;padding:10px 8px;background:linear-gradient(#d4ba7f,#ad8b4e);color:#30271a;border-color:#e8d29e;border-radius:6px;font-size:15px}
.arrival-portrait{height:clamp(110px,22dvh,170px);display:flex;align-items:flex-end;justify-content:center;background:radial-gradient(ellipse at 50% 80%,#7e956a28,transparent 60%)}.arrival-portrait .hero-sprite{width:110px;height:100%;max-height:165px}.arrival-copy h2{font-size:22px;margin:9px 0 15px}
.arrival-lines{position:relative;text-align:left;border-block:1px solid #6b785655;padding:10px 0;margin:0 0 21px}.arrival-lines p{font-size:15px;line-height:1.85;color:#e7dfc9;margin:7px 0 12px}.arrival-lines p:last-child{margin-bottom:7px}
@media(max-height:620px){.identity-frame{padding:12px 17px 16px}.name-portrait{height:85px}.name-portrait .hero-sprite{height:85px;width:60px}.identity-dialog h2{font-size:23px}.identity-dialog .name-opening{margin-bottom:15px}.arrival-portrait{height:105px}.arrival-copy h2{font-size:21px}.arrival-lines{margin-bottom:15px;padding-block:6px}.arrival-lines p{font-size:14px;line-height:1.75}}
.hero-fighter.windup .hero-sprite{animation-duration:.32s}.enemy-fighter.counter img{animation-duration:.3s}.hero-fighter.recoil .hero-sprite,.enemy-fighter.recoil img{animation-duration:.32s}.hero-fighter.recover .hero-sprite,.enemy-fighter.recover img{animation-duration:.34s}
.arrival-copy h2 small{display:inline-block;font:11px/1.4 'Microsoft YaHei',sans-serif;color:#c0cbb3;margin-left:8px;white-space:nowrap;vertical-align:middle}
