:root{--font-gothic:"Noto Sans JP","Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,system-ui,sans-serif;--ink:#0b1623;--panel:#14283a;--line:#345166;--white:#f5f8ed;--muted:#a3b9c3;--lime:#dfff5a;--orange:#ff9b53;--blue:#64d3e9;--usable-h:max(140px,calc(100svh - 144px));--field-h:min(700px,var(--usable-h),calc((100vw - 24px)*1.4));--field-w:calc(var(--field-h)*.7142857143);--field-top:calc(88px + (var(--usable-h) - var(--field-h))/2)}
*{box-sizing:border-box}html,body{margin:0;background:var(--ink);color:var(--white);font-family:var(--font-gothic);overscroll-behavior:none}button,input,select,textarea{font:inherit}button,a,input{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit;border:0;touch-action:manipulation}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid var(--blue);outline-offset:4px}button:disabled{opacity:.45;cursor:default}[hidden]{display:none!important}button:active{transform:translateY(2px)}a{color:var(--blue)}
#game{position:relative;height:100svh;min-height:320px;overflow:hidden;isolation:isolate}.arcade-backdrop{position:absolute;inset:0;z-index:-2;background:radial-gradient(ellipse at 50% 42%,#254759 0%,#101f30 49%,#08121e 100%)}.arcade-backdrop::before{content:"";position:absolute;inset:0;opacity:.17;background:repeating-linear-gradient(135deg,transparent 0 47px,#80adad44 48px 49px,transparent 50px 96px)}.arcade-backdrop::after{content:"";position:absolute;width:90vw;height:90vw;left:5vw;top:calc(50% - 45vw);border:1px solid #8bbca121;border-radius:50%;box-shadow:0 0 0 85px #72b7bb07,0 0 0 170px #72b7bb05;z-index:-1}
.game-header{position:absolute;left:24px;right:24px;top:max(14px,env(safe-area-inset-top));display:flex;align-items:center;justify-content:space-between;gap:16px;height:44px}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;font-weight:900;font-style:italic;font-size:22px;line-height:1;color:var(--white)}.brand svg{width:38px;height:38px;fill:none;stroke:var(--lime);stroke-width:2}.brand-small{display:block;color:var(--lime);font-size:10px;letter-spacing:3px;margin-top:6px;font-style:normal}.header-mode{margin-left:auto;margin-right:20px;font-size:9px;font-weight:800;letter-spacing:2px;color:#a5c4c3}.iconbtn{width:46px;height:44px;background:var(--panel);border:1px solid var(--line);border-bottom:4px solid #06101a;border-radius:9px;font-size:24px;font-weight:900}
.arena{position:absolute;top:var(--field-top);left:50%;transform:translateX(-50%);width:var(--field-w);height:var(--field-h);aspect-ratio:5/7;overflow:hidden;background:#b9ccc4;border:2px solid #6e8a8a;border-radius:15px;box-shadow:0 0 0 5px #07111ba6,0 22px 75px #0008}.arena::after{content:"";position:absolute;inset:0;border:1px solid #ffffff38;border-radius:12px;pointer-events:none;z-index:2}#world{position:absolute;inset:0;touch-action:none}#world canvas{display:block;width:100%;height:100%;touch-action:none}.world-input{position:absolute;inset:0;z-index:4;pointer-events:none;user-select:none}.world-input>svg{width:100%;height:100%;position:absolute;inset:0}.world-input polyline{fill:none;stroke:var(--lime);stroke-width:3;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 3px #182c29)}.world-input circle{fill:var(--lime)}.vignette{position:absolute;inset:0;pointer-events:none;background:linear-gradient(0deg,#07182777,transparent 30%,transparent 80%,#0d243444)}body:not(.started) .vignette{background:linear-gradient(0deg,#071827ee,#07182799 50%,#07182766)}
.stage-info{position:absolute;width:180px;left:calc(50% - var(--field-w)/2 - 206px);top:calc(var(--field-top) + 25px)}.eyebrow{color:var(--blue);font-size:10px;font-weight:900;letter-spacing:1.5px;line-height:1.7}.stage-info .eyebrow{font-size:9px}.stage-info h1{font-size:22px;line-height:1.5;margin:10px 0 14px;letter-spacing:.3px;font-weight:900}.stage-info p{font-size:11px;line-height:1.9;color:var(--muted);margin:0}.stage-info::after{content:"";display:block;width:36px;height:4px;background:var(--lime);margin-top:20px}.distance-card{position:absolute;left:calc(50% + var(--field-w)/2 + 28px);top:calc(var(--field-top) + 26px);display:flex;flex-direction:column;gap:5px}.distance-card>span{font-size:10px;font-weight:900;color:var(--muted);letter-spacing:2px}.distance-card strong{font-size:44px;font-weight:900;font-style:italic;font-variant-numeric:tabular-nums;line-height:1.15}.distance-card small{font-size:15px;margin-left:4px;color:var(--lime)}.best{position:absolute;left:calc(50% + var(--field-w)/2 + 28px);top:calc(var(--field-top) + 125px);max-width:170px;font-size:10px;line-height:1.8}.record-label{display:block;color:var(--muted);font-size:9px;font-weight:800;letter-spacing:2px}#best{display:block;color:var(--lime);font-weight:800}body:not(.started) .stage-info{display:none}.primary,.secondary{display:flex;align-items:center;justify-content:center;gap:14px;min-height:48px;padding:12px 18px;border-radius:8px;border:1px solid #e9ffc166;border-bottom:5px solid #6d8431;background:var(--lime);color:#14221c;font-size:13px;font-weight:900;line-height:1.5;text-decoration:none;box-shadow:0 4px 0 #06111b}.primary:hover{background:#ecff9b}.secondary{border:1px solid #53748b;border-bottom:4px solid #06131e;background:#203c50;color:var(--white)}.secondary:hover{background:#30546c}.tokyo-link{background:transparent;color:var(--orange);font-size:11px;font-weight:800;min-height:40px;margin-top:5px;padding:7px}
.tools{position:absolute;left:calc(50% + var(--field-w)/2 + 26px);top:calc(var(--field-top) + 208px);display:flex;gap:7px;flex-wrap:wrap;width:170px}.tool{width:48px;height:53px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;border:1px solid var(--line);border-bottom:4px solid #06121e;background:var(--panel);border-radius:8px}.tool svg{width:20px;height:20px;fill:none;stroke:var(--blue);stroke-width:1.8;stroke-linejoin:round}.tool span{font-size:8px;font-weight:800;white-space:nowrap}.tool[aria-pressed=true]{background:#2c493d;border-color:#95bd6a}.tool[aria-pressed=true] svg{stroke:var(--lime)}.zoom-controls{position:absolute;left:calc(50% + var(--field-w)/2 + 26px);top:calc(var(--field-top) + 281px);display:flex;background:var(--panel);border:1px solid var(--line);border-bottom:4px solid #06121e;border-radius:8px;overflow:hidden}.zoom-controls button{width:44px;height:44px;background:transparent;font-size:20px;font-weight:900}.zoom-controls button:hover{background:#2a4a5c}.zoom-controls #zoomReset{width:58px;font-size:10px;border-inline:1px solid var(--line)}.zoom-hint{position:absolute;left:calc(50% + var(--field-w)/2 + 26px);top:calc(var(--field-top) + 339px);width:170px;font-size:8px;line-height:1.8;color:var(--muted)}body:not(.started) .tools,body:not(.started) .zoom-controls,body:not(.started) .zoom-hint{display:none}
.draw-hud{position:absolute;left:50%;top:calc(var(--field-top) + var(--field-h) + 10px);transform:translateX(-50%);width:var(--field-w);text-align:center;pointer-events:none}.draw-hud{padding:6px 14px;border:1px solid #344e5c;border-radius:8px;background:#122735;text-align:left}.draw-hud>div:first-child{display:flex;justify-content:space-between;gap:10px;font-size:11px}.draw-hud span{color:var(--lime);font-weight:900}.draw-strength{height:6px;background:#07141f;border-radius:5px;margin-top:7px;overflow:hidden}.draw-strength i{display:block;height:100%;width:0;background:var(--lime)}.street-status{position:absolute;top:10px;left:50%;transform:translateX(-50%);padding:5px 9px;max-width:95%;white-space:nowrap;font-size:8px;line-height:1.6;color:#f7f3d5;border-radius:5px;background:#162a38bc;pointer-events:none}.street-status:empty{display:none}body:not(.started) .street-status{display:none}
.result{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:calc(100% - 30px);max-width:345px;padding:23px 20px 14px;text-align:center;background:#102636f5;border:2px solid #638c88;border-top:6px solid var(--lime);border-radius:13px;box-shadow:0 15px 50px #0009;z-index:4}.result .eyebrow{color:var(--lime);font-size:clamp(25px,calc(var(--field-w)*.08),38px);font-style:italic;font-weight:900;letter-spacing:-1px;line-height:1.1}.result h2{font-size:18px;font-weight:900;margin:12px 0}.result p{font-size:10px;line-height:1.9;color:#c2d4d8;margin:8px 0}.result-stars{font-size:34px;letter-spacing:6px;color:#ffcf56;text-shadow:0 3px 0 #7f5d26;animation:star-pop .32s ease-out}.result-distance{padding:13px 0;margin:12px 0 16px;border-block:1px solid #3f626977;display:flex;align-items:center;justify-content:space-between;gap:10px}.result-distance>span{color:var(--muted);font-size:10px;font-weight:900;letter-spacing:2px}.result-distance strong{font-size:27px;font-style:italic;font-weight:900;color:var(--white)}.result>.primary,.result>.secondary{width:100%;margin-top:10px}.result>.textbtn{margin:8px 0 0}.textbtn{background:transparent;color:var(--muted);padding:10px 4px;min-height:40px;font-size:11px}.textbtn:hover{color:var(--white)}.shot-badge{position:absolute;left:50%;bottom:18px;transform:translateX(-50%);background:#112b3cdb;color:var(--lime);padding:8px 13px;border:1px solid #b8dc6555;border-radius:6px;font-size:10px;font-weight:900;white-space:nowrap;pointer-events:none}.stunt-callout{position:absolute;left:50%;top:19%;transform:translateX(-50%) rotate(-5deg);padding:10px 14px;background:var(--lime);color:#173026;font-size:clamp(18px,calc(var(--field-w)*.07),31px);font-style:italic;font-weight:900;white-space:nowrap;box-shadow:5px 5px 0 #122535aa;pointer-events:none}.kick-pulse{position:absolute;left:50%;top:55%;transform:translate(-50%,-50%) rotate(-9deg);width:125px;height:125px;border-radius:50%;border:3px solid #e4ff7e88;pointer-events:none}.kick-pulse span{position:absolute;bottom:-20px;left:5px;font-size:27px;color:var(--lime);font-weight:900;font-style:italic}.speed-veil{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;opacity:0}.speed-veil path{fill:none;stroke:#efffe3;stroke-width:2;stroke-linecap:round}.texture-status{position:absolute;left:10px;bottom:12px;padding:7px 9px;max-width:calc(100% - 20px);font-size:9px;line-height:1.7;border-radius:6px;color:#e2eddd;background:#112837e8;pointer-events:none;z-index:3}
footer{position:absolute;bottom:9px;left:20px;right:20px;font-size:8px;color:#6e8b96;letter-spacing:1px;display:flex;justify-content:space-between}body.started footer{display:none}#toast{position:absolute;left:50%;top:64px;transform:translateX(-50%);padding:10px 14px;border:1px solid #62857a;border-radius:7px;background:#112d3bef;color:var(--white);font-size:11px;line-height:1.7;z-index:12;max-width:calc(100% - 30px);width:max-content;pointer-events:none}.orientation-note{display:none}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
/* Game menus */
dialog{width:440px;max-width:calc(100% - 24px);max-height:calc(100svh - 24px);overflow-y:auto;border:2px solid #4f747f;border-top:6px solid var(--lime);border-radius:13px;background:#112838;color:var(--white);padding:28px;box-shadow:0 25px 100px #000b;overscroll-behavior:contain}dialog::backdrop{background:#030c16c9;backdrop-filter:blur(5px)}dialog h2{font-size:23px;font-weight:900;margin:7px 0 20px}dialog p,dialog li{font-size:12px;line-height:1.9;color:#bfd0d4}dialog ol{padding-left:20px}dialog li{margin-bottom:16px}dialog strong{color:var(--white)}.close{position:absolute;right:12px;top:12px;width:40px;height:40px;border:1px solid #456777;border-radius:7px;background:#213e50;font-size:25px;font-weight:900}.muted{font-size:10px!important;color:#91acb5!important}.volume-label{display:flex;justify-content:space-between;font-size:12px;font-weight:800;margin:18px 0 12px}input[type=range]{width:100%;accent-color:var(--lime);height:28px}.menu-feet{display:flex;align-items:center;gap:7px;margin-top:15px}.menu-feet>span{font-size:12px;margin-right:auto}.menu-feet .secondary{font-size:11px;min-height:44px;padding:8px 12px}.menu-feet button[aria-pressed=true]{color:#16291e;background:var(--lime);border-color:#dfff5a}.reduce-motion{display:flex;align-items:center;gap:8px;font-size:11px;line-height:1.7;min-height:48px;margin-top:10px}.reduce-motion input{width:19px;height:19px;accent-color:var(--lime)}#resumeBtn{width:100%;margin-top:12px}#exitBtn{display:block;margin-inline:auto}
.stage-dialog{width:740px;padding:28px 24px}.stage-dialog h2{margin-bottom:16px}.area-tabs{display:flex;gap:7px;padding:4px;border:1px solid #345765;border-radius:9px;background:#091b29}.area-tabs button{flex:1;min-height:48px;padding:8px 10px;border:1px solid transparent;border-radius:6px;color:#a1b9c0;background:transparent;font-size:12px;font-weight:900;letter-spacing:1px}.area-tabs button span{font-size:10px;margin-left:6px;letter-spacing:0}.area-tabs button[aria-pressed=true]{background:var(--lime);color:#153023;border-bottom:4px solid #75923c}.area-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:22px 0 12px}.area-heading strong{font-size:16px;font-weight:900}.area-heading>span{font-size:9px;letter-spacing:1px;color:var(--blue)}.stage-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.stage-card{position:relative;display:grid;grid-template-columns:40px 1fr;align-content:start;gap:7px 10px;min-height:165px;border:1px solid #466b7b;border-bottom:5px solid #071724;border-radius:10px;background:linear-gradient(145deg,#264557,#183243);padding:16px;text-align:left;overflow:hidden}.stage-card:hover{border-color:var(--lime);background:#2c505b}.stage-card .stage-number{grid-row:1/4;display:grid;place-items:center;align-self:start;width:36px;height:36px;border-radius:50%;background:var(--lime);color:#1a3223;border-bottom:3px solid #6c8740;font-size:16px;font-weight:900;font-style:italic}.stage-card>strong{font-size:13px;line-height:1.5;font-weight:900;grid-column:2}.stage-desc{grid-column:2;font-size:10px;line-height:1.6;color:#b8ced0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.course-meta{grid-column:2;color:var(--blue);font-size:9px;font-weight:900;letter-spacing:.5px}.stage-card>small{grid-column:1/-1;font-size:9px;color:#cce39a;border-top:1px solid #6b8c7655;padding-top:10px;margin-top:auto;letter-spacing:.4px}.card-play{position:absolute;right:12px;bottom:12px;font-size:11px;color:var(--lime)}.stage-card.station{background:linear-gradient(145deg,#4d4437,#253c42);border-top:3px solid var(--orange)}.stage-card.bay{border-top:3px solid var(--blue)}.stage-card.dome{border-top:3px solid #b5d68d}.station-set{grid-column:1/-1;font-size:10px;font-weight:900;color:var(--orange);letter-spacing:1px;border-top:1px solid #5e787b;padding-top:17px;margin-top:6px}.station-set span{display:block;font-size:10px;font-weight:500;letter-spacing:0;color:#bbced0;margin-top:5px}#error{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:#0c2234;z-index:99;padding:26px;text-align:center}#error h2{font-size:22px}#error p{font-size:12px;line-height:1.8;color:var(--muted)}#error button{padding:14px 24px;background:var(--lime);color:#142a20;font-weight:900;border-radius:8px}
@keyframes star-pop{from{opacity:.3;transform:scale(.65)}to{opacity:1;transform:scale(1)}}
@media(max-width:950px){.header-mode{font-size:8px;letter-spacing:1px;margin-right:6px}.stage-info{left:calc(50% - var(--field-w)/2);top:calc(var(--field-top) - 39px);width:calc(var(--field-w) - 87px)}.stage-info .eyebrow{font-size:7px;line-height:1.2;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.stage-info h1{font-size:13px;margin:5px 0 0;line-height:1.3;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.stage-info p,.stage-info::after{display:none}.distance-card{left:auto;right:calc(50% - var(--field-w)/2);top:calc(var(--field-top) - 39px);display:flex;flex-direction:row;align-items:baseline;gap:5px}.distance-card>span{font-size:8px;letter-spacing:0}.distance-card strong{font-size:23px}.distance-card small{font-size:10px;margin-left:2px}.best{display:none}.tools{left:calc(50% - var(--field-w)/2);top:auto;bottom:5px;display:flex;flex-wrap:nowrap;width:auto;gap:6px}.tool{width:44px;height:44px;gap:2px}.tool svg{width:18px;height:18px}.tool span{font-size:7px}.zoom-controls{top:auto;left:auto;right:calc(50% - var(--field-w)/2);bottom:5px}.zoom-controls button{width:38px;height:39px}.zoom-controls #zoomReset{width:55px;font-size:9px}.zoom-hint{display:none}.draw-hud{padding:5px 12px;top:calc(var(--field-top) + var(--field-h) + 8px)}.draw-hud>div:first-child{font-size:10px}.draw-strength{height:5px;margin-top:5px}}
@media(max-width:600px){.game-header{left:14px;right:14px;top:max(10px,env(safe-area-inset-top));height:36px}.brand{font-size:16px;gap:7px}.brand svg{width:31px;height:31px}.brand-small{font-size:8px;letter-spacing:2px;margin-top:4px}.header-mode{font-size:6px;letter-spacing:1px;max-width:100px;line-height:1.8;text-align:right}.iconbtn{width:40px;height:38px;font-size:21px}.arena{border-radius:12px}.result{padding:18px 16px 10px}.result h2{font-size:16px;margin:10px 0}.result-stars{font-size:29px;letter-spacing:5px}.result-distance{padding:10px 0;margin:10px 0}.result-distance strong{font-size:25px}.result>.primary,.result>.secondary{min-height:44px;margin-top:8px;padding:9px 12px;font-size:12px}.result>.textbtn{min-height:33px;padding:7px 0}.stage-dialog{padding:24px 16px}.stage-grid{gap:9px}.stage-card{grid-template-columns:28px 1fr;padding:12px 10px;gap:6px 7px;min-height:172px}.stage-card .stage-number{width:27px;height:27px;font-size:13px}.stage-card>strong{font-size:11px}.stage-desc{font-size:9px}.course-meta{font-size:8px}.stage-card>small{font-size:8px;padding-top:9px}.card-play{font-size:8px;right:8px}.area-tabs button{font-size:11px}.area-tabs button span{font-size:9px}.area-heading strong{font-size:14px}.stage-dialog h2{font-size:21px}dialog{padding:24px 21px}.close{width:35px;height:35px;right:10px;top:10px}.stunt-callout{top:18%}}
@media(max-height:680px){.tokyo-link{min-height:32px;font-size:10px;margin-top:2px}.result{padding:14px 14px 7px}.result h2{font-size:14px;margin:8px 0}.result p{font-size:9px;line-height:1.6}.result-stars{font-size:26px}.result-distance{padding:7px 0;margin:8px 0}.result-distance strong{font-size:22px}.result>.primary,.result>.secondary{min-height:40px;padding:7px;margin-top:7px}.result .textbtn{min-height:30px;padding:6px}}
@media(max-width:340px){.header-mode{display:none}.stage-grid{grid-template-columns:1fr}.stage-card{min-height:135px;grid-template-columns:36px 1fr}.stage-card>strong{font-size:13px}.stage-card .stage-number{width:32px;height:32px}.tool{width:40px}.tools{gap:3px}.zoom-controls button{width:34px}.zoom-controls #zoomReset{width:47px}}
@media(max-height:500px) and (min-width:600px){.game-header{top:8px;height:34px}.brand{font-size:16px}.brand svg{width:29px;height:29px}.brand-small{font-size:7px;margin-top:3px}.header-mode{font-size:7px}.iconbtn{height:36px;width:40px;font-size:20px}.tools{left:20px;top:110px;bottom:auto;display:grid;grid-template-columns:44px;width:44px}.zoom-controls{right:20px;top:110px;bottom:auto;display:flex;flex-direction:column}.zoom-controls button,.zoom-controls #zoomReset{width:52px;height:40px;border:0}.zoom-controls #zoomReset{border-block:1px solid var(--line)}.tokyo-link{display:none}.result{width:calc(100% - 16px);padding:10px 8px 5px}.result .eyebrow{font-size:21px}.result h2,.result p,.result-stars{display:none}.result-distance{margin:7px 0;padding:6px 0}.result-distance>span{font-size:7px}.result-distance strong{font-size:17px}.result>.primary,.result>.secondary{min-height:33px;padding:5px;font-size:9px;margin-top:6px}.result .textbtn{min-height:27px;font-size:8px}.draw-hud{width:240px}.street-status{font-size:6px;padding:3px 5px;top:5px}.texture-status{font-size:7px;padding:5px;left:4px;bottom:5px}.shot-badge{font-size:7px;bottom:8px;padding:5px}.stunt-callout{font-size:14px;padding:7px}.orientation-note{display:block;position:absolute;left:80px;bottom:7px;font-size:8px;color:#92aab4}.speed-veil path{stroke-width:1}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}.reduced-motion *{animation:none!important;transition:none!important}
/* Fit the title to the shared playfield, independently of device width. */
.arena{border:0;outline:2px solid #6e8a8a}.tokyo-link{min-height:clamp(28px,calc(var(--field-h)*.062),40px);line-height:1.4;font-size:10px;padding:6px;margin-top:3px}
@media(max-height:580px){}
@media(max-height:380px) and (min-width:600px){.tokyo-link{display:none}}

.credits{border-top:1px solid #3b5c69;margin-top:14px;padding-top:13px}.credits summary{font-size:10px;color:var(--muted);cursor:pointer;min-height:32px}.credits p{font-size:10px;line-height:1.8}
/* v0.13: goals, replays and maximum-power impact. */
.result{max-height:calc(100% - 24px);overflow-y:auto}.replay-button{border-color:#5cafc2!important;color:#9eeaff!important}.replay-controls{position:absolute;left:8px;right:8px;bottom:8px;padding:9px 11px;background:#071d2bef;border:1px solid #5595a2;border-radius:10px;z-index:7}.replay-head{display:flex;justify-content:space-between;gap:8px;align-items:center;font-size:9px;color:#b5cbd2}.replay-head strong{color:#ffb573;letter-spacing:2px;font-size:10px}.replay-controls input[type=range]{height:27px;margin:4px 0;width:100%}.replay-row{display:flex;gap:5px;flex-wrap:wrap}.replay-row button{flex:1;min-width:32px;min-height:36px;font-size:10px;font-weight:800;border:1px solid #3d697b;border-radius:5px;background:#1b3e53}.replay-row button:last-child{color:var(--lime);min-width:49px}.replay-row button:hover{background:#346078}.power-callout{position:absolute;left:50%;top:26%;transform:translate(-50%,-50%) rotate(-5deg);padding:10px 24px;border:2px solid #fff1b2;background:#de8e36ef;color:#112737;box-shadow:8px 8px 0 #0c2039a8;pointer-events:none;text-align:center;z-index:5}.power-callout small{display:block;font-size:11px;font-weight:900;letter-spacing:3px;white-space:nowrap}.power-callout strong{font-size:48px;font-weight:900;font-style:italic;line-height:1.2}.miss-callout{position:absolute;left:50%;top:30%;transform:translateX(-50%) rotate(3deg);padding:10px 16px;background:#e4a064;color:#222e39;font-size:clamp(18px,calc(var(--field-w)*.075),32px);font-weight:900;font-style:italic;white-space:nowrap;pointer-events:none;box-shadow:5px 5px 0 #132b3c99}.replaying .street-status{display:none}.reduced-motion .power-callout{display:none}.stunt-callout{animation:goal-pop .28s ease-out}.miss-callout{animation:miss-pop .22s ease-out}@keyframes goal-pop{from{opacity:.2;transform:translateX(-50%) rotate(-8deg) scale(.7)}to{opacity:1;transform:translateX(-50%) rotate(-5deg) scale(1)}}@keyframes miss-pop{from{opacity:.1;transform:translateX(-50%) rotate(3deg) scale(.8)}to{opacity:1;transform:translateX(-50%) rotate(3deg) scale(1)}}
@media(max-height:500px) and (min-width:600px){.replay-controls{padding:5px;left:4px;right:4px;bottom:4px}.replay-head strong{font-size:8px}.replay-head>span{font-size:7px}.replay-controls input[type=range]{height:20px;margin:1px 0}.replay-row{gap:3px}.replay-row button{font-size:8px;min-height:28px;min-width:24px}.replay-row button:last-child{min-width:38px}.power-callout{padding:6px 10px}.power-callout strong{font-size:30px}.power-callout small{font-size:7px;letter-spacing:1px}}
/* v0.16 regional courses */
.area-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}.stage-card.regional{border-top-color:#78b9a9}.stage-card.yokohama{border-top-color:#e6ba73}.stage-card.kawagoe{border-top-color:#c5ac8c}.stage-card.kusatsu{border-top-color:#8fc6b0}.stage-card.inubosaki{border-top-color:#a9ccd9}.stage-card.ryujin{border-top-color:#85b4c8}.stage-card.nikko{border-top-color:#a0bb87}#kantoBtn{margin-top:0;padding:8px 0}.area-tabs button{min-width:0}

@media(max-height:580px){#kantoBtn{min-height:26px;padding:4px 0;font-size:9px}}

/* v0.17: compact play controls and centered confirmation */
.draw-hud{top:auto;bottom:12px;width:calc(var(--field-w) - 24px);max-width:440px;z-index:3}
.tools{display:grid;grid-template-columns:repeat(2,1fr);width:154px}.tool{width:auto}.tool:disabled{opacity:.4;cursor:default}.zoom-controls{top:calc(var(--field-top) + 330px)}.zoom-hint{top:calc(var(--field-top) + 386px)}
dialog{position:fixed;inset:0;margin:auto;height:fit-content}#menuDialog{width:390px;padding:25px}#menuDialog h2{margin-bottom:18px}#menuDialog .volume-label{margin-top:0}#menuDialog .muted{margin:8px 0}.exit-dialog{width:390px;text-align:center;padding:28px 22px}.exit-dialog h2{font-size:21px;margin:10px 0}.exit-dialog p{margin:10px 0 22px}.exit-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.exit-actions button{font-size:11px;min-height:46px;padding:9px 6px}
@media(max-width:950px){.tools{display:flex;width:auto;top:auto;bottom:5px}.tool{width:44px}.zoom-controls{top:auto}.draw-hud{top:auto;bottom:10px}}
@media(max-width:340px){.tool{width:40px}.tools{gap:3px}}
@media(max-height:500px) and (min-width:600px){.tools{left:20px;top:100px;bottom:auto;display:grid;grid-template-columns:44px;width:44px}.zoom-controls{top:110px}.draw-hud{width:calc(var(--field-w) - 16px);bottom:7px;padding:5px 7px}.draw-hud>div:first-child{font-size:8px}}

.stage-card.umihotaru{border-top-color:#a9ccd9}.stage-card.kashima{border-top-color:#c6ba8b}
@media(min-width:341px) and (max-width:380px){.tool{width:42px}.tools{gap:4px}.zoom-controls button{width:34px}.zoom-controls #zoomReset{width:47px}}
.inspecting #result,.inspecting #replayControls,.inspecting #drawHud,.inspecting #shotBadge,.inspecting #stuntCallout,.inspecting #streetStatus{visibility:hidden}.tools #viewBtn span{font-size:9px;line-height:1.2}

.inspecting #missCallout,.inspecting #powerCallout,.inspecting #kickPulse,.inspecting #speedVeil{visibility:hidden}


@media(max-height:550px){}
@media(max-width:700px){}

.previous-stroke{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:3}.previous-stroke polyline{fill:none;stroke:#a4edff;stroke-width:3.5;stroke-dasharray:8 5;opacity:.95;filter:drop-shadow(0 1px 2px #061c34);stroke-linecap:round;stroke-linejoin:round}.inspecting #previousStroke{display:none}

/* Target location and a brief skill acknowledgement; both let strokes pass through. */
.goal-cue{position:absolute;transform:translate(-50%,-100%);padding:5px 8px;border:1px solid #edffd49c;border-radius:4px;background:#12313dd9;color:#e8ff91;font-size:clamp(8px,calc(var(--field-w)*.025),12px);font-weight:900;letter-spacing:.8px;white-space:nowrap;pointer-events:none;z-index:2;box-shadow:0 2px 8px #07131e55}
.thread-callout{position:absolute;left:12px;top:16%;padding:7px 11px;border-left:3px solid #ffe09b;background:#102f42e8;color:#fff2ca;pointer-events:none;z-index:3;animation:thread-pop .18s ease-out}
.thread-callout small{display:block;font-size:clamp(6px,calc(var(--field-w)*.02),9px);letter-spacing:1px;font-weight:800}.thread-callout strong{display:block;margin-top:2px;font-size:clamp(12px,calc(var(--field-w)*.046),21px);font-style:italic;font-weight:900}
.inspecting .goal-cue,.inspecting .thread-callout{visibility:hidden}.result[data-outcome="miss"] .retry-button{background:var(--lime);color:#132c2d;border-color:var(--lime)}
@keyframes thread-pop{from{opacity:0;transform:translateX(-8px)}to{opacity:1;transform:translateX(0)}}
.reduced-motion .thread-callout{animation:none}
.area-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.prefecture-progress{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 0 14px;color:#c9d9db;font-size:10px}.prefecture-progress strong{color:var(--lime);font-size:12px}.stage-card.kawaguchi{border-top-color:#88dbe3}.stage-card.jigokudani{border-top-color:#d6ddce}.stage-card.miho{border-top-color:#81c8d3}

.area-tabs button{font-size:10px;letter-spacing:.5px;padding:8px 3px}.area-tabs button span{display:block;margin:4px 0 0;font-size:9px}
.result-skills{margin:9px 0 3px;padding:9px 0 3px;border-top:1px solid #3f626977;text-align:left}.skills-title{display:block;font-size:8px;letter-spacing:.4px;color:#9dbac2;margin-bottom:6px}.skill-chips{display:flex;gap:5px}.skill-chips>span{flex:1;min-width:0;padding:6px 3px;border:1px solid #3c5a67;border-radius:5px;background:#0d2231;color:#94acb7;font-size:8px;font-weight:900;text-align:center;white-space:nowrap}.skill-chips>span[data-complete="true"]{border-color:#b7d77988;color:#d6f695;background:#2b493c}.stage-skills{grid-column:1/-1;color:#c5d8ad;font-size:7px;line-height:1.6;white-space:normal;padding-bottom:2px}.stage-card:has(.stage-skills:not([hidden])){padding-bottom:27px}
@media(max-height:500px) and (min-width:600px){.result-skills{padding:5px 0 0;margin:5px 0}.skills-title{display:none}.skill-chips>span{font-size:6px;padding:4px 2px}}

.stage-card.shirakawa{border-top:3px solid #cfba8a}.stage-card.nagoya{border-top:3px solid #e3ce77}.stage-card.bandai{border-top:3px solid #8bcdd3}

.stage-card.snow{border-top:3px solid #d0e7f1}.stage-card.garden{border-top:3px solid #afd0a1}.stage-card.coast{border-top:3px solid #c5d1ad}
/* Five area tabs keep their labels readable on narrow displays. */
.area-tabs{grid-template-columns:repeat(5,minmax(0,1fr))}.stage-card.matsushima{border-top-color:#8fc4c4}.stage-card.yamadera{border-top-color:#bbcb8d}
@media(max-width:440px){.area-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* Six areas: consistent two-row navigation on narrow screens. */
.area-tabs{grid-template-columns:repeat(6,minmax(0,1fr))}.stage-card.onomichi{border-top-color:#d4b58b}.stage-card.naruto{border-top-color:#76c7d1}.stage-card.tottori{border-top-color:#e1c17e}.stage-card.dotonbori{border-top-color:#d48a8a}
@media(max-width:520px){.area-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* Seven regions, with full labels on desktop and phones. */
.area-tabs{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:520px){.area-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Ten regional tabs remain tappable on narrow screens. */
.area-tabs{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:520px){.area-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* Kick school stays compact and disappears as soon as the player draws. */
.lesson-card{position:absolute;z-index:8;top:12px;left:12px;right:12px;padding:10px 12px;background:#0b1b2aee;border:1px solid #b7d65a88;border-radius:12px;box-shadow:0 5px 20px #0003;color:#f5f8ed;pointer-events:none}
.lesson-card small{font-size:10px;letter-spacing:.12em;color:var(--lime)}
.lesson-card p{font-size:12px;line-height:1.55;margin:4px 0 8px}
.lesson-actions{display:flex;gap:8px;pointer-events:auto}
.lesson-actions button{background:#21374a;color:#f1f6e7;border:1px solid #789093;border-radius:7px;padding:8px 12px;font:inherit;font-size:11px;min-height:36px}
.lesson-actions button:first-child{background:#d9f56a;color:#14232c;font-weight:800}
.lesson-dialog{max-width:520px}.lesson-dialog p{line-height:1.8}.lesson-diagrams{display:grid;grid-template-columns:1fr 1fr;gap:12px;background:#102431;border-radius:12px;padding:10px}.lesson-diagrams figure{margin:0;text-align:center}.lesson-diagrams svg{display:block;width:100%;height:155px}.lesson-diagrams figcaption{font-size:11px;color:#eff8e7}.lesson-dialog .muted{font-size:12px}
.difficulty-picker{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:16px 0 8px}.difficulty-picker label{font-weight:800}.difficulty-picker select{font:inherit;background:#152b3a;color:#f3f6ea;border:1px solid #6b8592;border-radius:8px;padding:9px 16px}.difficulty-picker span{font-size:12px;color:var(--muted)}.difficulty-note{font-size:12px;line-height:1.7;color:var(--muted)}.difficulty-badge{display:block;font-size:11px;color:#aee2d7;padding:7px 0 0}.difficulty-badge[data-rank="3"]{color:#f4cd89}.difficulty-badge[data-rank="4"]{color:#f5adb7}#helpDialog details{padding:13px 0;border-bottom:1px solid #5e738344}#helpDialog summary{cursor:pointer;font-weight:800}#helpDialog details p,#helpDialog li{font-size:13px;line-height:1.85}body.inspecting .lesson-card{display:none}
@media(max-height:650px){.lesson-card{top:6px;padding:6px 10px}.lesson-card p{font-size:11px;margin:2px 0 4px}.lesson-actions button{min-height:30px;padding:5px 10px}}
/* Bound the dialog itself; only the body scrolls, not its close/action controls. */
#lessonDialog{--lesson-viewport:100vh;--lesson-top:max(12px,env(safe-area-inset-top));--lesson-bottom:max(12px,env(safe-area-inset-bottom));--lesson-left:max(12px,env(safe-area-inset-left));--lesson-right:max(12px,env(safe-area-inset-right));box-sizing:border-box;inset:var(--lesson-top) var(--lesson-right) var(--lesson-bottom) var(--lesson-left);width:min(520px,calc(100% - var(--lesson-left) - var(--lesson-right)));max-width:calc(100% - var(--lesson-left) - var(--lesson-right));height:min(720px,calc(var(--lesson-viewport) - var(--lesson-top) - var(--lesson-bottom)));max-height:calc(var(--lesson-viewport) - var(--lesson-top) - var(--lesson-bottom));padding:0;overflow:hidden}
#lessonDialog[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
@supports(height:100svh){#lessonDialog{--lesson-viewport:100svh}}
@supports(height:100dvh){#lessonDialog{--lesson-viewport:100dvh}}
.lesson-dialog-head{position:relative;padding:16px 56px 10px 18px;min-width:0}.lesson-dialog-head h2{font-size:20px;line-height:1.4;margin:6px 0;overflow-wrap:anywhere}.lesson-dialog-head .close{width:40px;height:40px;right:10px;top:10px}
.lesson-dialog-body{min-height:0;min-width:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:0 18px 16px;-webkit-overflow-scrolling:touch;overflow-wrap:anywhere}.lesson-dialog-body p{font-size:13px}.lesson-diagrams{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.lesson-diagrams figure{min-width:0}.lesson-diagrams svg{max-width:100%}
#lessonDialog .lesson-dialog-actions{position:static;transform:none;display:grid;grid-template-columns:1fr 1fr;gap:8px;width:auto;padding:12px 16px max(12px,env(safe-area-inset-bottom));margin:0;border-top:1px solid #416171;background:#112838;letter-spacing:normal}
.lesson-dialog-actions button{min-height:44px;white-space:normal;font-size:12px;padding:9px 8px;line-height:1.5}.lesson-actions{flex-wrap:wrap}.lesson-actions button[aria-pressed="true"]{border-color:#ffe08a;color:#ffe08a}
.lesson-sample{position:absolute;inset:0;width:100%;height:100%;z-index:3;pointer-events:none}.lesson-sample polyline{fill:none;stroke:#ffda70;stroke-width:4;stroke-dasharray:12 7;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 2px #172533)}.lesson-sample circle{fill:#ffda70;stroke:#172533;stroke-width:2}.lesson-sample text{fill:#ffe69b;stroke:#172533;stroke-width:3;paint-order:stroke;font-size:14px;font-weight:800}.inspecting .lesson-sample{display:none}
@media(max-height:450px){.lesson-dialog-head{padding-top:8px;padding-bottom:4px}.lesson-dialog-head h2{font-size:16px}.lesson-dialog-head .eyebrow{display:none}#lessonDialog .lesson-dialog-actions{padding-top:6px;padding-bottom:max(6px,env(safe-area-inset-bottom))}.lesson-diagrams svg{height:120px}}
.tour-passport{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0}.tour-stamp{border:1px dashed #67818b;border-radius:9px;padding:12px 8px;display:grid;gap:5px;text-align:center;background:#142733}.tour-stamp strong{font-size:12px}.tour-stamp span{font-size:10px;color:#9fb7bb}.tour-stamp.earned{border:2px solid #d9f56a;background:#344633;box-shadow:inset 0 0 0 3px #102a25}.tour-stamp.earned span{color:#eff9c0}.passport-panel summary{cursor:pointer;font-weight:800;font-size:12px;line-height:1.7}.stage-card[aria-disabled="true"]{filter:saturate(.3);opacity:.65}.tour-course-state{grid-column:1/-1;font-size:10px;color:#d9f56a;line-height:1.5;padding-right:15px}.stage-card[aria-disabled="true"] .tour-course-state{color:#c4ced3}.result-tour{border:1px solid #d9f56a;border-radius:8px;background:#304831;color:#efffc4;padding:10px;font-size:12px;line-height:1.6;margin:10px 0;animation:stamp-arrive .3s ease-out}.score-breakdown{font-size:10px!important;line-height:1.7!important;color:#cae1d8!important;margin:8px 0!important}@keyframes stamp-arrive{from{transform:scale(1.08);opacity:0}to{transform:scale(1);opacity:1}}.reduced-motion .result-tour{animation:none}
@media(max-height:600px){}
/* Journey map: accessible region buttons accompany the small prefecture shapes. */
.travel-nav{display:flex;gap:8px;position:sticky;top:0;z-index:5;padding:8px 0;background:#112838}.travel-nav button{flex:1;min-height:44px;border-radius:8px;background:#203f50;color:#d6e9e7;font:inherit;font-size:12px}.travel-nav button[aria-pressed=true]{background:#d9f56a;color:#17372d;font-weight:800}#stageDialog>.close{position:sticky;top:0;float:right;z-index:7;flex-shrink:0}#stageDialog>h2{padding-right:40px;font-size:22px}.map-heading h3{font-size:17px;margin:12px 0 6px}.map-heading p{font-size:11px;line-height:1.7;margin:5px 0 12px;overflow-wrap:anywhere}#mapBackBtn{min-height:40px;padding:7px 10px;border:1px solid #6c8f98;border-radius:7px;background:#1d3b4c;color:#e9f4e3;margin-top:8px}.travel-map-art{border:2px solid #608d94;border-radius:14px;overflow:hidden;background:#b7dce0}.travel-map-art svg{display:block;width:100%;height:auto;max-height:480px}.prefecture{stroke:#577d79;stroke-width:.8;stroke-linejoin:round;cursor:pointer}.prefecture.locked{fill:#a6b6aa}.prefecture.available{fill:#d4dfae}.prefecture.visited{fill:#68b882}.prefecture.outside-area{opacity:.2}.sea-label{fill:#4a7885;font-size:17px;font-weight:700}.map-small-label{fill:#405f49;font-size:15px}.map-next-route{fill:none;stroke:#c8683d;stroke-width:4;stroke-dasharray:8 7;stroke-linecap:round;pointer-events:none}.map-destination{fill:none;stroke:#d58236;stroke-width:3;stroke-dasharray:4 4;pointer-events:none}.map-ball{pointer-events:none}.map-legend{display:flex;flex-wrap:wrap;gap:12px;font-size:10px;margin:9px 0}.map-legend span:nth-child(1){color:#80d99b}.map-legend span:nth-child(2){color:#e0e7aa}.map-legend span:nth-child(3){color:#a6b6aa}.map-caption,.map-source{font-size:10px!important;line-height:1.65!important;color:#b6cdd0!important}.map-source{margin-top:16px}.map-regions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.map-regions button,.tokyo-map-choices button{min-width:0;min-height:50px;padding:9px 5px;border:1px solid #6b9199;border-radius:8px;background:#214253;color:#f4f6dd;font:inherit;font-size:12px;font-weight:800}.map-regions small,.tokyo-map-choices small{display:block;font-size:9px;color:#aecdcb;margin-top:4px;font-weight:400}.tokyo-map-choices{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.tokyo-map-choices button[aria-pressed=true]{border-color:#d9f56a;background:#3b543e}.map-place-hit{fill:#fff7df;fill-opacity:.8;stroke:#8aab8e;stroke-width:1.5}.tokyo-place{cursor:pointer}.tokyo-place.selected .map-place-hit{stroke:#bf6e39;stroke-width:3}.tokyo-place.locked{opacity:.65}.map-place-label{fill:#233f48;font-size:14px;font-weight:800}.map-preview{padding:12px;margin-top:10px;background:#1c3949;border-radius:10px}.map-preview h3{font-size:15px;margin:0 0 7px}.map-preview p{font-size:12px;margin:6px 0 10px}.map-preview button{width:100%;min-height:44px;font-size:13px;padding:10px}.map-preview button:disabled{opacity:.6;cursor:not-allowed}
#travelDialog{box-sizing:border-box;width:min(560px,calc(100% - 24px));max-width:calc(100% - 24px);max-height:calc(100dvh - 24px);padding:18px;overflow-y:auto}#travelDialog h2{font-size:18px;margin:10px 0}.travel-actions{display:flex;gap:8px}.travel-actions button{flex:1;min-height:44px;padding:10px;font-size:12px}#travelDialog .travel-map-art svg{max-height:45dvh}
@media(max-width:450px){#stageDialog{padding:14px 12px}.travel-nav{top:0}.map-heading p{font-size:10px}.map-regions button{min-height:48px}.travel-map-art svg{max-height:360px}}
.travel-nav{padding-right:48px}
/* A bounded selection screen: the map never shares a scroll column with details. */
#stageDialog.compact-selection{box-sizing:border-box;inset:0;margin:auto;width:100vw;max-width:1100px;height:100vh;height:min(860px,100dvh);max-height:100dvh;border:0;border-radius:0;padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));overflow:hidden;gap:6px}
#stageDialog[open]{display:grid;grid-template-rows:44px minmax(0,1fr) 48px}
.selection-head{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:6px;min-width:0}.selection-head #mapTitle{grid-column:2;grid-row:1;font-size:18px;line-height:1.3;text-align:center;margin:0;padding:0}.selection-head #mapBackBtn{grid-column:1;grid-row:1;margin:0;width:44px;height:44px;min-height:44px;padding:0;font-size:22px}.selection-head .close{position:static;grid-column:3;grid-row:1;width:44px;height:44px;margin:0}
#travelMapView{display:grid;grid-template-rows:minmax(0,1fr) auto;min-height:0;overflow:hidden;gap:6px}#mapViewport{position:relative;min-height:0;overflow:hidden;background:#b7dce0;border-radius:12px;touch-action:manipulation}#mapPlane{position:absolute;overflow:visible}#travelMapArt{height:100%;width:100%;border:0;border-radius:0;background:none}#travelMapArt svg{width:100%;height:100%;max-height:none}
#mapRegions,#tokyoMapCourses{position:absolute;inset:0;margin:0;padding:0;display:block;pointer-events:none}#mapRegions button,#tokyoMapCourses button{position:absolute;margin:0;padding:4px;min-height:44px;min-width:0;border:1px solid #527a85;border-radius:9px;background:#143849ed;box-shadow:0 2px 6px #183f4940;color:#f6f4df;font-size:11px;line-height:1.2;pointer-events:auto}#mapRegions small,#tokyoMapCourses small{display:none}#tokyoMapCourses button[aria-pressed=true]{background:#ddeba7;color:#183c31;border:2px solid #547a54}.compact-selection .map-place-label{display:none}.compact-selection .map-place-hit{fill-opacity:.2;stroke-opacity:.25}.prefecture.selected-pref{stroke:#b76128;stroke-width:3;fill:#f4d28a}.map-location{position:absolute;left:50%;top:5px;transform:translateX(-50%);max-width:calc(100% - 190px);padding:4px 7px;border-radius:20px;background:#163c49db;color:#f9f6df;font-size:10px;line-height:1.3;text-align:center;pointer-events:none}
#mapNextRow{padding:2px 0}#mapNextBtn{width:100%;min-height:48px;margin:0;padding:10px;font-size:14px;line-height:1.4}.compact-map-preview{display:grid;gap:4px;padding:6px;background:#1b3646;border-radius:10px;min-width:0}.preview-heading{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:6px;align-items:center}.preview-heading>button{height:44px;min-height:44px;border-radius:8px;background:#294c5e;font-size:25px}.preview-heading>div{text-align:center;min-width:0}.preview-heading h3{font-size:13px;line-height:1.35;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}#mapDifficulty{font-size:10px;color:#c9dcc6}.preview-actions{display:grid;grid-template-columns:76px minmax(0,1fr);gap:8px}.preview-actions button{height:44px;min-height:44px;font-size:12px;padding:7px}.preview-actions button:disabled{opacity:.55}.selection-toolbar{display:grid;grid-template-columns:1fr 1fr 1.2fr 44px;gap:6px;align-items:center}.selection-toolbar button{height:44px;min-height:44px;font:inherit;font-size:12px;background:#203e50;color:#e6f3dd;border:1px solid #577c86;border-radius:8px}
#searchDialog,.selection-aux{box-sizing:border-box;inset:0;margin:auto;width:min(760px,calc(100% - 16px));max-width:calc(100% - 16px);height:min(680px,calc(100dvh - 16px));max-height:calc(100dvh - 16px);padding:10px;overflow:hidden;gap:8px}.selection-aux{width:min(540px,calc(100% - 16px));height:min(600px,calc(100dvh - 16px))}#searchDialog[open]{display:grid;grid-template-rows:44px minmax(0,1fr) 44px}.selection-aux[open]{display:grid;grid-template-rows:44px minmax(0,1fr)}.aux-head{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:8px}.aux-head h2{font-size:17px;line-height:1.3;margin:0;padding:0}.aux-head .close{position:static;width:44px;height:44px}.aux-content{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 8px 12px}.aux-content p{font-size:13px;line-height:1.8}.aux-content .map-caption,.aux-content .map-source{font-size:12px!important}.aux-content .tour-passport{grid-template-columns:repeat(3,minmax(0,1fr))}
#stageListView{display:grid;position:relative;grid-template-columns:1fr 1fr;grid-template-rows:48px minmax(0,1fr);gap:8px;min-height:0;overflow:hidden}.search-filters,#stageListView .difficulty-picker{display:flex;align-items:center;gap:5px;min-width:0;margin:0;font-size:11px;flex-wrap:nowrap}.search-filters select,#stageListView .difficulty-picker select{width:100%;min-width:0;max-width:100%;min-height:44px;padding:7px 5px;background:#193749;color:#e9f2de;border:1px solid #65868d;border-radius:7px;font:inherit}#stageListView #difficultyCount{display:none}#stageListView>section{grid-column:1/-1;grid-row:2;min-height:0;overflow:hidden}#stageListView .area-heading{display:none}#stageListView .stage-grid{display:flex;flex-direction:column;gap:6px;height:100%}#stageListView .stage-card{display:flex;align-items:center;gap:8px;height:50px;min-height:50px;flex-shrink:0;padding:6px 10px;border-bottom-width:2px;border-radius:8px}#stageListView .stage-card>strong{flex:1;min-width:0;font-size:12px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#stageListView .stage-number{width:25px;height:25px;min-width:25px;font-size:11px;align-self:auto}#stageListView .difficulty-badge{padding:0;font-size:10px;flex-shrink:0}#stageListView .stage-desc,#stageListView .course-meta,#stageListView .stage-card>small,#stageListView .stage-skills,#stageListView .card-play,#stageListView .tour-course-state{display:none!important}#stageListView .stage-card[aria-disabled=true]::after{content:'🔒';font-size:11px}#stageListView .stage-card[data-cleared=true] .stage-number{font-size:0}#stageListView .stage-card[data-cleared=true] .stage-number::after{content:'✓';font-size:13px}.search-pagination{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;text-align:center;font-size:12px}.search-pagination button{width:44px;height:44px;background:#294b5e;border:1px solid #5f808a;border-radius:8px;font-size:18px}.search-pagination button:disabled{opacity:.35}#searchEmpty{position:absolute;inset:55px 0 auto;text-align:center;padding:20px;font-size:13px;color:#c6d8d6}
@media(max-height:420px){#stageDialog[open]{grid-template-rows:36px minmax(0,1fr) 40px;gap:4px;padding:4px}.selection-head{grid-template-columns:36px minmax(0,1fr) 36px}.selection-head .close,.selection-head #mapBackBtn{width:36px;height:36px;min-height:36px}.selection-head #mapTitle{font-size:15px}.selection-toolbar button{height:36px;min-height:36px}.compact-map-preview{padding:3px;gap:2px}.preview-heading{grid-template-columns:32px minmax(0,1fr) 32px}.preview-heading>button{height:30px;min-height:30px;font-size:20px}.preview-heading h3{font-size:11px;-webkit-line-clamp:1}#mapDifficulty{font-size:9px}.preview-actions button{height:40px;min-height:40px}}
#searchDialog,.selection-aux{--aux-top:max(8px,env(safe-area-inset-top));--aux-bottom:max(8px,env(safe-area-inset-bottom));--aux-left:max(8px,env(safe-area-inset-left));--aux-right:max(8px,env(safe-area-inset-right));inset:var(--aux-top) var(--aux-right) var(--aux-bottom) var(--aux-left);max-width:calc(100% - var(--aux-left) - var(--aux-right));height:min(680px,calc(100dvh - var(--aux-top) - var(--aux-bottom)));max-height:calc(100dvh - var(--aux-top) - var(--aux-bottom))}.selection-aux{height:min(600px,calc(100dvh - var(--aux-top) - var(--aux-bottom)))}
#mapRegions button,#tokyoMapCourses button{font-size:12px}.map-location{font-size:11px}.search-filters select,#stageListView .difficulty-picker select{font-size:16px}

/* Province controls use the same native hit targets as the national regions. */
#mapPrefectures{position:absolute;inset:0;pointer-events:none}
#mapPrefectures button{position:absolute;min-width:44px;min-height:44px;margin:0;padding:3px;font-size:12px;line-height:1.2;pointer-events:auto;border-radius:12px;background:#ecf1dfef;color:#21454b;border:1px solid #4c797b}
#mapPrefectures button[aria-pressed="true"]{background:#ffe3a0;border:2px solid #956323;color:#523915}
#mapPrefectures button[data-state="visited"]{box-shadow:inset 0 -3px #5b9365}
#mapPrefectures button[data-state="locked"]{color:#53646b;background:#d8e0deed}
#mapRegions button{overflow-wrap:anywhere;line-height:1.15}
#searchDialog #stageListView>section:not([hidden]){display:contents}
#searchDialog #stageListView{grid-template-rows:48px;grid-auto-rows:min-content;align-content:start}

#searchDialog #stageListView{row-gap:6px}
#searchDialog #stageListView .stage-grid{display:contents}
#searchDialog #stageListView .stage-card{grid-column:1/-1}

/* The course title itself is the launch control; adjacent actions never launch. */
#mapPreview .preview-heading{grid-template-columns:44px minmax(0,1fr) 44px 44px;gap:4px}
#mapPreview .preview-heading>button{min-height:44px;height:44px;padding:0}
#mapPreview #mapPlayBtn{height:auto;min-height:88px;display:flex;flex-direction:column;justify-content:center;gap:4px;text-align:left;background:#e1efb5;color:#193a35;border:1px solid #a8c57b;border-radius:9px;padding:8px 10px;font:inherit;white-space:normal;min-width:0}
#mapPreview #mapPlayBtn:disabled{background:#344b57;color:#d9e0df;border-color:#61747c;opacity:1;cursor:not-allowed}
#mapPlayBtn .course-pref{font-size:10px;line-height:1.3;font-weight:700}
#mapPlayBtn #mapStageTitle{font-size:13px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;width:100%;margin:0}
.course-launch-meta{display:flex;gap:4px;align-items:center;flex-wrap:wrap;font-size:11px;line-height:1.4;width:100%}
#mapPlayBtn #mapDifficulty{color:inherit;font-size:10px}
#mapPlayLabel{margin-left:auto;font-weight:800;font-size:11px}
#mapPlayBtn:disabled #mapPlayLabel{font-size:10px;margin-left:0}
#mapPreview #mapDetailsBtn{font-size:23px}
#mapDetailsDialog h3{font-size:12px;color:#c4e593;margin:14px 0 5px}
#mapDetailsDialog #mapHintBtn{min-height:44px;font-size:13px;padding:8px 14px}
#mapStageHint{padding:12px;background:#213e50;border-radius:8px}
#mapPlayBtn:focus-visible,#mapDetailsBtn:focus-visible{outline:3px solid #ffcd75;outline-offset:2px}
@media(max-height:420px){#mapPreview #mapPlayBtn{min-height:76px;padding:5px 7px;gap:2px}#mapPlayBtn #mapStageTitle{font-size:11px}#mapPreview{padding:3px}}

/* Readable course cards: give the title its own full-width row. */
#mapPreview .preview-heading{grid-template-columns:44px minmax(0,1fr) 44px;gap:6px}
#mapPreview #mapPlayBtn{grid-column:1/-1;grid-row:1;min-height:86px;padding:12px 14px;gap:6px;background:#eff7d8;color:#142f2a}
#mapPlayBtn #mapStageTitle{font-size:16px;line-height:1.5;-webkit-line-clamp:2}
#mapPlayBtn .course-pref{font-size:12px;color:inherit}
#mapPlayLabel{font-size:14px}
#mapPreview #mapPrevCourse{grid-column:1;grid-row:2}
#mapPreview #mapDetailsBtn{grid-column:2;grid-row:2;justify-self:center;width:44px}
#mapPreview #mapNextCourse{grid-column:3;grid-row:2}
#mapPreview #mapPlayBtn:disabled{color:#f0f4ef;background:#344b57}
#mapUnlock{font-size:12px;line-height:1.5;color:#fff0c5;margin:2px 6px}
#searchDialog #stageListView{grid-template-columns:minmax(0,1fr)}
#searchDialog .search-filters{grid-column:1/-1;font-size:14px}
#searchDialog .stage-card>strong{font-size:14px}
@media(max-height:520px) and (min-width:500px){#mapPreview .preview-heading{grid-template-columns:44px minmax(0,1fr) 44px 44px}#mapPreview #mapPlayBtn{grid-column:2;grid-row:1;min-height:76px;padding:6px 10px}#mapPreview #mapPrevCourse{grid-column:1;grid-row:1}#mapPreview #mapDetailsBtn{grid-column:3;grid-row:1}#mapPreview #mapNextCourse{grid-column:4;grid-row:1}#mapPlayBtn #mapStageTitle{font-size:14px}}
/* v0.55.1: explicit title contrast overrides dialog strong; compact two-line card. */
#mapPreview .preview-heading{gap:4px}
#mapPreview #mapPlayBtn{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;column-gap:12px;row-gap:2px;min-height:64px;padding:8px 12px;align-content:center;align-items:center}
#mapPlayBtn .course-pref{grid-column:1;grid-row:1;color:#294e42;font-size:12px;line-height:1.3}
#mapPlayBtn #mapStageTitle{grid-column:1;grid-row:2;color:#142f2a;font-size:16px;line-height:1.4;font-weight:800;-webkit-line-clamp:2;text-shadow:none}
#mapPlayBtn .course-launch-meta{grid-column:2;grid-row:1/3;width:auto;align-self:center;color:#142f2a}
#mapPlayBtn #mapPlayLabel{margin:0;font-size:14px;white-space:nowrap;color:inherit}
#mapPreview #mapPlayBtn:disabled .course-pref,#mapPreview #mapPlayBtn:disabled #mapStageTitle,#mapPreview #mapPlayBtn:disabled .course-launch-meta{color:#f0f4ef}
#mapPreview{gap:2px;padding:4px}
@media(min-width:600px){#mapPreview .preview-heading{grid-template-columns:44px minmax(0,1fr) 44px 44px;align-items:center}#mapPreview #mapPlayBtn{grid-column:2;grid-row:1}#mapPreview #mapPrevCourse{grid-column:1;grid-row:1}#mapPreview #mapDetailsBtn{grid-column:3;grid-row:1}#mapPreview #mapNextCourse{grid-column:4;grid-row:1}}
@media(max-width:599px){#mapPreview .preview-heading{grid-template-columns:44px minmax(0,1fr) 44px}#mapPreview #mapPlayBtn{grid-column:1/-1;grid-row:1;column-gap:8px}#mapPreview #mapPrevCourse{grid-column:1;grid-row:2}#mapPreview #mapDetailsBtn{grid-column:2;grid-row:2}#mapPreview #mapNextCourse{grid-column:3;grid-row:2}}#mapPreview #mapPlayBtn{border-radius:8px;border:1px solid #e9ffc166;border-bottom:5px solid #6d8431;background:var(--lime);color:#14221c;font-weight:900;box-shadow:0 4px 0 #06111b}#mapPreview #mapPlayBtn:hover:not(:disabled){background:#ecff9b}
#mapPlayBtn .course-pref,#mapPlayBtn #mapStageTitle,#mapPlayBtn .course-launch-meta{color:#14221c;font-weight:900}
#mapPreview #mapPlayBtn:disabled{background:#344b57;border-color:#61747c;border-bottom-color:#263b44;color:#f0f4ef}
#mapPreview #mapPlayBtn:disabled .course-pref,#mapPreview #mapPlayBtn:disabled #mapStageTitle,#mapPreview #mapPlayBtn:disabled .course-launch-meta{color:#f0f4ef}
@media(max-height:520px){}
@media(max-height:520px){}

/* Home layout: title above the scenery, one launch action and two secondary actions below. */
.intro{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:16px;padding:24px 18px 26px;overflow-y:auto;overscroll-behavior:contain;text-align:center;background:linear-gradient(180deg,#07141e10,transparent 25%,#07141e33 45%,#07141ee8 75%,#07141ef5)}
.intro>*{flex-shrink:0}
.intro h2{width:100%;margin:0;font-style:italic;line-height:1.15;text-shadow:2px 3px 0 #07141e,0 3px 12px #0008}
.intro h2>strong{display:block;font-size:clamp(20px,calc((var(--field-w) - 50px)/7.2),48px);font-weight:900;line-height:1.15;letter-spacing:-.04em;color:var(--lime);white-space:nowrap}
.home-actions{width:100%;max-width:340px;display:grid;gap:10px;margin-top:0}
.home-destination{margin:0;color:#eff6e9;font-size:12px;line-height:1.5;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:0 1px 3px #000}
.home-destination strong{font-weight:700;color:inherit}
.intro #startBtn{width:100%;min-height:52px;height:auto;padding:10px 14px;gap:12px;font-size:18px;line-height:1.4;font-weight:900;letter-spacing:0;font-style:normal;background:var(--lime);color:#14221c;box-shadow:none}
.intro #startBtn:hover{background:#ecff9b}
.home-secondary{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
.home-secondary .secondary{width:100%;min-width:0;height:48px;min-height:48px;box-sizing:border-box;border:1px solid #53748b;border-radius:8px;margin:0;padding:8px 5px;font-size:13px;line-height:1.4;box-shadow:none;justify-content:center}
body:not(.started) .game-header .brand,body:not(.started) .header-mode,body:not(.started) .stage-info,body:not(.started) footer{display:none}
body:not(.started) .game-header{justify-content:flex-end;z-index:10}
body:not(.started) #menuBtn{font-style:normal;font-size:23px}
@media(max-height:520px){.intro{padding:10px 12px;gap:8px}.intro h2>strong{font-size:clamp(20px,calc((var(--field-w) - 40px)/7.2),32px)}.home-actions{gap:6px}.home-destination{font-size:11px}.intro #startBtn{min-height:44px;padding:6px 12px;font-size:16px}.home-secondary{gap:8px}.home-secondary .secondary{min-height:44px;padding:6px 4px;font-size:12px}}

/* Keep the title and launch actions together; scenery supplies the upper visual. */
.intro h2{max-width:340px;padding-bottom:10px;position:relative}
.intro h2::after{content:'';display:block;width:100px;height:10px;margin:8px auto 0;border-bottom:3px solid var(--lime);border-radius:0 0 65% 50%;transform:rotate(-5deg);opacity:.8}
.home-destination{padding:6px 10px;border-left:2px solid #cde96980;background:#d9f56a0a;text-align:left;border-radius:0 6px 6px 0}
.intro #startBtn{border:1px solid #eaffac;border-bottom:3px solid #809344;border-radius:10px;box-shadow:0 3px 12px #0003}
.home-secondary .secondary{background:#203c50e8;border-color:#7895a5;transition:background .15s,border-color .15s}
.home-secondary .secondary:hover{background:#30546c;border-color:#c8e0e5}
@media(max-height:520px){.intro{justify-content:flex-end;padding:10px 12px 12px;gap:8px}.intro h2{padding-bottom:0}.intro h2::after{height:5px;margin-top:4px}.home-destination{padding:3px 8px}.home-secondary .secondary{height:44px;min-height:44px}}
@media(prefers-reduced-motion:reduce){.home-secondary .secondary{transition:none}}

/* Approved C home: animated light layers align with the same SVG image coordinates. */
.intro{isolation:isolate;justify-content:space-between;padding:clamp(28px,7vh,66px) 18px 20px;gap:12px;background:#031127;overflow:hidden}
.home-speed-art{position:absolute;inset:0;width:100%;height:100%;z-index:-2;pointer-events:none}
.intro::before{content:'';position:absolute;inset:68% 0 0;z-index:-1;background:linear-gradient(transparent,#031127e8);pointer-events:none}
.intro h2{max-width:100%;padding:0;margin:0;font-style:italic;text-shadow:1px 2px 0 #587284,0 3px 7px #0009}
.intro h2>strong{color:#f5fcff;font-size:clamp(26px,calc((var(--field-w) - 40px)/7),56px);letter-spacing:-.06em}
.intro h2::after{width:74%;height:8px;border-bottom:3px solid #c5f637;transform:rotate(-7deg);margin:4px auto 0;opacity:1}
.home-actions{margin-top:auto;gap:12px;max-width:360px}
.home-destination{display:none}
.intro #startBtn{border:1px solid #e6ff9d;border-radius:30px;background:linear-gradient(#dcff69,#a4db15);color:#091d2a;box-shadow:0 2px 10px #bdff2633;min-height:54px;font-size:23px}
.home-secondary .secondary{border:1px solid #d5f65c;border-radius:25px;background:#07172bcc;color:#f5fcff;height:48px;min-height:48px;font-size:14px}
.home-light-flow{stroke-dasharray:5 30;animation:home-light-run 2.6s linear infinite;opacity:.8}
.home-flow-blue{animation-duration:3.7s;animation-delay:-1.5s;stroke-dasharray:2 24;opacity:.65}
.home-ball-glow{animation:home-glow 4s ease-in-out infinite;opacity:.15}
.home-sparks{animation:home-sparks 3.4s ease-out infinite;opacity:.5}
@keyframes home-light-run{to{stroke-dashoffset:-105}}
@keyframes home-glow{50%{opacity:.45} }
@keyframes home-sparks{0%{transform:translate(0,18px);opacity:0}30%{opacity:.6}100%{transform:translate(35px,-50px);opacity:0}}
body.started .home-speed-art *,body:has(dialog[open]) .home-speed-art *{animation-play-state:paused}
body.reduced-motion .home-speed-art *{animation:none!important}.reduced-motion .home-light-flow{opacity:0}
@media(prefers-reduced-motion:reduce){.home-speed-art *{animation:none!important}.home-light-flow{opacity:0}}
@media(max-height:520px){.intro{padding:16px 12px 12px}.intro h2>strong{font-size:clamp(22px,calc((var(--field-w) - 32px)/7),34px)}.home-actions{gap:7px}.intro #startBtn{min-height:44px;font-size:18px}.home-secondary .secondary{height:44px;min-height:44px;font-size:12px}}

/* Directional wake stays behind the ball; its corrected panel artwork is untouched. */
.home-speed-streaks path{stroke-dasharray:14 86;animation:home-speed-dash .85s linear infinite;opacity:.65}
.home-speed-streaks path+path{animation-delay:-.42s;animation-duration:1.1s}
.home-wake{animation:home-wake-drift 1.3s ease-out infinite;opacity:0}
.home-wake-second{animation-delay:-.65s}
@keyframes home-speed-dash{from{stroke-dashoffset:100}to{stroke-dashoffset:0}}
@keyframes home-wake-drift{0%{transform:translate(0,0);opacity:0}18%{opacity:.35}100%{transform:translate(-90px,65px);opacity:0}}
.home-light-flow{animation-duration:1.7s}.home-flow-blue{animation-duration:2.3s}
body.reduced-motion .home-speed-streaks,body.reduced-motion .home-wake{display:none}
@media(prefers-reduced-motion:reduce){.home-speed-streaks,.home-wake{display:none}}

#exportProgress{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);z-index:30;width:min(430px,94vw);padding:12px;background:#102636;color:#fff;border:1px solid #cdef78;border-radius:10px;display:flex;gap:12px;align-items:center;font-size:13px}#exportProgress[hidden]{display:none}#exportCancel{min-height:44px;padding:8px;background:#304c60;border-radius:8px}.exporting-replay #replayControls,.exporting-replay .game-header{visibility:hidden}#exportDialog{width:min(480px,94vw);max-height:90dvh;overflow:auto;padding:18px;border-radius:14px}#exportPreview{display:block;width:100%;max-height:48dvh;background:#071626}#exportPreview[hidden]{display:none}.export-actions{display:grid;gap:8px}#exportDialog p{font-size:13px;line-height:1.7}.result{max-height:calc(100% - 16px);overflow-y:auto}
