/*
 * Interface mobile V21 reconstruída do zero.
 * Mantém somente os elementos funcionais do motor e define uma composição
 * nova: informações no alto, movimento à esquerda e combate à direita.
 */
@media (max-width:950px),(hover:none) and (pointer:coarse){
  body.mobile-landscape-game{
    --m-safe-t:max(7px,env(safe-area-inset-top));
    --m-safe-r:max(7px,env(safe-area-inset-right));
    --m-safe-b:max(7px,env(safe-area-inset-bottom));
    --m-safe-l:max(7px,env(safe-area-inset-left));
    --m-gold:#e3bc67;
    --m-edge:#806039;
    --m-glass:rgba(9,13,18,.82);
  }
  body.mobile-landscape-game #hud{font-size:9px!important;pointer-events:none!important}
  body.mobile-landscape-game #hud .mmo-frame,
  body.mobile-landscape-game #hud .quest{
    border:1px solid var(--m-edge)!important;
    border-radius:9px!important;
    background:linear-gradient(180deg,rgba(28,35,42,.9),rgba(6,9,13,.88))!important;
    box-shadow:inset 0 0 0 1px rgba(255,225,157,.08),0 5px 16px rgba(0,0,0,.62)!important;
    backdrop-filter:blur(5px)!important;
  }

  /* Alto esquerdo: personagem, recursos essenciais e missão. */
  body.mobile-landscape-game .hud-left-stack{
    position:fixed!important;left:var(--m-safe-l)!important;top:var(--m-safe-t)!important;
    width:205px!important;height:auto!important;display:block!important;z-index:72!important;
  }
  body.mobile-landscape-game .player-card{
    position:relative!important;inset:auto!important;width:205px!important;min-height:64px!important;
    display:grid!important;grid-template-columns:50px 1fr!important;gap:6px!important;padding:6px!important;
    transform:none!important;pointer-events:auto!important;
  }
  body.mobile-landscape-game .player-card:after{inset:3px!important}
  body.mobile-landscape-game .player-card #portrait{
    width:50px!important;height:50px!important;min-width:50px!important;border-radius:50%!important;
    border:2px solid #ae844a!important;background-color:#0a0d12!important;overflow:hidden!important;
  }
  body.mobile-landscape-game .player-card>div:last-child{min-width:0!important}
  body.mobile-landscape-game .player-card b{display:block!important;font-size:10px!important;line-height:12px!important;color:#fff2c8!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  body.mobile-landscape-game .player-card small{font-size:6px!important;line-height:8px!important;color:#b7c3d0!important}
  body.mobile-landscape-game .player-card .combat-power{display:none!important}
  body.mobile-landscape-game .player-card .bar{height:9px!important;margin-top:2px!important;border-radius:2px!important}
  body.mobile-landscape-game .player-card .bar em{font-size:6px!important;line-height:8px!important}
  body.mobile-landscape-game .target-card{
    display:grid!important;position:fixed!important;left:50%!important;right:auto!important;top:var(--m-safe-t)!important;
    width:210px!important;min-height:46px!important;grid-template-columns:38px 1fr!important;gap:6px!important;
    padding:5px 7px!important;transform:translateX(-50%)!important;z-index:73!important;pointer-events:none!important;
  }
  body.mobile-landscape-game .target-card.hidden{display:none!important}
  body.mobile-landscape-game #targetPortrait{width:36px!important;height:36px!important;border-radius:50%!important}
  body.mobile-landscape-game .target-card b{font-size:9px!important}.target-card small{font-size:6px!important}
  body.mobile-landscape-game .target-card .combat-power{display:none!important}
  body.mobile-landscape-game .target-card .bar{height:9px!important;margin-top:4px!important}
  body.mobile-landscape-game .quest{
    position:fixed!important;left:var(--m-safe-l)!important;right:auto!important;top:calc(var(--m-safe-t) + 96px)!important;
    width:205px!important;max-width:205px!important;min-height:35px!important;margin:0!important;padding:5px 8px!important;
    transform:none!important;text-align:left!important;z-index:71!important;pointer-events:auto!important;
  }
  body.mobile-landscape-game .quest b,body.mobile-landscape-game .quest span{display:block!important;text-align:left!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  body.mobile-landscape-game .quest b{font-size:8px!important;color:#ffe39a!important}.quest span{font-size:7px!important;color:#e4e7ec!important}

  /* XP no centro inferior, como uma barra discreta de progressão. */
  body.mobile-landscape-game .xp-header{
    display:grid!important;position:fixed!important;left:50%!important;right:auto!important;top:auto!important;
    bottom:var(--m-safe-b)!important;width:min(230px,29vw)!important;min-width:155px!important;height:23px!important;
    grid-template-columns:36px 1fr 48px!important;align-items:center!important;gap:4px!important;padding:3px 6px!important;
    transform:translateX(-50%)!important;z-index:66!important;pointer-events:none!important;
  }
  body.mobile-landscape-game .xp-header small,body.mobile-landscape-game .xp-header b{font-size:6px!important;white-space:nowrap!important}
  body.mobile-landscape-game .xp-top-bar{height:7px!important;margin:0!important}

  /* Alto direito: mapa circular e atalhos compactos ao redor. */
  body.mobile-landscape-game .hud-right-stack{position:static!important;width:0!important;height:0!important;transform:none!important}
  body.mobile-landscape-game .minimap-shell{
    display:grid!important;position:fixed!important;right:var(--m-safe-r)!important;left:auto!important;top:var(--m-safe-t)!important;
    width:126px!important;height:126px!important;padding:4px!important;place-items:center!important;border-radius:50%!important;
    transform:none!important;z-index:74!important;pointer-events:auto!important;
  }
  body.mobile-landscape-game .minimap-header{position:absolute!important;left:17px!important;right:17px!important;top:7px!important;display:block!important;height:18px!important;z-index:2!important;text-align:center!important}
  body.mobile-landscape-game .minimap-header b{display:block!important;font-size:7px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  body.mobile-landscape-game .minimap-header>span{display:none!important}
  body.mobile-landscape-game .mobile-map-toggle{display:grid!important;position:absolute!important;right:-12px!important;top:-4px!important;width:24px!important;height:24px!important;min-width:24px!important;padding:0!important;place-items:center!important;border-radius:50%!important;font-size:9px!important}
  body.mobile-landscape-game .minimap-circle{width:104px!important;height:104px!important;margin:8px 0 0!important;border:3px solid #96713e!important;border-radius:50%!important}
  body.mobile-landscape-game .minimap-shell .mobile-map-help{display:none!important}
  body.mobile-landscape-game .minimap-shell.mobile-map-expanded{
    left:50%!important;right:auto!important;top:50%!important;width:min(330px,68vw)!important;height:auto!important;
    padding:10px!important;border-radius:14px!important;transform:translate(-50%,-50%)!important;z-index:180!important;
    box-shadow:0 0 0 100vmax rgba(0,0,0,.72),0 18px 55px #000!important;
  }
  body.mobile-landscape-game .minimap-shell.mobile-map-expanded .minimap-circle{width:min(240px,50vw)!important;height:min(240px,50vw)!important;margin-top:28px!important}
  body.mobile-landscape-game .gamer-resources{
    display:flex!important;position:fixed!important;left:var(--m-safe-l)!important;right:auto!important;top:calc(var(--m-safe-t) + 67px)!important;
    width:205px!important;height:25px!important;gap:4px!important;padding:0!important;border:0!important;background:transparent!important;
    z-index:72!important;pointer-events:none!important;
  }
  body.mobile-landscape-game .gamer-resources .resource-card{display:flex!important;width:auto!important;min-width:76px!important;height:25px!important;padding:3px 6px!important;border-radius:999px!important}
  body.mobile-landscape-game .gamer-resources .xp-card,body.mobile-landscape-game .gamer-resources .power-card{display:none!important}
  body.mobile-landscape-game .gamer-resources .resource-icon{width:18px!important;height:18px!important}.gamer-resources .resource-icon img{width:15px!important;height:15px!important}
  body.mobile-landscape-game .gamer-resources small{font-size:5px!important}.gamer-resources b{font-size:7px!important}
  body.mobile-landscape-game .gamer-menu{
    display:grid!important;position:fixed!important;right:calc(var(--m-safe-r) + 1px)!important;left:auto!important;
    top:calc(var(--m-safe-t) + 132px)!important;bottom:auto!important;width:118px!important;height:75px!important;
    grid-template-columns:repeat(3,34px)!important;grid-template-rows:repeat(2,34px)!important;gap:4px!important;
    padding:0!important;margin:0!important;border:0!important;background:transparent!important;box-shadow:none!important;
    transform:none!important;z-index:76!important;overflow:visible!important;pointer-events:auto!important;
  }
  body.mobile-landscape-game .gamer-menu button{display:grid!important;place-items:center!important;width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;margin:0!important;border-radius:50%!important}
  body.mobile-landscape-game .gamer-menu button i{display:block!important;font-size:14px!important;color:#ffe0a0!important}.gamer-menu button span{display:none!important}

  /* Inferior esquerdo: analógico e corrida separados, sem cobrir o mapa. */
  body.mobile-landscape-game #mobile{display:block!important;position:fixed!important;inset:0!important;z-index:75!important;pointer-events:none!important}
  body.mobile-landscape-game #mobile button{pointer-events:auto!important;touch-action:none!important;-webkit-user-select:none!important;user-select:none!important}
  body.mobile-landscape-game .movement-joystick{
    display:block!important;position:fixed!important;left:var(--m-safe-l)!important;bottom:var(--m-safe-b)!important;
    width:126px!important;height:136px!important;z-index:77!important;transform:none!important;pointer-events:auto!important;touch-action:none!important;
  }
  body.mobile-landscape-game .joystick-rim{
    position:relative!important;width:124px!important;height:124px!important;border:3px solid rgba(209,175,105,.58)!important;border-radius:50%!important;
    background:radial-gradient(circle,rgba(82,103,110,.36) 0 28%,rgba(9,14,18,.54) 30% 60%,rgba(112,86,48,.58) 62% 65%,rgba(5,8,11,.62) 67%)!important;
    box-shadow:inset 0 0 18px #000b,0 7px 20px #0009!important;
  }
  body.mobile-landscape-game .joystick-knob{width:54px!important;height:54px!important;margin:-27px 0 0 -27px!important;border:2px solid #d0aa61!important;background:radial-gradient(circle at 35% 30%,#7f8d8f,#303c42 52%,#11181c 82%)!important}
  body.mobile-landscape-game .movement-joystick>small{display:none!important}
  body.mobile-landscape-game #movementArrows{display:none!important}
  body.mobile-landscape-game.control-arrows #movementJoystick{display:none!important}
  body.mobile-landscape-game.control-arrows #movementArrows{display:grid!important;position:fixed!important;left:var(--m-safe-l)!important;bottom:var(--m-safe-b)!important;width:132px!important;height:132px!important;z-index:77!important}
  body.mobile-landscape-game .mobile-utility{display:contents!important}
  body.mobile-landscape-game .mobile-utility button{position:fixed!important;width:48px!important;height:48px!important;padding:5px!important;border-radius:50%!important;z-index:78!important}
  body.mobile-landscape-game .mobile-utility button img{width:25px!important;height:25px!important}.mobile-utility button span,.mobile-utility button b{font-size:5px!important}
  body.mobile-landscape-game .mobile-utility [data-action="run"]{left:calc(var(--m-safe-l) + 132px)!important;bottom:calc(var(--m-safe-b) + 58px)!important}
  body.mobile-landscape-game .mobile-utility [data-action="dash"]{left:calc(var(--m-safe-l) + 132px)!important;bottom:var(--m-safe-b)!important}
  body.mobile-landscape-game .mobile-utility [data-action="interact"]{left:50%!important;bottom:calc(var(--m-safe-b) + 29px)!important;width:82px!important;height:38px!important;border-radius:20px!important;transform:translateX(-50%)!important}

  /* Inferior direito: ações em arco, inspiradas em MMORPG mobile clássico. */
  body.mobile-landscape-game .actions{
    display:block!important;position:fixed!important;right:var(--m-safe-r)!important;left:auto!important;bottom:var(--m-safe-b)!important;
    width:276px!important;height:188px!important;z-index:79!important;transform:none!important;pointer-events:none!important;
  }
  body.mobile-landscape-game .actions button{position:absolute!important;inset:auto!important;width:50px!important;height:50px!important;padding:5px!important;border:2px solid #9b7642!important;border-radius:50%!important;pointer-events:auto!important}
  body.mobile-landscape-game .actions button img{width:82%!important;height:82%!important;object-fit:contain!important}.actions button>span{font-size:5px!important}
  body.mobile-landscape-game .actions .mobile-attack{right:0!important;bottom:35px!important;width:72px!important;height:72px!important;border-width:3px!important}
  body.mobile-landscape-game .actions button[data-action="heavy"]{right:76px!important;bottom:0!important;width:58px!important;height:58px!important}
  body.mobile-landscape-game .actions button[data-action="defend"]{right:76px!important;bottom:112px!important}
  body.mobile-landscape-game .actions button[data-action="potion"]{right:136px!important;bottom:3px!important;width:44px!important;height:44px!important}
  body.mobile-landscape-game .actions button[data-action="mana"]{right:136px!important;bottom:54px!important;width:44px!important;height:44px!important}
  body.mobile-landscape-game .actions button[data-action="skill1"]{left:0!important;top:8px!important;width:56px!important;height:56px!important}
  body.mobile-landscape-game .actions button[data-action="skill2"]{left:59px!important;top:0!important;width:54px!important;height:54px!important}
  body.mobile-landscape-game .actions button[data-action="skill3"]{left:4px!important;top:69px!important;width:52px!important;height:52px!important}
  body.mobile-landscape-game .actions button[data-action="ultimate"]{left:61px!important;top:61px!important;width:58px!important;height:58px!important;border-color:#d9b24e!important}
  body.mobile-landscape-game #skillBar{display:none!important}

  /* Utilidades, chat e diálogos não invadem o campo central. */
  body.mobile-landscape-game #worldChatToggle{position:fixed!important;right:calc(var(--m-safe-r) + 128px)!important;top:calc(var(--m-safe-t) + 136px)!important;bottom:auto!important;width:38px!important;height:38px!important;z-index:90!important}
  body.mobile-landscape-game #worldChatToggle b{display:none!important}
  body.mobile-landscape-game #worldChat:not(.hidden){right:var(--m-safe-r)!important;bottom:calc(var(--m-safe-b) + 196px)!important;width:min(310px,43vw)!important;max-height:52dvh!important;z-index:190!important}
  body.mobile-landscape-game #hud:not(.hidden)~.game-utility-bar{position:fixed!important;right:calc(var(--m-safe-r) + 172px)!important;top:calc(var(--m-safe-t) + 136px)!important;bottom:auto!important;display:flex!important;flex-direction:row!important;gap:4px!important;z-index:89!important}
  body.mobile-landscape-game .game-utility-bar button{width:34px!important;min-width:34px!important;height:34px!important;padding:0!important;border-radius:50%!important}.game-utility-bar button b{display:none!important}
  body.mobile-landscape-game .interaction{left:50%!important;bottom:calc(var(--m-safe-b) + 72px)!important;transform:translateX(-50%)!important;min-width:116px!important;min-height:34px!important;z-index:82!important;font-size:8px!important}
  body.mobile-landscape-game .dialogue{left:20%!important;right:20%!important;bottom:calc(var(--m-safe-b) + 34px)!important;min-height:96px!important;max-height:42dvh!important;padding:9px!important;z-index:200!important}
  body.mobile-landscape-game .dialogue img{width:50px!important;height:50px!important;flex-basis:50px!important}.dialogue strong{font-size:12px!important}.dialogue p{font-size:9px!important;line-height:1.35!important}.dialogue-continue{min-height:32px!important;font-size:7px!important}
  body.mobile-landscape-game #kocBlessingGameplayHud{max-width:195px!important;max-height:45dvh!important;overflow:auto!important;transform-origin:left top!important}
}

@media (hover:none) and (pointer:coarse) and (orientation:landscape) and (max-height:430px){
  body.mobile-landscape-game .hud-left-stack{scale:.86!important;transform-origin:left top!important}
  body.mobile-landscape-game .target-card{scale:.86!important;transform:translateX(-58%)!important}
  body.mobile-landscape-game .minimap-shell{scale:.84!important;transform-origin:right top!important}
  body.mobile-landscape-game .gamer-menu{scale:.88!important;transform-origin:right top!important}
  body.mobile-landscape-game .movement-joystick,body.mobile-landscape-game #movementArrows{scale:.82!important;transform-origin:left bottom!important}
  body.mobile-landscape-game .mobile-utility [data-action="run"]{left:calc(var(--m-safe-l) + 108px)!important}
  body.mobile-landscape-game .mobile-utility [data-action="dash"]{left:calc(var(--m-safe-l) + 108px)!important}
  body.mobile-landscape-game .actions{scale:.82!important;transform-origin:right bottom!important}
}

