:root{color-scheme:dark;--ink:#0b262c;--cream:#ffe8b3;--gold:#f6b544}*{box-sizing:border-box}body{margin:0;background:#151b30;color:var(--cream);font:16px/1.5 'Courier New',monospace}button,a{-webkit-tap-highlight-color:transparent}button{font:700 16px 'Courier New',monospace;cursor:pointer;color:var(--cream);background:#123b40;border:2px solid #e4c28e;box-shadow:3px 3px 0 #09252a;padding:12px 18px;min-height:44px}button:hover{background:#23535a}button:focus-visible,a:focus-visible{outline:3px solid #ffce55;outline-offset:5px}button:disabled{opacity:.55}button[hidden],[hidden]{display:none!important}header{position:fixed;top:24px;left:32px;right:32px;display:flex;justify-content:space-between;align-items:flex-start;z-index:20;pointer-events:none}header a,header button{pointer-events:auto}header a{display:flex;flex-direction:column;text-decoration:none;color:var(--cream)}.logo{width:240px;filter:drop-shadow(3px 5px 0 #071f2a)}header a span{font-size:10px;letter-spacing:2px;margin:10px 0 0 8px;text-shadow:1px 2px #152b40}#cart-button{position:relative;width:72px;height:72px;background:#132938e8;padding:9px;border-color:#8eafaa}#cart-button img{width:100%;height:100%;object-fit:contain}#count{position:absolute;right:-10px;top:-10px;min-width:28px;background:#f4b548;color:#163a3d;border:2px solid #152f33;padding:2px 5px}#street{height:100svh;overflow:hidden;position:relative;background:#7776c9;touch-action:none}#world{position:absolute;transform-origin:0 0;width:1672px;height:941px}#street-bg{position:absolute;width:100%;height:100%;pointer-events:none;image-rendering:pixelated}#hero{position:absolute;z-index:6;width:72px;height:110px;transform:translate(-50%,-100%);pointer-events:none;transition:opacity .4s}#hero>img{width:100%;height:100%;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 4px 2px #0008)}@keyframes walk{from{translate:0 0;rotate:-3deg}to{translate:0 -3px;rotate:3deg}}#bubble{position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);width:300px;padding:15px 18px;background:#fff2cf;color:#14363b;border:3px solid #123b40;box-shadow:4px 4px #102b36;font-weight:bold;font-size:17px;line-height:1.4;transition:opacity .35s}#bubble:after{content:'';position:absolute;bottom:-12px;left:50%;border:6px solid transparent;border-top-color:#fff2cf}.door{position:absolute;background:#100f21;border:0;padding:0;box-shadow:none;perspective:500px;z-index:4;overflow:visible;min-height:0}.door:hover{background:#100f21}.door .leaf{display:block;width:100%;height:100%;transform-origin:left;transition:transform .6s ease;backface-visibility:hidden;pointer-events:none}.door.open .leaf{transform:rotateY(-85deg)}.door:after{content:'';position:absolute;inset:-5px;border:2px solid #ffdf8c;opacity:0;transition:opacity .2s;pointer-events:none}.door:hover:after,.door:focus-visible:after{opacity:1}#enter{position:absolute;z-index:9;transform:translate(-50%,-100%);white-space:nowrap;background:#ffe5a8;color:#17373c;padding:7px 16px}.street-label{position:absolute;top:19%;left:50%;transform:translateX(-50%);text-align:center;text-shadow:2px 2px #3c3463;pointer-events:none;width:90%}.street-label>span{letter-spacing:3px;font-size:12px;color:#ffe3b5}.street-label p{font-size:19px;margin:6px}.controls{position:absolute;bottom:22px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:24px;background:#10272de6;padding:10px 16px;border:1px solid #789490;box-shadow:4px 4px #10242b;max-width:96%;width:max-content}.controls p{font-size:12px;margin:0}.controls p span{display:block;color:#b3c3bd;font-size:11px;margin-top:5px}.controls i{padding:0 8px}.walk-buttons{display:flex;gap:8px}.walk-buttons button{padding:7px 13px;touch-action:none}.controls #help{padding:5px 14px}kbd{background:#26494e;border:1px solid #638080;padding:3px;font:12px monospace}#store{min-height:100svh;background:radial-gradient(ellipse at top,#45534d,#18252b);padding:135px 5vw 20px}.store-top{display:flex;justify-content:space-between;align-items:center;gap:20px;max-width:1200px;margin:auto}.store-top>div{text-align:center}h1{font-size:clamp(24px,3vw,40px);margin:2px;color:#ffe2a0;text-shadow:3px 3px #102d30}.eyebrow{font-size:11px;letter-spacing:2px;color:#a8c4bb}.demo{font-size:11px;color:#f9c677;border:1px dashed #9e8864;padding:7px 10px}.shop-instruction{text-align:center;color:#bcd0c4;font-size:13px;margin:16px 0 22px}#shelves{position:relative;max-width:1200px;margin:auto;aspect-ratio:1672/941;border:5px solid #172a28;box-shadow:8px 8px #101d24}#shelves>img{width:100%;height:100%;display:block;image-rendering:pixelated}#products{position:absolute;inset:0}.shelf-product{position:absolute;width:19%;height:19%;padding:0;background:none!important;border:0;box-shadow:none;display:flex;align-items:center;justify-content:flex-end;flex-direction:column}.shelf-product img{height:75%;width:85%;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(2px 4px 2px #0009);transition:transform .2s}.shelf-product:hover img{transform:translateY(-7px)}.shelf-product span{color:#23312f;background:#ffe6b4;box-shadow:2px 2px #322f28;font-size:clamp(9px,1.1vw,15px);padding:2px 7px;white-space:nowrap}.store-bottom{max-width:1100px;margin:18px auto 0;display:flex;align-items:center;gap:18px}.store-bottom img{height:100px}.store-bottom p{font-size:14px}.store-bottom p span{font-size:12px;color:#b1c6be}.store-bottom>.demo{margin-left:auto}dialog{color:#17383b;background:#fff0cd;border:4px solid #19464b;box-shadow:8px 8px 0 #051e28;max-width:min(740px,calc(100vw - 28px));width:740px;padding:30px;max-height:90svh;overflow:auto}dialog::backdrop{background:#071423bc;backdrop-filter:blur(4px)}dialog .eyebrow{color:#667e73}dialog h2{font-size:28px;margin:10px 35px 24px 0;line-height:1.2}.close{position:absolute;right:12px;top:12px;color:#17383b;background:transparent;border:0;box-shadow:none;font-size:28px;padding:0;width:44px}.product-layout{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:20px}.photo{background:#d3d5bc;border:2px solid #99a691;display:grid;place-items:center;min-height:240px}.photo img{width:90%;height:220px;object-fit:contain;image-rendering:pixelated}.price{font-size:27px;font-weight:bold;margin:24px 0 12px}.primary{background:#16484c;color:#fff0c6;min-width:200px}.fine{font-size:12px;color:#6a7666;line-height:1.6}#description{font-size:15px}.cart-row{display:grid;grid-template-columns:64px 1fr auto;gap:14px;align-items:center;border-top:1px solid #c0c5aa;padding:18px 0}.cart-row img{width:64px;height:64px;object-fit:contain}.cart-row h3{font-size:16px;margin:0 0 4px}.cart-row small{font-size:13px}.quantity{display:flex;align-items:center;gap:10px}.quantity button{min-width:44px;padding:6px}.remove{font-size:12px;background:none;color:#5e7369;border:0;box-shadow:none;padding:3px 0;display:block}.total{display:flex;justify-content:space-between;border-top:3px solid #1b494c;padding-top:18px;font-size:23px}#toast{position:fixed;z-index:100;left:50%;bottom:30px;transform:translate(-50%,20px);background:#ffe4a9;color:#163c3e;border:3px solid #19474c;padding:14px 22px;opacity:0;pointer-events:none;transition:.2s;text-align:center}#toast.show{opacity:1;transform:translate(-50%,0)}@media(max-width:700px){header{top:20px;left:18px;right:18px}.logo{width:170px}header a span{font-size:8px;letter-spacing:.6px;margin-left:3px}#cart-button{width:58px;height:58px}.street-label{top:24%;}.street-label>span{font-size:9px;letter-spacing:1px}.street-label p{font-size:15px}.controls{bottom:calc(18px + env(safe-area-inset-bottom));gap:12px;padding:9px}.controls p{font-size:10px;max-width:180px}.controls kbd,.controls i{display:none}.controls p span{font-size:9px}.walk-buttons button{padding:8px 12px}#store{padding:115px 12px 20px}.store-top{flex-wrap:wrap;gap:12px}.store-top>div{order:-1;width:100%}.store-top h1{font-size:28px}.store-top button{font-size:14px}.shop-instruction{font-size:11px;margin:15px 10px}#shelves{aspect-ratio:1672/1300;overflow:hidden}#shelves>img{object-fit:fill}.shelf-product{height:19%}.shelf-product span{font-size:10px;padding:3px}.store-bottom img{height:80px}.store-bottom>.demo{display:none}.store-bottom p{font-size:12px}.product-layout{grid-template-columns:1fr;gap:8px}dialog{padding:22px}.photo{min-height:150px}.photo img{height:150px}dialog h2{font-size:24px}.cart-row{grid-template-columns:44px 1fr;gap:10px}.cart-row img{width:44px}.quantity{grid-column:2}.total{font-size:20px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;scroll-behavior:auto!important}}
/* Дверь повторяет фрагмент исходного фасада, проём находится под створкой. */
.door .leaf{backface-visibility:visible}
@media(max-width:700px){.street-label{top:17%}.street-label p{font-size:13px}#bubble{bottom:calc(100% + 200px)}.door:before{content:'';position:absolute;inset:-5px}.controls p{font-size:0}.controls p span{font-size:10px}.controls p span:before{content:'Коснитесь тротуара, чтобы идти. ';}.controls p span{font-size:0}.controls p span:before{font-size:10px}.controls p span:after{content:'Нажмите на дверь, чтобы войти.';font-size:10px}}
@media(max-width:700px){.street-label{display:none}}

/* Version 2: one camera for the clean background, doors, actors and traffic. */
#traffic,#pedestrians{position:absolute;inset:0;pointer-events:none;overflow:hidden}
#traffic{z-index:8}#pedestrians{z-index:5}
.hero-sprite,.npc-sprite{width:100%;height:100%;background-size:200% 100%;background-repeat:no-repeat;image-rendering:pixelated}
.hero-sprite{background-image:url(assets/animated/hero.webp)}
#hero.left .hero-sprite{transform:scaleX(-1)}
#hero.walking .hero-sprite,.npc-sprite{animation:stride .46s steps(2) infinite}
@keyframes stride{from{background-position:0 0}to{background-position:200% 0}}
.pedestrian{position:absolute;animation:cross-street linear infinite;transform:translateY(-100%)}
@keyframes cross-street{from{left:var(--start-x)}to{left:var(--end-x)}}
.window-customer{position:absolute;height:88px;transform:translate(-50%,-100%);transform-origin:bottom;animation:customer-sway 3s ease-in-out infinite alternate;image-rendering:pixelated}
@keyframes customer-sway{from{rotate:-1deg}to{rotate:1deg}}
.traffic-car{position:absolute;animation:cross-street linear infinite;transform:translateY(-100%)}
.traffic-car img{display:block;width:100%;image-rendering:pixelated}
header{top:max(10px,env(safe-area-inset-top));align-items:flex-start}
body.inside-store header{position:relative;top:auto;left:auto;right:auto;margin:0;padding:12px 32px;min-height:112px;background:#1b3036;border-bottom:1px solid #436064;align-items:center}
body.inside-store #store{padding-top:24px}
body.inside-store header .logo{width:210px}
body.inside-store header a span{display:none}
.street-label{top:16%}
@media(max-width:700px){
 header{top:max(8px,env(safe-area-inset-top));left:14px;right:14px}.logo{width:160px}
 header a span{margin-top:4px}#cart-button{width:52px;height:52px}
 body.inside-store header{padding:10px 16px;min-height:86px}
 body.inside-store header .logo{width:155px}
 body.inside-store #store{padding:22px 12px 20px;min-height:calc(100svh - 86px)}
 .store-top>div{margin-bottom:8px}
 #bubble{bottom:calc(100% + 220px);width:320px}
 .controls{bottom:calc(10px + env(safe-area-inset-bottom))}
}
@media(prefers-reduced-motion:reduce){.pedestrian,.traffic-car{animation-play-state:paused}.npc-sprite,.hero-sprite,.window-customer{animation:none!important}}

/* The tutorial stays in the sky and never scales over either entrance. */
#bubble{z-index:10;top:clamp(140px,22vh,230px);bottom:auto;left:50%;width:min(340px,calc(100vw - 32px));transform:translateX(-50%);pointer-events:none}
.street-label{display:none}
@media(max-width:700px){#bubble{top:30%;bottom:auto;width:min(320px,calc(100vw - 32px))}}
@media(min-width:701px){.traffic-car:nth-child(3){top:1345px!important}}
