/* Shared layout for /, /play and X's /embed. Input type is independent of width. */
html,body{min-width:0;min-height:0}
#start{overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}
#world:focus{outline:none}
.embedMouseHelp{display:none;position:fixed;left:8px;bottom:8px;margin:0;max-width:calc(100% - 16px);z-index:35;pointer-events:auto;padding:4px 6px;background:#132521bc;color:#f6f1df;font:10px/1.4 system-ui,sans-serif}
@media(hover:hover) and (pointer:fine){
 #hud #joystick,#hud .gameActions{display:none!important;pointer-events:none!important}
 body.game-embed.playing:not(.ui-open):not(.pointer-locked) .embedMouseHelp{display:block}
}
/* Short windows keep the desktop composition, including every home button. */
@media(min-width:480px) and (max-height:600px){
 #start.tweetpumpHome{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:12px 18px!important;gap:8px;min-height:0;height:100dvh}
 #start.tweetpumpHome .startCard{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(220px,1fr);align-items:center;gap:24px;width:100%!important;max-width:920px!important;margin:auto!important;padding:0!important;text-align:left}
 #start .homeIdentity,#start .homeConsole{min-width:0;width:100%}
 #start.tweetpumpHome .homeIdentity h1{font-size:clamp(24px,4.8vw,46px)!important;line-height:1.4!important;letter-spacing:-1px;margin:0 0 14px!important;-webkit-text-stroke:.6px #fff0cf;text-shadow:0 2px #9b7657,0 4px #604734,0 5px #2c2822!important}
 #start.tweetpumpHome .homeTagline{font-size:clamp(15px,2.5vw,25px)!important;line-height:1.3;margin:0 0 12px!important;letter-spacing:0}
 #start .homeFeatures{font-size:5px;gap:6px;justify-content:flex-start;padding:8px 0;letter-spacing:0}
 #start .homeIntro,#start .homeFooter{display:none!important}
 #start .homeConsole{padding:12px!important;text-align:left}
 #start .consoleHeading{font-size:7px;margin:0 0 8px;padding:0 0 8px;line-height:1.5}
 #start.tweetpumpHome .homeName{font-size:7px;margin:0 0 8px!important}
 #start.tweetpumpHome .homeName input{min-height:30px;height:30px;padding:6px 8px;font-size:10px;margin-top:4px}
 #start.tweetpumpHome .homeButtons{display:grid;gap:6px;margin:0}
 #start.tweetpumpHome .homeButtons button{min-height:32px;padding:7px 6px;font-size:8px!important;line-height:1.5}
 #start.tweetpumpHome .homeHelp{margin-top:8px}
 #start.tweetpumpHome .homeHelp summary{display:flex;align-items:center;justify-content:center;text-align:center;min-height:32px;padding:7px 22px;font-size:8px;line-height:1.5}
 #start.tweetpumpHome .homeHelp p{font:10px/1.5 system-ui,sans-serif!important;margin:5px 0!important}
 #start.tweetpumpHome #startStatus{font-size:10px;min-height:0;margin:6px 0 0}
 #start:has(.homeHelp[open]){justify-content:flex-start}
}
@media(max-width:479px){
 #start.tweetpumpHome{min-height:0;height:100dvh;padding:18px 14px!important;overflow:auto}
 #start.tweetpumpHome .startCard{gap:18px;margin:0 auto!important}
 #start.tweetpumpHome .homeIdentity h1{font-size:clamp(26px,9vw,38px)!important}
 #start .homeConsole{padding:16px!important}
}
/* Keep the world visible in a short card: proportional hand, compact HUD. */
@media(max-height:600px){
 #hud .topbar{padding:6px!important;gap:6px!important;font-size:8px!important;min-height:30px}
 #hud .topbar strong{font-size:9px!important}
 #hud #online,#hud #fps{font-size:7px!important}
 #hud #menuBtn{padding:6px!important;font-size:7px!important;min-height:24px}
 #hud .topActions{top:38px!important;right:6px!important;gap:4px!important}
 #hud .topActions button{min-width:0!important;padding:6px!important;font-size:7px!important;min-height:26px}
 #handOverlay{--arm-width:clamp(72px,min(20vw,38vh),190px);width:var(--arm-width)!important;height:calc(var(--arm-width)*1.16)!important;right:1vw!important;bottom:calc(var(--arm-width)*-.2)!important;z-index:6!important;filter:drop-shadow(3px 4px #0003)!important}
 #hud .bottom{bottom:6px!important;width:min(62vw,320px)!important;z-index:30!important;gap:3px}
 #hud #hotbar{width:100%!important;min-width:0!important;padding:2px!important;gap:2px!important}
 #hud #hotbar .slot{width:100%!important;min-width:0!important;height:auto!important;max-height:32px!important;aspect-ratio:1/1;padding:0!important;border-width:2px!important}
 #hud #hotbar .slotNum,#hud #hotbar .slotCount{font-size:5px!important}
 #hud #hotbar .slotIcon{font-size:13px!important}
 #hud #vitals{gap:6px;padding:0!important}
 #hud #hearts,#hud #food{width:104px!important;height:14px!important;background-size:contain!important}
 #hud #contextHint{top:auto!important;bottom:66px!important;font-size:7px!important;max-width:66%;padding:4px!important}
 #hud #craftPrompt{bottom:68px!important;font-size:7px!important;padding:7px!important;min-width:0!important;max-width:80%}
 #hud #chatPreview{bottom:64px!important;max-width:34vw!important;max-height:35px!important;font-size:7px!important;padding:3px!important}
 #hud #chatPreview:empty{display:none!important}
 #toast{position:fixed!important;top:72px!important;font-size:9px!important;max-width:85%;padding:6px!important;z-index:120}
 #spawnPopup .mcPopupInner{max-height:calc(100dvh - 24px);padding:16px!important}
 #spawnPopup h2{font-size:17px!important;margin-bottom:10px!important}
 #spawnPopup p{font-size:10px!important;margin-bottom:8px!important}
 #spawnPopup small{font-size:12px!important;line-height:1.4;margin-bottom:12px!important}
 #spawnPopup #stayBtn{min-height:34px;font-size:9px;padding:8px}
 body .panel,body #inventoryPanel.mcInventory,body #craftPanel.forgePanel,body #marketPanel.discoverPanel,body #menuPanel,body #settingsPanel{
  top:8px!important;bottom:auto!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important;
  max-height:calc(100dvh - 16px)!important;min-height:0!important;width:min(94vw,480px)!important;overflow:auto!important;padding:10px!important;overscroll-behavior:contain;
 }
 body .panel header{font-size:12px!important;min-height:28px!important;margin-bottom:8px!important;padding:0 0 6px!important}
 body .panel header button{min-height:26px!important;min-width:26px!important;font-size:14px!important;padding:3px!important}
 #inventoryPanel .invWrap{grid-template-columns:140px minmax(0,1fr)!important;gap:8px!important;margin-bottom:6px!important}
 #inventoryPanel .playerCard,#inventoryPanel .craftCard{min-height:110px!important;padding:5px!important}
 #inventoryPanel .playerPreview{height:108px!important}
 #inventoryPanel .inventoryGrid,#inventoryPanel .inventoryHotbar{grid-template-columns:repeat(9,minmax(0,1fr))!important;gap:3px!important}
 #inventoryPanel .item{min-height:25px!important;height:25px!important}
 #inventoryPanel .storageLabel{font-size:7px;margin:6px 0}
 #inventoryPanel small{font-size:7px!important;line-height:1.5!important}
 #chatPanel .chatLog{height:clamp(70px,40vh,160px)}
 #marketPanel .discoverIntro{padding:8px 0;gap:8px}
 #marketPanel .discoverIntro h2{font-size:20px!important}
 #marketPanel .discoverIntro p{font-size:11px!important;margin:5px 0}
}
@media(hover:hover) and (pointer:fine) and (max-height:600px){
 #hud .topActions{top:6px!important;right:6px!important}
 #hud .topbar{padding-right:220px!important}
 #hud #contextHint{bottom:65px!important}
}
@media(max-width:479px) and (max-height:600px){
 #hud .topActions{top:36px!important}
 #hud .topbar{padding-right:6px!important}
 #start.tweetpumpHome .homeIdentity h1{font-size:24px!important;line-height:1.25;margin-bottom:8px!important}
 #start .homeTagline,#start .homeFeatures,#start .homeIntro,#start .homeFooter{display:none!important}
 #start.tweetpumpHome .startCard{gap:12px;padding:0!important}
 #start .homeConsole{padding:10px!important}
 #start .consoleHeading{display:none}
 #start.tweetpumpHome .homeName{margin-bottom:8px!important}
 #start.tweetpumpHome .homeButtons button{min-height:32px;padding:8px;font-size:9px!important}
 #start .homeHelp{margin-top:6px}
 #start.tweetpumpHome .homeHelp summary{min-height:28px;padding:7px;font-size:7px}
}

/* Give every header label its own space when the card is narrower than a desktop. */
@media(max-width:699px) and (max-height:600px){
 #hud .topbar{padding-right:6px!important;flex-wrap:nowrap}
 #hud .topbar>*{flex-shrink:0}
 #hud #fps{min-width:48px;text-align:right}
 #hud .topActions{top:40px!important;right:6px!important}
 #hud .topActions button{min-height:26px!important}
}
#start.tweetpumpHome .homeHelp summary{display:flex;align-items:center;justify-content:center;text-align:center}
.embedMouseHelp a{display:block;margin-top:4px;color:#fff;text-decoration:underline;font-weight:700;pointer-events:auto}
.embedMouseHelp a[hidden]{display:none}

/* Keep the native pointer visible while playing inside X. */
body.game-embed #world{cursor:default!important}
