/* ======================================================================================================
   (v13.1) celular / toque (js/celular.js): body.toque = dedo; body.celular = dedo em tela pequena
   ====================================================================================================== */
.so-celular, .cel-menu, .cel-stick, .cel-atk, .cel-gire { display: none; }
body.toque { -webkit-tap-highlight-color: transparent; }
/* arrastar item/skill com o dedo: sem isso o navegador rola a pagina e solta o item no meio */
body.toque .g-slot, body.toque .inv-slot, body.toque .hud-slot, body.toque .g-tree [class*="card"] { touch-action: none; }
body.toque:not(.in-lobby) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.toque:not(.in-lobby) input, body.toque:not(.in-lobby) textarea { -webkit-user-select: text; user-select: text; }

body.celular { --top-h: 36px; --cel-h: 100vh; --hud-h: 100px; overscroll-behavior: none; }
/* barra de cima: nome do lugar, versao e o botao do menu */
body.celular .g-topbar { height: var(--top-h); box-sizing: border-box; padding: 4px 8px; gap: 8px; }
body.celular .g-brand, body.celular .g-clock, body.celular .g-coords { display: none; }
body.celular .g-map { font-size: 11.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body.celular .g-version { font-size: 9.5px; }
body.celular .g-rates { font-size: 9.5px; padding: 1px 5px; }
body.celular .cel-menu { display: inline-block; margin-left: auto; flex-shrink: 0; padding: 6px 12px; font-size: 11px; }
body.celular .so-celular { display: inline-block; }
body.celular .g-actions { display: none; position: fixed; top: calc(var(--top-h) + 4px); right: 6px; z-index: 62; margin: 0;
  grid-template-columns: repeat(3, minmax(96px, 1fr)); gap: 6px; padding: 8px; max-height: calc(var(--cel-h) - var(--top-h) - 12px); overflow: auto;
  background: rgba(10, 7, 4, .95); border: 1px solid var(--lb-line); box-shadow: 0 10px 30px rgba(0, 0, 0, .7); }
body.celular .g-topbar.menu-aberto .g-actions { display: grid; }
body.celular .g-actions .g-btn, body.celular .g-actions .g-btn.small { padding: 10px 8px; font-size: 11px; white-space: normal; }

/* janelas: encostadas na direita (da barra de cima ate a barra de baixo), rolando por dentro; o heroi continua
   visivel no lado livre (a camera desloca, app.js updateViewShift) e tocar no chao continua andando.
   Janela de NPC/troca vai para a esquerda, para dar para arrastar do inventario (direita) para ela. */
body.celular .gwin { left: auto !important; right: 0 !important; top: var(--top-h) !important; bottom: auto !important; transform: none !important;
  width: min(440px, 56vw) !important; max-width: none !important; max-height: calc(var(--cel-h) - var(--top-h) - var(--hud-h)) !important;
  padding: 8px 10px 10px; overflow: hidden auto; overscroll-behavior: contain; }
body.celular #npc-panel, body.celular .trade-win { left: 0 !important; right: auto !important; width: min(400px, 44vw) !important; }
body.celular .gwin-head { cursor: default; margin-bottom: 6px; }
body.celular .gwin-head h2 { font-size: 14px; }
body.celular .gwin-head .g-sub { font-size: 9.5px; letter-spacing: .06em; }
body.celular .gwin-x { width: 36px; height: 36px; font-size: 20px; flex-shrink: 0; }
body.celular .g-help { font-size: 10px; }
body.celular #inv-grid { grid-template-columns: repeat(auto-fill, 38px); }
body.celular .char-body, body.celular .g-tree { grid-template-columns: 1fr; }

/* coluna da esquerda: icone do grupo e o chat pequeno ao lado; o joystick fica embaixo, acima da barra */
body.celular .party-icon { top: calc(var(--top-h) + 6px); left: 8px; width: 34px; height: 34px; }
body.celular .party-panel { top: calc(var(--top-h) + 46px); left: 8px; width: 200px; max-height: calc(var(--cel-h) - var(--top-h) - var(--hud-h) - 60px) !important; z-index: 23; }
body.celular #chat { left: 50px; right: auto; top: calc(var(--top-h) + 6px); bottom: auto; width: min(300px, 36vw); gap: 3px; }
body.celular #chat-log { max-height: 54px; }
body.celular #chat-log div { font-size: 10.5px; line-height: 1.3; }
body.celular .chat-row #chat-input { padding: 2px 5px; font-size: 16px; height: 24px; box-sizing: border-box; } /* 16px: o iPhone nao da zoom */
body.celular .chat-toggle { font-size: 10px; padding: 0 6px; }
body.celular #boost-bar { bottom: auto; top: calc(var(--top-h) + 116px); left: 8px; max-width: 40vw; }
body.celular #boost-bar .boost { width: 26px; height: 26px; }
body.celular .ms-hud { top: calc(var(--top-h) + 6px) !important; bottom: auto !important; left: auto !important; right: 166px; transform: none; width: 170px; font-size: 10px; }

/* coluna da direita: periodo so com a primeira linha (tocar abre), lista de herois recolhida, ultimos EXP fora */
body.celular .periodo { top: calc(var(--top-h) + 6px); right: 8px; width: 150px; padding: 4px 7px; font-size: 10px; cursor: pointer; }
body.celular .periodo:not(.aberto) > :not(.pd-top) { display: none; }
body.celular .periodo .pd-name { font-size: 10.5px; }
body.celular .periodo .pd-left { font-size: 11px; }
body.celular .exp-log { display: none !important; }
body.celular .roster { top: calc(var(--top-h) + 46px); transform: none; max-height: calc(var(--cel-h) - var(--top-h) - var(--hud-h) - 130px); width: 170px; }
body.celular .roster-icon { top: calc(var(--top-h) + 40px); transform: none; right: 8px; }
body.celular #minimap.small { right: 8px; top: calc(var(--top-h) + 42px); bottom: auto; transform: scale(.62); transform-origin: top right; }
body.celular #zona-banner { top: calc(var(--top-h) + 40px); max-width: 60vw; font-size: 12px; }
body.celular .target-frame { max-width: 46vw; }

/* joystick (esquerda) e ataque (direita), logo acima da barra de baixo */
body.celular:not(.in-lobby) .cel-stick { display: block; position: fixed; left: 18px; bottom: calc(var(--hud-h) + 10px); z-index: 24; width: 112px; height: 112px;
  border-radius: 50%; touch-action: none; background: radial-gradient(circle, rgba(255, 230, 170, .08) 0 55%, rgba(255, 230, 170, .16) 56% 100%);
  border: 1px solid rgba(214, 178, 106, .45); box-shadow: inset 0 0 18px rgba(0, 0, 0, .5); opacity: .7; }
body.celular .cel-stick.on { opacity: 1; }
body.celular .cel-knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 40% 35%, #fff1c8, #c9963c 60%, #6b4a1e); box-shadow: 0 0 0 1px #000, 0 3px 10px rgba(0, 0, 0, .7); }
body.celular .cel-stick:not(.on) .cel-knob { transition: transform .12s; }
body.celular:not(.in-lobby) .cel-atk { display: grid; place-items: center; position: fixed; right: 22px; bottom: calc(var(--hud-h) + 46px); z-index: 24;
  width: 66px; height: 66px; padding: 0; border-radius: 50%; touch-action: none; font: 700 30px/1 serif; color: #fff1c8;
  background: radial-gradient(circle at 45% 35%, rgba(170, 40, 24, .95), rgba(70, 12, 6, .95)); border: 2px solid rgba(255, 200, 120, .7);
  box-shadow: 0 0 0 1px #000, 0 6px 16px rgba(0, 0, 0, .7); opacity: .85; }
body.celular .cel-atk.on { transform: scale(.93); opacity: 1; box-shadow: 0 0 0 1px #000, 0 0 18px rgba(255, 120, 60, .8); }
body.spectator .cel-stick, body.spectator .cel-atk { display: none !important; }

/* de pe: aviso para deitar o celular (da para fechar e jogar assim mesmo) */
body.celular.retrato:not(.in-lobby) .cel-gire:not(.fechado) { display: flex; position: fixed; inset: 0; z-index: 200; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 24px; text-align: center; background: rgba(8, 5, 3, .94); color: var(--lb-text); font-family: Inter, sans-serif; }
.cel-gire b { font: 700 20px Cinzel, serif; color: var(--lb-gold-hi); letter-spacing: .08em; }
.cel-gire p { margin: 0; max-width: 300px; font-size: 13px; line-height: 1.5; color: #d8ccb4; }
.cel-gire .cg-ico { font-size: 54px; color: var(--lb-gold); animation: cel-gira 2.4s ease-in-out infinite; }
@keyframes cel-gira { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }
/* de pe mesmo assim: janelas embaixo, largura toda, ate metade da tela */
body.celular.retrato .gwin { left: 0 !important; right: 0 !important; width: 100% !important; top: auto !important; bottom: var(--hud-h) !important;
  max-height: calc((var(--cel-h) - var(--hud-h)) * .55) !important; }
body.celular.retrato #chat { width: calc(100vw - 180px); }
body.celular .troca-win .trade-grid, body.celular .troca-win .trade-inv { grid-template-columns: repeat(auto-fill, var(--tc)); } /* (v13.61) */
