:root{--paper:#f4efe3;--ink:#233e35;--muted:#7f8979;--line:#dbd2bd;--orange:#d96732;--orange-dark:#b54b21;--teal:#278c7e;font-family:"Segoe UI",system-ui,sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,a{-webkit-tap-highlight-color:transparent}button{font:600 14px/1.2 "Segoe UI",system-ui,sans-serif;color:inherit;cursor:pointer;border:0}button:disabled{cursor:default;opacity:.35}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid #246f63;outline-offset:4px}button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}[hidden]{display:none!important}
.game{width:min(1600px,100%);margin:auto;padding:22px 28px 10px}.masthead{display:flex;gap:28px;align-items:center;justify-content:space-between;padding:0 6px 20px}.brand{display:flex;gap:11px;align-items:center;font:700 29px/.94 Georgia,serif;letter-spacing:-1px;text-decoration:none;color:var(--ink)}.brand-mark{font:400 53px/1 Georgia,serif;color:#bf6e36}.brand-dot{color:var(--orange)}.scoreboard{display:flex;gap:0;margin-left:auto;background:#fffcf3;border:1px solid var(--line);border-radius:17px;padding:12px 0;box-shadow:0 4px 0 #dcd1ba35}.scoreboard>div{padding:0 27px;min-width:132px;border-right:1px solid var(--line)}.scoreboard>div:last-child{border:0}.scoreboard small{display:block;font-size:9px;font-weight:700;letter-spacing:1.9px;color:var(--muted);margin-bottom:4px}.scoreboard strong{font-size:23px;font-variant-numeric:tabular-nums;font-weight:650;letter-spacing:-.7px}.header-tools{display:flex;gap:8px}.icon-button{display:grid;place-items:center;width:47px;height:47px;border-radius:50%;border:1px solid var(--line);background:#fffcf3}.pause{color:#fff;background:var(--orange);border:0}.icon-button:hover:enabled{box-shadow:0 0 0 4px #d9673212}.icon-button:active:enabled{transform:translateY(1px)}
.stage{position:relative;height:min(66vh,680px);min-height:380px;border:1px solid #ded2b7;border-radius:24px;background:#e9dfca;overflow:hidden;isolation:isolate;box-shadow:0 18px 50px -38px #704f2c66}.stage canvas{display:block;width:100%;height:100%;touch-action:none;outline-offset:-5px}.stage-caption{position:absolute;top:18px;left:22px;right:22px;display:flex;justify-content:space-between;gap:15px;font-size:12px;font-weight:650;color:#4f6352;pointer-events:none}.stage-caption span{background:#fff9e9db;padding:8px 12px;border-radius:8px;backdrop-filter:blur(10px)}#best{font-variant-numeric:tabular-nums}.notice{position:absolute;bottom:14px;left:50%;transform:translateX(-50%);max-width:calc(100% - 30px);background:#fffcf2e8;border:1px solid #dfd4bb;border-radius:24px;padding:9px 17px;font-size:12px;font-weight:550;text-align:center;pointer-events:none;white-space:nowrap}
.overlay{position:absolute;inset:0;display:grid;place-items:center;background:#e8e1cb26;backdrop-filter:blur(1px)}.panel{position:relative;max-width:calc(100% - 32px);width:390px;padding:28px 32px 24px;background:#fffcf3f5;border:1px solid #fff9ed;border-radius:23px;box-shadow:0 18px 80px #5e452926;text-align:center}.seal{width:47px;height:47px;border:7px solid #e9a34a;box-shadow:inset 0 0 0 2px #ffdf98,0 3px 0 #b7792c;transform:rotate(-15deg);border-radius:50%;margin:0 auto 19px}.eyebrow{font-size:9px;font-weight:750;letter-spacing:1.2px;color:#9a7b50;margin:0 0 12px}.panel h1{font:600 39px/1.04 Georgia,serif;letter-spacing:-1.6px;margin:0 0 15px}.panel-copy{color:#6d796a;font-size:13px;line-height:1.65;margin:0 0 22px}.primary{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;padding:17px 20px;border-radius:13px;background:var(--orange);color:#fff;box-shadow:0 4px 0 var(--orange-dark)}.primary:hover{background:#cb5c29}.primary:active{transform:translateY(2px);box-shadow:0 2px 0 var(--orange-dark)}.secondary{width:100%;margin-top:13px;padding:12px;background:#e9efe3;border-radius:10px}.text-button{width:100%;margin-top:17px;background:transparent;color:#286f61;padding:8px}.text-button span{margin-left:15px}.panel-foot{margin:20px 0 0;font-size:10px;color:#9b9b83}.fallback{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--paper);text-align:center;padding:30px}.fallback p{max-width:420px;line-height:1.6}.fallback .primary{width:auto;min-width:240px}
.dock{display:flex;align-items:center;gap:24px;background:#fffcf3;border:1px solid var(--line);border-radius:19px;margin-top:14px;padding:15px 21px;box-shadow:0 4px 0 #dcd1ba35}.route-block{min-width:0;flex:1}.dock-label{display:flex;justify-content:space-between;gap:12px;margin:0 2px 10px;font-size:9px;letter-spacing:1.7px;color:#928a73}.dock-label strong{font-weight:550;letter-spacing:0;color:#69816b;font-size:11px}.route-picker{display:flex;gap:5px;overflow-x:auto;scrollbar-width:thin;padding:2px 2px 6px}.route-button{position:relative;width:34px;height:34px;flex-shrink:0;background:#f3eee0;border:1px solid #dfd4bb;border-radius:50%;font-size:13px;font-variant-numeric:tabular-nums}.route-button[aria-current="true"]{background:#e9a34a;border:2px solid #fff6d4;outline:2px solid #e1a951;color:white}.route-button[data-medal="gold"]{box-shadow:0 3px 0 #d7a845}.route-button[data-medal="silver"]{box-shadow:0 3px 0 #a4b4ab}.route-button[data-medal="bronze"]{box-shadow:0 3px 0 #c4895e}.drive-controls{display:grid;grid-template-columns:44px 44px 44px;grid-template-rows:35px 35px;gap:3px}.drive-controls button{display:grid;place-items:center;background:#e9e9d9;border:1px solid #e0dac4;border-radius:10px;touch-action:none;user-select:none}.drive-controls button svg{fill:var(--ink);stroke-width:1;width:21px}.drive-controls button:active,.drive-controls button[data-held="true"]{background:#d0dbbd}.north{grid-column:2}.west{grid-column:1;grid-row:2}.south{grid-column:2;grid-row:2}.east{grid-column:3;grid-row:2}.dock-actions{display:flex;gap:18px;align-items:center;border-left:1px solid var(--line);padding-left:22px}.dock-actions p{margin:0;display:flex;flex-direction:column;gap:7px}.dock-actions strong{font-size:12px;font-weight:650}.dock-actions span{font-size:10px;color:#84907d}.reset-button{display:grid;place-items:center;width:39px;height:39px;border-radius:50%;border:1px solid var(--line);background:transparent}.credit{text-align:center;font-size:8px;color:#9b9f8d;letter-spacing:1px;margin:13px 0 2px}.storage-message{text-align:center;max-width:630px;margin:12px auto;color:#89542f;font-size:12px;line-height:1.5}
@media(min-width:1450px){.route-button{width:38px;height:38px}.route-picker{gap:7px}.stage{height:67vh}.dock{gap:30px}}
@media(max-width:1000px){.game{padding:18px}.dock-actions p{display:none}.scoreboard>div{padding:0 18px;min-width:110px}.brand{font-size:25px}.dock{gap:14px;padding:13px 15px}.dock-actions{padding-left:14px}.route-button{width:31px;height:31px}.route-picker{gap:4px}}
@media(max-width:620px){.game{padding:12px 10px max(10px,env(safe-area-inset-bottom))}.masthead{flex-wrap:wrap;gap:12px;padding:0 3px 12px}.brand{font-size:23px;letter-spacing:-.8px}.brand-mark{font-size:41px}.header-tools{margin-left:auto}.icon-button{width:38px;height:38px}.scoreboard{order:3;width:100%;margin:0;padding:9px 0;border-radius:12px}.scoreboard>div{flex:1;min-width:0;padding:0 17px}.scoreboard small{font-size:8px;margin-bottom:2px}.scoreboard strong{font-size:20px}.stage{height:calc(100svh - 290px);min-height:340px;max-height:680px;border-radius:18px}.stage-caption{top:11px;left:11px;right:11px;font-size:10px;gap:8px}.stage-caption span{padding:7px 8px}.notice{white-space:normal;font-size:10px;line-height:1.3;bottom:10px;max-width:calc(100% - 18px);width:max-content;padding:7px 12px}.panel{width:320px;padding:21px 23px 18px}.panel h1{font-size:33px;margin-bottom:12px}.seal{width:34px;height:34px;border-width:5px;margin-bottom:15px}.eyebrow{font-size:8px;letter-spacing:.8px;margin-bottom:10px}.panel-copy{font-size:12px;line-height:1.55;margin-bottom:18px}.panel-foot{font-size:9px;margin-top:16px}.primary{padding:15px 16px}.dock{margin-top:10px;display:grid;grid-template-columns:1fr auto;gap:10px;border-radius:15px;padding:12px}.route-block{grid-column:1/-1}.dock-label{margin-bottom:7px;font-size:8px}.route-button{width:30px;height:30px}.route-picker{gap:4px}.drive-controls{grid-template-columns:48px 48px 48px;grid-template-rows:34px 34px;justify-self:center}.dock-actions{border:0;padding:0}.reset-button{width:42px;height:42px}.credit{font-size:7px;letter-spacing:.5px;margin-top:10px}}
@media(max-height:600px) and (min-width:621px){.game{padding-top:8px}.masthead{padding-bottom:8px}.brand{font-size:20px}.brand-mark{font-size:36px}.scoreboard{padding:5px 0}.scoreboard strong{font-size:18px}.stage{height:calc(100svh - 180px);min-height:240px}.dock{padding:7px 15px;margin-top:8px}.dock-label{margin-bottom:5px}.panel{padding:15px 25px}.panel h1{font-size:27px}.seal,.panel-foot{display:none}.panel-copy{font-size:12px;margin-bottom:15px}.drive-controls{grid-template-rows:26px 26px}.credit{margin-top:7px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
/* Системный модальный диалог удерживает фокус и оставляет поездку на паузе. */
.about-dialog{width:min(560px,calc(100% - 24px));max-height:calc(100dvh - 24px);margin:auto;padding:0;border:1px solid var(--line);border-radius:23px;color:var(--ink);background:#fffcf3;box-shadow:0 20px 90px #233e3540;overflow:hidden;user-select:text;touch-action:pan-y}
.about-dialog[open]{display:flex;flex-direction:column}.about-dialog::backdrop{background:#233e3573;backdrop-filter:blur(3px)}
.about-heading{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:25px 27px 19px;border-bottom:1px solid var(--line);flex-shrink:0}.about-heading .eyebrow{margin:0 0 8px}.about-heading h2{font:600 29px/1.1 Georgia,serif;letter-spacing:-.7px;margin:0}.about-heading .icon-button{flex-shrink:0;width:40px;height:40px}
.about-content{padding:0 27px 24px;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;font-size:13px;line-height:1.65;outline-offset:-5px}.about-content:focus-visible{outline:3px solid #246f63}.about-content section{margin-top:22px}.about-content h3{font-size:14px;line-height:1.3;margin:0 0 7px}.about-content p{margin:0 0 10px;color:#596957}.about-content .about-developer{margin-top:18px;color:var(--ink)}.about-content a{color:#246f63;text-underline-offset:3px;overflow-wrap:anywhere}.about-content .support-email{font-size:16px;font-weight:650}.about-content .storage-key{font-size:11px;color:#6d796a}.storage-key code{font-size:11px;overflow-wrap:anywhere}.about-content .about-foot{margin:24px 0 0;padding-top:16px;border-top:1px solid var(--line);font-size:12px;color:#6d796a}
@media(max-width:620px){.about-heading{padding:20px 20px 16px;gap:12px}.about-heading h2{font-size:26px}.about-content{padding:0 20px 20px;font-size:12px}.about-content section{margin-top:18px}}
/* Поле, HUD и все четыре кнопки помещаются в портретный экран вместе. */
@media(max-width:620px){.stage{height:calc(100svh - 365px);min-height:300px}.panel{max-height:calc(100% - 24px);overflow:auto}}
