:root{--ink:#293431;--paper:#faf8f1;--accent:#de563b;--yellow:#edc965;--muted:#717770;--line:#29343122;color-scheme:light;font-family:"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP",system-ui,sans-serif}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#d8e5e5;color:var(--ink)}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--accent);outline-offset:4px}button:disabled{opacity:.4;cursor:wait}.hidden{display:none!important}#game{position:relative;width:100%;height:100dvh;min-height:320px;overflow:hidden;isolation:isolate;user-select:none;-webkit-user-select:none}#scene{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}.vignette{position:absolute;inset:0;pointer-events:none;background:linear-gradient(#faf8f12b,transparent 20%,transparent 85%,#29343114);z-index:1}#danger-vignette{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 85px 3px #da573a;opacity:0;z-index:2}.screen{position:absolute;inset:0;z-index:6}
/* A large, plain-spoken headline leaves the lower half to the character. */
#title-screen{background:linear-gradient(180deg,#faf8f1f7 0%,#faf8f1cc 24%,#faf8f100 55%,#faf8f140 69%,#faf8f1ef 100%)}.title-copy{position:absolute;left:7%;top:max(7%,env(safe-area-inset-top));max-width:86%}h1{margin:0;font-weight:900;font-size:clamp(34px,5.1vw,74px);letter-spacing:-.055em;line-height:1.30;color:var(--ink)}h1 span{display:block;white-space:nowrap}h1 .title-lead{font-size:.71em;letter-spacing:-.025em;margin-bottom:.18em}h1 em{font-style:normal;color:var(--accent)}h1 .title-last{margin-left:.9em}.start-area{position:absolute;left:7%;bottom:max(5%,env(safe-area-inset-bottom));width:310px}.primary{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:56px;padding:16px 21px;border:0;border-radius:8px;background:var(--ink);color:var(--paper);font-size:17px;font-weight:800;transition:background .15s,transform .15s;box-shadow:0 3px 0 #16221e26}.primary:hover{background:#414d43}.primary:active{transform:translateY(2px);box-shadow:none}.primary span{display:grid;place-items:center;font-size:16px;font-weight:500;color:var(--ink);background:var(--yellow);width:28px;height:28px;border-radius:50%}#start{font-size:20px;padding:15px 20px 15px 24px;min-height:62px}#start span{width:32px;height:32px}.start-note{font-size:11px;line-height:1.9;margin:14px 0 8px;color:#525d54}.best{font-size:11px;font-weight:650;font-variant-numeric:tabular-nums;color:var(--muted)}.eyebrow{font-size:11px;font-weight:750;letter-spacing:.12em}
/* Progress and notifications occupy separate, compact corners. */
#hud{position:absolute;inset:0;z-index:3;pointer-events:none}.top-progress{position:absolute;top:0;left:0;right:0;height:3px;background:#ffffff50}#progress{height:100%;background:var(--accent)}.hud-header{position:absolute;top:max(16px,env(safe-area-inset-top));left:max(16px,env(safe-area-inset-left));width:176px;max-width:calc(51% - 23px)}.hud-left{padding:10px 14px 12px;background:#faf8f1f2;border-radius:8px;box-shadow:0 2px 12px #2934310a}.life-line{display:flex;justify-content:space-between;gap:10px;align-items:center}.age-display{order:-1;white-space:nowrap;line-height:1}#age{font-size:45px;font-weight:850;letter-spacing:-.07em;font-variant-numeric:tabular-nums}.age-display small{font-size:12px;margin-left:4px;font-weight:750}#chapter{font-size:9px;font-weight:600;letter-spacing:.03em;color:var(--muted);white-space:nowrap}.hud-header h2{font-size:18px;font-weight:850;line-height:1.4;letter-spacing:-.035em;margin:6px 0 9px;overflow-wrap:anywhere}#friend-status{padding-top:7px;border-top:1px solid var(--line);font-size:11px;font-weight:600;white-space:nowrap}#friend-count{font-size:21px;font-weight:800;font-variant-numeric:tabular-nums;margin-left:3px}#friend-status small{font-size:10px;color:var(--muted);font-weight:500}#friend-status.alone #friend-count{color:var(--accent)}#group-count,#ride-name{display:none}#dropout-feed{position:absolute;top:max(16px,env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right));width:210px;max-width:calc(47% - 12px);display:flex;flex-direction:column;gap:7px;pointer-events:none}.dropout-notice{position:relative;padding:11px 13px 11px 16px;background:#faf8f1f7;border-radius:7px;color:var(--ink);box-shadow:0 3px 14px #29343112;animation:notice-in .25s ease-out}.dropout-notice::before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:3px;background:var(--friend-color,var(--accent));border-radius:0 3px 3px 0}.dropout-notice strong{display:block;font-size:20px;font-weight:850;line-height:1.3;letter-spacing:-.02em;overflow-wrap:anywhere}.dropout-notice span{display:block;margin-top:3px;font-size:11px;font-weight:650;color:#6e594e}
#chapter-announcement{position:absolute;left:50%;top:clamp(172px,23vh,205px);transform:translateX(-50%);z-index:4;width:max-content;max-width:92%;padding:11px 24px 14px;text-align:center;pointer-events:none;background:#faf8f1f5;border-radius:5px;box-shadow:0 3px 0 #29343112;animation:chapter-arrive .3s ease-out}#chapter-announcement-age{display:flex;align-items:center;justify-content:center;gap:7px;font-size:11px;font-weight:750;letter-spacing:.07em;color:#6b736a}#chapter-announcement-age::before{content:"";width:6px;height:6px;background:var(--accent);border-radius:50%}#chapter-announcement-name{display:block;margin-top:5px;font-size:clamp(31px,4.6vw,54px);font-weight:900;line-height:1.18;letter-spacing:-.045em;word-break:keep-all}
/* The steering wheel is the only driving control. */
#play-controls{position:absolute;inset:0;pointer-events:none;z-index:4}.rolling-controls{position:absolute;inset:0;pointer-events:none}#steering-wheel{position:absolute;left:50%;bottom:max(8px,env(safe-area-inset-bottom));width:clamp(132px,23vh,186px);height:clamp(132px,23vh,186px);transform:translateX(-50%);pointer-events:auto;touch-action:none;cursor:grab;filter:drop-shadow(0 4px 5px #29343125)}#steering-wheel.engaged{cursor:grabbing}#wheel-face{display:block;width:100%;height:100%;transform:rotate(var(--wheel-angle,0deg))}#steering-wheel:focus-visible{border-radius:50%}.balance-panel{position:absolute;left:max(20px,env(safe-area-inset-left));bottom:max(24px,env(safe-area-inset-bottom));width:74px}#balance-meter{height:6px;position:relative;background:#faf8f1db;border-radius:3px}.safe-zone{position:absolute;left:14%;right:14%;height:100%;background:#91a58a77}.balance-center{position:absolute;left:50%;top:-3px;height:12px;width:1px;background:#29343144}#balance-needle{position:absolute;top:-3px;width:6px;height:12px;transform:translateX(-50%);background:var(--ink);border-radius:3px}.danger #balance-needle{background:var(--accent)}#joystick{position:absolute;opacity:0;pointer-events:none;transform:translate(-50%,-50%);width:132px;height:132px;border:1px solid #faf8f188;border-radius:50%;background:#29343115}#joystick.engaged{opacity:.8}#joystick>span{display:none}#joy-knob{position:absolute;width:44px;height:44px;top:44px;left:44px;border:2px solid var(--paper);border-radius:50%;background:#faf8f177}
/* Results are a quiet pause, with the age as the visual centre. */
.modal{background:#29343155;display:grid;place-items:center;padding:20px;overflow:auto;overscroll-behavior:contain}.dialog{width:min(420px,100%);max-height:calc(100dvh - 40px);overflow:auto;padding:28px;background:var(--paper);color:var(--ink);border-radius:14px;box-shadow:0 14px 55px #29343126;touch-action:pan-y}.dialog h2{font-size:27px;line-height:1.4;font-weight:850;letter-spacing:-.04em;margin:0 0 22px}.dialog .eyebrow{margin-bottom:12px;color:var(--accent)}.result-panel h2{font-size:25px;margin:0;max-width:14em}.result-panel #result-message{font-size:15px;line-height:1.5;margin:8px 0 15px;color:#74776e}#result-message:empty{display:none}.life-age{display:inline-flex;align-items:baseline;gap:5px;margin:7px 14px 2px 0}.life-age span{font-size:68px;line-height:1.05;letter-spacing:-.075em;font-weight:800;font-variant-numeric:tabular-nums}.life-age small{font-size:15px;font-weight:700}#result-stage{display:inline-block;font-size:16px;font-weight:800}#result-reason{font-size:11px;line-height:1.8;margin:7px 0 18px;color:var(--muted)}.stats{display:grid;grid-template-columns:1.25fr 1fr;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:13px 0;gap:22px}.stats>div{display:flex;flex-direction:column;gap:5px}.stats span{font-size:10px;color:var(--muted);font-weight:600}.stats strong{font-size:23px;font-weight:750;font-variant-numeric:tabular-nums;letter-spacing:-.03em}#result-route{display:none}#result-best{margin:10px 0 17px;font-size:10px}#retry-note{font-size:11px;margin:0 0 9px;color:var(--muted)}#retry-note:empty{display:none}#retry{font-size:15px}.secondary{display:block;min-height:44px;width:100%;background:transparent;border:0;border-radius:7px;padding:12px;color:#59645b;font-size:12px;font-weight:650}.secondary:hover{background:#29343107}#result-share{margin-top:10px;border:1px solid #29343133;color:var(--ink);font-size:13px}#restart{margin-top:8px}#result-title{font-size:11px;color:var(--muted)}#share-copy-fallback{margin:12px 0}#share-copy-fallback p{font-size:11px;color:var(--muted)}#share-copy-text{display:block;width:100%;padding:12px;border:1px solid #29343144;border-radius:6px;background:#fffdf8;color:var(--ink);font:13px/1.7 sans-serif;resize:vertical;user-select:text;-webkit-user-select:text;touch-action:auto}#success-flash{position:absolute;inset:0;background:#fff4c8;z-index:5;pointer-events:none;opacity:0}#countdown{position:absolute;top:45%;left:50%;transform:translate(-50%,-50%);z-index:5;font-size:56px;font-weight:900;letter-spacing:-.04em;color:var(--ink);text-shadow:0 2px 0 var(--paper)}#load-state{position:absolute;left:50%;bottom:20px;transform:translateX(-50%);z-index:10;padding:10px 16px;max-width:90%;background:var(--paper);color:var(--ink);border-radius:6px;font-size:12px;text-align:center}
.free-flight .balance-panel,.free-flight #steering-wheel{display:none}#flight-guide{position:absolute;z-index:4;left:50%;bottom:50px;transform:translateX(-50%);width:min(92%,440px);text-align:center;pointer-events:none;color:#294c5b}#flight-guide strong{font-size:22px;font-weight:850}#flight-guide p{font-size:13px}#flight-guide small{display:block;font-size:11px;margin-top:5px}.flight-gesture{display:flex;align-items:center;justify-content:center;gap:20px;height:54px;font-size:28px}.flight-time-track{height:3px;width:110px;margin:auto;background:#fff8}#flight-time{height:100%;background:#426c75}.touch-flight-help{display:none}.departing #joystick{opacity:0}
@keyframes notice-in{from{opacity:0;transform:translateX(12px)}to{opacity:1;transform:translateX(0)}}@keyframes chapter-arrive{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}
@media(max-width:600px){.title-copy{left:7%;top:max(8%,env(safe-area-inset-top))}h1{font-size:clamp(34px,9.2vw,51px)}.start-area{left:7%;width:86%;max-width:350px;bottom:max(4%,env(safe-area-inset-bottom))}.hud-header{left:max(12px,env(safe-area-inset-left));top:max(12px,env(safe-area-inset-top));width:167px;max-width:calc(51% - 19px)}.hud-left{padding:9px 11px 11px}#age{font-size:37px}#chapter{font-size:8px}.life-line{gap:6px}.hud-header h2{font-size:17px;margin:5px 0 7px}#friend-status{font-size:10px}#friend-count{font-size:19px}#friend-status small{font-size:9px}#dropout-feed{top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));max-width:calc(48% - 14px)}.dropout-notice{padding:10px 10px 10px 13px}.dropout-notice strong{font-size:clamp(16px,4.7vw,20px)}.dropout-notice span{font-size:10px}#chapter-announcement{top:clamp(165px,23vh,190px);padding:10px 16px 13px}#chapter-announcement-name{font-size:clamp(30px,8vw,43px)}.dialog{padding:24px}.life-age span{font-size:62px}}
@media(max-width:350px){#friend-status small{display:none}.dialog{padding:20px}.result-panel h2{font-size:23px}.hud-header{max-width:calc(51% - 17px)}#chapter{font-size:7px}.age-display small{font-size:10px}#age{font-size:32px}}
@media(max-height:600px) and (orientation:landscape){#title-screen{background:linear-gradient(90deg,#faf8f1ed, #faf8f100 55%,#faf8f18c)}.title-copy{left:5%;top:10%;max-width:47%}h1{font-size:clamp(28px,4.5vw,48px)}.start-area{left:auto;right:5%;bottom:8%;width:30%;max-width:300px}.start-note{font-size:10px}.hud-header{top:10px;left:12px;width:150px}.hud-left{padding:8px 11px}#age{font-size:30px}.hud-header h2{font-size:15px;margin:4px 0 6px}#friend-status{padding-top:5px}#friend-count{font-size:17px}#dropout-feed{top:10px;right:12px;width:175px}.dropout-notice{padding:8px 11px}.dropout-notice strong{font-size:17px}.dropout-notice span{font-size:10px}#chapter-announcement{top:26px;max-width:calc(100% - 385px);padding:9px 14px 11px}#chapter-announcement-name{font-size:clamp(23px,3.5vw,36px);word-break:normal}#chapter-announcement-age{font-size:10px}#steering-wheel{width:116px;height:116px;bottom:4px}.balance-panel{bottom:18px}.dialog{max-height:calc(100dvh - 24px);padding:20px 25px}.modal{padding:12px}.life-age span{font-size:48px}.result-panel h2{font-size:23px}.stats{padding:9px 0}#flight-guide{bottom:18px}}
@media(pointer:coarse){.touch-flight-help{display:inline}.key-flight-help{display:none}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

#game.free-flight{touch-action:none}#flight-hand{transform:translate(var(--steer-x,0px),var(--steer-y,0px));transition:transform .1s}
