:root{color-scheme:dark;--paper:#eee9d6;--gold:#e9c383;--ink:#172726;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px)}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#334747;color:var(--paper);font-family:"Yu Mincho","Hiragino Mincho ProN",Georgia,serif}body{touch-action:none;-webkit-user-select:none;user-select:none}button,a{-webkit-tap-highlight-color:transparent}button{color:inherit;font:inherit;cursor:pointer;border:1px solid #eeead336;background:#1b2b2a80;backdrop-filter:blur(9px);border-radius:3px;transition:background .2s}button:hover{background:#4c5d4bc9}button:focus-visible,a:focus-visible{outline:2px solid var(--gold);outline-offset:5px}button:active{transform:translateY(1px)}[hidden]{display:none!important}#stage{position:fixed;inset:0;outline:0}canvas{width:100%;height:100%;display:block}#loading{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;flex-direction:column;background:#1c2d30;transition:opacity .7s}#loading.done{opacity:0;pointer-events:none}.load-symbol{font-size:62px;color:#cbb58b;animation:breathe 2s infinite}#loading p{letter-spacing:.3em;font-size:15px}#load-detail{opacity:.45;font-family:sans-serif;font-size:11px}#hub{position:fixed;left:28px;top:calc(21px + var(--safe-top));color:#e6e9dc99;font:10px/1.5 sans-serif;letter-spacing:.06em;text-decoration:none;z-index:12;padding:8px}#hub:hover{color:white}#demo-tag{position:fixed;bottom:calc(30px + var(--safe-bottom));left:50%;transform:translateX(-50%);font:10px/1.5 sans-serif;letter-spacing:.20em;display:flex;align-items:center;gap:12px;color:#fff8decc;white-space:nowrap;text-shadow:0 1px 8px #000}#demo-tag i{width:4px;height:4px;border-radius:50%;background:var(--gold);box-shadow:0 0 8px #ffe2a3}#demo-hint{opacity:.7;font-size:9px;margin-left:12px}#hud{position:fixed;inset:0;pointer-events:none;text-shadow:0 1px 8px #162825bb;transition:opacity .6s}.journey{position:absolute;top:calc(70px + var(--safe-top));left:36px;width:223px}.eyebrow{font:9px/1.5 sans-serif;letter-spacing:.27em;color:#e5cfab;opacity:.85}#chapter{font-size:19px;letter-spacing:.11em;margin:8px 0 15px}.route-line{height:1px;background:#edead44d;position:relative;width:100%}.route-line>i{position:absolute;left:0;top:0;height:1px;width:0;background:#f8dda1;box-shadow:0 0 5px #f4db9c}.route-line>b{position:absolute;top:-2px;width:5px;height:5px;background:#c8c2a2;border:1px solid #fff4d9;transform:rotate(45deg)}#distance{display:block;text-align:right;font:9px/1.5 sans-serif;letter-spacing:.08em;opacity:.7;margin-top:9px}.status{position:absolute;right:38px;top:calc(74px + var(--safe-top));text-align:right}#lanterns{display:flex;gap:14px;justify-content:flex-end;margin-bottom:14px}#lanterns i{height:13px;width:10px;border:1px solid #d0cbb48c;border-radius:4px;position:relative;transform:rotate(0deg)}#lanterns i:after{content:"";width:2px;height:3px;position:absolute;top:13px;left:3px;background:#b6af91}#lanterns i.lit{background:#eac784;box-shadow:0 0 14px #ffc561aa;border-color:#fff3b1}#timer{font-size:26px;font-weight:400;letter-spacing:.12em;font-variant-numeric:tabular-nums}.status>small{display:block;margin-top:8px;font-size:11px;opacity:.7;letter-spacing:.08em}#tools{position:fixed;right:28px;top:calc(24px + var(--safe-top));display:flex;gap:6px;z-index:14}#tools button{font:10px/1.4 sans-serif;padding:7px 10px;color:#e5e5d2cc}#intro{position:fixed;left:50%;top:28%;transform:translate(-50%,-50%);width:80%;text-align:center;pointer-events:none;text-shadow:0 2px 16px #162424;transition:opacity 1.3s}#intro h1{font-weight:400;letter-spacing:.25em;font-size:40px;margin:12px 0 15px}#intro p{font-size:13px;letter-spacing:.19em}#control-hint{font:11px/2 sans-serif;margin-top:25px;opacity:.8;letter-spacing:.05em}#intro.hide{opacity:0}#interact{position:fixed;bottom:calc(86px + var(--safe-bottom));left:50%;transform:translateX(-50%);padding:13px 24px 12px;background:#1a2929a8;backdrop-filter:blur(14px);border:1px solid #d9c28d55;font:12px sans-serif;letter-spacing:.06em;text-align:center;min-width:240px}#interact>div{height:2px;background:#a7a99b55;margin-top:10px}#charge-fill{display:block;height:100%;background:#f9dda5;width:0;box-shadow:0 0 10px #e4c578}#toast{position:fixed;top:calc(23% + var(--safe-top));left:50%;transform:translateX(-50%);font-size:17px;letter-spacing:.2em;opacity:0;transition:opacity .6s;text-shadow:0 1px 12px #203333;pointer-events:none;white-space:nowrap}#toast.show{opacity:1}#photo-hint{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);font:10px sans-serif;letter-spacing:.2em;white-space:nowrap;display:flex;align-items:center;gap:20px;z-index:20}#photo-hint span{opacity:.6;font-size:10px;letter-spacing:.06em}#photo-close{padding:8px 12px;font:11px sans-serif}#result{position:fixed;right:8%;top:50%;transform:translateY(-50%);width:470px;max-width:86%;padding:38px;background:linear-gradient(130deg,#233432e8,#23343299);backdrop-filter:blur(18px);border:1px solid #c6b58966;box-shadow:0 20px 100px #0d191944}#result h1{font-size:25px;font-weight:400;line-height:1.8;letter-spacing:.08em;margin:13px 0}#result p{font-size:12px;line-height:2;opacity:.8}#result .result-rule{height:1px;background:#d7c49c4d;margin:25px 0}.result-stats{display:flex;gap:65px;margin-bottom:30px}.result-stats small{font:10px sans-serif;display:block;opacity:.6}.result-stats strong{font-size:26px;display:block;font-weight:400;margin-top:8px}#result button{padding:12px 15px;font-size:12px;margin:0 7px 10px 0}#result a{font:10px sans-serif;display:block;color:#e4dfcb99;margin-top:12px}#touch-controls{display:none}#frame-top,#frame-bottom{pointer-events:none;position:fixed;left:0;right:0;height:26px;background:#16282a;opacity:.7;z-index:8;transition:height 1s}#frame-top{top:0}#frame-bottom{bottom:0}body[data-mode=play] #frame-top,body[data-mode=play] #frame-bottom{height:0}body:not([data-mode=demo]) #demo-tag{display:none}body[data-mode=demo] #hud,body[data-mode=demo] #intro,body[data-mode=demo] #tools{display:none}body[data-mode=loading] #hud,body[data-mode=loading] #intro,body[data-mode=loading] #tools{display:none}body[data-mode=result] #hud,body[data-mode=result] #intro{display:none}body.photo #hud,body.photo #tools,body.photo #hub,body.photo #intro,body.photo #touch-controls,body.photo #interact,body.photo #toast{display:none!important}body.photo #frame-top,body.photo #frame-bottom{height:38px}@keyframes breathe{50%{opacity:.45;transform:translateY(-3px)}}@media(pointer:coarse){body[data-mode=play]:not(.photo) #touch-controls{display:block}#joystick{position:fixed;bottom:calc(32px + var(--safe-bottom));left:35px;width:108px;height:108px;border:1px solid #e3e2c74d;border-radius:50%;background:#233c362c;touch-action:none}#joystick:before,#joystick:after{content:"";position:absolute;left:50%;top:50%;background:#e3e2c722;transform:translate(-50%,-50%)}#joystick:before{height:70px;width:1px}#joystick:after{height:1px;width:70px}#stick{position:absolute;left:36px;top:36px;width:34px;height:34px;border-radius:50%;border:1px solid #fff6d366;background:#efe1b54d;box-shadow:0 2px 12px #14262633}.touch-actions{position:fixed;bottom:calc(27px + var(--safe-bottom));right:28px;display:flex;gap:13px;align-items:flex-end}.touch-actions button{width:57px;height:57px;border-radius:50%;font-size:12px;background:#253a3380;border-color:#e3e2c761}.touch-actions #pray{height:68px;width:68px;margin-bottom:18px}.touch-actions button.held{background:#d2b57999}#tools{right:15px;gap:4px}#tools button{padding:7px;font-size:9px}#photo{display:none}#hub{left:14px;font-size:9px}.journey{left:23px;top:calc(64px + var(--safe-top));width:175px}.status{right:22px;top:calc(64px + var(--safe-top))}#chapter{font-size:16px}#timer{font-size:23px}#interact{bottom:calc(145px + var(--safe-bottom));font-size:11px}#intro{top:35%}#intro h1{font-size:30px}#intro p{font-size:11px}#control-hint{font-size:10px;margin-top:14px}#result{right:7%;width:420px;padding:25px}#result h1{font-size:21px}}@media(max-width:600px) and (orientation:portrait){.journey{width:160px}.status>small{display:none}.status{top:125px}#lanterns{margin-bottom:8px}#intro{top:32%}#intro h1{font-size:29px}#tools button{font-size:8px;padding:6px}.touch-actions{right:16px;gap:7px}.touch-actions button{width:48px;height:48px}.touch-actions #pray{width:56px;height:56px}#joystick{left:24px;width:96px;height:96px}#stick{left:30px;top:30px}#photo-hint span{display:none}}@media(max-height:480px){.journey{top:51px}.status{top:51px}#intro{top:35%}#intro h1{font-size:28px;margin:4px}#control-hint{margin-top:10px}#result{padding:20px;max-height:95%;overflow:auto}#result h1{font-size:20px;margin:5px 0}#result .result-rule{margin:12px 0}.result-stats{margin-bottom:14px}#toast{top:28%}#interact{bottom:36px}#joystick{width:88px;height:88px;bottom:20px}#stick{left:26px;top:26px}.touch-actions{bottom:18px}}
#demo-tag{pointer-events:none}body[data-mode=result] #guide,body[data-mode=result] #photo{display:none}
/* Explicit touch preview uses the same controls as a coarse-pointer device. */
body.touch-mode[data-mode=play]:not(.photo) #touch-controls{display:block}
body.touch-mode #joystick{position:fixed;bottom:calc(32px + var(--safe-bottom));left:35px;width:108px;height:108px;border:1px solid #e3e2c74d;border-radius:50%;background:#233c362c;touch-action:none}
body.touch-mode #stick{position:absolute;left:36px;top:36px;width:34px;height:34px;border-radius:50%;border:1px solid #fff6d366;background:#efe1b54d;box-shadow:0 2px 12px #14262633}
body.touch-mode .touch-actions{position:fixed;bottom:calc(27px + var(--safe-bottom));right:28px;display:flex;gap:13px;align-items:flex-end}
body.touch-mode .touch-actions button{width:57px;height:57px;border-radius:50%;font-size:12px;background:#253a3380;border-color:#e3e2c761}
body.touch-mode .touch-actions #pray{height:68px;width:68px;margin-bottom:18px}
body.touch-mode .touch-actions button.held{background:#d2b57999}
@media(max-width:600px) and (orientation:portrait){body.touch-mode .touch-actions{right:16px;gap:7px}body.touch-mode .touch-actions button{width:48px;height:48px}body.touch-mode .touch-actions #pray{width:56px;height:56px}body.touch-mode #joystick{left:24px;width:96px;height:96px}body.touch-mode #stick{left:30px;top:30px}}
@media(max-height:480px){body.touch-mode #joystick{width:88px;height:88px;bottom:20px}body.touch-mode #stick{left:26px;top:26px}body.touch-mode .touch-actions{bottom:18px}}
@media(max-width:600px) and (orientation:portrait){.journey{left:22px;top:75px;width:190px}#chapter{font-size:14px;white-space:nowrap;margin-bottom:13px;letter-spacing:.06em}.status{right:22px;top:82px}#timer{font-size:21px}#distance{font-size:8px}#lanterns{gap:10px}#interact{bottom:148px;min-width:210px;max-width:85%;font-size:10px}.status>small{display:none}}
#hud:before{content:"";position:absolute;inset:0 0 auto;height:190px;background:linear-gradient(180deg,rgba(13,30,30,.42),transparent);pointer-events:none}
#hud{text-shadow:0 1px 3px #122522,0 2px 10px #122522bb}
#control-hint{text-shadow:0 1px 3px #102321,0 2px 12px #102321}
