/* Native Android: preserve the square board and use the landscape screen efficiently. */
.android-app,.android-app body{width:100%;min-height:100%;overflow-x:hidden}
@media (orientation:landscape){
  .android-app .welcome{width:100%!important;max-width:100%!important;min-height:100dvh;padding:8px max(14px,env(safe-area-inset-right)) 8px max(14px,env(safe-area-inset-left))!important;box-sizing:border-box}
  .android-app .welcome-head{display:grid!important;grid-template-columns:150px minmax(300px,1fr) 185px!important;gap:10px!important;align-items:center!important;padding:2px 0 8px!important}
  .android-app .welcome-head>div:first-child{min-width:0!important}
  .android-app .welcome-head .logo{max-width:116px!important}
  .android-app .welcome-head p{font-size:7px!important;line-height:1.25!important;letter-spacing:1.1px!important;white-space:nowrap}
  .android-app .welcome-actions{display:grid!important;grid-template-columns:1fr 1.25fr!important;gap:8px!important;min-width:0!important;width:100%!important}
  .android-app .welcome-actions button{min-width:0!important;min-height:42px!important;padding:7px 10px!important;font-size:9px!important;line-height:1.15!important;white-space:nowrap!important}
  .android-app .author-lockup{display:grid!important;grid-template-columns:1fr auto!important;gap:4px 6px!important;min-width:0!important;align-items:center!important;text-align:right!important}
  .android-app .author-lockup .account-button{grid-column:1/-1!important;min-height:34px!important;padding:6px 8px!important;font-size:9px!important}
  .android-app .author-lockup .registered-total{display:none!important}
  .android-app .author-lockup .language-picker{grid-column:1/-1!important;margin:0!important;justify-content:flex-end!important}
  .android-app .author-lockup .language-picker select{max-width:125px!important;padding:4px 6px!important;font-size:8px!important}
  .android-app .lobby-layout{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(220px,25vw)!important;gap:10px!important;padding-top:8px!important}
  .android-app .room-browser,.android-app .lobby-side{border-radius:12px!important}
  .android-app .lobby-tabs button{padding:10px 12px!important;font-size:9px!important}
  .android-app .room-filter{display:none!important}
  .android-app .room-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;min-height:150px!important;padding:10px!important}
  .android-app .empty-rooms{min-height:145px!important;padding:18px 10px!important}
  .android-app .room-card{padding:10px!important}
  .android-app .lobby-side{display:block!important;padding:11px!important;min-width:0!important}
  .android-app .join-code>div{width:100%!important}
  .android-app .join-code input{width:0!important;padding:9px!important;font-size:11px!important}
  .android-app .join-code button{flex:0 0 auto!important;padding:0 11px!important;font-size:9px!important}
  .android-app .online-head{margin:14px 0 5px!important;padding-bottom:7px!important}
  .android-app .online-head b{font-size:11px!important}
  .android-app .online-list{max-height:calc(100dvh - 185px)!important;overflow:auto!important}
  .android-app .online-list>div{grid-template-columns:34px 1fr 7px!important;gap:6px!important;padding:6px 0!important}
  .android-app .online-list i{width:32px!important;height:32px!important;border-radius:9px!important;font-size:16px!important}
  .android-app .online-list b{font-size:9px!important}.android-app .online-list small{font-size:7px!important}
  .android-app .welcome-foot{padding:8px 2px!important;font-size:6px!important}
  html.android-app body .waiting-dialog.offline-waiting{width:min(720px,calc(100vw - 44px))!important;max-height:calc(100dvh - 26px)!important;margin:auto!important;overflow:auto!important}
  html.android-app body .offline-waiting .waiting-stage{padding:12px 16px 14px!important}
  html.android-app body .offline-waiting .waiting-stage>small{font-size:7px!important}
  html.android-app body .offline-waiting .waiting-stage h2{font-size:24px!important;line-height:1!important;margin:2px 0 8px!important}
  html.android-app body .offline-waiting .waiting-status{align-items:center!important;margin:6px 0 8px!important;gap:10px!important}
  html.android-app body .offline-waiting .waiting-status b{font-size:11px!important}
  html.android-app body .offline-waiting .waiting-status small{font-size:0!important;line-height:1.15!important}
  html.android-app body .offline-waiting .waiting-status small::after{font-size:9px!important}
  html.android-app body .offline-waiting .waiting-seats{gap:8px!important}
  html.android-app body .offline-waiting .waiting-seat{min-height:58px!important;padding:8px!important;gap:8px!important}
  html.android-app body .offline-waiting .waiting-seat i{width:34px!important;height:34px!important;font-size:17px!important}
  html.android-app body .offline-waiting .waiting-seat b{font-size:10px!important}.android-app .offline-waiting .waiting-seat small{font-size:8px!important}
  html.android-app body .offline-waiting .waiting-seat select{margin-top:4px!important;padding:6px 24px 6px 7px!important;font-size:9px!important}
  html.android-app body .offline-waiting .seat-type-toggle{margin-top:4px!important;padding:5px 7px!important;font-size:7px!important}
  html.android-app body .offline-waiting .waiting-actions{margin-top:9px!important;gap:7px!important}
  html.android-app body .offline-waiting .waiting-actions button{padding:9px!important;font-size:9px!important}
  html.android-app body .game-shell{position:relative!important;width:100%!important;max-width:none!important;padding:0 8px 5px!important}
  html.android-app body .topbar{position:absolute!important;z-index:30!important;top:2px!important;right:8px!important;left:auto!important;width:auto!important;height:32px!important;min-height:32px!important;padding:0!important;justify-content:flex-end!important;pointer-events:none!important}
  html.android-app body .topbar .brand,html.android-app body .room{display:none!important}
  html.android-app body .top-actions{gap:5px!important;pointer-events:auto!important}
  html.android-app body .top-actions .back-lobby{min-height:32px!important;padding:5px 10px!important;font-size:8px!important}
  html.android-app body .top-actions .icon-btn{width:32px!important;height:32px!important;font-size:15px!important;border-radius:9px!important}
  html.android-app body .fullscreen-toggle{display:none!important}
  html.android-app body .game-layout{display:grid!important;grid-template-columns:minmax(0,1fr) 150px!important;grid-template-areas:'arena players'!important;gap:6px!important;align-items:start}
  .android-app .arena{grid-area:arena;padding:2px 5px 4px!important;overflow:visible}
  html.android-app body .players{grid-area:players!important;display:block!important;position:static!important;padding:40px 7px 7px!important;max-height:calc(100dvh - 6px)!important;overflow:auto!important}
  .android-app .chat,.android-app .vertical-slogan,.android-app footer{display:none!important}
  html.android-app body .turn-banner{height:20px!important;margin:0 auto 1px!important}
  html.android-app body .turn-banner span{font-size:13px!important}.android-app .turn-banner small{font-size:6px!important}.android-app .turn-banner em{font-size:6px!important}
  html.android-app body .board-wrap{width:min(calc(100dvh - 76px),calc(100vw - 174px))!important;max-width:none!important;margin:0 auto!important;padding:0!important}
  html.android-app body .board{width:100%!important;height:auto!important;aspect-ratio:1/1!important;max-width:none!important;max-height:none!important}
  html.android-app body .home .band-members{grid-template-columns:repeat(2,clamp(35px,7.4vmin,60px))!important;gap:3px!important}
  html.android-app body .home .band-members button{width:clamp(35px,7.4vmin,60px)!important;height:clamp(35px,7.4vmin,60px)!important;border-width:2px!important}
  html.android-app body .home strong{font-size:7px!important}.android-app .home small{font-size:5px!important}
  html.android-app body .toast{top:9%!important;max-width:48vw!important;padding:7px 14px!important;font-size:14px!important;border-width:3px!important}
  html.android-app body .center .die-cube-shell{--die-size:clamp(34px,7vmin,50px)!important;transform:none!important;filter:drop-shadow(0 6px 4px #000a)!important}
  html.android-app body .center .die-face{border-width:2px!important;border-radius:9px!important}
  html.android-app body .center .die-face>b{font-size:clamp(26px,5.2vmin,36px)!important}
  html.android-app body .center .die-face::after{inset:4px!important;border-radius:6px!important}
  .android-app .board .pawn.member-piece{margin-left:calc(100% / 30)!important;margin-top:calc(100% / 30)!important;transform:translate(-50%,-100%)!important;transform-origin:50% 100%!important}
  .android-app .board .pawn.member-piece.running{animation:android-figure-run .23s ease-in-out infinite alternate!important}
  .android-app .board-legend,.android-app .action-row{display:none!important}
  html.android-app body .player{grid-template-columns:28px 1fr 12px!important;gap:5px!important;padding:4px 2px!important}.android-app .player .avatar{width:27px!important;height:27px!important;font-size:13px!important}.android-app .player b{font-size:8px!important}.android-app .player small{display:none!important}.android-app .controls{margin-top:5px!important;grid-template-columns:1fr!important}
  .android-app .controls .pill{min-height:34px;padding:6px;font-size:8px}
}
@keyframes android-figure-run{from{transform:translate(-50%,-100%) rotate(-5deg) scaleY(.97)}to{transform:translate(-50%,-112%) rotate(5deg) scaleY(1.03)}}

/* Keep a manual escape hatch visible even before native immersive mode starts. */
.android-app .fullscreen-toggle{display:grid!important;place-items:center!important;position:fixed!important;top:max(10px,env(safe-area-inset-top))!important;right:max(70px,calc(env(safe-area-inset-right) + 12px))!important;z-index:9999!important;width:46px!important;height:46px!important}
@media (orientation:portrait){
  .android-app .game-shell{width:100%!important;padding:2px!important}
  .android-app .board-wrap,.android-app .board{width:100%!important;max-width:100%!important;aspect-ratio:1/1!important}
}
