/* Native-size controls and menus on iPhone. The arena retains its 16:9 frame. */
#game-window.phone-layout{padding:max(6px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));gap:6px;position:relative;isolation:isolate;-webkit-text-size-adjust:100%;}
.phone-layout button,.phone-layout select{touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
#game-window.phone-layout .viewer-toolbar{height:44px;min-height:44px;flex-basis:44px;}
.phone-layout #fullscreen{height:44px;min-width:96px;font-size:13px;}
.phone-layout #menu-screen{position:relative;inset:auto;flex:none;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:auto;overflow:hidden;border:1px solid #394358;}
.phone-layout #menu-screen .menu-page{padding:20px 16px;width:100%;height:100%;min-height:0;overflow-y:auto;}
.phone-layout #menu-screen #screen-main{grid-template-columns:1fr;gap:12px;align-content:center;padding:20px 16px;background-size:cover;}
.phone-layout #screen-main .home-art{width:200px;max-width:60%;}
.phone-layout #screen-main .home-art img{width:100%;}
.phone-layout #screen-main .home-art>span{font-size:9px;letter-spacing:2px;padding:6px 8px;}
.phone-layout #menu-screen .home-options>button{min-height:48px;padding:12px 16px;font-size:16px;margin:10px auto 0;max-width:440px;}
.phone-layout #menu-screen .menu-page h1{font-size:27px;letter-spacing:-1px;margin:10px 0 16px;}
.phone-layout #menu-screen .eyebrow{font-size:9px;letter-spacing:1.5px;}
.phone-layout #menu-screen .menu-page p{font-size:13px;}
.phone-layout #menu-screen .stage-card{margin-top:16px;}
.phone-layout .grid-preview{height:130px;}
.phone-layout .stage-card strong{font-size:22px;padding:14px 16px 8px;}
.phone-layout #menu-screen .back{min-height:44px;font-size:14px;margin-top:16px;}
.phone-layout #menu-screen .selection-heading{display:block;}
.phone-layout #menu-screen .opponent-mode{margin:8px 0;font-size:13px;}
.phone-layout select{min-height:44px;font-size:16px;}
.phone-layout #menu-screen .selection-summary{gap:7px;margin:12px 0 18px;}
.phone-layout #menu-screen .selection-summary button{font-size:11px;min-height:44px;padding:8px 6px;flex:1;}
.phone-layout #menu-screen .roster{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;}
.phone-layout #menu-screen .character-card img{height:130px;}
.phone-layout #menu-screen .character-card strong{font-size:10px!important;padding:9px 5px 7px;white-space:normal;}
.phone-layout #menu-screen .character-card small{font-size:7px;letter-spacing:0;padding:0 5px 8px;overflow-wrap:anywhere;}
.phone-layout #menu-screen .selection-bottom{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px;}
.phone-layout #menu-screen .selection-bottom p{width:100%;order:3;margin:0;}
.phone-layout #menu-screen .selection-bottom .primary{min-height:48px;font-size:14px;padding:12px;}
.phone-layout #menu-screen .help-columns{grid-template-columns:1fr;gap:12px;}
.phone-layout .help-page table{font-size:12px;}
.phone-layout .pixel-status.pixel-error{left:16px;right:16px;bottom:8px;font-size:12px;z-index:10;}
.phone-layout #play-surface{margin:auto;flex-shrink:0;overflow:hidden;}
.phone-layout .battle-actions{position:relative;top:auto;left:auto;right:auto;width:100%;height:44px;min-height:44px;flex-shrink:0;justify-content:space-between;gap:4px;flex-wrap:nowrap;}
.phone-layout .battle-actions button,.phone-layout .battle-actions select{min-height:44px;padding:8px;font-size:12px;}
.phone-layout .battle-actions label,.phone-layout .battle-actions select{display:none;}
.phone-layout #play-surface>.hud{top:10px;left:10px;right:10px;gap:8px;grid-template-columns:minmax(0,1fr) 42px minmax(0,1fr);}
.phone-layout #play-surface>.hud .portrait{display:block;width:24px;height:35px;flex-shrink:0;border-width:1px;}
.phone-layout.pixel-mode .portrait{background-size:cover!important;background-position:center!important;image-rendering:pixelated;}
.phone-layout #play-surface>.hud .fighter-hud{gap:5px;}
.phone-layout #play-surface>.hud .name{font-size:11px!important;letter-spacing:0;margin-bottom:4px;}
.phone-layout #play-surface>.hud .name small,.phone-layout #play-surface>.hud .round strong,.phone-layout #play-surface>.hud .round span,.phone-layout #play-surface>.hud .ability-label{display:none;}
.phone-layout #play-surface>.hud .health{height:13px;padding:2px;border-width:1px;box-shadow:none;}
.phone-layout #play-surface>.hud .ability{height:6px;border-width:1px;margin-top:4px;box-shadow:none;}
.phone-layout #play-surface>.hud #wave-count{font-size:9px;white-space:normal;margin:0;letter-spacing:0;}
.phone-layout #play-surface>.overlay{z-index:6;}
.phone-layout #play-surface>.overlay h1{font-size:32px;letter-spacing:-1px;}
.phone-layout #play-surface>.overlay p{font-size:12px;margin:0 8px 12px;text-align:center;}
.phone-layout #play-surface>.overlay>span{font-size:9px;letter-spacing:2px;}
.phone-layout #play-surface>.overlay button{min-height:48px;padding:12px 18px;font-size:14px;}
.phone-layout #play-surface>.overlay small{font-size:10px;margin-top:8px;}
.phone-layout #touch-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;position:relative;left:auto;right:auto;bottom:auto;width:100%;padding:0;flex-shrink:0;z-index:5;}
.phone-layout #touch-controls>div{display:grid;grid-template-columns:repeat(3,minmax(44px,1fr));grid-template-rows:repeat(2,48px);gap:5px;}
.phone-layout #touch-controls button{min-width:44px;min-height:48px;padding:4px 2px;font-size:11px;font-weight:700;line-height:1.15;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;background:#202b3d;color:#f4f1df;border:1px solid #67778b;border-radius:7px;}
.phone-layout #touch-controls button[data-key^="Arrow"]{font-size:24px;}
.phone-layout #touch-controls [data-key="ArrowUp"]{grid-column:2;grid-row:1;}
.phone-layout #touch-controls [data-key="ArrowLeft"]{grid-column:1;grid-row:2;}
.phone-layout #touch-controls [data-key="ArrowDown"]{grid-column:2;grid-row:2;}
.phone-layout #touch-controls [data-key="ArrowRight"]{grid-column:3;grid-row:2;}
.phone-layout #touch-controls [data-key="ShiftRight"]{border-color:#c7ac52;}
.phone-layout #touch-controls .touch-held{background:#d7b449;color:#131c2a;transform:translateY(1px);}
#game-window.phone-layout .build-footer{font-size:9px;min-height:18px;padding:2px 0;}
.phone-layout .build-footer i{margin-left:3px;}
.phone-layout .alpha-build{font-size:8px;letter-spacing:1px;}
#game-window.phone-layout.phone-landscape .viewer-toolbar{align-self:flex-end;}
.phone-layout.phone-landscape.phone-battle .battle-actions{position:absolute;left:max(8px,env(safe-area-inset-left));right:120px;top:max(6px,env(safe-area-inset-top));width:auto;justify-content:flex-start;}
.phone-layout.phone-landscape #touch-controls{position:absolute;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:max(25px,env(safe-area-inset-bottom));width:auto;display:flex;justify-content:space-between;pointer-events:none;}
.phone-layout.phone-landscape #touch-controls>div{width:170px;pointer-events:auto;}
.phone-layout.phone-landscape #touch-controls button{background:#202b3de8;}
.phone-layout.phone-landscape #touch-controls .touch-held{background:#d7b449;}
.phone-layout.phone-landscape #menu-screen #screen-main{grid-template-columns:1fr 1.2fr;gap:30px;padding:12px 30px;}
.phone-layout.phone-landscape #screen-main .home-art{max-width:100%;width:200px;}
.phone-layout.phone-landscape #menu-screen .home-options>button{margin-top:7px;min-height:44px;padding:9px 14px;}
.phone-layout.phone-landscape #menu-screen .roster{grid-template-columns:repeat(6,minmax(0,1fr));}
.phone-layout.phone-landscape #menu-screen .character-card img{height:110px;}
.phone-layout.phone-landscape #menu-screen .selection-heading{display:flex;}
