:root { --game-ui-bg:#F8ECD3; --game-ui-surface:#F8ECD3; --game-ui-surface-raised:#FFF8E9; --game-ui-surface-subtle:#F2E3C5; --game-ui-field:#FFF8E9; --game-ui-text:#142741; --game-ui-muted:#536070; --game-ui-subtle:#657181; --game-ui-border-soft:#D7C7A7; --game-ui-border:#64788C; --game-ui-primary:#263F60; --game-ui-primary-hover:#304F75; --game-ui-primary-pressed:#1B304D; --game-ui-on-primary:#FFF3D8; --game-ui-secondary:#FFF8E9; --game-ui-secondary-hover:#F3E6CD; --game-ui-secondary-pressed:#E8D8B9; --game-ui-selected:#DEE8F2; --game-ui-selected-line:#355C84; --game-ui-focus:#4D7DAC; --game-ui-disabled-bg:#E7DFCF; --game-ui-disabled-text:#657181; --game-ui-disabled-line:#B4B3AF; --game-ui-danger-fill:#963E46; --game-ui-danger:#8E3942; --game-ui-danger-border:#AD6269; --game-ui-warning:#805819; --game-ui-info:#294969; --game-ui-scrim:rgba(20,39,65,.64); --game-ui-light-surface:#FFF8E9; --game-ui-light-ink:#142741; --game-ui-hud-fill:rgba(38,63,96,.96); --game-ui-caption-fill:rgba(38,63,96,.96); --game-ui-surface-deep:#FFF8E9; --game-ui-hud-text:#FFF3D8; --game-ui-hud-muted:#D5DFEA; --game-ui-hud-border:#93AEC7; --game-ui-danger-pressed:#78313A; --game-ui-gold:#294969; --game-ui-gold-bright:#142741; --game-ui-radius-control:9px; --game-ui-radius-panel:18px; --game-ui-panel-fill:var(--game-ui-surface); --game-ui-control-fill:var(--game-ui-secondary); --game-ui-primary-fill:var(--game-ui-primary); --game-ui-panel-shadow:0 5px 14px rgba(20,39,65,.18); --game-ui-control-shadow:0 2px 4px rgba(20,39,65,.16); --game-ui-pressed-shadow:none; }
#boot-screen *{box-sizing:border-box}
#boot-screen{position:fixed;inset:0;z-index:9000;isolation:isolate;margin:0;padding:0;max-width:none;color:#142741;background:#7fc9ed;--boot-group-width:min(36vw,360px);--boot-safe-left:max(16px,calc(env(safe-area-inset-left,0px) + 12px));--boot-safe-right:max(16px,calc(env(safe-area-inset-right,0px) + 12px));font-family:system-ui,'Microsoft JhengHei',sans-serif;overflow-x:hidden;overflow-y:auto}
#boot-screen [hidden]{display:none!important}
.boot-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;z-index:-1;pointer-events:none}
.boot-content{position:absolute;left:77%;top:max(max(16px,calc(env(safe-area-inset-top,0px) + 12px)),calc(50dvh - 110px));transform:translateX(-50%);width:var(--boot-group-width);max-width:calc(100vw - var(--boot-safe-left) - var(--boot-safe-right));text-align:center}
.boot-logo{display:block;width:clamp(180px,27vw,248px);max-width:82%;height:auto;margin:0 auto 24px}
#boot-brand-fallback{margin-bottom:24px;text-align:center}#boot-brand-fallback h1{font-size:28px;line-height:1.2;font-weight:600;margin:0}#boot-brand-fallback p{font-size:11px;line-height:1.4;margin:6px 0}
.boot-card{position:relative;isolation:isolate;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;min-height:0;text-align:left}
.boot-card::before{content:'';position:absolute;inset:-18px -24px -18px;z-index:-1;pointer-events:none;background:radial-gradient(ellipse at 50% 50%,rgba(255,248,232,.66) 0%,rgba(255,248,232,.42) 50%,rgba(255,248,232,.14) 68%,rgba(255,248,232,0) 82%)}
.boot-status-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}
.boot-status{font-size:17px;font-weight:600;line-height:1.45;margin:0}
.boot-count{color:#35516a;font-size:13px;line-height:1.4;font-variant-numeric:tabular-nums;white-space:nowrap}
.boot-hint{font-size:14px;line-height:1.5;margin:6px 0 0;color:#35516a}
.boot-progress-space{height:8px;margin-top:12px}
.boot-progress{height:5px;overflow:hidden;border-radius:3px;background:rgba(20,39,65,.18)}
.boot-progress-fill{display:block;height:100%;background:#315b78;border-radius:3px;width:0;transition:none}
.boot-indeterminate .boot-progress-fill{width:35%;animation:boot-sweep 1.4s linear infinite}
@keyframes boot-sweep{from{transform:translateX(-100%)}to{transform:translateX(290%)}}
#boot-screen[data-phase="failed"] .boot-status{color:#943e36}
#boot-screen[data-phase="failed"] .boot-progress-fill,#boot-screen[data-phase="stalled"] .boot-progress-fill{animation:none;transition:none}
#boot-screen .boot-retry{display:block;min-height:46px;margin:12px 0 0;padding:10px 18px;border:1px solid #142741;border-radius:8px;background:#315b78;color:#f8ecd3;font:700 16px/1.4 system-ui;cursor:pointer}
#boot-screen button:focus-visible{outline:3px solid #efbd60;outline-offset:3px}
.boot-footer{display:flex;justify-content:flex-start;align-items:baseline;gap:8px;line-height:1.5;margin:14px 0 0;padding-top:10px;border-top:1px solid rgba(20,39,65,.16);font-size:13px;color:#35516a}
.boot-tip-label{font-size:11px;font-weight:600;letter-spacing:.1em;padding-top:0}.boot-skill-name{font-weight:700}
#boot-screen[data-phase="ready"] .boot-count{display:none}
body.booting #app{visibility:hidden}body.booting #update-panel,body.booting #tutorial-panel{z-index:9001}
body:has(#update-panel:not([hidden])) .boot-footer,body:has(#tutorial-panel:not([hidden])) .boot-footer{display:none}
#boot-screen .boot-start{position:absolute;inset:0;z-index:3;width:100%;height:100%;max-width:none;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;cursor:pointer}
#boot-screen .boot-start:focus-visible{outline-offset:-8px}
@media(max-width:720px) and (orientation:landscape){#boot-screen{--boot-group-width:40vw}.boot-logo{margin-bottom:20px}#boot-brand-fallback{margin-bottom:20px}.boot-status-row{gap:8px}.boot-status{font-size:16px}.boot-hint{font-size:13px}}
@media(max-height:350px) and (orientation:landscape){.boot-footer{display:none}.boot-content{padding-bottom:max(16px,env(safe-area-inset-bottom,0px))}}
@media(orientation:landscape){.boot-content{left:clamp(calc(var(--boot-safe-left) + (var(--boot-group-width) / 2)),77vw,calc(100vw - var(--boot-safe-right) - (var(--boot-group-width) / 2)))}}
@media(max-height:300px) and (orientation:landscape){.boot-content{top:max(12px,calc(env(safe-area-inset-top,0px) + 8px))}.boot-logo{width:min(150px,72%);margin-bottom:12px}#boot-brand-fallback{margin-bottom:12px}.boot-status{font-size:16px}.boot-hint{font-size:13px}#boot-screen[data-phase="failed"] .boot-count,#boot-screen[data-phase="stalled"] .boot-count{margin-left:auto}}
@media(orientation:portrait){#boot-screen{background:#c3dded}.boot-art{height:62dvh;object-fit:cover;object-position:31% top}.boot-content{left:50%;top:62dvh;transform:translateX(-50%);width:min(calc(100vw - 40px),360px);padding:0 0 20px}.boot-logo{width:220px}.boot-scene:after{content:'';position:absolute;top:54dvh;height:8dvh;left:0;right:0;background:linear-gradient(transparent,#c3dded);z-index:-1}}
@media(prefers-reduced-motion:reduce){#boot-screen .boot-progress-fill{animation:none!important;transition:none!important}.boot-indeterminate .boot-progress-fill{width:35%;transform:none}}

/* The orientation guard loads with the lightweight shell, before the game bundle. */
.web-install-guide{margin:20px 0 0;border:1px solid var(--game-ui-border-soft);border-radius:12px;background:#F8ECD3;text-align:left;color:var(--game-ui-text);font-size:13px;line-height:1.7;letter-spacing:0}
.web-install-guide>summary{padding:12px 14px;min-height:44px;box-sizing:border-box;color:var(--game-ui-muted);font-weight:600;cursor:pointer;touch-action:manipulation}
.web-install-guide>summary:focus-visible{outline:2px solid var(--game-ui-focus);outline-offset:-4px;border-radius:12px}
.web-install-guide>summary:focus:not(:focus-visible){outline:none}
.web-install-body{padding:0 14px 14px}
.web-install-guide .web-install-intro{margin:0 0 12px;color:var(--game-ui-text)}
.web-install-route{padding:10px 12px;margin:8px 0;border-radius:8px;background:#244438}
.web-install-route>b{display:flex;align-items:center;gap:7px;color:#f4e3b5;font-size:14px}
.web-install-guide .web-install-route p{margin:6px 0 0;color:var(--game-ui-muted);line-height:1.7;font-size:13px}
.web-install-guide .web-share-icon{display:inline-block;width:20px;height:20px;flex:none;vertical-align:-4px;color:var(--game-ui-text)}
.web-install-guide .web-more-icon{display:inline-grid;place-items:center;width:20px;height:20px;border:1px solid currentColor;border-radius:50%;font:20px/14px sans-serif;flex:none}
.web-install-guide ol{margin:16px 0 0;padding-left:22px}
.web-install-guide li{margin:0 0 10px;padding-left:3px;line-height:1.8}
.web-install-guide strong{color:var(--game-ui-text)}
.web-install-guide .web-install-help{margin:14px 0 0;padding-top:12px;border-top:1px solid var(--game-ui-border-soft);font-size:12px;color:var(--game-ui-text);line-height:1.8}
#web-rotate{position:fixed;inset:0;margin:0;width:100vw;height:100dvh;max-width:none;max-height:none;box-sizing:border-box;border:0;padding:max(32px,env(safe-area-inset-top,0px)) max(24px,env(safe-area-inset-right,0px)) max(32px,env(safe-area-inset-bottom,0px)) max(24px,env(safe-area-inset-left,0px));color:var(--game-ui-text);background:#F8ECD3;text-align:center;overflow:auto;touch-action:pan-y}
#web-rotate:not([open]){display:none}
#web-rotate[open]{display:grid;place-items:center}
#web-rotate::backdrop{background:var(--game-ui-scrim)}
#web-rotate:focus{outline:none}
#web-rotate .web-rotate-content{width:min(100%,340px);margin:auto}
#web-rotate .web-rotate-brand{margin:0 0 34px;color:var(--game-ui-text);font-size:15px;letter-spacing:4px}
#web-rotate .web-rotate-brand span{display:block;margin-top:9px;font:9px/1.4 Georgia,serif;letter-spacing:3px}
#web-rotate .web-rotate-icon{display:block;width:112px;height:112px;margin:0 auto 24px;color:var(--game-ui-text)}
#web-rotate h1{margin:0;font-size:clamp(22px,6vw,28px);font-weight:600;letter-spacing:1px;line-height:1.5}
#web-rotate #web-rotate-copy{margin:12px 0 0;font-size:15px;color:var(--game-ui-muted);line-height:1.8}
#web-rotate button{margin:24px auto 0;padding:12px 28px;min-height:44px;border:1px solid var(--game-ui-border);border-radius:var(--game-ui-radius-control);background:#F8ECD3;color:var(--game-ui-text);font:inherit;font-size:15px;font-weight:600;touch-action:manipulation}
#web-rotate button[hidden]{display:none}
#web-rotate .web-rotate-help{margin:36px 0 0;font-size:13px;line-height:1.9;color:var(--game-ui-text)}
#web-rotate:has(.web-install-guide[open]) .web-rotate-brand{margin-bottom:16px}
#web-rotate:has(.web-install-guide[open]) .web-rotate-icon{width:64px;height:64px;margin-bottom:12px}
#web-rotate:has(.web-install-guide[open]) .web-rotate-help{display:none}
html.web-portrait,html.web-portrait body{overflow:hidden!important;overscroll-behavior:none}
@media(max-height:560px){#web-rotate .web-rotate-brand{margin-bottom:18px}#web-rotate .web-rotate-icon{width:88px;height:88px;margin-bottom:18px}#web-rotate .web-rotate-help{margin-top:24px}}
