/* A compact launch panel leaves the living city as the main view. */
:root{--game-ink:#f6f0df;--game-muted:#cfdbd1;--game-gold:#e1ca96;--game-line:#8d9f91;--game-surface:#102822;--game-focus:#ecdcab}

#world:focus-visible{outline:3px solid var(--game-focus);outline-offset:-5px}
#welcome{inset:auto auto max(22px,env(safe-area-inset-bottom,0px)) max(28px,env(safe-area-inset-left,0px));width:min(320px,calc(100% - 56px));max-width:none;max-height:calc(100vh - 112px);max-height:min(60dvh,calc(100dvh - 112px - env(safe-area-inset-top,0px)));overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#b4a477 #132b25;text-shadow:none}
/* A compact app launch sheet, while the city remains the main view. */
.welcome-panel{position:relative;padding:12px 14px 10px;background:linear-gradient(150deg,rgba(16,37,32,.97),rgba(7,22,20,.96));border:1px solid #d1bd8a6b;border-radius:20px;box-shadow:0 16px 42px #0006,inset 0 1px #ffffff17;color:var(--game-ink)}
.welcome-heading{min-height:44px;display:flex;align-items:center;padding-right:8rem}
#welcome h1{margin:0;font:400 1.5rem/1.2 Georgia,'Noto Serif TC',serif;letter-spacing:.06em;color:#f8f2e5}
.welcome-primary{margin-top:4px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px}
#welcome #enter{position:relative;width:100%;min-width:0;min-height:50px;display:flex;align-items:center;justify-content:center;padding:10px 5px;border:1px solid #f0dfb3;border-radius:13px;background:linear-gradient(105deg,#efdfbc,#d8c08b);box-shadow:inset 0 1px #fff8e5,0 5px 16px #0004;color:#102920;font-size:1rem;font-weight:700;letter-spacing:.03em;text-align:center;transition:background .18s,border-color .18s,box-shadow .18s}
#welcome #officeVisit{width:100%;min-width:0;min-height:50px;padding:10px 5px;border:1px solid #d7c491;border-radius:13px;background:#183b30;color:#fff4d6;font-size:.9375rem;font-weight:700;letter-spacing:0;line-height:1.35}
#welcome #officeVisit:hover:not(:disabled){background:#2b5545;border-color:#f0ddb0}
#welcome #officeVisit:disabled{opacity:.7;cursor:wait}
#welcome #enter:hover:not(:disabled){background:linear-gradient(105deg,#fff0cf,#e9d5a8);border-color:#fff1cd;box-shadow:inset 0 1px #fffbed,0 7px 20px #0005}
#welcome #enter:active:not(:disabled){background:linear-gradient(105deg,#ddc89a,#cbb17b);box-shadow:inset 0 2px 6px #684b2633}
#welcome #enter:disabled{opacity:1;background:linear-gradient(105deg,#b5aa8e,#a2987d);border-color:#c9bfa2;box-shadow:inset 0 1px #eee1bd59;color:#24352b;cursor:wait}
#welcome .loading-status{grid-column:1/-1;min-height:20px;margin:0;color:#d3e0d4;font-size:.875rem;line-height:1.4;letter-spacing:0}
.welcome-explore{margin:0;border:0}
.welcome-explore[open]{padding-top:8px}
.welcome-explore>summary{position:absolute;top:12px;right:14px;min-height:44px;display:flex;align-items:center;justify-content:center;gap:8px;padding:0 10px;border:1px solid #d4c08b66;border-radius:13px;background:#ffffff0a;box-shadow:none;cursor:pointer;list-style:none;color:#f4ead4;font-size:.875rem;font-weight:600;letter-spacing:0;transition:background .18s,border-color .18s}
.welcome-explore>summary:hover{color:#fff3d0;background:#ffffff14;border-color:#e3ce9599}
.welcome-explore>summary::-webkit-details-marker{display:none}
.welcome-explore>summary span{width:18px;height:18px;display:grid;place-items:center;border:0;font-size:1rem;font-weight:400;line-height:1;color:#f3dfad;transition:transform .18s}
.welcome-explore[open]>summary span{transform:rotate(45deg)}
.welcome-routes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px 0 2px}
#welcome .welcome-route{position:relative;width:auto;min-width:0;min-height:72px;margin:0;padding:11px 12px;border:1px solid #b5a77966;border-radius:12px;background:linear-gradient(140deg,#24483bef,#142e28f5);box-shadow:inset 0 1px #ffffff0d;color:var(--game-ink);display:flex;align-items:flex-start;gap:8px;text-decoration:none;transition:background .18s,border-color .18s}
#welcome .welcome-route:hover{background:linear-gradient(140deg,#335947,#1d3b30);border-color:#dbc58e}
.welcome-route>span{min-width:0;display:grid;gap:4px}
.welcome-route strong{color:#f4eedf;font-size:1rem;font-weight:700;line-height:1.25}
.welcome-route em{color:#c8d8c9;font-size:.875rem;font-style:normal;line-height:1.3}
#welcome .welcome-host{grid-column:1/-1;width:100%;min-width:0;min-height:58px;margin:0;padding:6px 13px 6px 7px;gap:13px;border:1px solid #b5a77966;border-radius:12px;background:linear-gradient(140deg,#24483bef,#142e28f5);box-shadow:inset 0 1px #ffffff0d;color:var(--game-ink)}
#welcome .welcome-host:not(:disabled):hover{background:linear-gradient(140deg,#335947,#1d3b30);border-color:#dbc58e}
#welcome .welcome-host:disabled{opacity:1;filter:saturate(.55);color:#cbd6ca;cursor:wait}
#welcome .welcome-host img{width:45px;height:44px;object-fit:cover;object-position:center 7%;border:1px solid #d0ba8266;border-radius:4px;background:#0c211b}
#welcome .welcome-host>span:nth-child(2){gap:5px;min-width:0}
#welcome .welcome-host strong{font-size:1rem;color:#f4eedf}
#welcome .intro-footer{margin-top:10px;padding-top:10px;border-top:1px solid #c6b48945;display:grid;gap:4px}
#welcome .instructions{font-size:.8125rem;line-height:1.5;letter-spacing:0;color:#d1ded2}
#welcome .instructions:empty{display:none}
.welcome-utilities{display:flex;flex-wrap:wrap;align-items:center;gap:4px 20px;margin-top:3px}
#welcome .welcome-utilities .textBtn{display:inline-flex;align-items:center;min-height:44px;padding:8px 0;margin:0;color:#e6d2a1;font-size:.875rem;letter-spacing:0;text-decoration:none}
#welcome .welcome-utilities .textBtn:hover{text-decoration:underline;background:transparent}
#welcome button:focus-visible,#welcome a:focus-visible,#welcome summary:focus-visible,.app-dock button:focus-visible{outline:3px solid var(--game-focus);outline-offset:2px}

/* A single translucent navigation rail keeps the city unobstructed. */
body:not(.world-active) .top{gap:2px;padding:4px;border:1px solid #c9b68173;border-radius:16px;background:#0b211ce8;box-shadow:0 6px 24px #0004;backdrop-filter:blur(15px)}
body:not(.world-active) .top button{min-height:44px;border:0;border-radius:11px;background:transparent;box-shadow:none;color:#f4eddd;font-weight:600;transition:background .18s,color .18s;backdrop-filter:none}
body:not(.world-active) .top button:not([hidden]){display:flex;align-items:center;justify-content:center;gap:7px}
body:not(.world-active) .top button::before{content:"";display:block;flex:none;width:17px;height:17px;background:center/contain no-repeat}
body:not(.world-active) .top #day::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8d3a1' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 4v16M12 4a8 8 0 0 1 0 16z' fill='%23e8d3a1'/%3E%3C/svg%3E")}
body:not(.world-active) .top #mapBtn::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8d3a1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l6-3 6 3 6-3v15l-6 3-6-3-6 3zM9 3v15M15 6v15'/%3E%3C/svg%3E")}
body:not(.world-active) .top #settingsBtn::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8d3a1' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3Ccircle cx='9' cy='6' r='2' fill='%230b211c'/%3E%3Ccircle cx='16' cy='12' r='2' fill='%230b211c'/%3E%3Ccircle cx='8' cy='18' r='2' fill='%230b211c'/%3E%3C/svg%3E")}

body:not(.world-active) .top button:hover{background:#e5d2a024;color:#fff3d1}
body:not(.world-active) .top button:focus-visible{outline:3px solid var(--game-focus);outline-offset:-3px}

/* In-world controls retain the original hit areas and functionality. */
.world-active .app-dock{border-color:#dfcc9a78;background:#102822f5;box-shadow:0 12px 36px #0006}
.world-active .app-dock button{color:#f2eee1;font-weight:600;letter-spacing:.01em}
.world-active .app-dock button>span{color:#ead49e}
#exploreMenu .app-menu-grid button{border-radius:7px;background:#17352c;border-color:#91a89b85;color:#f5f0e4;text-align:left}
#exploreMenu .app-menu-grid button:hover{background:#294b3e;border-color:#dcc58e}
#exploreMenu .app-menu-grid button small{color:#cfddd2}

/* Existing company services remain clearly marked external links. */
#exploreMenu .app-company-links summary{min-height:44px;font-size:.875rem;line-height:1.5}
#exploreMenu .app-company-links p{font-size:.875rem;line-height:1.55}
#exploreMenu .app-company-links nav{display:grid;gap:8px;margin-top:10px}
#exploreMenu .app-company-links a{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:10px 12px;border:1px solid #91a89b85;border-radius:10px;background:#17352c;color:#f5f0e4;font-size:1rem;line-height:1.4;text-decoration:none}
#exploreMenu .app-company-links a span{font-size:.875rem;color:#cfddd2;text-align:right}
#exploreMenu .app-company-links a:hover{background:#294b3e;border-color:#dcc58e}
#exploreMenu .app-company-links :is(summary,a):focus-visible{outline:3px solid var(--game-focus);outline-offset:2px}
@media(max-width:350px){#exploreMenu .app-company-links a{flex-wrap:wrap}}

/* The office selector uses the same touch-sized, keyboard-visible controls. */
#officeOverviewToggle{flex:none;min-height:44px;padding:8px 12px;border:1px solid #d7c491;border-radius:10px;background:#d9c391;color:#142b22;font-size:.875rem;font-weight:700;white-space:nowrap}
#officeOverviewToggle:hover{background:#f1dfb3}
#officeOverviewToggle:focus-visible{outline:3px solid var(--game-focus);outline-offset:2px}
#officeFloors{width:min(520px,calc(100% - 32px));max-height:calc(100dvh - 32px);overflow-y:auto}
#officeFloors p{font-size:1rem;line-height:1.5}
#officeFloors .office-floor-view{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0 0;padding:0;border:0}
#officeFloors .office-floor-view[hidden]{display:none}
#officeFloors .office-floor-view legend{padding:0 0 6px;color:#e4ddc9;font-size:.875rem}
#officeFloors .office-floor-view label{display:flex;align-items:center;gap:7px;min-width:0;min-height:48px;padding:8px 10px;border:1px solid #a8b8a388;border-radius:10px;background:#17352c;color:#f6f0df;font-size:.9375rem;line-height:1.35;cursor:pointer}
#officeFloors .office-floor-view input{width:18px;height:18px;margin:0;accent-color:#e3cb93;flex:none}
#officeFloors .office-floor-view label:focus-within{outline:3px solid var(--game-focus);outline-offset:2px}
#officeFloors .office-floor-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:16px}
#officeFloors .office-floor-choices[hidden]{display:none}
#officeFloors .office-floor-choices button{display:grid;gap:4px;min-width:0;min-height:62px;padding:10px 12px;border:1px solid #a8b8a388;border-radius:10px;background:#17352c;color:#f6f0df;text-align:left}
#officeFloors .office-floor-choices button:hover{background:#294b3e;border-color:#dcc58e}
#officeFloors .office-floor-choices strong{font-size:1rem;line-height:1.35}
#officeFloors .office-floor-choices span{font-size:.875rem;color:#d4dfd3;line-height:1.35}
#officeFloors :is(button,a):focus-visible{outline:3px solid var(--game-focus);outline-offset:2px}
@media(max-width:350px){#officeFloors .office-floor-choices,#officeFloors .office-floor-view{grid-template-columns:1fr}}

/* Recoverable load warnings never cover the central game view. */
.asset-warning{position:fixed;z-index:9;right:max(16px,env(safe-area-inset-right,0px));top:calc(84px + env(safe-area-inset-top,0px));display:flex;align-items:center;gap:14px;width:min(365px,calc(100% - 32px));padding:10px 10px 10px 14px;background:#25362b;border:1px solid #dfc987;color:#f9f2df;box-shadow:0 8px 25px #0006;font-size:.875rem;line-height:1.5}
.asset-warning span{min-width:0;flex:1}
.asset-warning button{flex:none;min-height:44px;padding:8px 11px;border:1px solid #cbb887;background:#344a39;color:#fff4da;font-size:.875rem}

/* The 2D fallback is a normal document with a visible, expandable menu. */
body.no-webgl #welcome{position:relative;inset:auto;width:min(540px,calc(100% - 32px));max-width:none;max-height:none;overflow:visible;margin:calc(90px + env(safe-area-inset-top,0px)) auto 24px;padding:0}
body.no-webgl .welcome-primary{grid-template-columns:1fr}
@media(max-width:700px){
 body:not(.world-active) .world-header{flex-wrap:wrap;gap:5px 10px}
 body:not(.world-active) .top{width:100%;display:flex;gap:2px}
 body:not(.world-active) .top button{flex:1;min-width:0;min-height:44px;padding:8px 5px;font-size:.875rem;letter-spacing:0}
 #welcome{top:auto;right:max(16px,env(safe-area-inset-right,0px));bottom:max(14px,env(safe-area-inset-bottom,0px));left:max(16px,env(safe-area-inset-left,0px));width:auto;max-height:calc(100vh - 144px);max-height:min(50dvh,calc(100dvh - 144px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)))}
 .welcome-panel{padding:10px 12px 8px;border-radius:20px;box-shadow:0 8px 30px #0005}
 #welcome h1{font-size:1.4rem}
 .welcome-explore>summary{top:10px;right:12px}
 .welcome-primary{margin-top:4px}
 #welcome #enter{min-height:48px}
 .asset-warning{top:calc(130px + env(safe-area-inset-top,0px));right:12px;width:min(340px,calc(100% - 24px))}
 .world-active .asset-warning{top:calc(70px + env(safe-area-inset-top,0px))}
 body.no-webgl #welcome{margin-top:calc(138px + env(safe-area-inset-top,0px))}
}
@media(max-width:350px){body:not(.world-active) .top button:not([hidden]){gap:4px}body:not(.world-active) .top button::before{width:15px;height:15px}.welcome-routes{grid-template-columns:1fr}#welcome .welcome-host{grid-column:auto}.welcome-utilities{gap:2px 12px}}
@media(max-height:500px) and (max-width:700px){#welcome{max-height:calc(100vh - 144px);max-height:calc(100dvh - 144px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}.welcome-panel{padding:7px 12px 4px}.welcome-explore>summary{top:7px}.welcome-primary{margin-top:2px}#welcome h1{font-size:1.25rem}}
@media(max-height:560px) and (min-width:701px){#welcome{top:auto;bottom:12px;max-height:calc(100dvh - 88px)}.welcome-panel{padding:9px 14px 5px}.welcome-explore>summary{top:9px}}
@media(prefers-reduced-motion:reduce){#welcome button,#welcome a,#welcome summary,#welcome summary span,body:not(.world-active) .top button,.app-dock button{transition:none;scroll-behavior:auto}}

/* Keep the floor visible while viewing the overview. */
.office-overview #mobile,.office-overview #interact{visibility:hidden}
