/* Shared touch layout; desktop keyboard controls remain available. */
.mobile-help{display:none;color:#b9c6dc;font-size:13px;line-height:1.6;text-align:center;margin:14px 0}
button,a,select{touch-action:manipulation}
@media (max-width:760px),(any-pointer:coarse),(max-width:1100px) and (max-height:600px){
 .mobile-help{display:block}.keyboard-help,.keyboard-tip{display:none}
 main,.arcade-shell{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));padding-bottom:max(20px,env(safe-area-inset-bottom))}
 button,select,.back-link,.back{min-height:44px}select{font-size:16px!important}.back-link,.back{display:inline-flex;align-items:center}
 .directions,.snake .directions{display:grid;grid-template-columns:repeat(3,60px);grid-template-rows:repeat(2,52px);gap:6px;margin:12px auto}
 .directions button,.tetris-controls button{touch-action:none;user-select:none;-webkit-user-select:none;min-height:52px}
 .directions button:active,.tetris-controls button:active{background:#a64c1d}
 .toolbar{flex-wrap:wrap}.toolbar #status{width:100%;max-width:none;margin:0}.toolbar button{flex:1;font-size:13px}
 .menu-board{padding:22px 14px}.game-card{min-width:0}.game-card>div{min-width:0}.game-card p{overflow-wrap:anywhere}
 .mine-panel{padding:12px}.mine-settings{flex-wrap:wrap}.mine-settings label{flex:1;min-width:150px}.mine-settings select{width:100%}
 .mine-mode{position:sticky;top:0;z-index:3;background:#091328;padding:10px 0;flex-wrap:wrap}.mine-mode button{min-height:48px;font-size:14px}
 #mine-grid{min-width:calc(var(--cols)*44px + (var(--cols) - 1)*3px);gap:3px}.mine-cell{min-height:44px;font-size:20px}.mine-scroll{max-width:100%;-webkit-overflow-scrolling:touch}
 .arcade-shell header{flex-wrap:wrap;gap:8px;padding-bottom:12px}.arcade-shell .brand{font-size:12px}
 .portrait{height:clamp(140px,44vw,230px)}.fighter-card .caption{font-size:13px;gap:4px}.fighter-card .caption b{overflow-wrap:anywhere}
 .match-setup{gap:10px}.match-setup>div{min-width:120px}#start{min-width:0}
 .touch-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:center}
 .touch-controls>div:first-child{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}
 .touch-controls>div:last-child{display:grid;grid-template-columns:1fr 1fr;gap:6px}
 .touch-controls button{min-width:0;min-height:52px;padding:8px 3px;font-size:12px;-webkit-touch-callout:none}
 .touch-controls button[data-key=jump]{grid-column:2;grid-row:1}.touch-controls button[data-key=left]{grid-column:1;grid-row:2}.touch-controls button[data-key=right]{grid-column:3;grid-row:2}
 .in-match .arcade-shell>header{display:none}.in-match #match{scroll-margin-top:8px}.match-top{gap:8px}.match-top .eyebrow{display:none}
 .overlay{padding:8px}.overlay h2{font-size:24px}.overlay button{min-height:44px}.special-hint{font-size:12px}
}
@media(max-width:760px) and (orientation:portrait){
 main:not(.menu):not(.mines):not(.arcade-shell) .arena{max-width:calc((100svh - 340px)*.905);min-width:240px;margin-inline:auto}
 header{margin-bottom:12px}.back-link{margin-bottom:4px}.stats{margin-bottom:10px}.intro img{width:44px;height:44px;margin-bottom:6px}.intro h2{font-size:21px;margin-bottom:10px}.intro p{font-size:13px;line-height:1.5;margin-bottom:12px}#overlay{padding:12px}
}
@media(orientation:landscape) and (max-height:600px) and (any-pointer:coarse){
 main:not(.menu):not(.mines):not(.arcade-shell){max-width:850px;display:grid;grid-template-columns:minmax(240px,1fr) minmax(220px,1fr);column-gap:20px;padding-top:8px}
 main:not(.menu):not(.mines):not(.arcade-shell) .arena{grid-column:1;grid-row:1 / span 7;max-height:calc(100svh - 24px);aspect-ratio:570/630;width:min(100%,calc((100svh - 24px)*570/630));justify-self:center}
 main:not(.menu):not(.mines):not(.arcade-shell)>:not(.arena){grid-column:2}.back-link{margin:0}header{margin:0}.directions{margin:6px auto}footer{margin:0}

}

.rotation-notice{display:none}
@media(max-width:1100px){
 .rotation-notice{display:flex;align-items:center;gap:12px;padding:14px 16px;margin:18px 0;border:1px solid #925328;border-radius:12px;background:#34251c;color:#ffcfaa;font-size:14px;line-height:1.5}
 .rotation-notice span{flex:1}.rotation-notice button{min-height:44px;padding:8px 12px;background:transparent;font-size:13px}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 body.in-match{overflow:hidden}
 .in-match .arcade-shell{padding:0;max-width:none}
 .in-match #match{position:fixed;inset:0;z-index:10;display:block;width:100%;height:100vh;height:100dvh;background:#101017;padding:0;overflow:hidden}
 .in-match .match-top{position:absolute;top:0;left:env(safe-area-inset-left,0px);right:env(safe-area-inset-right,0px);height:34px;margin:0;padding:0 8px;display:flex;gap:8px;font-size:11px;z-index:2}
 .in-match .match-top #pause{min-height:30px;padding:4px 12px;font-size:12px}
 .in-match .arena-wrap{position:absolute;top:34px;bottom:0;left:env(safe-area-inset-left,0px);right:env(safe-area-inset-right,0px);width:auto;height:auto;max-width:none;max-height:none;aspect-ratio:auto;border:0;border-radius:0;margin:0}
 .in-match #arena{width:100%;height:100%;object-fit:contain}
 .in-match .touch-controls{position:absolute;inset:0;display:block;margin:0;pointer-events:none;z-index:3}
 .in-match .touch-controls>div{position:absolute;bottom:max(8px,env(safe-area-inset-bottom));pointer-events:none;gap:5px}
 .in-match .touch-controls>div:first-child{left:max(8px,env(safe-area-inset-left));grid-template-columns:repeat(3,44px)}
 .in-match .touch-controls>div:last-child{right:max(8px,env(safe-area-inset-right));grid-template-columns:repeat(2,66px)}
 .in-match .touch-controls button{pointer-events:auto;min-height:44px;height:44px;padding:4px 2px;font-size:11px;background:#24242fbf;border-color:#777784aa;box-shadow:0 2px 8px #0005;color:#fff}
 .in-match .touch-controls button.down{background:#ff893de6;color:#171018}
 .in-match .special-hint,.in-match .mobile-help{display:none}
 .in-match .arena-wrap:has(.overlay:not([hidden])) ~ .touch-controls{visibility:hidden}
 .in-match .overlay{z-index:4}
}
