/* Layout de jeu compact pour téléphone, y compris l'app ajoutée à l'écran d'accueil. */
@media(max-width:700px){
  .home-shell{padding:max(16px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}
  .brand{font-size:11px}.brand-mark{font-size:27px}.edition{font-size:7px}
  .home-grid{gap:0;min-height:0}.intro{padding-top:14px;min-height:205px}
  .intro h1{font-size:clamp(36px,10vw,42px);letter-spacing:-2px;margin:10px 0 15px}
  .intro .eyebrow{font-size:7px}.intro .lead{font-size:11px;line-height:1.5;max-width:61%;margin:0}
  .intro .quiet{display:none}.intro .landscape{width:40%;bottom:8px;right:0}
  .menu-card{padding:18px}.card-heading{margin-bottom:7px}.menu-card h2{font-size:21px;margin-bottom:12px}
  .menu-card label{margin-top:12px}.menu-card #rename-world:disabled{display:none}
  .home-footer{margin-top:15px}
  .adventure-tabs{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:thin;padding-bottom:6px}
  .adventure-tabs button{flex:0 0 auto;min-width:95px;scroll-snap-align:start}
}
@media(max-width:900px){
  #context-inventories,#save,.topbar .title-pill,#rotate-hint{display:none!important}
  .topbar{left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));gap:8px}
  .topbar button{font-size:12px;padding:9px 13px;min-height:44px}
  #adventure-open{margin-left:auto}
  #palette{bottom:max(12px,calc(env(safe-area-inset-bottom) + 8px));gap:3px;padding:4px;border-radius:13px;max-width:calc(100% - 20px)}
  #palette button{font-size:0!important;min-width:37px;max-width:37px;width:37px;min-height:43px;height:43px;padding:4px 2px}
  #palette .swatch{width:24px;height:24px;margin:0 auto}
  #palette button:last-child{font-size:19px!important;min-width:36px;max-width:36px}
  #survival{left:max(12px,env(safe-area-inset-left));top:max(66px,calc(env(safe-area-inset-top) + 54px))}
  #compass{top:max(66px,calc(env(safe-area-inset-top) + 54px));max-width:55%;min-height:38px}
  #game-tip{top:max(111px,calc(env(safe-area-inset-top) + 100px));max-width:80%;font-size:10px;padding:7px 10px}
  #power-status{top:max(111px,calc(env(safe-area-inset-top) + 100px))}
  #interact{bottom:max(83px,calc(env(safe-area-inset-bottom) + 73px));max-width:70%}
  #save-status{bottom:max(2px,calc(env(safe-area-inset-bottom) - 3px));font-size:8px}
}
@media(max-width:900px) and (orientation:portrait){
  #compass{left:auto;right:max(12px,env(safe-area-inset-right));transform:none;max-width:61%}
  #compass:active{transform:none}
  #game-tip{top:max(117px,calc(env(safe-area-inset-top) + 106px))}
  #power-status{top:max(167px,calc(env(safe-area-inset-top) + 156px));right:max(12px,env(safe-area-inset-right))}
  #move-pad{left:max(16px,env(safe-area-inset-left));bottom:max(101px,calc(env(safe-area-inset-bottom) + 83px));width:102px;height:102px}
  #stick{left:26px;top:26px}
  .actions{right:max(16px,env(safe-area-inset-right));bottom:max(101px,calc(env(safe-area-inset-bottom) + 83px));grid-template-columns:57px 57px;gap:7px}
  .actions button{height:55px;font-size:24px;border-radius:15px}
  .actions small{font-size:9px}
  #interact{bottom:calc(50% - 58px)}
}
@media(max-width:900px) and (orientation:landscape){
  #game-tip{top:max(108px,calc(env(safe-area-inset-top) + 98px));max-width:55%}
  #power-status{right:max(12px,env(safe-area-inset-right))}
  #move-pad{left:max(16px,env(safe-area-inset-left));bottom:max(20px,calc(env(safe-area-inset-bottom) + 10px))}
  .actions{right:max(16px,env(safe-area-inset-right));bottom:max(20px,calc(env(safe-area-inset-bottom) + 10px))}
}
@media(max-height:500px) and (orientation:landscape){
  .menu-card{padding:14px}.menu-card h2{margin-bottom:7px}
  .menu-card label{margin-top:7px}.menu-card .detail{margin:4px 0}
  .menu-card .wide{margin-top:5px;min-height:42px}
  .menu-card #rename-world:disabled{display:none}
}
@media(display-mode:standalone){
  body.playing{height:100dvh}
  #hud{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
}
