/* Isolado por detecção de touchscreen + breakpoint. Desktop não recebe estilos. */
@media (pointer:coarse) and (max-width:1024px){
 html.cap-touch-ui,html.cap-touch-ui body{overscroll-behavior:none}
 html.cap-touch-ui .shell.touch-playing{position:fixed!important;inset:0!important;z-index:1100!important;width:100%!important;max-width:none!important;height:100dvh!important;min-height:0!important;margin:0!important;padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;background:#101729!important;gap:0!important}
 html.cap-touch-ui .shell.touch-playing .brand,html.cap-touch-ui .shell.touch-playing footer,html.cap-touch-ui .shell.touch-playing>.mobile{display:none!important}
 html.cap-touch-ui .shell.touch-playing .top{height:36px!important;min-height:36px!important;max-height:36px!important;margin:0!important;padding:2px 5px!important;flex:none!important;display:flex!important;flex-wrap:nowrap!important;gap:4px!important;background:#101729d9!important;z-index:8!important}
 html.cap-touch-ui .shell.touch-playing .hud{order:0!important;display:flex!important;gap:2px!important;width:auto!important;flex:1!important;min-width:0!important;max-width:calc(100% - 68px)!important}
 html.cap-touch-ui .shell.touch-playing .hud>div{padding:2px 3px!important;min-width:0!important;border-width:1px!important;flex:1!important;border-radius:5px!important}
 html.cap-touch-ui .shell.touch-playing .hud small{font-size:8px!important;line-height:1!important;letter-spacing:0!important}
 html.cap-touch-ui .shell.touch-playing .hud b{font-size:10px!important;line-height:1.2!important;white-space:nowrap!important}
 html.cap-touch-ui .shell.touch-playing .top-actions{order:1!important;width:auto!important;flex:none!important;display:flex!important;margin:0!important;gap:2px!important}
 html.cap-touch-ui .shell.touch-playing .top-actions>*:not(#fullscreen):not(#sound){display:none!important}
 html.cap-touch-ui .shell.touch-playing .top-actions button{font-size:13px!important;padding:3px!important;min-width:28px!important;min-height:28px!important;height:28px!important}
 html.cap-touch-ui .shell.touch-playing .gamebox{position:relative!important;flex:1 1 0!important;min-height:0!important;min-width:0!important;width:100%!important;max-height:none!important;aspect-ratio:auto!important;margin:0!important;border:0!important;border-radius:0!important;overflow:hidden!important;display:flex!important;justify-content:center!important;align-items:center!important;background:#192840!important}
 html.cap-touch-ui .shell.touch-playing .gamebox canvas{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;touch-action:none!important}
 html.cap-touch-ui .touch-gesture-region{display:none}
 html.cap-touch-ui .shell.touch-playing .touch-gesture-region{display:block;position:absolute;inset:0;z-index:2;touch-action:none!important;user-select:none;-webkit-user-select:none}
 html.cap-touch-ui .touch-toolbar{display:none}
 html.cap-touch-ui .shell.touch-playing .touch-toolbar{display:flex;position:absolute;z-index:4;left:0;right:0;bottom:max(6px,env(safe-area-inset-bottom,0px));padding:0 10px;justify-content:space-between;pointer-events:none;gap:24px}
 html.cap-touch-ui .touch-toolbar>div{display:flex;gap:7px;pointer-events:auto}
 html.cap-touch-ui .touch-toolbar button{width:clamp(50px,12vw,72px);height:clamp(50px,12vw,72px);touch-action:none;user-select:none;border:2px solid #f7d47e;box-shadow:0 3px 10px #0009;border-radius:16px;background:#1d355cce;color:white;font:800 18px Fredoka,system-ui,sans-serif;padding:0}
 html.cap-touch-ui .touch-toolbar .touch-right button{background:#a44f39dc;font-size:12px}
 html.cap-touch-ui .touch-toolbar button:active{transform:scale(.94);background:#df9e38}
 html.cap-touch-ui .touch-tips{display:none}
 html.cap-touch-ui .shell.touch-playing .touch-tips{display:block;position:absolute;z-index:3;top:8px;left:50%;transform:translateX(-50%);pointer-events:none;background:#0b1937b9;border-radius:15px;padding:5px 10px;white-space:nowrap;color:#fff;font-size:10px;font-weight:800;transition:opacity .8s}
 html.cap-touch-ui .shell.touch-playing .touch-tips.faded{opacity:0}
}
@media (pointer:coarse) and (max-width:1024px) and (orientation:landscape){
 html.cap-touch-ui .shell.touch-playing .top{height:30px!important;min-height:30px!important;max-height:30px!important}
 html.cap-touch-ui .shell.touch-playing .touch-toolbar{bottom:6px;padding:0 14px}
 html.cap-touch-ui .shell.touch-playing .touch-toolbar button{width:54px;height:54px;border-radius:13px}
}

/* Mobile V2.2: esconder controles antigos para evitar botões duplicados; visibilidade do placar não compromete a área jogável. */
@media (pointer:coarse){html.cap-touch-ui .shell.touch-playing>.mobile{display:none!important}html.cap-touch-ui .shell.touch-playing .touch-toolbar{pointer-events:none}html.cap-touch-ui .shell.touch-playing .touch-toolbar button{pointer-events:auto}html.cap-touch-ui .shell.touch-playing .touch-gesture-region{touch-action:none}}
@media (pointer:coarse) and (max-width:1024px){html.cap-touch-ui .shell.touch-playing+.score-strip{display:none!important}html.cap-touch-ui .shell.touch-playing .rank-toolbar{display:none!important}}

/* V2.5 — somente dispositivos touch: esconder a barra legada em TODOS os estados.
   Os botões continuam no DOM para compatibilidade com os listeners existentes.
   A barra de gestos compacta (.touch-toolbar) continua visível durante a partida. */
@media (hover: none) and (pointer: coarse) {
  html body .shell > .mobile,
  html body .shell:fullscreen > .mobile,
  html body .shell:-webkit-full-screen > .mobile,
  html body .shell.pseudo-fullscreen > .mobile {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
}
