/* ==========================================================================
   v10 menu screens (title, loading, lobby) — Western animated casual-game look.
   Big simple color blocks, white keylines, chunky rounded type, icon-first.
   #stage prefixes win over the older lobby.css rules without editing them.
   ========================================================================== */
:root{
 --x-font:"Baloo 2","Fredoka","Nunito","Arial Rounded MT Bold","Trebuchet MS","PingFang TC","Microsoft JhengHei",sans-serif;
 --x-green-1:#b6f24e;--x-green-2:#5fcb1c;--x-green-3:#2f8a12;
 --x-violet-1:#8a66e6;--x-violet-2:#5b3bb0;--x-violet-3:#35206e;
 --x-orange-1:#ffc94a;--x-orange-2:#ff8f1f;--x-orange-3:#c2550c;
 --x-cream:#fff6e0;--x-ink:#4a2a12;
}
/* Wide windows: phone-shaped frame for menu screens. */
html:has(#stage.framed-layout){background:#2f1d6b !important;}
html body:has(#stage.framed-layout){min-height:100vh;background:radial-gradient(ellipse at 50% 30%,#6b4fd0,#3a2580 70%,#24154f) !important;}
#stage.framed-layout{border-radius:30px;overflow:hidden;box-shadow:0 20px 60px #0008,0 0 0 6px #ffffff33;}
#stage.title-screen,#stage.city-lobby,#stage .transition-overlay{font-family:var(--x-font);}

/* ---------------- Title ---------------- */
/* The art ends in a flat coral counter; the stage continues that color so the button block sits on it. */
#stage.title-screen{padding:0;background:#cd4c30;}
#stage.title-screen .title-backdrop{position:absolute;inset:0 0 auto 0;width:100%;height:calc(100% - 104px);object-fit:cover;object-position:50% 100%;}
#stage.title-screen .title-shade{position:absolute;inset:auto 0 0 0;height:190px;background:linear-gradient(#7a1f1a00,#7a1f1a59);pointer-events:none;}
#stage.title-screen .title-brand{position:absolute;top:calc(var(--safe-top) + 64px);left:0;right:0;display:flex;justify-content:center;filter:none;}
#stage.title-screen .title-logo{width:min(88%,430px);margin:0;line-height:0;transform:none;animation:x-pop .7s cubic-bezier(.2,1.6,.4,1) both;filter:drop-shadow(0 8px 0 #2a145055);}
#stage.title-screen .title-logo img{width:100%;height:auto;max-height:27vh;object-fit:contain;}
#stage.title-screen .title-language{position:absolute;top:var(--safe-top);right:var(--safe-right);z-index:5;width:64px;height:64px;min-width:64px;min-height:64px;padding:0;border-radius:50%;
 display:grid;place-items:center;border:4px solid #fff;background:linear-gradient(var(--x-violet-1),var(--x-violet-2));box-shadow:0 5px 0 var(--x-violet-3),0 9px 12px #0005;}
#stage.title-screen .title-language>svg{width:42px;height:42px;margin-top:-6px;}
#stage.title-screen .title-language>span{position:absolute;bottom:-10px;left:50%;transform:translateX(-50%);padding:1px 9px;border-radius:10px;background:var(--x-orange-2);border:3px solid #fff;
 color:#fff;font-size:13px;font-weight:900;line-height:16px;letter-spacing:1px;}
#stage.title-screen .title-actions{position:absolute;left:var(--safe-left);right:var(--safe-right);bottom:calc(var(--safe-bottom) + 10px);max-width:380px;margin-inline:auto;display:flex;flex-direction:column;align-items:center;gap:16px;}
#stage.title-screen .title-play{width:80%;max-width:320px;min-height:84px;border-radius:44px;padding:0 20px;display:flex;align-items:center;justify-content:center;
 border:5px solid #fff;background:linear-gradient(var(--x-green-1),var(--x-green-2) 55%,#48b012);
 box-shadow:inset 0 5px 0 #e6ffb0,inset 0 -8px 0 #3c9c12,0 8px 0 var(--x-green-3),0 14px 18px #0006;animation:x-breathe 1.8s ease-in-out infinite;}
#stage.title-screen .title-play span{font-size:42px;font-weight:1000;letter-spacing:3px;color:#fff;-webkit-text-stroke:6px var(--x-green-3);paint-order:stroke fill;text-shadow:0 4px 0 var(--x-green-3);}
#stage.title-screen .title-links{display:flex;justify-content:center;gap:10px;width:100%;}
#stage.title-screen .legal-pill{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:4px 16px;border-radius:20px;background:#2a1450aa;border:2px solid #ffffff99;
 color:#fff;font-size:14px;font-weight:800;text-decoration:none;text-shadow:none;box-shadow:none;}
#stage.title-screen .legal-pill>svg{display:none;}

/* ---------------- Loading ---------------- */
#stage .transition-overlay{position:absolute;inset:0;z-index:90;overflow:hidden;display:block;
 background:radial-gradient(ellipse at 50% 42%,#ffe36a 0,#ffbf2e 30%,#ff9420 62%,#f0641a 100%);color:#fff;}
#stage .loading-rays{position:absolute;left:50%;top:40%;width:190vmax;height:190vmax;transform:translate(-50%,-50%);pointer-events:none;
 background:repeating-conic-gradient(from 0deg,#fff6b04d 0deg 10deg,transparent 10deg 24deg);
 -webkit-mask-image:radial-gradient(circle,#000 0,#000 18%,transparent 52%);mask-image:radial-gradient(circle,#000 0,#000 18%,transparent 52%);animation:x-rays 30s linear infinite;}
#stage .loading-content{position:absolute;inset:0;width:auto;max-width:none;max-height:none;padding:0;overflow:visible;display:block;text-align:center;}
#stage .loading-art{position:absolute;left:50%;top:40%;width:min(66%,270px);height:auto;aspect-ratio:1;margin:0;transform:translate(-50%,-50%);}
#stage .loading-art:before{display:none;}
#stage .loading-art>svg{width:100%;height:100%;filter:drop-shadow(0 16px 0 #c24d0a33);animation:x-bob 1.6s ease-in-out infinite;}
#stage .loading-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);}
#stage .loading-track{position:absolute;left:10%;right:10%;bottom:calc(var(--safe-bottom,20px) + 124px);height:38px;border:4px solid #fff;border-radius:22px;background:#a8400c;
 box-shadow:0 5px 0 #b64a0d,0 9px 12px #6a2a0844;overflow:hidden;}
#stage .loading-track>i{display:block;height:100%;width:0;border-radius:16px;background:linear-gradient(var(--x-green-1),var(--x-green-2) 60%,#48b012);box-shadow:inset 0 4px 0 #e6ffb0;transition:width .12s linear;}
#stage .loading-count{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;margin:0;font-size:20px;font-weight:1000;font-variant-numeric:tabular-nums;color:#fff;
 -webkit-text-stroke:4px #7a3209;paint-order:stroke fill;letter-spacing:1px;}
/* The tip is a picture strip (heart heart 2s -> bolt); its sentence is only read out. */
#stage .loading-tip{position:absolute;left:0;right:0;bottom:calc(var(--safe-bottom,20px) + 32px);margin:0;padding:0;background:none;display:flex;justify-content:center;}
#stage .loading-tip .tip-art{display:inline-flex;align-items:center;gap:6px;min-height:60px;padding:6px 18px;border:4px solid #fff;border-radius:34px;background:#fff8e7;box-shadow:0 5px 0 #c9661a,0 9px 12px #6a2a0844;color:#8a4a16;}
#stage .loading-tip .tip-art>svg{flex:none;}
#stage .loading-tip .tip-arrow{display:grid;place-items:center;color:#c98a4a;}
#stage .loading-tip .tip-arrow>svg{width:18px;height:18px;}
#stage .loading-tip .tip-chip{display:inline-flex;align-items:center;gap:2px;}
#stage .loading-tip .tip-chip>svg{flex:none;}
#stage .loading-tip .tip-chip>b{font-family:var(--x-font);font-size:22px;line-height:1;font-weight:1000;color:#5a3a1e;}
#stage .transition-overlay h2{color:#fff;font-size:24px;-webkit-text-stroke:4px #8a3a0c;paint-order:stroke fill;margin:0;}
#stage .transition-overlay.has-error .loading-content{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:24px;}
#stage .transition-overlay.has-error :is(.loading-art,.loading-track,.loading-tip){position:relative;left:auto;right:auto;top:auto;bottom:auto;transform:none;}
/* Loading failed: no sentence. The dish stops, a red no-signal badge sits on it, green = try again, yellow = go back.
   The label and the reason stay in the page for screen readers only. */
#stage .transition-overlay.has-error .loading-art{width:180px;}
#stage .transition-overlay.has-error .loading-art>svg{animation:none;filter:grayscale(.55) drop-shadow(0 12px 0 #c24d0a33);}
#stage .transition-overlay.has-error .loading-track{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);box-shadow:none;}
#stage .transition-overlay.has-error .loading-tip{display:none;}
#stage .loading-actions{position:relative;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:14px;width:84%;max-width:320px;}
#stage .loading-actions:empty{display:none;}
#stage .loading-oops{position:absolute;left:50%;bottom:calc(100% + 26px);width:76px;height:76px;margin-left:34px;display:grid;place-items:center;border:5px solid #fff;border-radius:50%;
 background:linear-gradient(#ff8a6e,#f0492f);box-shadow:0 5px 0 #9c2413;color:#fff;}
#stage .loading-oops>svg{width:44px;height:44px;}
#stage .loading-oops::after{content:"";position:absolute;left:50%;top:50%;width:58px;height:6px;border-radius:3px;background:#fff;box-shadow:0 0 0 2px #f0492f;transform:translate(-50%,-50%) rotate(-45deg);}
#stage .loading-actions>button{flex:none;height:76px;min-height:0;padding:0;border-radius:38px;display:grid;place-items:center;}
#stage .loading-actions>.primary{flex:1 1 0;min-width:0;}
#stage .loading-actions>.primary>svg{width:44px;height:44px;}
#stage .loading-actions>.secondary{width:76px;border-radius:26px;}
#stage .loading-actions>.secondary>svg{width:34px;height:34px;}
#stage .loading-actions .secondary{background:linear-gradient(#fff3a6,#ffd24a 60%,#f2b12b);border:3px solid #fff;color:#7a4313;text-shadow:none;box-shadow:0 5px 0 #b97a1e;}
#stage .transition-curtain{pointer-events:none;animation:x-curtain .45s ease-in forwards;}

/* ---------------- Lobby: one scrolling world ---------------- */
#stage.city-lobby{padding:0;background:#6ccf4a;overflow:hidden;}
#stage.city-lobby .city-scroll{position:absolute;inset:0;width:auto;max-width:none;margin:0;border:0;border-radius:0;box-shadow:none;
 overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:none;-ms-overflow-style:none;cursor:grab;}
#stage.city-lobby .city-scroll::-webkit-scrollbar{display:none;}
#stage.city-lobby .city-scroll.is-dragging{cursor:grabbing;}
#stage.city-lobby .city-scroll *{-webkit-user-drag:none;user-select:none;-webkit-user-select:none;}
#stage.has-modal.city-lobby .city-scroll{overflow-y:hidden;}
/* Controls floating over the map hand their drags to it (src/drag-scroll.js); the browser must leave the finger alone. */
#stage.city-lobby :is(.lobby-play,.hud10>*,.chapter-rail,.chapter-rail>*,.side-rail,.side-rail>*){touch-action:none;}
#stage.city-lobby :is(.lobby-play,.hud10,.chapter-rail,.side-rail) *{-webkit-user-drag:none;user-select:none;-webkit-user-select:none;}
/* Once the press has become a drag the button no longer looks pressed. */
#stage.city-lobby .lobby-play.is-dragging:active,#stage.city-lobby :is(.hud10,.chapter-rail,.side-rail).is-dragging button:active{transform:none;filter:none;}
#stage.city-lobby .city-world{position:relative;width:100%;margin:0;isolation:isolate;}
/* The ground belongs to the world: it moves with the road, buildings and level stones. */
#stage.city-lobby .city-ground{position:absolute;inset:0;z-index:-3;pointer-events:none;background:#6ccf4a url('./public/art/map-ground-day-v10.jpg') top center/100% auto repeat-y;}
#stage.city-lobby .theme-dusk .city-ground{background-color:#3f8f8a;background-image:url('./public/art/map-ground-dusk-v10.jpg');}
#stage.city-lobby .city-route{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:-1;}
#stage.city-lobby .city-route path{fill:none;stroke-linecap:round;stroke-linejoin:round;}
#stage.city-lobby .route-edge{stroke:#c58f3c;stroke-width:58;transform:translateY(7px);}
#stage.city-lobby .route-road{stroke:#f6d9a0;stroke-width:50;}
#stage.city-lobby .theme-dusk .route-edge{stroke:#8a5aa8;}
#stage.city-lobby .theme-dusk .route-road{stroke:#f0c8b4;}

/* Level stones: a color dome on a tan disc. */
#stage.city-lobby .city-node.map-node{position:absolute;left:var(--node-x);top:var(--node-y);transform:translate(-50%,-50%);width:72px;height:62px;min-width:72px;min-height:62px;
 padding:0 0 3px;display:grid;place-items:center;border-radius:50%;border:5px solid #f8e2b2;z-index:4;outline:0;opacity:1;filter:none;
 background:linear-gradient(var(--x-green-1),var(--x-green-2));box-shadow:0 8px 0 #b98643,0 14px 8px #1d3d1055;}
#stage.city-lobby .city-node.map-node.completed{background:linear-gradient(#ff8f6b,#ee4a2e);}
#stage.city-lobby .city-node.map-node.locked{background:linear-gradient(#b9c3d6,#8792aa);border-color:#e3e6ee;box-shadow:0 8px 0 #6c7690,0 14px 8px #1d3d1040;}
#stage.city-lobby .city-node-number{font-size:32px;font-weight:1000;line-height:1;color:#fff;-webkit-text-stroke:5px var(--x-green-3);paint-order:stroke fill;text-shadow:0 3px 0 var(--x-green-3);letter-spacing:-1px;}
#stage.city-lobby .completed .city-node-number{-webkit-text-stroke-color:#9c2714;text-shadow:0 3px 0 #9c2714;}
#stage.city-lobby .locked .city-node-number{color:#eef1f7;-webkit-text-stroke:5px #5f6983;text-shadow:0 3px 0 #5f6983;}
#stage.city-lobby .city-node-mark{position:absolute;left:50%;transform:translateX(-50%);background:none;border:0;padding:0;border-radius:0;filter:drop-shadow(0 3px 0 #0003);}
#stage.city-lobby .city-node-mark>svg{width:100%;height:100%;}
#stage.city-lobby .city-node-mark.done{top:-30px;bottom:auto;width:40px;height:40px;}
#stage.city-lobby .city-node-mark.lock{left:auto;right:-10px;top:auto;bottom:-10px;transform:none;width:30px;height:30px;}
#stage.city-lobby .city-node.current{outline:0;}
#stage.city-lobby .city-node.current:after{content:"";position:absolute;inset:-12px;border-radius:50%;border:5px solid #fff;animation:x-ring 1.4s ease-out infinite;pointer-events:none;}
#stage.city-lobby .current-pointer{position:absolute;top:-82px;left:50%;width:66px;height:66px;transform:translateX(-50%);border-radius:50%;background:linear-gradient(#bfe9ff,#7fc8ff);border:5px solid #fff;
 box-shadow:0 6px 0 #0003;animation:x-hop 1.2s ease-in-out infinite;font-size:0;color:inherit;text-shadow:none;overflow:visible;}
#stage.city-lobby .current-pointer:before{content:"";position:absolute;left:50%;bottom:-13px;width:18px;height:18px;background:#fff;transform:translateX(-50%) rotate(45deg);border-radius:3px;z-index:-1;}
#stage.city-lobby .current-pointer>svg{width:100%;height:100%;border-radius:50%;}

/* Restaurants grow beside the road (lot → cart → shop → restaurant). */
#stage.city-lobby .city-building{position:absolute;left:var(--building-x);top:var(--building-y);transform:translate(-50%,-50%);width:54%;max-width:240px;min-width:0;min-height:0;
 padding:0;border:0;background:none;box-shadow:none;display:flex;flex-direction:column;align-items:center;z-index:2;touch-action:pan-y;}
#stage.city-lobby .city-building>.building-art{width:100%;height:auto;aspect-ratio:1;filter:drop-shadow(0 8px 0 #1d3d1026);}
#stage.city-lobby .building-stars{display:flex;gap:2px;height:auto;margin-top:-4px;padding:2px 10px 3px;border-radius:18px;background:var(--x-cream);border:4px solid #fff;box-shadow:0 5px 0 #c8a56a;}
#stage.city-lobby .building-stars i{width:24px;height:24px;filter:grayscale(1) brightness(.85);opacity:.4;}
#stage.city-lobby .building-stars i.lit{filter:none;opacity:1;}
#stage.city-lobby .building-stars svg{width:100%;height:100%;}
#stage.city-lobby .city-destination{position:absolute;top:150px;left:50%;transform:translateX(-50%);width:128px;height:128px;padding:0;border-radius:50%;
 display:grid;place-items:center;background:linear-gradient(#fff9e8,#ffe2a6);border:6px solid #fff;box-shadow:0 8px 0 #c8a56a,0 14px 10px #1d3d1040;}
#stage.city-lobby .destination-art>svg{width:92px;height:92px;}
#stage.city-lobby .destination-lock{position:absolute;right:-6px;bottom:-6px;width:44px;height:44px;border-radius:50%;background:#fff;display:grid;place-items:center;box-shadow:0 4px 0 #0003;}
#stage.city-lobby .destination-lock>svg{width:32px;height:32px;}

/* ---------------- Lobby: HUD (one row) ---------------- */
#stage.city-lobby .hud10{position:absolute;top:0;left:0;right:0;z-index:8;padding:calc(var(--safe-top) + 4px) var(--safe-right) 26px var(--safe-left);pointer-events:none;
 display:grid;grid-template-columns:76px minmax(0,1fr) minmax(0,1fr) 54px;gap:12px;align-items:start;background:linear-gradient(#2a14504d,#2a145000);height:auto;}
#stage.city-lobby .hud10>*{pointer-events:auto;}
#stage.city-lobby .hud-avatar{position:relative;width:76px;height:76px;min-width:0;min-height:0;padding:0;border-radius:50%;display:block;border:5px solid #fff;gap:0;text-align:center;
 background:linear-gradient(#bfe9ff,#7fc8ff);box-shadow:0 6px 0 var(--x-violet-3),0 10px 12px #0005;}
#stage.city-lobby .avatar-face{position:absolute;inset:0;border-radius:50%;overflow:hidden;}
#stage.city-lobby .avatar-face>svg{width:100%;height:100%;}
#stage.city-lobby .avatar-stars{position:absolute;left:50%;bottom:-16px;transform:translateX(-50%);display:flex;align-items:center;gap:2px;padding:0 10px 0 4px;height:26px;border-radius:14px;
 background:linear-gradient(var(--x-orange-1),var(--x-orange-2));border:3px solid #fff;box-shadow:0 3px 0 var(--x-orange-3);}
#stage.city-lobby .avatar-stars>svg{width:22px;height:22px;}
#stage.city-lobby .avatar-stars>b{font-size:16px;font-weight:1000;color:#fff;-webkit-text-stroke:3px var(--x-orange-3);paint-order:stroke fill;line-height:1;}
#stage.city-lobby .hud-pill{position:relative;height:42px;margin:8px 0 0 16px;display:flex;align-items:center;justify-content:center;padding:0 10px 0 28px;border-radius:22px;
 background:linear-gradient(var(--x-violet-1),var(--x-violet-2));border:4px solid #fff;box-shadow:0 5px 0 var(--x-violet-3),0 9px 10px #0004;color:#fff;min-width:0;}
#stage.city-lobby .hud-pill>svg{position:absolute;left:-20px;top:50%;transform:translateY(-50%);width:50px;height:50px;margin:0;filter:drop-shadow(0 3px 0 #0003);}
#stage.city-lobby .hud-pill>b{font-size:22px;font-weight:1000;font-variant-numeric:tabular-nums;white-space:nowrap;-webkit-text-stroke:4px var(--x-violet-3);paint-order:stroke fill;line-height:1;}
#stage.city-lobby .hud-round{width:54px;height:54px;min-width:54px;min-height:54px;margin-top:4px;padding:0;border-radius:50%;border:0;background:none;box-shadow:none;display:grid;place-items:center;}
#stage.city-lobby .hud-round>svg{width:100%;height:100%;filter:drop-shadow(0 4px 0 #0003);}

/* Left: chapter medallions. Right: back-to-current pin. */
#stage.city-lobby .chapter-rail{position:absolute;left:calc(var(--safe-left) + 4px);top:calc(var(--safe-top) + 122px);z-index:7;display:flex;flex-direction:column;gap:22px;transform:none;}
#stage.city-lobby .chapter-medal{position:relative;width:68px;height:68px;min-width:68px;min-height:68px;padding:0;border-radius:50%;display:grid;place-items:center;
 background:linear-gradient(#fff9e8,#ffe2a6);border:5px solid #fff;box-shadow:0 6px 0 #c8a56a,0 10px 10px #0004;color:var(--x-ink);}
#stage.city-lobby .chapter-medal.selected{background:linear-gradient(var(--x-orange-1),var(--x-orange-2));box-shadow:0 6px 0 var(--x-orange-3),0 10px 10px #0004;transform:scale(1.08);}
#stage.city-lobby .chapter-medal.locked{background:linear-gradient(#d5dbe8,#a9b2c6);box-shadow:0 6px 0 #6c7690,0 10px 10px #0004;}
#stage.city-lobby .chapter-medal.locked .medal-art{filter:grayscale(1);opacity:.55;}
#stage.city-lobby .medal-art>svg{width:54px;height:54px;}
#stage.city-lobby .medal-lock{position:absolute;right:-8px;top:-8px;width:30px;height:30px;filter:drop-shadow(0 3px 0 #0003);}
#stage.city-lobby .medal-lock>svg{width:100%;height:100%;}
#stage.city-lobby .chapter-medal>small{position:absolute;bottom:-14px;left:50%;transform:translateX(-50%);padding:0 8px;border-radius:11px;background:var(--x-violet-2);border:3px solid #fff;
 color:#fff;font-size:13px;font-weight:900;line-height:17px;white-space:nowrap;}
#stage.city-lobby .chapter-medal.locked>small{background:#6c7690;}
#stage.city-lobby .side-rail{position:absolute;right:calc(var(--safe-right) + 2px);left:auto;top:calc(var(--safe-top) + 122px);bottom:auto;z-index:7;}
#stage.city-lobby .locate-button{width:64px;height:64px;min-width:64px;min-height:64px;margin:0;border-radius:50%;background:linear-gradient(#fff9e8,#ffe2a6);border:5px solid #fff;
 box-shadow:0 6px 0 #c8a56a,0 10px 10px #0004;}
#stage.city-lobby .locate-button>svg{width:44px;height:44px;filter:none;}

/* ---------------- Lobby: big play button + full-width tab bar ---------------- */
#stage.city-lobby .dock10{position:absolute;left:0;right:0;bottom:0;z-index:8;height:auto;padding:0;display:flex;flex-direction:column;align-items:center;gap:0;pointer-events:none;max-width:none;margin:0;}
#stage.city-lobby .dock10>*{pointer-events:auto;}
#stage.city-lobby .play10{width:76%;max-width:330px;min-height:84px;margin:0 0 30px;border-radius:44px;padding:0 20px;display:flex;align-items:center;justify-content:center;gap:8px;
 border:5px solid #fff;background:linear-gradient(var(--x-green-1),var(--x-green-2) 55%,#48b012);font-size:inherit;
 box-shadow:inset 0 5px 0 #e6ffb0,inset 0 -8px 0 #3c9c12,0 8px 0 var(--x-green-3),0 14px 16px #0006;}
/* Pin + number instead of a word: the same pair titles the level popup. */
#stage.city-lobby .play10>.play-pin{display:grid;place-items:center;width:56px;height:56px;flex:none;}
#stage.city-lobby .play10>.play-pin>svg{width:100%;height:100%;filter:drop-shadow(0 3px 0 var(--x-green-3));}
#stage.city-lobby .play10>b{font-size:46px;line-height:1;font-weight:1000;letter-spacing:1px;color:#fff;-webkit-text-stroke:6px var(--x-green-3);paint-order:stroke fill;text-shadow:0 4px 0 var(--x-green-3);}
#stage.city-lobby .tabbar10{position:relative;width:100%;max-width:none;height:calc(96px + env(safe-area-inset-bottom,0px));padding:0 0 env(safe-area-inset-bottom,0px);margin:0;
 display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;align-items:stretch;border:0;border-top:5px solid #fff;border-radius:0;
 background:linear-gradient(var(--x-violet-1),var(--x-violet-2) 70%);box-shadow:0 -6px 14px #0004;}
#stage.city-lobby .tab10{position:relative;width:auto;height:auto;min-width:0;min-height:0;padding:0;margin:0;border:0;border-radius:0;background:none;box-shadow:none;
 display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;color:#fff;font-size:inherit;}
#stage.city-lobby .tab10+.tab10{border-left:3px solid #3f2885;}
#stage.city-lobby .tab-art{display:grid;place-items:center;width:68px;height:68px;}
#stage.city-lobby .tab-art>svg{width:100%;height:100%;filter:drop-shadow(0 4px 0 #2a145066);}
#stage.city-lobby .tab-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);line-height:1;}
/* The current tab is a raised orange tile; every tab is icon-only (the word stays for screen readers). */
#stage.city-lobby .tab10.selected{margin-top:-22px;border:5px solid #fff;border-bottom:0;border-radius:24px 24px 0 0;z-index:1;
 background:linear-gradient(var(--x-orange-1),var(--x-orange-2));box-shadow:inset 0 5px 0 #ffe9a8;justify-content:center;padding-top:0;}
#stage.city-lobby .tab10.selected+.tab10{border-left:0;}
#stage.city-lobby .tab10.selected .tab-art{width:80px;height:80px;}
#stage.city-lobby .tabbar10 .nav-badge{position:absolute;top:8px;right:8px;min-width:26px;height:26px;padding:0 6px;border-radius:14px;background:#f0392f;border:3px solid #fff;color:#fff;
 font-size:14px;font-weight:900;font-style:normal;line-height:20px;display:grid;place-items:center;}
/* A tab that is not open yet: dimmed picture and a padlock. */
#stage.city-lobby .tab10.locked .tab-art>svg{filter:grayscale(1) opacity(.6);}
#stage.city-lobby .tab10 .tab-lock{position:absolute;top:6px;right:6px;display:grid;place-items:center;pointer-events:none;}
#stage.city-lobby .tab10 .tab-lock>svg{width:30px;height:30px;filter:drop-shadow(0 2px 0 #2a145066);}

/* Short phones (≤ 620 px tall play area) */
#stage.city-lobby.short-layout .hud10{grid-template-columns:64px minmax(0,1fr) minmax(0,1fr) 48px;gap:10px;}
#stage.city-lobby.short-layout .hud-avatar{width:64px;height:64px;}
#stage.city-lobby.short-layout .hud-pill{height:38px;margin-top:6px;}
#stage.city-lobby.short-layout .hud-pill>b{font-size:19px;}
#stage.city-lobby.short-layout .hud-round{width:48px;height:48px;min-width:48px;min-height:48px;}
#stage.city-lobby.short-layout :is(.chapter-rail,.side-rail){top:calc(var(--safe-top) + 100px);}
#stage.city-lobby.short-layout .chapter-rail{gap:18px;}
#stage.city-lobby.short-layout .chapter-medal{width:56px;height:56px;min-width:56px;min-height:56px;}
#stage.city-lobby.short-layout .medal-art>svg{width:44px;height:44px;}
#stage.city-lobby.short-layout .locate-button{width:56px;height:56px;min-width:56px;min-height:56px;}
#stage.city-lobby.short-layout .play10{min-height:70px;margin-bottom:26px;}
#stage.city-lobby.short-layout .play10>.play-pin{width:48px;height:48px;}
#stage.city-lobby.short-layout .play10>b{font-size:40px;}
#stage.city-lobby.short-layout .tabbar10{height:calc(82px + env(safe-area-inset-bottom,0px));}
#stage.city-lobby.short-layout .tab-art{width:58px;height:58px;}
#stage.city-lobby.short-layout .tab10.selected .tab-art{width:68px;height:68px;}
#stage.title-screen.short-layout .title-play{min-height:70px;}
#stage.title-screen.short-layout .title-play span{font-size:34px;}
#stage.title-screen.short-layout .title-brand{top:calc(var(--safe-top) + 44px);}

/* A-Fu guides the phone tutorial too (small avatar keeps the footer height). */
#stage.portrait-layout .tutorial-card>svg.mascot-art{display:block;width:46px;height:46px;flex-shrink:0;}
#stage.portrait-layout .tutorial-card:has(>svg.mascot-art){grid-template-columns:46px minmax(0,1fr) 48px;}

@keyframes x-pop{from{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}
@keyframes x-breathe{50%{transform:scale(1.04)}}
@keyframes x-rays{to{transform:translate(-50%,-50%) rotate(360deg)}}
@keyframes x-bob{50%{transform:translateY(-10px) rotate(-2deg)}}
@keyframes x-curtain{to{opacity:0;transform:scale(1.04)}}
@keyframes x-ring{from{transform:scale(.85);opacity:.95}to{transform:scale(1.3);opacity:0}}
@keyframes x-hop{50%{transform:translateX(-50%) translateY(-7px)}}
@media(prefers-reduced-motion:reduce){
 #stage .loading-rays,#stage .loading-art>svg,#stage.title-screen .title-play,#stage.title-screen .title-logo,#stage.city-lobby .current-pointer,#stage.city-lobby .city-node.current:after{animation:none;}
}

/* Area switcher: one medal by default, fans out when tapped. */
#stage.city-lobby .chapter-rail:not(.open) .chapter-medal:not(.selected){display:none;}
#stage.city-lobby .chapter-rail.open{padding:10px 10px 22px;margin:-10px;border-radius:44px;background:#2a1450b3;}
#stage.city-lobby .chapter-medal.selected{transform:none;}
#stage.city-lobby .medal-more{position:absolute;right:-10px;top:50%;width:26px;height:26px;margin-top:-13px;border-radius:50%;background:#fff;box-shadow:0 3px 0 #0003;}
#stage.city-lobby .medal-more{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 9l7 7 7-7' fill='none' stroke='%23c2550c' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;}
#stage.city-lobby .chapter-rail.open .medal-more{transform:rotate(180deg);}
/* Phone layouts never show a scrollbar; dragging is the way to scroll. */
#stage.portrait-layout{scrollbar-width:none;-ms-overflow-style:none;}
#stage.portrait-layout::-webkit-scrollbar{display:none;}
#stage.city-lobby .hud-pill{justify-content:flex-end;padding:0 12px 0 32px;}
#stage.city-lobby .hud-pill>b{font-size:20px;}
#stage.city-lobby .hud10{grid-template-columns:72px minmax(0,1fr) minmax(0,1fr) 50px;gap:8px;}
#stage.city-lobby .hud-avatar{width:72px;height:72px;}
#stage.city-lobby .hud-pill{margin-left:14px;padding:0 9px 0 28px;}
#stage.city-lobby .hud-pill>svg{left:-16px;width:46px;height:46px;}
#stage.city-lobby .hud-pill>b{font-size:19px;-webkit-text-stroke-width:3.5px;letter-spacing:-.3px;}
#stage.city-lobby .hud-round{width:50px;height:50px;min-width:50px;min-height:50px;}

/* ---------------- Lobby HUD: sizes follow the play width, so a four-character amount fits on every phone ----------------
   328 px wide (a 360 px phone) used to leave 32 px for a 43 px number, which slid under the coin.
   src/main.js (fitHudPills) still shrinks the face if a number is wider than its pill. */
#stage.city-lobby .hud10.hud10{
 --hud-a:clamp(52px,calc(var(--play-width,358px)*.3 - 34px),72px);
 --hud-s:clamp(44px,calc(var(--play-width,358px)*.1 + 15px),50px);
 --hud-g:clamp(6px,calc(var(--play-width,358px)*.03 - 3px),8px);
 --hud-i:clamp(38px,calc(var(--play-width,358px)*.11 + 6px),46px);
 grid-template-columns:var(--hud-a) minmax(0,1fr) minmax(0,1fr) var(--hud-s);gap:var(--hud-g);}
#stage.city-lobby .hud10 .hud-avatar{width:var(--hud-a);height:var(--hud-a);}
#stage.city-lobby .hud10 .hud-round{width:var(--hud-s);height:var(--hud-s);min-width:var(--hud-s);min-height:var(--hud-s);}
#stage.city-lobby .hud10 .hud-pill{margin-left:calc(var(--hud-i)*.36 - 2px);padding:0 7px 0 calc(var(--hud-i)*.64 + 2px);justify-content:flex-end;}
#stage.city-lobby .hud10 .hud-pill>svg{left:calc(var(--hud-i)*-.36);width:var(--hud-i);height:var(--hud-i);}
#stage.city-lobby .hud10 .hud-pill>b{font-size:19px;}
