/* Controles mais claros, com áreas grandes para toque e contraste com o cenário. */
.action-pad{grid-template-columns:repeat(2,68px);gap:8px}
.action-pad button{width:68px;height:62px;border-radius:17px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;overflow:hidden;backdrop-filter:blur(10px);box-shadow:inset 0 1px #ffffff30,0 5px 0 #0e0a18,0 0 18px #0c071355;transition:transform .14s ease,filter .14s ease,box-shadow .14s ease}
.action-pad button:active{transform:translateY(3px) scale(.97);box-shadow:inset 0 1px #ffffff25,0 2px 0 #0e0a18}
.action-pad button svg{position:relative;z-index:1;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.action-pad .control-label{position:relative;z-index:1;font:800 8px/1 'DM Sans',sans-serif;letter-spacing:.8px}
.action-pad .power:after{z-index:0;background:#120b1bd8}
.action-pad .power.shield{color:#ffe3a0;background:linear-gradient(150deg,#513d55,#292039);border-color:#f3cf8075;box-shadow:inset 0 1px #ffffff30,0 5px 0 #0e0a18,0 0 18px #f3cf8020}
.action-pad .power.dash{color:#a7eff0;background:linear-gradient(150deg,#294552,#1b2639);border-color:#87dce275;box-shadow:inset 0 1px #ffffff30,0 5px 0 #0e0a18,0 0 18px #62cbdc25}
.action-pad .power.attack{color:#ffc0df;background:linear-gradient(150deg,#51314f,#2d203c);border-color:#f098c575;box-shadow:inset 0 1px #ffffff30,0 5px 0 #0e0a18,0 0 18px #f098c525}
.action-pad .interact{width:68px;height:62px;border-radius:17px;color:#30203a;background:linear-gradient(145deg,#ffe6a2,#efbd61);border:1px solid #fff3ce;box-shadow:inset 0 1px #fff9,0 5px 0 #987444,0 0 20px #f3cf8040}
.action-pad .interact svg{width:20px;height:20px}
.action-pad .interact .control-label{color:#38283d}

@media(max-width:700px){
  .game-shell{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
  .play-area{touch-action:none}
  .controls{left:8px;right:8px;gap:8px}
  .dpad{grid-template-columns:repeat(3,42px);grid-template-rows:repeat(3,42px);gap:3px}
  .dpad button{border-radius:14px;background:linear-gradient(145deg,#382747ed,#20172feF);border-color:#e9d9f477;box-shadow:inset 0 1px #ffffff24,0 4px 0 #100b1d;font-size:23px}
  .dpad button:active{transform:translateY(2px);box-shadow:inset 0 1px #ffffff20,0 1px 0 #100b1d}
  .dpad span{background:#241b3480;border:1px solid #ffffff12;border-radius:13px}
  .battle-hud{backdrop-filter:blur(10px);border-color:#f098c54d;box-shadow:0 5px 18px #09061370}
  .dialog{backdrop-filter:blur(14px);border-color:#d2a8dc8c;box-shadow:0 12px 34px #090613a8}
}
@media(max-width:340px){
  .controls{left:6px;right:6px;gap:5px}
  .dpad{grid-template-columns:repeat(3,38px);grid-template-rows:repeat(3,40px);gap:2px}
  .action-pad{grid-template-columns:repeat(2,62px);gap:6px}
  .action-pad button,.action-pad .interact{width:62px;height:60px}
  .action-pad .control-label{font-size:7px}
}

/* Instalado na tela inicial, o jogo ocupa a tela inteira sem rolagem. */
@media(display-mode:standalone) and (max-width:700px){
  html,body{width:100%;height:100%;min-height:100%;overflow:hidden;overscroll-behavior:none}
  body{position:fixed;inset:0}
  .game-shell{width:100%;height:100dvh;min-height:0;max-width:none;margin:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:flex;flex-direction:column;overflow:hidden}
  .masthead{flex:0 0 48px;height:48px;min-height:48px;padding:0 9px}
  .play-area{flex:1 1 auto;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:auto;border-radius:13px}
  .game-footer{display:none}
  .music-panel{flex:0 0 auto;margin:7px 2px 0;padding:5px 12px;border-radius:11px}
  .music-panel summary{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:29px;font-size:12px}
  .music-panel summary span{float:none;font-size:10px;text-align:right}
  .music-panel[open]{position:fixed;z-index:20;left:12px;right:12px;bottom:calc(env(safe-area-inset-bottom) + 10px);max-height:55dvh;overflow:auto;box-shadow:0 12px 40px #000b}
  .playing .quest-panel,.playing .save-warning{display:none!important}
  .quest-panel{display:none!important}
  .target-list{display:none!important}
  .controls{bottom:max(12px,env(safe-area-inset-bottom));left:12px;right:12px}
  .hud{padding:15px 15px 28px}
}

@media(prefers-reduced-motion:reduce){.action-pad button{transition:none}}
