:root{color-scheme:dark;--bg:#061327;--panel:#0d233a;--panel2:#132d48;--line:#36516d;--text:#f0f6ff;--muted:#a7c0da;--gold:#ffc56e;--orange:#eaaa51;--green:#65d7a5;--red:#ff7b81;--radius:14px}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;background:var(--bg);color:var(--text)}body{font-size:14px}a{color:inherit;text-decoration:none}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.53;cursor:default}input{border-radius:10px;border:1px solid #3a5875;background:#061a2f;color:white;padding:10px;max-width:100%;width:100%;outline:0}input:focus{border-color:#f0af55;box-shadow:0 0 0 2px #e6a14b33}p{margin:.3em 0 .85em}h1,h2,h3{margin:.2em 0}.muted{color:var(--muted)}.center{text-align:center}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.app-shell{max-width:1080px;margin:auto;display:flex;flex-direction:column;height:100vh;height:100dvh;min-height:375px;background:radial-gradient(ellipse at 50% 70%,#0b304fa6,transparent 80%),linear-gradient(0deg,#041222,#07182c);box-shadow:0 0 40px #0008;position:relative;overflow:hidden}.app-shell:before{content:"";position:absolute;inset:54px 0 58px;background:linear-gradient(90deg,#06162aeb,#06172ac7),url('/assets/img/megapolis.webp') center center/cover;opacity:.3;pointer-events:none}.topbar,.bottom-nav{position:relative;z-index:3;flex-shrink:0;background:#0e2238;border-bottom:1px solid #31516e}.topbar{height:51px;display:flex;align-items:center;justify-content:space-between;padding:4px 10px;gap:7px}.brand{display:flex;align-items:center;gap:6px;color:var(--gold);font-weight:900;letter-spacing:.7px;font-size:13px;line-height:1.1;white-space:nowrap}.brand small{display:block;color:#a4c6e5;font-size:7px;letter-spacing:1.1px;margin-top:3px}.brand-emblem{display:grid;place-items:center;width:32px;height:32px;border:1px solid var(--orange);border-radius:9px;font-size:23px;background:#273447;flex-shrink:0}.top-right{display:flex;align-items:center;gap:4px;min-width:0}.wallet,.icon-button{border:1px solid #345572;border-radius:20px;display:flex;align-items:center;justify-content:center;gap:4px;padding:5px 7px;white-space:nowrap;color:white;font-size:11px;background:#091c31}.wallet b{max-width:90px;overflow:hidden;text-overflow:ellipsis}.icon-button{min-width:29px;height:29px;position:relative;border-radius:10px}.icon-button small{font-size:9px}.xp-bar{height:3px;background:#13304b;flex-shrink:0;position:relative;z-index:3}.xp-bar span,.progress span,.investor-progress span{height:100%;display:block;background:linear-gradient(90deg,#ba823c,#ffe4a1);border-radius:inherit;transition:width .3s}.main-pane{position:relative;z-index:1;flex:1;min-height:0;overflow:hidden}.game-content{height:100%;width:100%;overflow-y:auto;overscroll-behavior:contain;padding:8px 10px 12px;scrollbar-width:thin;scrollbar-color:#55718c transparent}.game-content::-webkit-scrollbar{width:4px}.game-content::-webkit-scrollbar-thumb{background:#50708e}.bottom-nav{height:56px;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border-bottom:0;border-top:1px solid #34516f;align-items:center;gap:1px;padding:2px 4px;padding-bottom:max(3px,env(safe-area-inset-bottom));height:calc(56px + env(safe-area-inset-bottom))}.bottom-nav>a{display:flex;flex-direction:column;align-items:center;gap:1px;justify-content:center;border-radius:11px;min-width:0;height:44px;font-size:18px}.bottom-nav>a small{font-size:9px;color:#aec3d6;white-space:nowrap}.bottom-nav .active{border:1px solid #d3994d;background:#3c332e}.bottom-nav .active small{color:#ffd38f}
.screen-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:1px 1px 7px}.screen-heading h1{font-size:16px;color:#ffd392;font-weight:850;white-space:nowrap}.screen-heading span{font-size:10px;color:#a8bdd3;text-align:right;line-height:1.2}.selector{display:grid;gap:5px;grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:7px}.selector .select-tile{border:1px solid #345873;min-height:58px;background:linear-gradient(160deg,#193754,#0c2038);color:#edf5ff;border-radius:11px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:0;padding:5px 2px;overflow:hidden;position:relative}.selector .select-tile.selected{border-color:#ffd184;background:#4b3a2f}.selector .select-tile.locked{opacity:.8}.tile-icon{font-size:19px;line-height:22px}.select-tile b{font-size:11px;overflow:hidden;text-overflow:ellipsis;max-width:100%;white-space:nowrap}.select-tile small{font-size:9px;color:#bad0e6}.main-panel{border:1px solid #375977;background:#112942ed;border-radius:14px;padding:9px;display:flex;flex-direction:column;gap:8px;box-shadow:0 10px 30px #0003}.panel-name{display:flex;align-items:center;justify-content:space-between;font-size:15px;font-weight:800;gap:8px}.panel-name small{font-size:11px;color:#a2bdd8}.stats{display:grid;gap:6px}.stats.compact{grid-template-columns:repeat(3,minmax(0,1fr))}.stats.compact.four{grid-template-columns:repeat(4,minmax(0,1fr))}.stats>div{border:1px solid #365876;background:#0a1e34;border-radius:11px;padding:7px 8px;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:3px}.stats small{font-size:9px;color:#b7cce1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.stats b{font-size:14px;color:#ffc66c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.stats.four b{font-size:12px}.btn{border:1px solid #476680;background:#1b3854;color:#edf6ff;padding:10px 12px;border-radius:10px;font-size:12px;font-weight:750;display:inline-flex;justify-content:center;align-items:center;gap:5px;line-height:1.1;text-align:center;white-space:normal}.btn:hover,.pill:hover,.select-tile:hover{filter:brightness(1.12)}.btn:focus-visible,a:focus-visible,button:focus-visible{outline:2px solid #ffd595;outline-offset:2px}.btn.gold{background:linear-gradient(105deg,#e1a248,#ffd98a);color:#142031;border-color:#ffdc96}.btn.purple{background:linear-gradient(105deg,#6053ad,#a18cea);color:white;border-color:#8c82d2}.btn.full{width:100%}.btn.large{padding:14px}.panel-subtitle{display:flex;justify-content:space-between;align-items:center;font-weight:850;font-size:12px}.panel-subtitle span{font-size:10px;color:var(--muted);font-weight:400}.upgrade-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.upgrade-button{padding:9px 4px;font-size:10px;overflow-wrap:anywhere;min-width:0}.pill-tabs{display:flex;gap:5px;margin-bottom:8px;flex-wrap:nowrap}.pill{flex:1;min-width:0;display:flex;justify-content:center;align-items:center;padding:9px 3px;border:1px solid #42617d;border-radius:10px;font-size:11px;white-space:nowrap;text-align:center;background:#142c45;overflow:hidden;text-overflow:ellipsis}.pill.on{background:#f5bb64;color:#102239;font-weight:850;border-color:#ffdd90}.market-chart{display:block;height:112px;width:100%;background:#0a2035;border-radius:10px;border:1px solid #31516d}.trade-summary{font-size:11px;color:#e3c58e;text-align:center}.trade-form{display:grid;grid-template-columns:minmax(90px,105px) 1fr;gap:8px;align-items:end}.trade-form label{font-size:10px;color:#b8cbe0}.trade-form label input{margin-top:3px;height:36px}.trade-buttons{display:grid;grid-template-columns:1fr 1fr;gap:5px}.trade-buttons .btn{min-height:36px;font-size:11px;padding:6px 3px}.shop-list,.quest-list,.investors-list,.rating-list{display:flex;flex-direction:column;gap:6px}.shop-item,.quest-item,.investor-tile,.rating-row{border:1px solid #385a75;background:#112a43;border-radius:12px;padding:8px;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:57px}.shop-item>div:first-child,.quest-info{display:flex;flex-direction:column;min-width:0;gap:4px;flex:1}.shop-item strong,.quest-item strong{font-size:12px}.shop-item small,.quest-item small{font-size:10px;color:#b5c9de}.shop-item .btn{flex:0 0 100px}.quest-item .btn{flex:0 0 88px}.quest-item .muted,.quest-item .state-done{font-size:10px}.state-done{color:var(--green)}.progress{height:5px;border-radius:10px;background:#21425b;overflow:hidden}.progress.large{height:11px}.investor-tile{justify-content:flex-start}.investor-tile>span{font-size:28px}.investor-tile>div{display:flex;flex-direction:column;flex:1;gap:4px}.investor-tile small{color:#b6c8da}.investor-tile>b{font-size:20px;color:#ffc777}.diff-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.diff-tile{border:1px solid #47627b;border-radius:10px;padding:8px 4px;text-align:center;background:#0c2038;display:flex;flex-direction:column;gap:7px}.diff-tile strong{color:#ffe0ac}.diff-tile small{font-size:10px;color:#b6c8dc}.diff-tile .btn{padding:9px 4px}.investor-progress{height:12px;border-radius:10px;overflow:hidden;background:#24405c}.inline-link{font-size:10px;color:#ffc671}.lottery-cards{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}.lottery-card{min-height:130px;border:1px solid #d19e54;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;background:radial-gradient(circle at 45% 25%,#434465,#1b2944 65%,#101b32);color:#ffcf7c;transform-style:preserve-3d;transition:transform .25s,background .25s}.lottery-card span{font-size:21px}.lottery-card small{font-size:9px;color:#bacddd}.lottery-card.revealed{background:linear-gradient(145deg,#235146,#173b43);color:#ffe4a3}.lottery-card.chosen{border:2px solid #64dfaf}.chat-box{height:min(56vh,450px);overflow:auto;border:1px solid #385570;border-radius:13px;background:#0b1d32;padding:8px;display:flex;flex-direction:column;gap:6px}.chat-line{padding:8px;background:#17304a;border-radius:9px;display:flex;flex-direction:column;gap:3px}.chat-line b{font-size:11px;color:#ffc778}.chat-line b small{color:#a1b8cf;font-weight:400;margin-left:4px}.chat-line>span{font-size:12px;overflow-wrap:anywhere}.chat-compose{display:flex;gap:6px;margin-top:7px}.chat-compose .btn{flex:0 0 91px}.rating-row strong{color:#ffcf86}.rating-row span{font-size:11px;color:#b3c7dc}.profile-card{border:1px solid #d4a55c;background:linear-gradient(90deg,#162c44,#0d2138);padding:14px;display:flex;gap:10px;border-radius:15px;align-items:center;margin-bottom:9px}.profile-avatar{font-size:29px;border:1px solid #dcac5f;border-radius:50%;width:55px;height:55px;display:grid;place-items:center;color:#ffca79}.profile-card h2{font-size:21px}.profile-card span{font-size:11px;color:#b8d0e7}.profile-card~.main-panel{margin-top:8px}.profile-card~.main-panel form{margin:0}.world-map{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.world-map img{display:block;max-width:100%;max-height:100%;height:100%;width:auto;object-fit:contain}.world-map nav{position:absolute;inset:0;left:50%;width:min(100%,calc((100dvh - 114px)*.6138));transform:translateX(-50%);pointer-events:none}.map-hotspot{position:absolute;pointer-events:auto;border-radius:12px}.map-hotspot:focus-visible{outline:3px solid #ffc56a;background:#ffcf6e20}.map-extra{position:absolute;bottom:1%;left:50%;transform:translateX(-50%);width:min(98%,520px);display:flex;justify-content:space-between;gap:8px}.map-extra a{background:#0c213be8;border:1px solid #d5a257;color:#ffe2a6;padding:5px 9px;border-radius:9px;font-weight:800;font-size:11px}.notice{border:1px solid #6389a8;background:#173148;border-radius:11px;padding:10px;font-size:12px;color:#e7f3ff}.notice.error{border-color:#b75e68;color:#ffd2d8;background:#4e2734}.notice.success{border-color:#4ba783;color:#d6fff0;background:#174737}.server-flash{display:none}.settings-list{display:flex;flex-direction:column;gap:6px}.setting-row{background:#10283f;border:1px solid #355675;border-radius:11px;padding:8px;display:flex;align-items:center;justify-content:space-between;gap:8px}.setting-row>span{font-size:12px;font-weight:700;flex:1}.setting-row small{display:block;color:#a5bace;font-size:9px}.setting-row input{width:95px;flex-shrink:0}.game-modal{border:1px solid #d9aa60;border-radius:17px;background:#0d2339;color:#f3f6ff;padding:18px;max-width:min(94vw,420px);box-shadow:0 24px 70px #0009;width:100%}.game-modal::backdrop{background:#020913bd;backdrop-filter:blur(3px)}.game-modal h2{color:#ffd18b;font-size:19px}.game-modal p{color:#b7cce0;line-height:1.5}.modal-actions{display:flex;gap:8px;margin-top:15px}.modal-actions>*{flex:1}.modal-x{float:right;border:0;background:transparent;color:#c3d0da;font-size:24px;line-height:1}.prompt-icon{font-size:35px;text-align:center}.modal-head{color:#ffda9d;font-size:17px;font-weight:800;margin-bottom:9px}.modal-text{color:#bfd0dd;font-size:12px;line-height:1.6;white-space:pre-line}.modal-price{color:#ffcc83;font-size:15px;font-weight:800;margin-top:10px}#toast-area{position:fixed;z-index:1000;top:64px;left:50%;transform:translateX(-50%);width:min(90vw,390px);display:flex;flex-direction:column;gap:6px;pointer-events:none}.toast{background:#143248;color:#eafff4;border:1px solid #5bc398;border-left:5px solid #61d9a4;border-radius:10px;padding:11px 12px;box-shadow:0 10px 25px #0007;animation:popin .2s ease-out;pointer-events:auto;font-weight:700}.toast.error{border-color:#e18a89;border-left-color:#f97b80;color:#ffe8e8;background:#3d2634}@keyframes popin{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}
.auth-screen,.setup{background:linear-gradient(#05122499,#061222da),url('/assets/img/megapolis.webp') center/cover;min-height:100dvh;display:flex;justify-content:center;align-items:center;padding:20px}.auth-box{background:#0e253de8;border:1px solid #b88b51;border-radius:18px;padding:22px;width:min(100%,420px);box-shadow:0 25px 70px #0008;max-height:94dvh;overflow:auto}.auth-box h1{font-size:22px;color:#ffce88;margin:20px 0 9px}.auth-box .logo{font-size:21px;color:#ffd188;font-weight:900}.auth-box .logo small{display:block;font-size:10px;color:#a3c1dc;letter-spacing:1.3px}.form{display:flex;flex-direction:column;gap:9px}.form label{font-size:12px;color:#c2d5e6;display:flex;flex-direction:column;gap:5px}.form .check{flex-direction:row;align-items:flex-start}.form .check input{width:auto}.auth-login{border-top:1px solid #42617b;margin-top:17px;padding-top:14px}.auth-login summary{cursor:pointer;color:#d3e1ee;text-align:center}.auth-login .form{margin-top:14px}.auth-box>form .btn{width:100%}.auth-links{font-size:10px;color:#a5bace;text-align:center;margin-top:16px}.auth-box>.link{display:block;text-align:center;color:#fbc577;margin-top:15px}
@media(max-width:500px){.game-content{padding:6px 7px 8px}.brand{font-size:11px}.brand-emblem{width:29px;height:29px}.topbar{padding:4px 6px}.wallet{padding:4px 5px;font-size:10px}.screen-heading h1{font-size:15px}.main-panel{padding:8px;gap:6px}.stats.compact>div{padding:7px 5px}.stats b{font-size:12px}.stats.four b{font-size:10px}.selector .select-tile{min-height:50px}.select-tile b{font-size:10px}.tile-icon{font-size:17px;line-height:18px}.upgrade-button{font-size:9px;line-height:1.2;min-height:46px}.world-map nav{width:min(100%,calc((100dvh - 114px)*.6138))}.lottery-card{min-height:100px}.lottery-card span{font-size:16px}.bottom-nav>a{font-size:17px}.bottom-nav>a small{font-size:8px}.trade-form{grid-template-columns:85px 1fr}.market-chart{height:105px}}
@media(max-height:680px){.topbar{height:45px}.bottom-nav{height:51px}.game-content{padding-top:5px;padding-bottom:5px}.selector .select-tile{min-height:44px}.market-chart{height:85px}.lottery-card{min-height:90px}.main-panel{gap:5px}.stats.compact>div{padding:6px 5px}.world-map nav{width:min(100%,calc((100dvh - 101px)*.6138))}}
@media(min-width:780px){.game-content{padding:16px}.app-shell{max-width:1050px}.selector{grid-template-columns:repeat(5,minmax(0,1fr))}.selector:has(.locked:nth-child(6)){grid-template-columns:repeat(6,minmax(0,1fr))}.lottery-card{min-height:160px}.stats.compact>div{padding:13px}.main-panel{padding:16px}.world-map nav{width:min(100%,calc((100dvh - 114px)*.6138))}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Precisely align hotspots with the contained portrait map at every viewport. */
.world-map .map-canvas{position:relative;aspect-ratio:863/1406;height:100%;max-width:100%;max-height:100%;width:auto;flex:none}
.world-map .map-canvas>img{width:100%;height:100%;display:block;object-fit:fill}
.world-map .map-canvas>nav{position:absolute;inset:0;left:auto;width:100%;height:100%;transform:none}
.world-map .map-extra{bottom:.3%;width:98%;white-space:nowrap;gap:4px}
@media(max-width:500px){.world-map .map-extra a{font-size:9px;padding:5px}}

.lottery-tiers{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.lottery-tiers .btn{font-size:10px;padding:10px 3px}
@media(max-width:370px){.lottery-tiers{grid-template-columns:repeat(2,minmax(0,1fr))}}


/* Compact Android-like pass */
.ui-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:18px;height:18px}
.ui-icon img{display:block;max-width:100%;max-height:100%;object-fit:contain}
.brand-emblem .ui-icon,.icon-button .ui-icon{width:18px;height:18px}.wallet .ui-icon{width:14px;height:14px}.bottom-nav .ui-icon{width:18px;height:18px}.pin-ico .ui-icon{width:20px;height:20px}.asset-ico{width:28px;height:28px;margin:0 auto 2px}.asset-ico img{filter:drop-shadow(0 1px 2px rgba(0,0,0,.35))}
body{overflow:hidden}.topbar{height:48px}.brand small{margin-top:2px}.wallet,.icon-button{padding:4px 6px}.icon-button{gap:3px}
.game-content{padding:6px 8px 8px;overflow-y:auto}.screen-heading{margin-bottom:6px}.screen-heading h1{font-size:15px}.screen-heading span{font-size:9px}
.selector.selector-compact{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.selector .select-tile{min-height:56px;padding:6px 3px;border-radius:12px}.select-tile b{font-size:10px}.select-tile small{font-size:8px}
.compact-panel{gap:6px;padding:8px}.compact-panel .panel-name{font-size:13px}.panel-name .panel-copy strong,.compact-panel .panel-name strong{display:block;font-size:14px}.panel-name .ui-icon.asset-ico{margin:0}
.btn{min-height:38px;padding:8px 10px}.btn.upgrade-button{display:flex;flex-direction:column;gap:4px;padding:7px 3px;min-height:64px}.btn.upgrade-button .ui-icon{width:17px;height:17px}.btn.upgrade-button span{font-size:10px;font-weight:800}.btn.upgrade-button small{font-size:8px;color:#d0deea}
.stats.compact>div{padding:7px 6px}.stats small{font-size:8px}.stats b{font-size:12px}.stats.compact.four{grid-template-columns:repeat(2,minmax(0,1fr))}
.game-scene.slim-scene{height:84px;border-radius:12px;margin-bottom:6px}.game-scene.slim-scene .scene-title{left:10px;bottom:8px;font-size:16px}.game-scene.slim-scene .scene-sub{font-size:9px}
.pill{padding:8px 4px;gap:4px}.pill .ui-icon,.pill .asset-ico{width:14px;height:14px;margin:0}.pill span{overflow:hidden;text-overflow:ellipsis}
.shop-list.two-col,.quest-list.two-col,.investors-list.two-col,.rating-list.two-col{display:grid;grid-template-columns:1fr;gap:6px}.shop-item,.quest-item,.investor-tile,.rating-row{min-height:52px;padding:8px}.shop-item .btn,.quest-item .btn{flex:0 0 92px}
.chat-box.compact-chat{height:min(42vh,280px)}
.trade-form{grid-template-columns:88px 1fr;gap:6px}.trade-buttons .btn{font-size:10px}
.bottom-nav{height:58px;padding:2px 4px;padding-bottom:max(3px,env(safe-area-inset-bottom))}.bottom-nav>a{font-size:15px;height:47px;gap:2px}.bottom-nav>a small{font-size:8px}
.profile-avatar .ui-icon{width:26px;height:26px}.profile-card{padding:10px;gap:8px}.profile-avatar{width:48px;height:48px}.profile-card h2{font-size:18px}
.world-v4-extra a .ui-icon{width:16px;height:16px;vertical-align:middle;margin-right:4px}.world-v4-pin .pin-ico .ui-icon{width:22px;height:22px}
@media(min-width:720px){.shop-list.two-col,.quest-list.two-col,.investors-list.two-col,.rating-list.two-col{grid-template-columns:1fr 1fr}.stats.compact.four{grid-template-columns:repeat(4,minmax(0,1fr))}.game-scene.slim-scene{height:110px}}
@media(max-width:480px){.app-shell{min-height:100dvh}.topbar{height:46px;padding:4px 6px}.brand{font-size:11px}.brand-emblem{width:28px;height:28px}.wallet{font-size:10px}.wallet b{max-width:76px}.xp-bar{height:3px}.screen-heading h1{font-size:14px}.screen-heading span{max-width:40%;font-size:8px}.selector.selector-compact{grid-template-columns:repeat(3,minmax(0,1fr))}.main-panel{border-radius:12px}.lottery-cards{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}.lottery-card{min-height:84px}.lottery-card span{font-size:14px}.trade-summary{font-size:10px}.chat-compose{gap:5px}.chat-compose .btn{flex:0 0 84px}}

/* Premium Game Icon Pack 3D assets */
.ui-icon{vertical-align:middle;width:22px;height:22px;overflow:visible}
.ui-icon img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 3px #0009)}
.bottom-nav .ui-icon{width:24px;height:24px}
.selector .ui-icon.asset-ico{width:34px;height:34px;margin:0 auto 2px}
.world-v4-pin .ui-icon{width:35px;height:35px}
.top-right .ui-icon{width:19px;height:19px}
.brand-emblem .ui-icon{width:26px;height:26px}
.main-panel .panel-name .ui-icon.asset-ico{width:38px;height:38px}
.upgrade-button .ui-icon{width:24px!important;height:24px!important}
.pill .ui-icon.asset-ico{width:21px;height:21px}
@media(max-height:700px){.selector .ui-icon.asset-ico{width:25px;height:25px}.game-scene.slim-scene{height:62px}.selector .select-tile{min-height:47px}}

/* Premium Game Icon Pack 3D assets */
.ui-icon{vertical-align:middle;width:22px;height:22px;overflow:visible}
.ui-icon img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 3px #0009)}
.bottom-nav .ui-icon{width:24px;height:24px}
.selector .ui-icon.asset-ico{width:34px;height:34px;margin:0 auto 2px}
.world-v4-pin .ui-icon{width:35px;height:35px}
.top-right .ui-icon{width:19px;height:19px}
.brand-emblem .ui-icon{width:26px;height:26px}
.main-panel .panel-name .ui-icon.asset-ico{width:38px;height:38px}
.upgrade-button .ui-icon{width:24px!important;height:24px!important}
.pill .ui-icon.asset-ico{width:21px;height:21px}
@media(max-height:700px){.selector .ui-icon.asset-ico{width:25px;height:25px}.game-scene.slim-scene{height:62px}.selector .select-tile{min-height:47px}}

/* Stage 2: 30 playable businesses, compact single-screen control grid */
.business-sectors{grid-template-columns:repeat(5,minmax(0,1fr))!important}
.business-sectors .select-tile{min-height:55px}.business-sectors .select-tile b{font-size:clamp(8px,2vw,11px)}
.business-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:5px 0}
.business-summary>div{border:1px solid #756146;border-radius:10px;background:#0b243be9;padding:7px 4px;text-align:center;min-width:0}
.business-summary small{display:block;color:#acc7d9;font-size:9px}.business-summary b{display:block;color:#ffcf83;font-size:clamp(10px,2.4vw,14px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.business-main-action{display:flex;gap:6px;margin:6px 0;align-items:flex-start}.business-main-action>.btn{flex:1}.business-expand{flex:1;position:relative;min-width:0;z-index:2}
.business-expand summary{cursor:pointer;list-style:none;border-radius:10px;border:1px solid #7b6b51;background:#14304b;color:#ffdb98;text-align:center;min-height:38px;display:grid;place-items:center;font-size:11px;font-weight:750}
.business-expand summary::-webkit-details-marker{display:none}.business-expand[open] .upgrade-grid{position:absolute;right:0;top:41px;width:min(92vw,380px);z-index:20;box-shadow:0 14px 32px #000d;background:#0a2139;padding:8px;border:1px solid #aa844d;border-radius:12px}
.business-unit-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;align-content:start}
.business-unit{display:flex;flex-direction:column;justify-content:space-between;gap:4px;min-width:0;border-radius:11px;border:1px solid #a17c4d8c;background:linear-gradient(150deg,#18344ddf,#0a1c33f2);padding:8px}
.business-unit.locked{background:linear-gradient(140deg,#101f33e6,#101b2be6)}.business-unit-head{display:flex;justify-content:space-between;gap:4px;min-height:16px}
.business-unit-head strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.business-unit-head small{font-size:9px;color:#c8ad80;flex-shrink:0}
.business-unit-rate{font-size:13px;color:#ffcf81;font-weight:800}.business-unit-rate small,.business-unit-stock{font-size:9px;color:#b7cadc;font-weight:500}
.business-unit-actions{display:grid;grid-template-columns:1fr 1fr;gap:4px}.business-unit .btn{font-size:10px;padding:6px 3px;min-height:33px}
@media(max-width:500px){.business-unit-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.business-unit{padding:6px;gap:3px}.business-summary>div{padding:6px 3px}.business-unit-rate{font-size:12px}.business-unit-head strong{font-size:10px}.business-unit-head small{font-size:8px}}
@media(max-height:680px){.business-unit{padding:5px}.business-unit .btn{min-height:29px}.business-unit-stock{font-size:8px}.business-unit-head{min-height:13px}}


/* === Global Compact UX V10 === */
:root{
  --b3-gap:10px;
  --b3-radius:14px;
}
#game-content{display:grid;gap:10px}
.main-panel,.compact-panel,.profile-card,.stats.compact,.resource-rig-card,.business-unit,.city-mini-card{
  box-sizing:border-box;
}
.screen-heading{margin-bottom:4px!important;padding:10px 12px!important}
.screen-heading h1{font-size:clamp(17px,2.2vw,24px)!important;line-height:1.15!important}
.screen-heading span{font-size:11px!important;max-width:52%!important}
.main-panel.compact-panel,.main-panel{padding:12px!important;border-radius:14px!important}
.panel-name{gap:10px!important}
.panel-name strong{font-size:16px!important}
.panel-name small{font-size:11px!important}
.stats.compact{gap:8px!important}
.stats.compact>div{padding:10px!important;border-radius:12px!important}
.stats.compact small{font-size:10px!important}
.stats.compact b{font-size:14px!important}
.btn{min-height:38px!important;padding:8px 10px!important;font-size:12px!important;border-radius:11px!important}
.selector{gap:7px!important}
.selector .select-tile{min-height:62px!important;padding:7px 6px!important;border-radius:12px!important}
.selector .select-tile b{font-size:11px!important;line-height:1.15!important;white-space:normal!important}
.selector .select-tile small{font-size:10px!important}

/* quick sections nav */
.b3-quick-sections{display:flex;gap:8px;overflow:auto;padding:2px 0 6px;scrollbar-width:none;-ms-overflow-style:none}
.b3-quick-sections::-webkit-scrollbar{display:none}
.b3-quick-link{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 11px;border-radius:999px;background:#112941;border:1px solid #4d6a84;color:#e8f0f8;text-decoration:none;font-size:12px;font-weight:700;white-space:nowrap}
.b3-quick-link.active{background:#4a3f2c;border-color:#d8aa63;color:#ffd894}

/* collapsible sections */
.b3-collapsible{overflow:hidden}
.b3-collapsible-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;background:#10283e;border:1px solid #4b6a83;color:#f3f7fd;padding:10px 12px;border-radius:12px;font-size:13px;font-weight:800;cursor:pointer}
.b3-collapsible-toggle small{color:#a9c0d4;font-size:11px;font-weight:600}
.b3-collapsible-toggle:after{content:'▾';font-size:14px;color:#f0cb88;transition:transform .18s ease}
.b3-collapsible.collapsed .b3-collapsible-toggle:after{transform:rotate(-90deg)}
.b3-collapsible-body{padding-top:8px}
.b3-collapsible.collapsed .b3-collapsible-body{display:none}

/* compact page layouts */
.business-unit-grid,.city-building-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important}
.business-unit,.city-mini-card,.resource-rig-card{padding:10px 9px!important;border-radius:13px!important;gap:6px!important}
.business-unit-head strong,.city-mini-header strong,.resource-rig-name strong{font-size:13px!important;line-height:1.15!important}
.business-unit-head small,.city-mini-status,.resource-rig-card>small{font-size:10px!important}
.business-unit-rate,.city-mini-rate,.resource-rig-rate{font-size:18px!important;line-height:1.1!important}
.business-unit-stock,.city-mini-stock{font-size:11px!important}
.business-unit-actions,.city-mini-actions,.resource-rig-buttons{gap:5px!important}
.resource-rig-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px!important}
.resource-rig-name{gap:4px!important}

/* profile compact */
.profile-card{padding:12px!important;border-radius:16px!important;gap:10px!important;display:grid!important;grid-template-columns:auto 1fr!important;align-items:center!important}
.profile-avatar{width:64px!important;height:64px!important;font-size:28px!important}
.profile-card h2{font-size:20px!important;margin:0 0 4px!important}
.profile-card span{font-size:12px!important}

/* social compact */
[data-location="social"] .social-head{padding:10px 12px!important}
[data-location="social"] .social-tabs{position:sticky;top:0;z-index:8;background:linear-gradient(180deg,#081c31 60%,rgba(8,28,49,0));padding-bottom:6px}
[data-location="social"] .social-tabs button,
[data-location="social"] .social-tabs a{min-height:40px;font-size:12px!important}
[data-location="social"] .social-mail-list,
[data-location="social"] .social-forum-topics,
[data-location="social"] .social-friend-list,
[data-location="social"] .social-corp-list{max-height:52vh!important}

/* empire / dashboard pages */
.empire-grid,.dashboard-grid,.empire-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}

/* top and bottom bars compact */
.topbar{min-height:54px!important;padding:7px 10px!important}
.brand span{font-size:14px!important}
.brand small{font-size:9px!important}
.wallet,.icon-button{min-height:32px!important;padding:5px 8px!important;font-size:11px!important;border-radius:10px!important}
.bottom-nav{height:60px!important}
.bottom-nav>a{height:48px!important;padding:4px 2px!important}
.bottom-nav>a small{font-size:10px!important}

@media (max-width: 760px){
  .screen-heading span{display:none!important}
  .main-panel.compact-panel,.main-panel{padding:10px!important}
  .stats.compact{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .business-unit-grid,.city-building-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .resource-rig-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width: 520px){
  #game-content{gap:8px}
  .stats.compact>div{padding:8px!important}
  .stats.compact b{font-size:13px!important}
  .panel-name strong{font-size:15px!important}
  .selector .select-tile{min-height:58px!important}
  .business-unit-grid,.city-building-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
  .resource-rig-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
  .business-unit,.city-mini-card,.resource-rig-card{padding:8px 7px!important}
  .business-unit-rate,.city-mini-rate,.resource-rig-rate{font-size:16px!important}
  .profile-card{grid-template-columns:58px 1fr!important}
  .profile-avatar{width:58px!important;height:58px!important}
  .b3-quick-link{font-size:11px;padding:7px 10px}
}
@media (max-width: 390px){
  .stats.compact{grid-template-columns:1fr 1fr!important}
  .business-unit-grid,.city-building-grid,.resource-rig-grid{grid-template-columns:1fr 1fr!important}
  .resource-rig-card .btn,.business-unit .btn,.city-mini-card .btn{min-height:34px!important;padding:6px 8px!important;font-size:11px!important}
}


/* City mobile hotfix V12.1 — overrides Compact UX V10 and earlier city styles. */
body[data-location="city"] #game-content {
  display:block !important;
}
body[data-location="city"] #game-content > * { margin-bottom:9px; }
body[data-location="city"] .screen-heading {padding:10px 12px !important;margin-bottom:8px !important}
body[data-location="city"] .city-districts {
  display:grid !important;grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:6px !important;margin:0 0 9px !important;
}
body[data-location="city"] .city-districts > * { min-width:0 !important; width:100% !important; }
body[data-location="city"] .city-districts .select-tile {
  min-height:64px !important;max-height:74px !important;margin:0 !important;
  padding:6px 4px !important;display:flex !important;flex-direction:column !important;
  align-items:center !important;justify-content:center !important;gap:2px !important;
}
body[data-location="city"] .city-districts .select-tile b{font-size:12px !important;line-height:1.1 !important}
body[data-location="city"] .city-districts .select-tile small{font-size:10px !important}
body[data-location="city"] .city-dashboard{display:block !important;margin:0 0 8px !important}
body[data-location="city"] .city-summary{
  display:grid !important;grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:5px !important;margin-bottom:7px !important;min-width:0 !important;
}
body[data-location="city"] .city-summary > div{
  min-width:0 !important;min-height:56px !important;padding:7px 6px !important;
  display:flex !important;flex-direction:column !important;justify-content:center !important;
}
body[data-location="city"] .city-summary small{font-size:10px !important;line-height:1.15 !important}
body[data-location="city"] .city-summary b{
  display:block !important;font-size:clamp(12px,3.45vw,17px) !important;
  line-height:1.2 !important;white-space:nowrap !important;
  overflow:hidden !important;text-overflow:ellipsis !important;
}
body[data-location="city"] .city-summary em{font-size:9px !important}
body[data-location="city"] .city-toolbar{
  display:grid !important;grid-template-columns:1fr 1fr !important;gap:7px !important;
  align-items:stretch !important;
}
body[data-location="city"] .city-toolbar > .btn{
  width:100% !important;min-width:0 !important;min-height:40px !important;
  padding:7px 5px !important;font-size:clamp(11px,3vw,14px) !important;
  line-height:1.12 !important;white-space:normal !important;
}
body[data-location="city"] .city-building-grid{
  display:grid !important;grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:6px !important;align-items:start !important;align-content:start !important;
  grid-auto-rows:auto !important;min-height:0 !important;height:auto !important;
  overflow:visible !important;
}
body[data-location="city"] .city-mini-card{
  height:auto !important;min-height:0 !important;align-self:start !important;
  padding:8px 5px !important;gap:5px !important;display:flex !important;
  flex-direction:column !important;justify-content:flex-start !important;
  text-align:center !important;
}
body[data-location="city"] .city-mini-header{
  display:flex !important;flex-direction:column !important;align-items:center !important;
  gap:4px !important;min-width:0 !important;
}
body[data-location="city"] .city-mini-header strong{
  font-size:clamp(10px,2.8vw,13px) !important;
  line-height:1.14 !important;min-height:0 !important;overflow-wrap:anywhere !important;
}
body[data-location="city"] .city-mini-header .ui-icon{
  width:26px !important;height:26px !important;
}
body[data-location="city"] .city-mini-status,
body[data-location="city"] .city-mini-stock{font-size:10px !important;line-height:1.2 !important}
body[data-location="city"] .city-mini-rate{
  font-size:clamp(13px,3.2vw,17px) !important;line-height:1.12 !important;
  margin:0 !important;overflow-wrap:anywhere !important;
}
body[data-location="city"] .city-mini-rate small{font-size:9px !important}
body[data-location="city"] .city-mini-actions{
  display:flex !important;gap:4px !important;margin-top:3px !important;
  flex-wrap:nowrap !important;width:100% !important;
}
body[data-location="city"] .city-mini-actions .btn{
  flex:1 1 auto !important;min-width:0 !important;width:auto !important;
  min-height:32px !important;padding:5px 2px !important;
  font-size:clamp(10px,2.45vw,12px) !important;line-height:1.05 !important;
}
body[data-location="city"] .city-mini-full{
  margin-top:5px !important;min-height:35px !important;
  font-size:10px !important;overflow-wrap:anywhere !important;
}
/* Keep city sections usable when Compact UX wraps its grid in a disclosure. */
body[data-location="city"] .b3-collapsible{margin-top:0 !important}
body[data-location="city"] .b3-collapsible-toggle{min-height:38px !important;padding:8px 10px !important}
body[data-location="city"] .b3-collapsible-body{padding-top:7px !important}
/* The V6 shortcut occupies a blank square in the narrow top bar: navigation still exists below. */
@media (max-width:760px){
 .topbar .top-right .b3v6-quick{display:none !important}
 .topbar{display:flex !important;min-width:0 !important;gap:5px !important;padding:6px 8px !important}
 .topbar .brand{flex:0 1 112px !important;min-width:0 !important;max-width:112px !important;overflow:hidden !important;gap:5px !important}
 .topbar .brand > span:not(.brand-emblem){min-width:0 !important;font-size:11px !important;overflow:hidden !important;text-overflow:clip !important}
 .topbar .brand small{display:none !important}
 .topbar .brand-emblem{width:29px !important;height:29px !important;flex-shrink:0 !important}
 .topbar .top-right{display:flex !important;flex:1 1 auto !important;min-width:0 !important;justify-content:flex-end !important;gap:4px !important}
 .topbar .wallet{flex:0 1 auto !important;min-width:0 !important;max-width:32vw !important;padding:5px 6px !important}
 .topbar .wallet b{min-width:0 !important;max-width:21vw !important;font-size:11px !important;overflow:hidden !important;text-overflow:ellipsis !important}
 .topbar .icon-button,.topbar .b3-help-button,.topbar .b3n-bell{flex-shrink:0 !important}
}
@media(max-width:380px){
 .topbar .brand{max-width:35px !important;flex-basis:35px !important}
 .topbar .brand > span:not(.brand-emblem){display:none !important}
 body[data-location="city"] .city-districts .select-tile b{font-size:11px !important}
 body[data-location="city"] .city-mini-card{padding:6px 3px !important}
 body[data-location="city"] .city-mini-header strong{font-size:10px !important}
 body[data-location="city"] .city-mini-actions{flex-direction:column !important}
 body[data-location="city"] .city-mini-actions .btn{width:100% !important}
}


/* V13: scrolling stability across ALL game locations. */
html,body { overscroll-behavior-x:none; }
body:has(.app-shell) { overflow:hidden!important; }
.app-shell { display:flex!important;flex-direction:column!important;height:100vh!important;height:100dvh!important;max-height:100dvh!important;min-height:0!important;overflow:hidden!important; }
.app-shell .topbar,.app-shell .xp-bar,.app-shell .bottom-nav { flex-shrink:0!important; }
.app-shell .main-pane { display:flex!important;flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow:hidden!important; }
#game-content.game-content { display:block!important; flex:1 1 auto!important;height:100%!important;min-height:0!important;max-height:100%!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-y:contain!important;touch-action:pan-y!important;padding-bottom:calc(30px + env(safe-area-inset-bottom))!important;scrollbar-width:thin; }
#game-content > * {min-width:0;max-width:100%;}
#game-content .main-panel,#game-content .business-unit-grid,#game-content .city-building-grid,#game-content .resource-rig-grid {max-height:none!important;overflow:visible!important;}
#game-content .business-unit-grid,#game-content .city-building-grid,#game-content .resource-rig-grid {height:auto!important;min-height:0!important;align-content:start!important;grid-auto-rows:auto!important;}
/* Existing V10 collapsible containers must not hide the core gameplay. */
body[data-location="bus"] .b3-collapsible-body,body[data-location="business"] .b3-collapsible-body,
body[data-location="city"] .b3-collapsible-body,body[data-location="min"] .b3-collapsible-body,
body[data-location="minigames"] .b3-collapsible-body {display:block!important;}
body[data-location="bus"] .b3-collapsible-toggle,body[data-location="business"] .b3-collapsible-toggle,
body[data-location="city"] .b3-collapsible-toggle {display:none!important;}
/* Business: two readable columns, no inner scrolling. */
body[data-location="bus"] .business-unit-grid,body[data-location="business"] .business-unit-grid {
 display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;align-items:stretch!important;
}
body[data-location="bus"] .business-unit,body[data-location="business"] .business-unit {display:flex!important;flex-direction:column!important;min-width:0!important;min-height:0!important;height:auto!important;overflow:visible!important;padding:9px!important;}
body[data-location="bus"] .business-unit-actions,body[data-location="business"] .business-unit-actions {display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:6px!important;margin-top:auto!important;}
body[data-location="bus"] .business-unit-actions .btn,body[data-location="business"] .business-unit-actions .btn{min-width:0!important;width:100%!important;min-height:39px!important;padding:6px 3px!important;white-space:normal!important;overflow-wrap:anywhere!important;}
/* Lottery: correct stacking, no fake minimum height or cropped cards. */
body[data-location="min"] .lottery-premium,body[data-location="minigames"] .lottery-premium {min-height:0!important;height:auto!important;overflow:visible!important;max-width:100%!important;}
body[data-location="min"] .lottery-premium-tiers,body[data-location="minigames"] .lottery-premium-tiers {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;align-items:stretch!important;}
body[data-location="min"] .lottery-tier-imperial,body[data-location="minigames"] .lottery-tier-imperial {grid-column:span 2;}
body[data-location="min"] .lottery-premium-tier,body[data-location="minigames"] .lottery-premium-tier {min-height:0!important;min-width:0!important;}
body[data-location="min"] .lottery-stage,body[data-location="minigames"] .lottery-stage {min-height:0!important;height:auto!important;overflow:visible!important;padding:12px 0 18px!important;}
body[data-location="min"] .lottery-premium-cards,body[data-location="minigames"] .lottery-premium-cards {display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:5px!important;width:100%!important;min-height:0!important;}
body[data-location="min"] .lottery-3d-card,body[data-location="minigames"] .lottery-3d-card {min-width:0!important;max-width:100%!important;aspect-ratio:637/850!important;height:auto!important;}
body[data-location="min"] .lottery-round-reward,body[data-location="minigames"] .lottery-round-reward{min-height:0!important;height:auto!important;flex-wrap:wrap!important;}
body[data-location="min"] .screen-heading,body[data-location="minigames"] .screen-heading {min-height:0!important;padding:12px!important;}
/* Keep upgrade dialogs reachable without locking vertical scroll inside forms. */
.game-modal,dialog {max-height:calc(100dvh - 32px)!important;overflow-y:auto!important;overscroll-behavior:contain!important;}
@media(max-width:480px){
 body[data-location="bus"] .business-unit,body[data-location="business"] .business-unit{padding:7px!important;}
 body[data-location="bus"] .business-unit-head strong,body[data-location="business"] .business-unit-head strong {white-space:normal!important;overflow-wrap:anywhere!important;font-size:12px!important;}
 body[data-location="min"] .lottery-premium-tiers,body[data-location="minigames"] .lottery-premium-tiers{gap:5px!important;}
}
