/* Authoritative HUD layout. All controls live in one frame and use explicit cells. */
#hud{position:absolute;left:24px;right:24px;top:18px;height:95px;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr) minmax(0,1fr) 74px;grid-template-rows:54px 25px;grid-template-areas:"identity money clock controls" "agenda agenda agenda agenda";gap:2px 10px;align-content:center;padding:4px 12px;box-sizing:border-box;overflow:hidden}
#hud #identity{grid-area:identity;display:flex;align-items:center;gap:9px;height:54px;width:auto;min-width:0;max-width:none;padding:0 8px;margin:0;flex:none;text-align:left;overflow:hidden}
#hud #portrait{width:43px;height:52px;flex:0 0 43px;object-fit:contain;margin:0}
#hud #identity>span{display:flex;flex-direction:column;justify-content:center;gap:1px;min-width:0;flex:1}
#hud #identity strong{display:block;max-width:100%;font-size:21px;line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}
#hud #reputation{display:block;font-size:10px;line-height:11px;margin:0;white-space:nowrap}
#hud .level-row{display:flex;align-items:center;gap:6px;height:12px;margin:0;min-width:0}
#hud #level,#hud #xpText{font-size:9px;line-height:11px;white-space:nowrap;padding:0;flex-shrink:0}
#hud .level-row>i{flex:1;max-width:160px;min-width:30px;height:5px;margin:0}
#hud .money{grid-area:money;display:grid;grid-template-columns:25px minmax(0,1fr);grid-template-rows:34px 13px;align-content:center;align-items:center;gap:0 5px;height:54px;width:auto;min-width:0;max-width:none;padding:0 10px;margin:0;flex:none}
#hud .money>span{grid-column:1;grid-row:1;font-size:22px;line-height:25px;padding:0;margin:0}
#hud #cash{grid-column:2;grid-row:1;font-size:31px;line-height:34px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;letter-spacing:-.4px}
#hud #income{grid-column:1/3;grid-row:2;font-size:10px;line-height:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;text-align:center}
#hud .clock{grid-area:clock;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:27px 16px;align-content:center;align-items:center;gap:0 10px;height:54px;width:auto;min-width:0;max-width:none;padding:0 8px;margin:0;flex:none}
#hud #week{display:flex;align-items:center;justify-content:flex-start;gap:3px;grid-column:1;grid-row:1;min-width:0;margin:0}
#hud #week span{width:22px;min-width:22px;height:19px;line-height:19px;font-size:10px;text-align:center;margin:0;padding:0;box-sizing:border-box}
#hud #clock{grid-column:2;grid-row:1;font-size:24px;line-height:27px;margin:0;white-space:nowrap}
#hud #day{grid-column:1/3;grid-row:2;font-size:10px;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}
#hudControls{grid-area:controls;display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;height:54px}
#hud #hudControls #fullscreen,#hud #hudControls #pauseButton{position:static;width:31px;height:31px;min-height:31px;min-width:31px;max-width:31px;margin:0;padding:0;flex:0 0 31px;font-size:20px;line-height:27px;box-sizing:border-box;translate:none}
#hud #firmAgenda{grid-area:agenda;position:static;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;height:25px;width:auto;min-width:0;padding:0;margin:0;border:0;background:transparent;box-shadow:none;overflow:hidden;flex:none}
#hud #agendaTasks{display:flex;align-items:center;gap:7px;min-width:0;height:25px;overflow:hidden;white-space:nowrap}
#hud .agenda-label{font-size:10px;line-height:18px;gap:4px;margin:0 3px 0 0;flex-shrink:0}
#hud .agenda-chip{display:flex;align-items:center;justify-content:center;gap:4px;height:23px;min-height:23px;min-width:0;max-width:280px;flex:0 1 auto;padding:2px 7px;margin:0;font-size:10px;line-height:15px;box-sizing:border-box;overflow:hidden}
#hud .agenda-chip>span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#hud .game-icon{width:14px;height:14px;margin:0;flex-shrink:0}
#hud #firmAgenda #status{position:static;display:flex;align-items:center;justify-content:flex-end;gap:8px;width:auto;min-width:0;max-width:390px;height:25px;padding:0;margin:0;border:0;background:transparent;box-shadow:none;font-size:10px;line-height:14px;white-space:nowrap;overflow:hidden}
.hud-energy{display:flex;align-items:center;gap:5px;white-space:nowrap}.hud-energy .energy-track{width:58px;height:8px}.hud-skip{min-height:22px;font-size:10px;padding:2px 7px;white-space:nowrap;background:#e8dbb4;border:1px solid #b5a475;border-radius:6px;color:#665a39;box-sizing:border-box}
body.portrait #hud{height:225px;left:20px;right:20px;top:18px;padding:9px;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 51px;grid-template-rows:72px 59px 60px;grid-template-areas:"identity identity controls" "money clock controls" "agenda agenda agenda";gap:5px 8px;align-content:center}
body.portrait #hud #identity{height:72px;grid-area:identity;padding:0 7px}body.portrait #hud #portrait{height:69px;width:55px;flex-basis:55px}body.portrait #hud #identity strong{font-size:27px;line-height:29px}body.portrait #hud #reputation{font-size:14px;line-height:15px}body.portrait #hud #level,body.portrait #hud #xpText{font-size:12px;line-height:14px}body.portrait #hud .level-row{height:15px}body.portrait #hud .money,body.portrait #hud .clock{height:59px;padding:0 7px}body.portrait #hud #cash{font-size:29px;line-height:32px}body.portrait #hud #income{font-size:12px;line-height:14px}body.portrait #hud #clock{font-size:25px;line-height:29px}body.portrait #hud #day{font-size:12px;line-height:15px}body.portrait #hud #week span{width:23px;min-width:23px;font-size:12px;height:23px;line-height:23px}
body.portrait #hudControls{height:100%;flex-direction:column;justify-content:flex-start;padding-top:4px}body.portrait #hud #hudControls #fullscreen{display:none}body.portrait #hud #hudControls #pauseButton{width:43px;height:43px;min-width:43px;max-width:43px;flex-basis:43px;line-height:40px;font-size:27px}
body.portrait #hud #firmAgenda{grid-area:agenda;grid-template-columns:minmax(0,1fr);grid-template-rows:30px 22px;height:60px;width:auto;padding:0;gap:3px}body.portrait #hud #agendaTasks{height:30px;flex-wrap:nowrap;gap:6px}body.portrait #hud .agenda-label{font-size:13px}body.portrait #hud .agenda-chip{font-size:14px;line-height:20px;height:29px;min-height:29px;max-width:400px;padding:3px 7px}body.portrait #hud #firmAgenda #status{height:22px;max-width:none;justify-content:flex-start;font-size:13px;line-height:20px}body.portrait #hud .game-icon{width:17px;height:17px}body.portrait #hud .hud-skip{font-size:13px;min-height:22px}
#hud #income{position:static;grid-column:2;grid-row:2;justify-self:start;text-align:left}#hud #week span{font-size:11px}#hud .agenda-chip{font-size:11px}#hud .agenda-label,#hud #firmAgenda #status{font-size:11px}body.portrait #hud .agenda-chip{font-size:14px}body.portrait #hud .agenda-label,body.portrait #hud #firmAgenda #status{font-size:13px}

#game #hud .money #oreStocks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 4px;grid-column:2;grid-row:1 / 4;margin-left:3px;padding-left:5px;border-left:1px solid #9b8756;align-content:center}
#oreStocks span{display:flex;align-items:center;gap:2px;min-width:0;padding:1px 2px;background:#142a21;border-radius:3px;color:#fff0ca}
#oreStocks img{width:16px;height:16px;flex:none;image-rendering:pixelated}
#oreStocks b{font:700 12px/1.15 TD Pixel,monospace;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
body.phone #oreStocks b{font-size:10px}
