/* Full-screen game surface. No document or panel scrolling. */
:root{--view-w:100vw;--view-h:100dvh;--safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px);--safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px)}
html{position:fixed;inset:0;overflow:hidden;overscroll-behavior:none;height:100%;width:100%;-webkit-text-size-adjust:100%}
body{position:fixed;left:0;top:0;width:100vw;max-width:100vw;height:min(var(--view-h),100dvh);overflow:hidden;overscroll-behavior:none;margin:0;touch-action:none}
body,input,button,select{-webkit-tap-highlight-color:transparent}input,select{font-size:16px!important}img{-webkit-user-drag:none;user-select:none}button{touch-action:manipulation}
.app,.welcome,.boot{position:absolute;inset:0;width:100%;height:100%;min-height:0;overflow:hidden}.app{display:block;background:transparent;isolation:isolate}.stage{position:absolute;inset:0;width:100%;height:100%;z-index:0;touch-action:none;background-size:cover}.world,.stage.focused .world{padding:56px calc(80px + var(--safe-r)) calc(48px + var(--safe-b)) calc(88px + var(--safe-l));transition:none}.building,.stage.focused .building{width:var(--building-width,70%);max-height:none;flex-shrink:0;transition:width .55s cubic-bezier(.2,.7,.3,1)}.floor,.stage.focused .floor{aspect-ratio:var(--room-ratio,3);min-height:0;flex-shrink:0}.roof,.stage.focused .roof{height:32px}.roof-sign{font-size:12px;padding:3px 20px;border-width:2px}.floors{border-width:5px;gap:4px}.foundation{height:8px}.lift-shaft,.food-shaft,.stage.focused .lift-shaft,.stage.focused .food-shaft{top:32px}
.topbar{position:absolute;left:calc(12px + var(--safe-l));right:calc(12px + var(--safe-r));top:calc(8px + var(--safe-t));height:40px;padding:0;gap:12px;border:0;background:none;pointer-events:none;z-index:10}.topbar button{pointer-events:auto}.brand{font-size:19px;color:#34462e;text-shadow:0 1px 7px #fff,0 0 16px #fff9}.topbar .chapter{display:none}.clock{padding:5px 10px;background:#fcf7e266;border-radius:20px;color:#3d4e32}.topbar .coins{font-size:17px;min-width:78px;padding:6px 12px;background:#fcf7e2c9;backdrop-filter:blur(5px);border:1px solid #fff9}.avatar-button{width:40px;height:40px;background:#fcf7e288;border:1px solid #fff9;box-shadow:0 2px 8px #20321a30}
.sidebar{position:absolute;left:calc(9px + var(--safe-l));top:calc(58px + var(--safe-t));bottom:calc(16px + var(--safe-b));width:66px;padding:0;gap:4px;z-index:10;border:0;background:none;overflow:hidden;max-height:414px;align-items:stretch;pointer-events:none}.nav[data-panel=world]{display:none}.nav{pointer-events:auto;width:100%;height:auto;min-height:44px;max-height:64px;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:3px;border:1px solid #fffa;border-radius:16px;background:#fff7dc55;backdrop-filter:blur(3px);box-shadow:0 2px 7px #2b3e3025;color:#354d2e;font-size:11px;font-weight:900;text-shadow:0 1px 3px #fff}.nav:hover,.nav.active{background:#fff6d8aa;border-color:#fff;box-shadow:0 2px 9px #26392038}.nav .nav-icon{display:block;width:27px;height:27px;font-size:24px;line-height:1}.nav-icon svg{width:100%;height:100%;stroke:currentColor;fill:none;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.badge{right:2px;top:-1px;background:#b16e44;border:1px solid #f9eacb;text-shadow:none;font-size:10px}
.footer{position:absolute;bottom:calc(6px + var(--safe-b));left:calc(90px + var(--safe-l));right:calc(12px + var(--safe-r));height:auto;min-height:0;padding:0;gap:8px;background:none;border:0;z-index:8;pointer-events:none;color:#30472d;font-size:10px;justify-content:flex-end;flex-wrap:nowrap}.footer .tip{display:none}.footer>span{background:#fff8e284;padding:3px 7px;border-radius:12px;backdrop-filter:blur(3px);text-shadow:0 1px 2px #fff}.footer>span:last-child{display:none}.stage .daylabel{top:calc(56px + var(--safe-t));left:calc(90px + var(--safe-l));font-size:10px;padding:4px 9px;background:#fff9e270;backdrop-filter:blur(3px);border:1px solid #fff6}.minimap{top:calc(58px + var(--safe-t));right:calc(10px + var(--safe-r));width:80px;padding:7px;background:#fff8e377;border:1px solid #fffb;backdrop-filter:blur(4px);border-radius:14px}.map-title{font-size:8px}.mini-floors{max-height:none;overflow:hidden;gap:3px}.mini-floor{height:25px;min-height:25px;background:#e9ecd28c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px}.map-add{min-height:32px;background:#f2dfaeaa;font-size:11px}.map-pages{display:flex;justify-content:space-between;gap:4px;margin-top:4px}.map-pages button{flex:1;min-height:30px;border-radius:8px;background:#fff8e488;font-size:18px}.back-view{left:calc(90px + var(--safe-l));top:calc(84px + var(--safe-t));padding:7px 12px;font-size:11px;background:#fff8e2b8;min-height:36px}
.floor-tools{bottom:calc(30px + var(--safe-b));max-width:calc(100% - 170px - var(--safe-l) - var(--safe-r));padding:4px;gap:5px;background:#fff9e58c;backdrop-filter:blur(4px);flex-wrap:nowrap}.floor-tools button{font-size:12px;padding:7px 10px;min-height:36px;background:#fbf5dfb0}.floor-name,.stage.focused .floor-name{font-size:10px;top:6px;left:7px}.floor-hint{font-size:9px;padding:3px 6px;bottom:5px}.floor-event{width:32px;height:32px;top:4px;right:6px;animation:none}.event-card,.stage.focused .event-card{bottom:calc(80px + var(--safe-b));left:calc(90px + var(--safe-l));width:min(430px,calc(100% - 190px - var(--safe-l) - var(--safe-r)));padding:12px 14px 12px 68px;border-radius:17px;background:#fff8e9ed}.event-card>img{width:75px;height:112px}.event-card h3{font-size:15px}.event-card p{font-size:12px;line-height:1.45;max-height:none;overflow:visible}.event-actions{margin-top:7px}.event-actions button{min-height:36px;padding:6px 10px}.portrait-note{display:none}
.actor.chef,.actor.waiter,.actor.guest,.steam{animation:none!important}.actor.chef{transform:none;left:18%}.actor.idle{opacity:0!important}.actor.walk-sprite{height:59%;width:auto;aspect-ratio:1;left:30%;bottom:7%;transform:translateX(-50%);transition:opacity .35s;filter:drop-shadow(0 3px 2px #51472a32);will-change:left}.walk-frames{display:block;width:100%;height:100%;background:url('./assets/waiter-walk-v03.webp') 0 0/800% 100% no-repeat;transform-origin:50% 92%;will-change:background-position,transform}.actor.chef{height:50%;bottom:8%}.actor.guest{height:37%}.dish{bottom:14%}.steam{opacity:.6}
.shade{position:absolute;inset:0;touch-action:none}.panel{position:absolute;top:calc(8px + var(--safe-t));bottom:calc(8px + var(--safe-b));left:calc(82px + var(--safe-l));right:calc(12px + var(--safe-r));width:auto;max-width:960px;border-radius:22px;overflow:hidden;touch-action:none}.panel-head{padding:10px 18px;flex:none;min-height:52px}.panel-head h2{font-size:21px;margin:0}.panel-head .eyebrow{font-size:9px}.panel-body{padding:10px 18px;flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;gap:8px}.panel-body>.tabs{flex:none;margin:0;gap:6px}.tabs button{min-height:34px;padding:6px 12px}.panel-pages{position:relative;flex:1;min-height:0;overflow:hidden}.panel-page{height:100%;overflow:hidden;display:flex;flex-direction:column;gap:8px}.panel-page .cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-content:start}.panel-page .card{min-width:0;padding:12px;overflow-wrap:anywhere}.panel-page .card h3{font-size:17px}.panel-page .card p{font-size:12px;line-height:1.45;margin-bottom:6px}.panel-page .card .portrait{height:66px;width:62px;margin:-2px 0 3px 7px}.panel-page .card .meta{font-size:11px;margin:3px 0}.panel-page .card button{min-height:38px;padding:7px 10px;font-size:12px;margin:6px 4px 0 0}.panel-page .note{padding:12px;font-size:13px;line-height:1.5;margin:0}.panel-page .letter{font-size:13px;line-height:1.55;padding:15px;margin:0}.panel-page .empty{padding:8px 0;margin:0;font-size:13px}.panel-page .setting{padding:10px 0}.panel-page .actions{margin:0;gap:8px}.panel-pager{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 18px 9px;border-top:1px solid #ddd9c680;flex:none;min-height:46px}.panel-pager button{min-width:74px;min-height:36px;padding:6px 12px;border-radius:12px;background:#e3e8d3;font-weight:800}.panel-page-label{font-size:12px;color:#748064}.panel-pages .card.continued .portrait{display:none}.close{width:38px;height:38px;flex-shrink:0}.toast{position:absolute;top:calc(48px + var(--safe-t));max-width:65%;padding:9px 16px;font-size:12px;pointer-events:none}.welcome{padding:12px;touch-action:manipulation}.welcome-card{max-height:100%;padding:20px 28px}.welcome input{font-size:16px!important}.welcome .primary{min-height:42px}.keyboard-open .welcome-card{display:block;width:min(500px,90%);padding:12px 24px}.keyboard-open .welcome-card>img,.keyboard-open .welcome-card .eyebrow,.keyboard-open .welcome-card h1,.keyboard-open .welcome-card p,.keyboard-open .welcome-card small,.keyboard-open #welcome-import{display:none}.keyboard-open .welcome form{margin:0;gap:6px}
@media(max-height:500px) and (orientation:landscape){.brand{font-size:16px}.topbar{height:36px;top:calc(7px + var(--safe-t))}.topbar .clock{font-size:10px}.topbar .coins{font-size:15px;padding:5px 10px}.avatar-button{height:36px;width:36px}.sidebar{top:calc(47px + var(--safe-t));bottom:calc(8px + var(--safe-b));gap:3px;width:60px}.nav{min-height:44px;max-height:52px;border-radius:13px;font-size:10px}.nav .nav-icon{width:24px;height:24px}.world,.stage.focused .world{padding:45px calc(80px + var(--safe-r)) calc(42px + var(--safe-b)) calc(82px + var(--safe-l))}.minimap{top:calc(48px + var(--safe-t));width:74px}.stage .daylabel{top:calc(46px + var(--safe-t));left:calc(82px + var(--safe-l))}.back-view{top:calc(70px + var(--safe-t));left:calc(82px + var(--safe-l));padding:5px 9px;font-size:10px}.floor-tools{bottom:calc(22px + var(--safe-b));max-width:calc(100% - 160px - var(--safe-l) - var(--safe-r));gap:3px}.floor-tools button{font-size:11px;padding:5px 8px;min-height:34px}.footer{font-size:9px;bottom:calc(3px + var(--safe-b))}.footer>span{padding:1px 6px}.event-card,.stage.focused .event-card{bottom:calc(68px + var(--safe-b));padding:10px 12px 10px 62px}.event-card p{font-size:11px}.event-card h3{font-size:14px}.event-card>img{height:98px;width:66px}.event-actions button{min-height:32px;font-size:11px}.panel-head{min-height:47px;padding:6px 14px}.panel-head h2{font-size:19px}.panel-head .eyebrow{display:none}.panel-body{padding:7px 14px;gap:6px}.panel-pager{padding:4px 14px 6px;min-height:42px}.panel-page .card{padding:10px}.panel-page .card .portrait{height:58px;width:55px}.panel-page .card h3{font-size:15px}.panel-page .card p{font-size:11px}.panel-page .card .meta{font-size:10px}.panel-page .card button{min-height:36px;font-size:11px;padding:6px 9px}.panel-page .recipe-icon{font-size:24px;margin-bottom:5px}}
@media(max-height:350px) and (orientation:landscape){.sidebar{width:118px;display:grid;grid-template-columns:repeat(2,56px);grid-template-rows:repeat(3,1fr);bottom:calc(15px + var(--safe-b));gap:5px}.nav{max-height:64px;height:100%;width:56px}.world,.stage.focused .world{padding-left:calc(136px + var(--safe-l))}.panel{left:calc(132px + var(--safe-l))}.stage .daylabel,.back-view{left:calc(137px + var(--safe-l))}.event-card,.stage.focused .event-card{left:calc(138px + var(--safe-l));width:calc(100% - 235px - var(--safe-l) - var(--safe-r))}}
@media(orientation:portrait){.brand{font-size:15px}.topbar .clock{display:none}.topbar .coins{font-size:14px;min-width:65px}.sidebar{width:58px;top:calc(90px + var(--safe-t));bottom:calc(60px + var(--safe-b));gap:8px;max-height:410px}.nav{font-size:10px}.world,.stage.focused .world{padding:100px calc(32px + var(--safe-r)) calc(90px + var(--safe-b)) calc(72px + var(--safe-l))}.minimap{width:63px;top:calc(58px + var(--safe-t));right:calc(7px + var(--safe-r));padding:5px}.map-title{font-size:7px}.map-add{font-size:9px}.mini-floor{font-size:9px}.stage .daylabel{left:calc(77px + var(--safe-l));top:calc(56px + var(--safe-t));max-width:170px}.back-view{left:calc(77px + var(--safe-l));top:calc(83px + var(--safe-t));font-size:10px}.floor-tools{max-width:calc(100% - 70px);left:calc(50% + 20px);white-space:normal;bottom:calc(39px + var(--safe-b));flex-wrap:wrap;justify-content:center}.floor-tools button{font-size:10px;min-height:36px}.footer{left:calc(70px + var(--safe-l));gap:4px;font-size:8px}.event-card,.stage.focused .event-card{left:calc(73px + var(--safe-l));width:calc(100% - 86px - var(--safe-l) - var(--safe-r));bottom:calc(116px + var(--safe-b));padding:12px 12px 12px 49px}.event-card>img{width:52px;height:85px}.event-card p{font-size:11px}.event-card h3{font-size:14px}.event-actions{gap:3px;flex-wrap:wrap}.event-actions button{font-size:10px;padding:6px 7px}.panel{left:calc(8px + var(--safe-l));right:calc(8px + var(--safe-r));top:calc(8px + var(--safe-t));bottom:calc(8px + var(--safe-b));border-radius:18px}.panel-body{padding:10px 14px}.panel-page .cards{grid-template-columns:1fr}.panel-page .card .portrait{height:82px;width:76px}.panel-head h2{font-size:20px}.welcome-card{padding:18px 24px}.welcome-card>img{height:110px}.welcome-card h1{font-size:28px}}
@media(prefers-reduced-motion:reduce){.building,.walk-frames,.actor{transition:none!important;animation:none!important}}
