@font-face{font-family:'Press Start 2P';src:url('assets/fonts/press-start.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:'Nunito Sans';src:url('assets/fonts/nunito-regular.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:'Nunito Sans';src:url('assets/fonts/nunito-bold.ttf') format('truetype');font-weight:600 900;font-display:swap}
:root{font-family:'Nunito Sans',sans-serif;color:#ffffff;--red:#ed0f00;--ink:#ffffff;--paper:#171717;--line:#383838;color-scheme:dark;--pattern:url('assets/pattern-portrait.png')}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{display:grid;place-items:center;background:#121212 var(--pattern) center/cover no-repeat;-webkit-tap-highlight-color:transparent}button,input{font:inherit}button{cursor:pointer;color:inherit}button:disabled{cursor:wait;opacity:.6}button:focus-visible,input:focus-visible{outline:3px solid #ffffff;outline-offset:3px}button:active{transform:translateY(2px)}[hidden]{display:none!important}
.game{position:relative;width:100vw;height:100dvh;max-height:none;overflow:hidden;background:#b6ed63;isolation:isolate;container-type:size;touch-action:none;user-select:none;box-shadow:0 0 70px #00000066}#world{position:absolute;inset:0;width:100%;height:100%;touch-action:none}.vignette{position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,#121212ed 0%,#121212c4 18%,#12121200 40%,#12121200 75%,#12121280 100%)}.game[data-view=home] .vignette,.game[data-view=register] .vignette{background:linear-gradient(180deg,#121212 0%,#121212dc 27%,#12121200 52%,#12121200 75%,#12121288 100%)}
.topbar{position:absolute;top:0;left:0;right:0;z-index:5;padding:calc(14px + env(safe-area-inset-top)) 18px 0;display:flex;align-items:center;justify-content:space-between;pointer-events:none}.brand{width:92px;height:auto;object-fit:contain;padding:0;background:none}.top-actions{display:flex;gap:8px;pointer-events:auto}.icon-button{width:44px;height:44px;border:1px solid #555555;background:#1b1b1be8;display:grid;place-items:center;border-radius:6px;box-shadow:0 3px 0 #00000044}.icon-button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.screen{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;pointer-events:none}.screen>*{pointer-events:auto}.scene-title{padding:82px 15px 0;text-align:center;pointer-events:none}.game-logo{width:88%;height:auto;max-height:155px;object-fit:contain;filter:drop-shadow(0 5px 2px #00000066)}.scene-title p{margin:5px 0 0;font-size:15px;font-weight:800;text-shadow:0 2px 8px #000;color:#ffffff}.welcome{padding-bottom:calc(15px + env(safe-area-inset-bottom));gap:12px}.welcome .sheet,.home-bottom{margin:auto 16px 0;width:calc(100% - 32px);background:var(--paper);border:1px solid #3b3b3b;border-radius:12px;box-shadow:0 6px 0 #00000055;padding:20px}.home-bottom{padding:14px 20px 17px}.player-line{display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:800;font-size:16px;overflow-wrap:anywhere}.player-line>span:last-child{font-size:12px}.player-line .text-button{margin:0;font-size:12px;padding:8px 0;min-height:38px}.attempts{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;font-size:13px}.attempts b{font-family:'Press Start 2P';font-size:20px;color:var(--red)}.attempts small{font:700 13px 'Nunito Sans';color:#bcbcbc}.primary,.secondary{min-height:52px;width:100%;border:0;padding:12px 14px;display:flex;align-items:center;justify-content:center;gap:10px;font-size:16px;font-weight:800;border-radius:6px}.primary{color:white;background:var(--red);box-shadow:0 4px 0 #ac291b}.secondary{background:#303030;border:1px solid #444444;box-shadow:0 3px 0 #111111}.text-button{border:0;background:none;display:block;min-height:44px;padding:10px 8px;font-size:13px;text-decoration:underline;text-underline-offset:3px;margin:6px auto 0;color:#cccccc}.home-links{display:flex;gap:10px;margin-top:13px}.home-links button{font-size:13px;min-height:44px;padding:9px 8px}.rules-line{font-size:12px;text-align:center;margin:13px 0 0;color:#bcbcbc}
.modal{background:#12121277;backdrop-filter:blur(3px);padding:calc(76px + env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom));overflow-y:auto;touch-action:pan-y}.sheet{margin:auto 0;flex-shrink:0;padding:23px;background:var(--paper);border:1px solid #3b3b3b;border-radius:12px;box-shadow:0 7px 0 #00000055}.sheet h1{font:400 clamp(15px,4.1cqw,21px)/1.7 'Press Start 2P';letter-spacing:-.045em;margin:10px 0 14px}.eyebrow{font-size:10px;letter-spacing:.08em;font-weight:800;color:#bcbcbc}.sheet p{font-size:14px;line-height:1.45;margin:0 0 14px;color:#c7c7c7}.sheet .primary,.sheet>.secondary{margin-top:12px}.sheet label{display:block;font-weight:800;font-size:12px;margin:13px 0 7px}.nick-input{display:flex;align-items:center;background:#222222;border:2px solid #555555;border-radius:6px;height:50px;padding:0 13px;gap:7px}.nick-input span{color:var(--red);font-size:23px;font-weight:800}.nick-input input{width:100%;min-width:0;border:0;background:none;font-size:16px;color:var(--ink);outline:none;user-select:text}.nick-input:focus-within{border-color:#ffffff}.sheet .fine{font-size:11px;line-height:1.4;color:#bcbcbc;margin:16px 0 0}.sheet .error,.error{color:#ff8379;font-size:12px;line-height:1.45;margin:8px 0;overflow-wrap:anywhere}.error:empty{display:none}
.hud{position:absolute;top:calc(77px + env(safe-area-inset-top));left:20px;right:20px;z-index:2;display:flex;gap:16px;align-items:flex-start;pointer-events:none;color:#ffffff}.hud .eyebrow{color:#dddddd}.score strong{font-family:'Press Start 2P';font-size:34px;font-weight:400;line-height:1.7;text-shadow:2px 3px #000000}.coin-counter{display:flex;align-items:center;gap:5px;margin-top:20px;font-size:20px;font-weight:800;background:#121212b0;border-radius:5px;padding:2px 6px}.coin-counter img{width:25px;height:25px}.best{margin-left:auto;font-size:11px;text-align:right;padding-top:3px}.best b{display:block;font-family:'Press Start 2P';font-size:13px;margin-top:10px;font-weight:400}.attempt-status{position:absolute;top:80px;left:0;font-size:10px;font-weight:800;padding:6px 9px;background:#121212d9;border-radius:4px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hint{position:absolute;top:calc(196px + env(safe-area-inset-top));left:20px;right:20px;z-index:3;background:#171717ed;border-radius:6px;font-size:12px;font-weight:800;padding:10px;text-align:center;pointer-events:none;color:#ffffff}.start-prompt{position:absolute;top:42%;left:30px;right:30px;text-align:center;background:#171717ed;padding:15px;border-radius:8px;pointer-events:none;box-shadow:0 4px 0 #00000055}.start-prompt b{display:block;font-size:19px}.start-prompt span{display:block;font-size:13px;margin-top:4px}
.controls{position:absolute;bottom:calc(19px + env(safe-area-inset-bottom));left:20px;right:20px;z-index:3;display:flex;justify-content:space-between;align-items:flex-end;gap:10px;pointer-events:none}.controls-label{font-size:10px;letter-spacing:.08em;max-width:110px;line-height:1.5;padding:6px 0;color:#ffffff;font-weight:800;text-shadow:0 2px 3px #000}.dpad{display:flex;gap:7px;align-items:flex-end;pointer-events:auto}.dpad-middle{display:flex;flex-direction:column;gap:7px}.dpad button{width:47px;height:44px;display:grid;place-items:center;background:#181818dc;border:1px solid #3b3b3b;border-radius:5px;box-shadow:0 3px 0 #00000077;touch-action:none}.dpad button[data-move=up]{background:var(--red);border-color:#ff6a4b;color:white}.dpad svg{fill:currentColor;width:20px;height:20px}.floaters{position:absolute;inset:0;z-index:3;pointer-events:none}.floater{position:absolute;font:16px 'Press Start 2P';color:#fff4a5;text-shadow:2px 2px #835c18;animation:float-up .8s ease-out forwards}@keyframes float-up{from{transform:translate(-50%,0);opacity:1}to{transform:translate(-50%,-55px);opacity:0}}
.result-score{font:44px/1.5 'Press Start 2P';color:var(--red);margin:12px 0}.result-score small{display:block;font:700 12px 'Nunito Sans';color:#bcbcbc}.result-details{display:grid;grid-template-columns:1fr 1fr;border-block:1px solid var(--line);padding:14px 0;margin-bottom:14px}.result-details b{display:block;font-size:23px}.result-details span{display:block;font-size:12px;color:#bcbcbc}.sheet .saved{font-size:12px;line-height:1.5}.rank-list{list-style:none;padding:0;margin:12px 0}.rank-list li{display:grid;grid-template-columns:27px 1fr auto;align-items:center;gap:10px;min-height:43px;border-bottom:1px solid var(--line);padding:8px 6px;font-size:14px}.rank-no{font-weight:800;color:#bcbcbc}.rank-list li:nth-child(-n+3) .rank-no{color:var(--red)}.rank-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rank-list b{font:11px 'Press Start 2P'}.rank-list .is-you{background:#333333;border-radius:4px}.help-list{list-style:none;padding:0;margin:0 0 19px;display:grid;gap:15px}.help-list li{display:flex;gap:11px;font-size:13px;line-height:1.45}.help-list li>b{flex:0 0 31px;height:31px;background:#303030;border-radius:5px;display:grid;place-items:center;color:var(--red);font-size:19px}.help-list strong{display:block}.reset-clock{font:32px/1.8 'Press Start 2P';color:var(--red);margin:10px 0}.countdown{margin:auto;align-self:center;font:64px 'Press Start 2P';color:white;text-shadow:5px 6px var(--red)}.toast{position:absolute;bottom:calc(130px + env(safe-area-inset-bottom));left:20px;right:20px;z-index:30;padding:14px;background:#272727;border:2px solid #555555;border-radius:7px;font-size:13px;color:#ffffff;box-shadow:0 4px 12px #00000055}
.boot{position:absolute;inset:0;z-index:50;background:#121212;overflow:hidden;display:flex;align-items:center;justify-content:center}.boot::before{content:'';position:absolute;inset:0;background:radial-gradient(ellipse clamp(250px,45vw,520px) clamp(200px,28vh,330px) at 50% 50%,#121212 0%,#121212fc 35%,#121212e6 55%,#12121299 73%,#12121233 88%,#12121200 100%),var(--pattern) center/cover no-repeat}.boot-brand{position:absolute;padding:22px 26px;background:transparent;transition:opacity .3s,transform .3s}.boot-brand img{width:210px;height:auto;display:block}.boot-game{filter:drop-shadow(0 4px 10px #121212);position:absolute;width:90%;opacity:0;transform:translateY(12px);transition:opacity .3s,transform .3s}.game-phase .boot-brand{opacity:0;transform:translateY(-12px)}.game-phase .boot-game{opacity:1;transform:translateY(0)}.load-panel{position:absolute;max-width:360px;margin-inline:auto;padding:12px 16px;background:#121212ee;border-radius:8px;bottom:15%;left:30px;right:30px;text-align:center;font-size:10px;font-weight:800}.load-panel p{letter-spacing:.08em}.load-track{height:14px;border:1px solid #555555;border-radius:3px;background:#222222;padding:2px;margin:14px 0 9px}#load-fill{height:100%;width:0;background:var(--red);transition:width .15s}#boot-error{font-size:14px}.no-script{position:absolute;inset:0;z-index:99;background:var(--paper);padding:100px 24px;font-size:22px}
@media(max-aspect-ratio:10/16){.game{width:100vw;height:100dvh;max-height:none}}@media(max-height:650px){.scene-title{padding-top:68px}.game-logo{max-height:109px}.scene-title p{font-size:12px;margin-top:3px}.welcome{gap:6px;padding-bottom:10px;overflow-y:auto;touch-action:pan-y}.welcome .sheet,.home-bottom{padding:14px;margin-inline:12px;width:calc(100% - 24px)}.sheet h1{font-size:14px;margin:6px 0 10px}.sheet p{font-size:12px;margin-bottom:9px}.sheet .fine{font-size:10px;margin-top:12px}.topbar{padding-top:10px}.sheet{padding:17px}.modal{padding:70px 14px 16px}.primary{min-height:47px}.welcome .sheet .text-button{min-height:34px;margin:0}.hud{top:70px}.controls{bottom:12px}.controls-label{display:none}.dpad{margin-left:auto}.help-list{gap:10px}.help-list li{font-size:12px}.rank-list li{min-height:39px}.result-score{font-size:36px}.scene-title{flex-shrink:0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition:none!important}}

.help-list li>b{flex-basis:38px;height:38px}.help-list svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:square;stroke-linejoin:miter}.help-list img{width:29px;height:29px}.boot-game{max-width:390px}.home-links .text-button{width:auto}.sheet .home-links{justify-content:center}.sheet .home-links .text-button{margin:0}.scene-title{flex-shrink:0}

@media(min-aspect-ratio:1/1){
 :root{--pattern:url('assets/pattern-landscape.png')}
 .welcome{display:grid;grid-template-columns:minmax(0,1fr) minmax(310px,410px);align-items:center;gap:clamp(24px,5vw,90px);padding:86px clamp(24px,6vw,100px) 32px;overflow-y:auto;touch-action:pan-y}
 .scene-title{padding:0;text-align:left;align-self:start;margin-top:clamp(25px,8dvh,100px)}
 .game-logo{width:min(100%,440px);max-height:none}
 .scene-title p{margin-top:10px;font-size:16px;max-width:440px;text-align:center}
 .welcome .sheet,.home-bottom{width:100%;margin:0;padding:24px}
 .home-bottom{align-self:end;margin-bottom:3dvh}
 .topbar{padding:24px 32px 0}.brand{width:112px}
 .modal{padding:90px 24px 28px;align-items:center}
 .modal>.sheet{width:min(100%,460px);margin:auto}
 .sheet h1{font-size:19px}.sheet p{font-size:14px}
 .hud{top:94px;left:32px;right:32px}.best{padding-right:0}
 .hint{left:32px;right:auto;max-width:320px;top:212px}
 .start-prompt{width:340px;left:50%;right:auto;transform:translateX(-50%);top:32%}
 .controls{left:32px;right:32px;bottom:24px}.controls-label{max-width:160px}
 .toast{width:min(460px,80vw);left:50%;right:auto;transform:translateX(-50%)}
 .game[data-view=home] .vignette,.game[data-view=register] .vignette{background:linear-gradient(110deg,#121212e6 0%,#12121270 34%,#12121200 58%),linear-gradient(#121212b0,transparent 40%,transparent 80%,#12121266)}
 .boot-game{width:440px;max-width:45vw}.boot-brand img{width:240px}
 .load-panel{bottom:9%;width:360px;left:0;right:0}
}
@media(min-aspect-ratio:1/1) and (max-height:560px){
 .topbar{padding:12px 20px 0}.brand{width:92px}
 .welcome{grid-template-columns:minmax(0,1fr) minmax(290px,360px);padding:68px 20px 18px;gap:24px;align-items:start}
 .scene-title{margin-top:12px}.scene-title p{font-size:12px}.game-logo{max-height:130px}
 .welcome .sheet,.home-bottom{padding:15px}.home-bottom{margin-bottom:0}
 .sheet h1{font-size:14px}.sheet p{font-size:12px}.sheet .fine{font-size:10px}
 .modal{padding:68px 16px 16px}.hud{top:68px;left:20px;right:20px}.attempt-status{top:68px}
 .controls{left:20px;right:20px;bottom:12px}.hint{top:154px;left:20px;font-size:11px}
 .start-prompt{top:30%;width:290px}.boot-brand img{width:170px}.boot-game{max-height:130px;width:auto}
 .load-panel{bottom:5%;padding:6px 14px}.load-track{margin:8px 0 5px}.load-panel p{margin:5px 0}
}

.hud{right:auto;left:18px;top:76px;width:220px;display:block;padding:14px 15px 10px;background:#171717f5;border:1px solid #ffffff25;border-radius:10px;box-shadow:0 4px 0 #0005;gap:0}.hud-stats{display:flex;justify-content:space-between;align-items:center;gap:12px}.score{display:flex;flex-direction:column;gap:9px}.score>span{font:800 9px 'Nunito Sans';letter-spacing:.12em;color:#aaa}.score strong{font-size:26px;line-height:1;font-weight:400;text-shadow:none}.coin-counter{margin:0;background:none;padding:0;gap:7px;font:16px 'Press Start 2P';font-weight:400}.coin-counter img{width:28px;height:28px}.hud-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;border-top:1px solid #ffffff1f;margin-top:12px;padding-top:8px}.attempt-status{position:static;padding:0;background:none;font-size:10px;font-weight:700;max-width:125px}.best{padding:0;margin:0;font-size:10px;white-space:nowrap;color:#aaa}.best b{display:inline;font:800 10px 'Nunito Sans';color:#fff;margin:0 0 0 3px}.hint{top:202px;width:220px;right:auto;left:18px;font-size:11px}.game[data-view=game] .vignette,.game[data-view=ready] .vignette{background:linear-gradient(#12121255,transparent 22%,transparent 85%,#12121255)}.help-list{gap:18px}.help-list li{align-items:center;gap:15px}.help-list li>b{flex:0 0 68px;height:68px;background:#252525;border-radius:10px}.help-list img{width:76px;height:76px;object-fit:contain;max-width:none}.help-list li>span{flex:1}.sound-settings{padding:14px 0;margin:14px 0 2px;border-block:1px solid #363636;display:grid;gap:10px}.sheet .sound-settings label{display:flex;align-items:center;justify-content:space-between;margin:0;gap:18px;font-size:13px}.sound-settings input{width:58%;accent-color:#ed0f00;min-height:28px}.sound-settings>span{font-size:10px;color:#aaa}.sheet>[data-action=home]{margin-top:12px;background:#262626;border-color:#555;min-height:50px}.game[data-view=help] .sheet{max-width:510px}
@media(min-aspect-ratio:1/1){.hud{left:32px;top:94px;width:236px}.hint{left:32px;top:222px;width:236px}.controls-label{display:none}}
@media(max-width:350px){.hud{width:198px;padding:12px}.score strong{font-size:23px}.coin-counter{font-size:14px}.hint{width:198px}.help-list li>b{flex-basis:54px;height:54px}.help-list img{width:64px;height:64px}.help-list li{gap:10px}}
@media(min-aspect-ratio:1/1) and (max-height:560px){.hud{left:20px;top:66px;width:208px;padding:10px 12px 8px}.score strong{font-size:22px}.score{gap:6px}.hud-footer{margin-top:9px;padding-top:6px}.hint{top:174px;left:20px;width:208px}.help-list li>b{flex-basis:60px;height:60px}}

.dpad{margin-left:auto}

.distance-marker{position:absolute;z-index:5;pointer-events:none;width:210px;transform:translate(-50%,-100%);padding:9px 12px;background:#171717f0;border:1px solid #ffd549;border-bottom:3px solid #ffd549;border-radius:6px;text-align:center;box-shadow:0 4px 14px #0004}.distance-marker::after{content:"";position:absolute;left:calc(50% - 5px);bottom:-8px;border-inline:5px solid transparent;border-top:6px solid #ffd549}.distance-marker span{display:block;font:800 9px "Nunito Sans";letter-spacing:.08em;color:#ffd549}.distance-marker b{display:block;overflow:hidden;text-overflow:ellipsis;font-size:14px;line-height:1.4;white-space:nowrap}.distance-marker small{font-size:11px;color:#ddd}.distance-marker.is-passed{border-color:#a5df60}.distance-marker.is-passed span{color:#a5df60}.distance-leader{border-left:3px solid #ffd549;padding:8px 12px;background:#252525;overflow-wrap:anywhere}
