:root{color-scheme:dark;--bg:#0c0c10;--text:#f2f2f2;--soft:#bcb9bc;--gold:#ffd479;--line:rgba(255,255,255,.2);--serif:"Noto Serif SC","Songti SC",STSong,serif;--mono:"DM Mono","SFMono-Regular",monospace;--sans:"PingFang SC",sans-serif;--edge:32px;--tone:#8da9b6}*{box-sizing:border-box}html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font-family:var(--serif)}body{overflow:hidden}button,a,select{font:inherit}button,a.primary{min-height:44px;border-radius:6px;padding:0 16px;display:inline-flex;align-items:center;justify-content:center;gap:12px}button{color:var(--text);background:rgba(12,12,16,.68);border:1px solid var(--line);cursor:pointer;font-size:14px}a{color:inherit;text-decoration:none}button:disabled{color:#aaa5a0;cursor:default}button:hover:not(:disabled){border-color:var(--gold)}:focus-visible{outline:2px solid var(--gold);outline-offset:4px}a.primary,.primary{background:var(--gold);color:#211b10;border:1px solid var(--gold);font-weight:600}p{font-size:14px;line-height:1.7}h1,h2,h3,p{margin:0}#hub{height:100dvh;position:relative;isolation:isolate;overflow:hidden}.scene{position:absolute;inset:0;z-index:-3;background:radial-gradient(ellipse at 73% 43%,color-mix(in srgb,var(--tone) 26%,#171820),#0c0c10 78%)}#scenePhoto{position:absolute;right:6%;top:0;width:52%;height:100%;object-fit:cover;object-position:50% 20%;opacity:.82;mask-image:linear-gradient(90deg,transparent,#000 25%,#000 85%,transparent)}[hidden]{display:none!important}#sceneArt{position:absolute;right:6%;top:14%;width:48%;height:65%;color:var(--tone);opacity:.8}#sceneArt svg{width:100%;height:100%;filter:drop-shadow(0 16px 24px #0006)}.has-photo #sceneArt{right:3%;top:42%;width:28%;height:35%;opacity:.85}.shade{position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#090a0fee 0%,#090a0fd9 28%,#090a0f18 64%),linear-gradient(0deg,#090a0f 0%,#090a0fbb 14%,transparent 45%,transparent 82%,#090a0fcc)}.hub-header{position:absolute;top:max(16px,env(safe-area-inset-top));left:var(--edge);right:var(--edge)}.hub-header .page-header__inner{min-height:48px;padding:0;gap:16px}.identity,.resources{display:flex;align-items:center;gap:12px}.back{display:grid;place-items:center;width:44px;height:44px;border-radius:6px}.back span{font-size:28px;transform:translateY(-3px)}h1{font-size:20px;line-height:1.2;font-weight:600}.eyebrow{font:9px/1.2 var(--mono);letter-spacing:2px;color:#cbc5bf}.identity small{margin-left:8px}.resource{display:flex;align-items:center;justify-content:center;min-width:132px;height:48px;border:1px solid var(--line);border-radius:6px;background:#08090de0;font:14px/1.2 var(--mono)}#weekly{min-width:180px;height:48px;position:relative}#weekly.ready::after{content:"";position:absolute;right:-6px;top:-6px;width:12px;height:12px;border-radius:50%;background:#ff5f6d}.current{position:absolute;left:calc(var(--edge) + 44px);top:27%;width:min(420px,43%);display:grid;gap:12px}.current h2{font-size:20px;line-height:1.2;font-weight:600}.current h3{font-size:16px;line-height:1.4;font-weight:500;color:var(--gold)}#gameCopy{max-width:360px}#gameType{margin-bottom:4px;color:var(--tone)}.actions{display:flex;gap:12px;margin-top:12px}.actions a{min-width:156px;font-size:14px}.support{font:11px/1.5 var(--sans);color:var(--soft)}#leadNav{position:absolute;bottom:max(16px,env(safe-area-inset-bottom));left:var(--edge);right:var(--edge);display:flex;justify-content:center;gap:16px;overflow-x:auto;padding:8px 4px;scrollbar-width:thin}#leadNav button{flex:none;display:flex;flex-direction:column;gap:8px;padding:4px;background:transparent;border:0;min-width:80px;font-size:11px;line-height:1.5;color:var(--soft)}.avatar{width:64px;height:64px;border-radius:50%;border:2px solid transparent;display:grid;place-items:center;background:#202028;overflow:hidden;color:var(--text);font-size:16px}.avatar img{width:100%;height:100%;object-fit:cover;object-position:50% 22%}#leadNav button[aria-pressed="true"]{color:var(--gold)}#leadNav button[aria-pressed="true"] .avatar{border-color:var(--gold)}#notice{position:absolute;top:80px;left:50%;transform:translateX(-50%);max-width:min(340px,90%);background:#15151cf2;text-align:center;font:13px/1.5 var(--sans);padding:12px 16px;pointer-events:none}#notice:empty{display:none}dialog{width:min(520px,calc(100vw - 48px));max-height:calc(100dvh - 32px);padding:16px 24px 24px;background:#15151c;color:var(--text);border:1px solid var(--line);overflow:auto}dialog::backdrop{background:#000a;backdrop-filter:blur(8px)}.modal-head{display:flex;align-items:center;justify-content:center;position:relative;min-height:48px;margin-bottom:12px}.modal-head h2{font-size:18px;line-height:1.3;padding:0 44px;text-align:center}#close{position:absolute;right:-8px;top:2px;width:44px;min-width:44px;padding:0;border:0;background:transparent;font:28px/1 var(--sans)}#modalBody{display:grid;gap:12px}#modalBody p{font-size:14px}#modalBody label{font-size:14px;display:grid;gap:8px}select{width:100%;min-height:44px;padding:8px;background:#202029;color:var(--text);border:1px solid var(--line);border-radius:6px;font-size:14px}.reward-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:64px}.reward-row small{display:block;font:11px/1.5 var(--sans);color:var(--soft);margin-top:4px}.reward-row button{flex:none}.quick-options{display:grid;gap:8px}.quick-options button{justify-content:space-between;text-align:left;padding:12px 16px}.quick-options small{font:11px/1.5 var(--sans)}#modalStatus{margin-top:12px;color:#b4e9da;font-size:13px}#modalStatus:empty{margin:0}.result-detail{color:var(--gold)}@media(max-width:1000px),(max-height:560px){:root{--edge:16px}.hub-header{top:max(8px,env(safe-area-inset-top))}h1{font-size:17px}.identity small{display:none}.identity,.resources{gap:8px}.resource{min-width:104px;height:44px;font-size:13px}#weekly{min-width:160px;height:44px;font-size:12px}.current{left:calc(var(--edge) + 16px);top:24%;gap:8px;width:45%}.current h2{font-size:17px}.current h3{font-size:15px}#gameCopy{font-size:13px;line-height:1.7}.support{font-size:10px}.actions{margin-top:8px;gap:8px}.actions a{min-width:132px}.actions a,button{font-size:13px}#leadNav{gap:8px;bottom:max(8px,env(safe-area-inset-bottom));padding:4px}.avatar{width:52px;height:52px}#leadNav button{min-width:64px;gap:4px;font-size:10px}.eyebrow{font-size:8.5px}.current #gameType{margin:0}.modal-head h2{font-size:16px}dialog{padding:8px 16px 16px}#modalBody p,#modalBody label{font-size:13px}#notice{top:60px}#quickHint{display:none}}@media(max-height:380px){.current{top:22%;gap:8px}#lastProgress{display:none}.actions{margin-top:0}#leadNav{bottom:4px}}@media(orientation:portrait){.current{top:20%;width:85%}#scenePhoto{width:90%;right:0}.shade{background:linear-gradient(90deg,#090a0fd9,transparent),linear-gradient(0deg,#090a0f,transparent)}.hub-header .page-header__inner{flex-wrap:wrap;gap:8px}.resources{margin-left:auto}#leadNav{justify-content:flex-start}#sceneArt{right:0;width:90%}}@media(prefers-reduced-motion:no-preference){.scene{transition:background .18s}#sceneArt svg{animation:arrive .18s ease-out}@keyframes arrive{from{opacity:.5}to{opacity:1}}}/* Long dialog content scrolls independently; title, close and result stay reachable. */
dialog[open]{display:flex;flex-direction:column;overflow:hidden}.modal-head{flex:none}#modalBody{overflow:auto;min-height:0;flex:1;padding:4px}#modalStatus{flex:none}
#modalBody p.support{font:11px/1.5 var(--sans)}
@media(max-width:1000px),(max-height:560px){#modalBody{gap:8px}#modalBody p.support{font-size:10px}.reward-row{min-height:48px;gap:12px}.modal-head{margin-bottom:8px}}

/* Full-screen cover stage; gradients protect edge controls without framing the artwork. */
.has-cover #scenePhoto{inset:0;width:100%;height:100%;object-fit:cover;object-position:center 20%;opacity:1;mask-image:none}
.has-cover .shade{background:linear-gradient(180deg,#08090de6,transparent 20%,transparent 55%,#08090df5 100%);pointer-events:none}
.has-cover .shade::after{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at 0% 75%,#08090df0 0%,#08090dbb 22%,transparent 65%)}
.has-cover[data-info-side="right"] .shade::after{background:radial-gradient(ellipse at 100% 75%,#08090df0 0%,#08090dbb 22%,transparent 65%)}
.has-cover .current{left:var(--edge);top:auto;bottom:144px;width:380px;max-width:42%;text-shadow:none}
.has-cover[data-info-side="right"] .current{left:auto;right:var(--edge)}
.has-cover .support{color:#e2dfdf}.avatar{background-repeat:no-repeat}
#leadNav button{color:#e2dfdf;text-shadow:none}
@media(max-width:1000px),(max-height:560px){
 .has-cover .current{left:var(--edge);top:auto;bottom:104px;width:360px;max-width:48%;gap:8px}
 .has-cover #gameType,.has-cover #lastProgress{display:none}
 .has-cover #gameCopy{max-width:100%}
 .has-cover .actions{margin-top:0}
 .has-cover .actions a{min-width:124px}
 .has-cover .actions button{padding:0 12px}
}
@media(orientation:portrait){
 .has-cover .current,.has-cover[data-info-side="right"] .current{left:16px;right:16px;top:auto;bottom:128px;width:auto;max-width:none}
 .has-cover .shade::after,.has-cover[data-info-side="right"] .shade::after{background:linear-gradient(0deg,#08090df0,transparent 80%)}
 .has-cover #scenePhoto{object-position:var(--portrait-focus,50%) center}
}

/* World boundaries: nine direct-selection buttons retain keyboard order. */
#leadNav button[data-lead="shinian"],#leadNav button[data-lead="xiaochengjin"]{position:relative;margin-left:16px}
#leadNav button[data-lead="shinian"]::before,#leadNav button[data-lead="xiaochengjin"]::before{content:"";position:absolute;left:-16px;top:8px;bottom:8px;width:1px;background:var(--line);pointer-events:none}
@media(max-width:1000px),(max-height:560px){
 #leadNav button[data-lead="shinian"],#leadNav button[data-lead="xiaochengjin"]{margin-left:8px}
 #leadNav button[data-lead="shinian"]::before,#leadNav button[data-lead="xiaochengjin"]::before{left:-8px;top:4px;bottom:4px}
}
