/* The farm stays on screen; detailed management lives in accessible dialogs. */
body{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
.topbar{height:62px;min-height:62px;padding:0 24px}.brand{font-size:20px}.brand small{font-size:9px}.brand-mark{width:34px;height:34px}.top-note{display:none}
main{width:100%;max-width:1500px;min-height:0;flex:1;padding:12px 24px 0;display:flex;flex-direction:column}
.player-bar{flex-shrink:0;margin:0 0 10px;gap:24px}.player-level{max-width:none}.level-badge{width:40px;height:40px;font-size:25px}.balance strong,.mining-stat strong{font-size:25px}.xp-row{margin-top:3px}.xp-row>span{font-variant-numeric:tabular-nums}.xp-track{border:0;background:none;padding:6px 0;width:100%;display:block}.xp-track .progress{display:block;margin:0;height:6px}.overline{font-size:11px}
.game-layout{display:flex;flex:1;min-height:0;gap:0}.game-layout>.scene-panel{width:100%;display:flex;flex-direction:column;min-height:0;position:relative}.scene-title{margin:0 0 8px;flex-shrink:0}.scene-title h1{font-size:28px}.scene-title .overline{display:none}.location-caption{font-size:12px;max-width:none}.small-status{font-size:11px}.game-layout>.scene-panel>.room{flex:1 1 0;min-height:0;aspect-ratio:auto;background:#171820}.room-art{object-fit:cover;object-position:center 48%}.collect-bar{flex-shrink:0;padding:9px 14px;gap:10px;min-height:53px}.collect-bar strong{margin-top:3px;font-size:12px}.collect-bar .overline{font-size:10px}.collect-bar .primary{padding:10px 18px;font-size:13px}
#game-toolbar{display:flex;justify-content:center;gap:10px;padding:10px 0 max(10px,env(safe-area-inset-bottom));flex-shrink:0}#game-toolbar>button{display:flex;align-items:center;justify-content:center;gap:10px;min-height:48px;min-width:130px;background:#252832;border:1px solid #454956;color:#eeede5;font-size:14px;padding:10px 18px}#game-toolbar>button:hover{border-color:var(--lime);background:#30392e}#game-toolbar>button>span{font:22px var(--pixel);color:var(--lime)}
.tool-panel{width:min(780px,calc(100% - 32px));max-width:780px;max-height:85dvh;padding:22px;overscroll-behavior:contain}.tool-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}.tool-panel-heading h2{margin:0;font-size:28px}.tool-panel-heading button{flex-shrink:0}.tool-panel .panel{margin:0;padding:0;border:0;background:none}.tool-panel .panel>.section-heading{margin-bottom:16px}.tool-panel .shop-item{padding:16px 0}.tool-panel .shop-art{width:75px;height:65px}.tool-panel .buy-button{min-height:44px}.tool-panel .coin-wallet{grid-template-columns:repeat(2,minmax(0,1fr))}.tool-panel .exchange-row{align-items:stretch;flex-direction:column;margin-top:20px}.tool-panel .exchange-row button{min-height:48px}.tool-panel .helper-row{align-items:center}.tool-panel .pool-coins{grid-template-columns:1fr}.tool-panel .location-path{grid-template-columns:1fr;display:grid;margin-bottom:24px}.tool-panel .location-stop{border:0;border-bottom:1px solid var(--line);padding:14px}.tool-panel .next-location{padding:18px;background:#252a2a}.tool-panel .music-controls{flex-wrap:wrap;gap:14px}.tool-panel .music-controls input{width:100px}.tool-panel footer{font-size:12px;flex-direction:column}.more-menu{display:grid;grid-template-columns:1fr 1fr;gap:12px}.more-menu button{min-height:56px;text-align:left}.tool-panel .energy-actions button{min-height:44px}.tool-panel .shop-note{margin-top:15px}
.event-alert{position:absolute;top:46px;left:16px;z-index:6;border:1px solid var(--gold);background:#292416;color:var(--gold);padding:9px 14px;max-width:80%;text-align:left;font-size:13px}.bonus-note{border:1px solid #748950;background:#2c3428;padding:14px;line-height:1.6;font-size:14px}.level-list{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:0;list-style:none}.level-list li{border:1px solid var(--line);padding:12px;font-size:14px;line-height:1.6}.level-list li.current{border-color:var(--lime);color:var(--lime)}.level-list strong{display:block}.level-list small{display:block;color:var(--muted)}
.room>.miner-person{width:min(var(--person-size),24vh)!important;bottom:42%}.room[data-location=apartment]>.miner-person{left:18%;bottom:43%}.machines,.machines.large{top:42%;bottom:6%;left:12%;right:12%;gap:4px 12px;align-content:end}.rig-wrap{max-width:min(140px,19vh)}.large .rig-wrap{max-width:min(80px,11vh)}.machine-slot{min-height:0}.machine-slot.empty{min-height:36px;max-height:55px}.room>.miner-thought{top:10%;max-height:34%;overflow:auto;font-size:12px}.room-overlay{top:10px;left:12px;right:12px}.room-label{font-size:10px;padding:6px}.room-bottom{bottom:4px;font-size:9px}.room-bottom span:last-child{display:none}
@media(max-width:780px){.topbar{height:52px;min-height:52px;padding:0 12px;flex-wrap:nowrap}.brand{font-size:15px;gap:8px}.brand small{display:none}.brand-mark{width:28px;height:28px}.account-controls{width:auto;gap:6px}.account-controls .outline-button{max-width:100px;font-size:11px;padding:8px}.account-controls .icon-button{width:28px;height:28px}main{padding:10px 10px 0}.player-bar{gap:12px;flex-wrap:wrap;margin-bottom:8px}.player-level{flex-basis:100%;gap:10px}.level-badge{width:34px;height:34px}.balance,.mining-stat{display:flex;align-items:center;gap:7px}.balance{margin-right:auto}.balance strong,.mining-stat strong{margin:0;font-size:22px}.balance .overline,.mining-stat .overline{font-size:9px}.scene-title{margin-bottom:5px}.scene-title h1{font-size:25px}.location-caption>span:first-child{display:none}.location-caption{font-size:10px}.small-status{font-size:10px}.collect-bar{padding:8px 10px;flex-wrap:nowrap}.collect-bar .primary{font-size:12px;padding:10px}.collect-bar strong{font-size:11px;max-width:180px}.collect-bar .primary span{display:none}#game-toolbar{gap:5px;padding-top:8px}#game-toolbar>button{flex:1;min-width:0;flex-direction:column;gap:3px;padding:6px 2px;min-height:55px;font-size:11px}#game-toolbar>button>span{font-size:20px}.tool-panel{width:100%;max-width:none;max-height:88dvh;margin:auto 0 0;padding:20px 16px max(24px,env(safe-area-inset-bottom));border-bottom:0}.tool-panel-heading h2{font-size:27px}.tool-panel .section-heading h2{font-size:16px}.level-list{grid-template-columns:repeat(2,1fr)}.tool-panel .coin-box{padding:12px}.room-art{object-fit:cover}.room>.miner-person{left:8%;bottom:49%;width:32%!important;max-width:180px}.room[data-location=apartment]>.miner-person{left:10%;bottom:49%}.room>.miner-thought,.room[data-location=apartment]>.miner-thought{left:45%;width:52%;top:12%;font-size:11px;line-height:1.4}.machines{left:3%;right:3%;top:48%;bottom:7%}.machines.large{left:3%;right:3%;top:42%;bottom:6%;gap:3px}.rig-wrap{max-width:115px}.large .rig-wrap{max-width:60px}.large .machine-caption{font-size:9px;padding:2px}.large .rig-coin-readout strong{font-size:9px}.large .rig-earned{display:none}.large .machine-slot.empty{min-height:22px}.event-alert{top:38px;font-size:11px;left:8px}.room-label{font-size:8px}.room-overlay{top:6px}}
@media(max-height:560px) and (min-width:781px){.topbar{min-height:44px;height:44px}.brand small{display:none}main{padding-top:6px}.player-bar{margin-bottom:4px}.scene-title{display:none}.collect-bar{min-height:42px;padding:5px 12px}#game-toolbar{padding:5px}#game-toolbar>button{min-height:38px}.machine-caption .rig-earned{display:none}}

.donation-product{border:1px solid var(--line);padding:18px;margin-top:16px}.donation-product p{font-size:14px;line-height:1.6;color:var(--muted)}.donation-product strong{display:block;color:var(--gold);margin-bottom:14px}.donation-product button{width:100%}.donation-product select{display:block;width:100%;background:#171820;color:var(--text);border:1px solid var(--line);padding:12px;margin-top:8px;font:inherit}
@media(max-width:780px){.machines.large{grid-template-rows:repeat(4,minmax(0,1fr));align-content:stretch}.large .rig-wrap{height:55%;width:auto;flex-shrink:1}.large .machine-slot{min-height:0}.large .empty>span{font-size:18px}}
@media(max-height:500px) and (max-width:780px){.topbar{height:40px;min-height:40px}.player-bar{flex-wrap:nowrap}.player-level{flex-basis:auto}.player-name,.balance .overline,.mining-stat{display:none}.scene-title{display:none}.player-bar .overline{display:none}#game-toolbar>button{flex-direction:row;min-height:36px}.collect-bar{min-height:38px}.room>.miner-thought{display:none}}

/* Keep the scene sized inside the mobile column, even with absolutely positioned art. */
.game-layout>.scene-panel{flex:1 1 auto}
.room>.miner-thought{height:auto;max-height:none;overflow:visible;bottom:auto}
@media(max-width:780px){
 .game-layout{flex-direction:row}
 .game-layout>.scene-panel>.room{flex:0 0 auto;width:100%;height:auto;min-height:0;aspect-ratio:3/2}
 .room-art{object-fit:contain;object-position:center}
 .room>.miner-thought,.room[data-location=apartment]>.miner-thought{display:block;height:auto;max-height:none;overflow:visible;bottom:auto;padding:7px 9px}
 .player-bar{column-gap:10px;row-gap:6px}
 .balance,.mining-stat{flex-wrap:nowrap;white-space:nowrap}
 .balance .overline{display:none}
 .balance strong,.mining-stat strong{font-size:20px}
}
@media(max-height:500px) and (max-width:780px){
 body{height:auto;min-height:100dvh;overflow-y:auto}
 main{flex:none}
 .game-layout{flex:none}
 #game-toolbar{position:sticky;bottom:0;background:var(--bg);z-index:8}
}

.topbar .music-controls{display:flex;align-items:center;gap:8px;margin-right:10px}
.topbar .music-controls select{max-width:128px;font-size:12px;padding:8px}
.topbar .music-controls input{width:65px}
#game-toolbar>button[data-panel=donate]{border-color:#7b6740;color:var(--gold)}
#game-toolbar>button[data-panel=donate]>span{color:var(--gold)}
@media(max-width:780px){
 .topbar{height:auto;min-height:78px;display:grid;grid-template-columns:1fr;gap:6px;padding:8px 12px;flex-shrink:0}
 .topbar .brand{justify-self:start}
 .topbar .account-controls{width:100%;display:flex;justify-content:flex-end;gap:5px}
 .topbar .music-controls{margin-right:auto;gap:5px}
 .topbar .music-controls select{width:92px;max-width:92px;padding:6px;font-size:11px}
 .topbar .music-controls input{width:44px}
 .topbar .music-controls button{padding:6px;max-width:none}
 .topbar .account-controls>.outline-button{max-width:80px;padding:6px;font-size:10px}
 #game-toolbar{gap:4px}
 #game-toolbar>button{font-size:10px;padding:6px 1px}
}
@media(max-width:360px){.topbar .music-controls input{width:30px}.topbar .music-controls select{width:78px}.topbar .account-controls>.outline-button{max-width:64px}}

/* Scene layers: equipment in front of the seated miner. */
.room>.miner-person{z-index:2}.room>.machines{z-index:4}.room>.miner-thought{z-index:5}
.room-power{position:absolute;z-index:6;right:10px;bottom:6px;width:min(260px,65%);padding:6px 9px;background:#171d23ed;border:1px solid #768c5e;color:var(--lime);font-size:11px;text-align:left}.room-power span{display:block;white-space:nowrap}.room-power meter{display:block;width:100%;height:9px;margin-top:3px;accent-color:var(--lime)}.room-power[data-risk=near]{color:#ffd078;border-color:#ffd078}.room-power[data-risk=over]{color:#ff8c7c;border-color:#ff8c7c}.room-bottom{display:none}.machines .machine-caption{max-width:100%;min-width:0}.machine-caption [data-timer]{display:grid;grid-template-rows:auto auto;gap:3px;min-width:0}.machine-caption .rig-time,.machine-caption .rig-earned,.large .machine-caption .rig-earned{display:block;white-space:nowrap;font-size:inherit;line-height:1.2}.machine-caption>img{display:none}.machine-caption{font-size:clamp(7px,1.1vw,13px)!important;padding:5px!important}.donation-method{display:grid;gap:8px}.donation-method select{padding:10px;background:var(--bg);color:var(--lime);border:1px solid var(--line)}.payment-details{margin-top:16px}.payment-details code{display:block;overflow-wrap:anywhere;margin-top:8px}.payment-details span{display:block;margin-top:8px}
@media(max-width:780px){.room-power{font-size:9px;padding:4px 6px;bottom:3px;right:5px}.machine-caption{font-size:clamp(6px,1.65vw,11px)!important}.machines.large .machine-caption{font-size:clamp(4px,1.3vw,8px)!important;padding:2px!important}}

.boost-launch{position:absolute;z-index:7;right:12px;top:42%;display:flex;align-items:center;gap:8px;border:1px solid #bd9751;background:#292419ed;color:#f9d57f;padding:7px 10px;font-size:12px;box-shadow:3px 3px 0 #12141c}.boost-coin{position:relative;display:grid;place-items:center;width:28px;height:28px;border:2px solid #ffe0a0;border-radius:50%;background:#b17b28;color:#fff0b8;font-weight:bold;font-size:20px}.boost-coin i{position:absolute;right:-8px;top:-8px;font-style:normal;color:var(--lime);text-shadow:1px 1px #172016;animation:boost-rise 1.5s ease-in-out infinite}.pool-summary{display:grid;grid-template-columns:1.5fr repeat(3,1fr);gap:8px;width:100%;flex-shrink:0;text-align:left;border:1px solid var(--line);background:#20232b;color:var(--text);padding:8px 12px;margin-top:6px}.pool-summary span{min-width:0}.pool-summary b{display:block;font-size:11px}.pool-summary small{display:block;margin-top:3px;font-size:10px;color:var(--muted)}@keyframes boost-rise{50%{transform:translateY(-4px);filter:brightness(1.3)}}@media(max-width:780px){.boost-launch{right:6px;padding:5px;font-size:9px;gap:5px}.boost-coin{width:22px;height:22px;font-size:15px}.pool-summary{padding:6px;gap:4px;grid-template-columns:1.25fr repeat(3,1fr)}.pool-summary b{font-size:8px}.pool-summary small{font-size:8px}#game-toolbar>button{font-size:11px}}@media(prefers-reduced-motion:reduce){.boost-coin i{animation:none}}

.scene-events{position:absolute;z-index:7;right:12px;top:calc(42% + 57px);width:38px;height:38px;display:grid;place-items:center;border:1px solid #6f795c;background:#202820ed;color:var(--lime)}.scene-events svg{width:23px;height:23px;transform-origin:50% 10%}.scene-events.has-event svg{animation:bell-ring 2s ease-in-out infinite}.event-dot{display:none;position:absolute;right:4px;top:4px;width:7px;height:7px;border-radius:50%;background:#ff8c7c}.has-event .event-dot{display:block}@keyframes bell-ring{0%,40%,100%{transform:rotate(0)}10%,30%{transform:rotate(18deg)}20%{transform:rotate(-18deg)}}@media(max-width:780px){.scene-events{right:6px;top:calc(42% + 40px);width:30px;height:30px}.scene-events svg{width:20px;height:20px}}@media(prefers-reduced-motion:reduce){.scene-events.has-event svg{animation:none}}

.scene-panel>.room-power{position:relative;inset:auto;z-index:auto;flex-shrink:0;width:100%;margin:5px 0;padding:6px 10px;display:flex;align-items:center;gap:12px}.scene-panel>.room-power meter{flex:1;min-width:30px;margin:0;height:10px}.scene-panel>.room-power span{font-size:11px}.machines .rig-wrap{width:65%;max-width:min(110px,15vh)}.machines.large .rig-wrap{width:65%;max-width:min(65px,9vh)}.room>.miner-thought{font-size:10px!important;line-height:1.35!important;padding:6px 8px!important;width:clamp(150px,21vw,240px)}@media(max-width:780px){.machines .rig-wrap{max-width:82px;width:64%}.machines.large .rig-wrap{max-width:43px;width:60%}.room>.miner-thought,.room[data-location=apartment]>.miner-thought{font-size:9px!important;width:43%;left:48%;padding:5px 6px!important}.scene-panel>.room-power span{font-size:9px}.scene-panel>.room-power{gap:8px;padding:5px 7px}}

.pool-summary small{white-space:normal}.miner-person .miner-sprite{animation:none!important}

.room>.scene-events{top:10px;right:12px}.room-overlay{padding-right:48px}.pool-summary .pool-coin-label{display:flex;align-items:center;gap:4px;white-space:nowrap}.pool-coin-label img{width:16px;height:16px;object-fit:contain;flex-shrink:0}@media(max-width:780px){.room>.scene-events{top:6px;right:6px}.room-overlay{padding-right:34px}.pool-summary .pool-coin-label{gap:2px;font-size:8px}.pool-coin-label img{width:11px;height:11px}}

.room-rates{flex-shrink:0;display:flex;align-items:center;gap:18px;padding:5px 0 8px;margin-bottom:3px;font-size:11px;min-height:28px}.room-rate{display:flex;align-items:center;gap:5px;white-space:nowrap}.room-rate img{width:15px;height:15px}.room-rate b{font-weight:500}.room-rate>span{color:var(--gold);font-variant-numeric:tabular-nums}.room-rates>small{font-size:9px;color:var(--muted);margin-left:auto}@media(max-width:780px){.room-rates{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:3px 0 5px;margin-bottom:1px;font-size:8px}.room-rate{gap:3px;flex-wrap:wrap}.room-rate img{width:11px;height:11px}.room-rate>span{flex-basis:100%;padding-left:14px}.room-rates>small{grid-column:1/-1;font-size:7px;margin:0;text-align:right}}
.room>.scene-events{width:27px;height:27px;padding:0}.scene-events svg{width:20px;height:20px;animation:bell-nudge 5s ease-in-out infinite}.scene-events.has-event svg{animation:bell-ring 2s ease-in-out infinite}.room-overlay{padding-right:35px}@keyframes bell-nudge{0%,72%,100%{transform:rotate(0)}76%,84%{transform:rotate(14deg)}80%,88%{transform:rotate(-14deg)}92%{transform:rotate(0)}}@media(max-width:780px){.room>.scene-events{width:27px;height:27px}.room-overlay{padding-right:29px}}@media(prefers-reduced-motion:reduce){.scene-events svg{animation:none!important}}

.scene-events .event-dot{right:-7px;top:-7px;min-width:17px;width:auto;height:17px;padding:0 4px;border-radius:10px;background:#ef3946;color:#fff;border:1px solid #171820;font:600 10px/15px 'Golos Text',sans-serif;text-align:center;box-shadow:0 1px 3px #0006}.scene-events.has-event .event-dot{display:block}

.machines .machine-caption{box-sizing:border-box;max-width:100%;min-width:0;width:max-content;align-self:center}.machines .machine-caption [data-timer]{max-width:100%;min-width:0;width:100%}.machines .machine-caption .rig-time,.machines .machine-caption .rig-earned{min-width:0;white-space:nowrap;font-size:inherit}.scene-events .event-dot{top:-4px;right:-4px}

#game-toolbar .toolbar-picture{display:grid;place-items:center;width:28px;height:28px;flex-shrink:0;color:var(--lime)}#game-toolbar .toolbar-picture img,#game-toolbar .toolbar-picture svg{display:block;width:100%;height:100%;object-fit:contain}#game-toolbar .toolbar-picture img{image-rendering:pixelated}@media(max-width:780px){#game-toolbar .toolbar-picture{width:24px;height:24px}}
.machines .machine-slot .machine-caption,.machines .machine-slot.ready .machine-caption{background:transparent;border:0;box-shadow:none;padding:4px 0!important;text-shadow:0 1px 3px #000,1px 0 2px #000,-1px 0 2px #000}

/* Reserve toolbar height; only the game content can scroll. */
html{height:100%;overflow:hidden}body{height:100dvh;min-height:0;overflow:hidden}.topbar{flex-shrink:0}body>main{flex:1 1 0;min-height:0;overflow:hidden}.game-scroll{display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding-bottom:10px;scroll-padding-bottom:10px}.game-scroll>.player-bar,.game-scroll>.room-rates{flex-shrink:0}.game-scroll>.game-layout{flex:1 0 auto;min-height:400px}.game-scroll .scene-panel>.room{min-height:240px}#game-toolbar{position:relative;bottom:auto;z-index:20;isolation:isolate;flex:0 0 auto;margin:0;background:var(--bg);border-top:1px solid var(--line);box-shadow:0 -5px 12px #17182088}#game-toolbar>button{flex-shrink:0}@media(max-width:780px){.game-scroll>.game-layout{flex:0 0 auto;min-height:0}.game-scroll .scene-panel>.room{min-height:0;flex:0 0 auto;aspect-ratio:3/2}.game-scroll .scene-panel{flex:0 0 auto}#game-toolbar>button{flex:1 1 0;min-width:0}}
