/* Comando Direto: painel do herói pilotado + joysticks do celular */
#bDirect { display: inline-flex; align-items: center; gap: 5px; color: #9fe6ff; border-color: #2f7fa0 !important; background: linear-gradient(#123447, #0b2230) !important; }
#bDirect.hidden { display: none; }
#bDirect i { font-size: 11px; }
body.direct #panel, body.direct #tools, body.direct #ctx, body.direct #selbox { display: none !important; }
body.direct #bDirect { color: #fff; background: linear-gradient(#2c8fb8, #176887) !important; }

#dcHud { --hero-accent: #e7b857; position: fixed; inset: 0; pointer-events: none; z-index: 40; font-family: "Saira Condensed", system-ui, sans-serif; color: #eef6fb; }
#dcHud.hidden { display: none; }
#dcHud .dc-top { position: absolute; left: 50%; transform: translateX(-50%); bottom: 18px; display: flex; gap: 10px; align-items: stretch; pointer-events: auto; }
#dcHud .dc-card { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-width: 300px; background: rgba(8, 16, 24, .86); border: 1px solid rgba(255, 255, 255, .14); border-left: 3px solid var(--hero-accent); border-radius: 8px; box-shadow: 0 6px 22px rgba(0, 0, 0, .45); }
#dcHud .dc-ic { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; background: rgba(255, 255, 255, .06); color: var(--hero-accent); font-size: 19px; flex: none; }
#dcHud .dc-info { flex: 1; min-width: 0; }
#dcHud .dc-info b { display: block; font-size: 15px; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dcHud .dc-hp { position: relative; height: 14px; margin-top: 3px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
#dcHud .dc-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #3fcf6e, #8ef08a); transition: width .15s; }
#dcHud .dc-hp i.low { background: linear-gradient(90deg, #d8443a, #ff8a5c); }
#dcHud .dc-hp span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 14px; font-weight: 700; text-shadow: 0 1px 2px #000; }
#dcHud .dc-ab { display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 78px; padding: 0 8px; border-radius: 6px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
#dcHud .dc-ab small { font-size: 10px; opacity: .75; text-transform: uppercase; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
#dcHud .dc-ab b { font-size: 15px; }
#dcHud .dc-ab.ready { border-color: var(--hero-accent); color: var(--hero-accent); }
#dcHud .dc-ab.on { background: rgba(255, 190, 80, .25); border-color: #ffbe50; color: #ffd27a; }
#dcHud .dc-exit { align-self: center; height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(8, 16, 24, .86); color: #eef6fb; font: 700 13px "Saira Condensed", sans-serif; text-transform: uppercase; cursor: pointer; }
#dcHud .dc-exit:hover { background: rgba(40, 70, 90, .9); }
#dcHud .dc-help { position: absolute; left: 50%; transform: translateX(-50%); bottom: 82px; font-size: 13px; padding: 3px 12px; border-radius: 12px; background: rgba(0, 0, 0, .45); white-space: nowrap; opacity: .85; }
#dcHud .dc-cross { position: fixed; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); display: none; }
#dcHud .dc-cross::before, #dcHud .dc-cross::after { content: ""; position: absolute; background: #fff; left: 50%; top: 50%; }
#dcHud .dc-cross::before { width: 2px; height: 8px; margin: -4px 0 0 -1px; }
#dcHud .dc-cross::after { width: 8px; height: 2px; margin: -1px 0 0 -4px; }
#dcHud .dc-cross.fire { border-color: #ff7a4a; transform: scale(.85); }
body.direct:not(.mobile) #view canvas { cursor: none; }

/* joysticks e botão de habilidade: só no celular */
#dcHud .dc-stick, #dcHud .dc-abbtn { display: none; }
body.mobile #dcHud .dc-help { display: none; }
body.mobile #dcHud .dc-stick { display: block; position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); width: 132px; height: 132px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03) 70%); border: 2px solid rgba(255, 255, 255, .22); pointer-events: auto; touch-action: none; }
body.mobile #dcHud .dc-stick.L { left: calc(18px + env(safe-area-inset-left)); }
body.mobile #dcHud .dc-stick.R { right: calc(18px + env(safe-area-inset-right)); border-color: rgba(255, 140, 90, .4); }
body.mobile #dcHud .dc-stick i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(255, 255, 255, .28); border: 2px solid rgba(255, 255, 255, .55); }
body.mobile #dcHud .dc-stick.R i { background: rgba(255, 120, 70, .35); border-color: rgba(255, 170, 120, .7); }
body.mobile #dcHud .dc-stick small { position: absolute; left: 0; right: 0; top: -18px; text-align: center; font-size: 11px; font-weight: 700; opacity: .7; text-shadow: 0 1px 2px #000; white-space: nowrap; }
body.mobile #dcHud .dc-abbtn { display: grid; place-items: center; position: absolute; right: calc(160px + env(safe-area-inset-right)); bottom: calc(30px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); background: rgba(8, 16, 24, .8); color: #8a9aa6; font-size: 22px; pointer-events: auto; touch-action: none; }
body.mobile #dcHud .dc-abbtn.ready { color: var(--hero-accent); border-color: var(--hero-accent); box-shadow: 0 0 14px rgba(255, 200, 100, .35); }
/* celular: painel do herói no alto, no centro, compacto */
body.mobile #dcHud .dc-top { top: calc(34px + env(safe-area-inset-top)); bottom: auto; gap: 6px; }
body.mobile #dcHud .dc-card { min-width: 0; width: min(330px, 62vw); padding: 5px 8px; gap: 7px; }
body.mobile #dcHud .dc-ic { width: 28px; height: 28px; font-size: 14px; }
body.mobile #dcHud .dc-info b { font-size: 12px; }
body.mobile #dcHud .dc-hp { height: 12px; } body.mobile #dcHud .dc-hp span { font-size: 10px; line-height: 12px; }
body.mobile #dcHud .dc-ab { min-width: 54px; padding: 0 5px; } body.mobile #dcHud .dc-ab small { font-size: 8px; max-width: 64px; } body.mobile #dcHud .dc-ab b { font-size: 12px; }
body.mobile #dcHud .dc-exit { height: 34px; padding: 0 10px; font-size: 11px; }
@media (orientation: portrait) {
  body.mobile #dcHud .dc-top { flex-direction: column; align-items: center; width: calc(100vw - 24px); }
  body.mobile #dcHud .dc-card { width: 100%; max-width: 360px; }
  body.mobile #dcHud .dc-stick { width: 118px; height: 118px; bottom: calc(26px + env(safe-area-inset-bottom)); }
  body.mobile #dcHud .dc-abbtn { right: calc(28px + env(safe-area-inset-right)); bottom: calc(166px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  body.mobile #dcHud .dc-stick { width: 104px; height: 104px; }
  body.mobile #dcHud .dc-stick i { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  body.mobile #dcHud .dc-abbtn { bottom: calc(146px + env(safe-area-inset-bottom)); }
}
@media (max-height: 420px) and (orientation: landscape) {
  body.mobile #dcHud .dc-stick { width: 112px; height: 112px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  body.mobile #dcHud .dc-abbtn { right: calc(140px + env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); width: 50px; height: 50px; font-size: 19px; }
}
/* celular: mensagens abaixo do painel do herói; botão Comando só com ícone; botão de sair numa linha */
body.mobile #bDirect span { display: none; }
body.mobile #dcHud .dc-exit { white-space: nowrap; }
body.mobile.direct #msgs { top: calc(86px + env(safe-area-inset-top)) !important; max-width: 46vw; }
@media (orientation: portrait) { body.mobile.direct #msgs { top: calc(124px + env(safe-area-inset-top)) !important; max-width: calc(100vw - 24px); } }

/* ---------------- Duelo de Heróis */
body.duel #dcHud .dc-exit, body.duel #dcHud .dc-help, body.duel #bDirect { display: none !important; }
body.duel #mmwrap { display: none !important; }
#duelHud { position: fixed; top: calc(34px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 41; pointer-events: none; font-family: "Saira Condensed", system-ui, sans-serif; color: #fff; }
#duelHud.hidden { display: none; }
#duelHud .du-score { display: flex; align-items: stretch; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .16); }
#duelHud .du-t { min-width: 58px; display: grid; place-items: center; font: 400 28px "Black Ops One", sans-serif; padding: 0 12px; }
#duelHud .du-t.t0 { background: linear-gradient(#2f6fc0, #1d4a85); }
#duelHud .du-t.t1 { background: linear-gradient(#c0412f, #84261b); }
#duelHud .du-mid { background: rgba(8, 16, 24, .9); padding: 4px 16px; text-align: center; min-width: 96px; }
#duelHud .du-mid b { display: block; font-size: 22px; letter-spacing: 1px; line-height: 1.1; }
#duelHud .du-mid small { font-size: 11px; opacity: .7; text-transform: uppercase; white-space: nowrap; }
#duelHud .du-respawn { margin: 18vh auto 0; width: max-content; text-align: center; padding: 10px 26px; border-radius: 10px; background: rgba(8, 16, 24, .82); border: 1px solid rgba(255, 120, 90, .5); }
#duelHud .du-respawn.hidden { display: none; }
#duelHud .du-respawn small { display: block; font-size: 13px; text-transform: uppercase; color: #ff9f86; }
#duelHud .du-respawn b { display: block; font: 400 46px "Black Ops One", sans-serif; line-height: 1.05; }
#duelHud .du-respawn span { font-size: 13px; opacity: .8; }
/* no duelo o painel do herói desce para o rodapé (o placar ocupa o topo) também no celular */
body.duel:not(.mobile) #dcHud .dc-top { bottom: 18px; }
body.mobile.duel #duelHud { top: calc(30px + env(safe-area-inset-top)); }
body.mobile.duel #duelHud .du-t { min-width: 42px; font-size: 21px; padding: 0 8px; }
body.mobile.duel #duelHud .du-mid { min-width: 74px; padding: 2px 10px; }
body.mobile.duel #duelHud .du-mid b { font-size: 16px; }
body.mobile.duel #duelHud .du-mid small { font-size: 9px; }
body.mobile.duel #dcHud .dc-top { top: auto; bottom: calc(14px + env(safe-area-inset-bottom)); }
body.mobile.duel #dcHud .dc-card { width: min(300px, 46vw); }
body.mobile.duel #msgs { top: calc(84px + env(safe-area-inset-top)) !important; }
@media (orientation: portrait) {
  body.mobile.duel #dcHud .dc-top { bottom: calc(160px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
  body.mobile.duel #dcHud .dc-card { width: 100%; max-width: 330px; }
  body.mobile.duel #dcHud .dc-abbtn { bottom: calc(220px + env(safe-area-inset-bottom)); }
  body.mobile.duel #msgs { top: calc(84px + env(safe-area-inset-top)) !important; }
}
body.duel #panel, body.duel #tools, body.duel #ctx { display: none !important; }
/* classificação do duelo */
.du-board { width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
.du-board h2 { margin: 0 0 8px; } .du-board h2 i { color: #ffc061; }
.du-list { list-style: none; margin: 8px 0 12px; padding: 0; }
.du-list li { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.du-list li span { opacity: .6; } .du-list li em { font-style: normal; font-weight: 700; color: #ffc061; } .du-list li small { opacity: .7; }
.du-me { padding: 8px 10px; border-radius: 6px; background: rgba(255,192,97,.1); border: 1px solid rgba(255,192,97,.3); }
.ranked-progress-card .du-board-btn { margin-top: 8px; }
#dcHud .dc-cross.wait { border-color: rgba(190, 190, 190, .6); border-style: dashed; }
/* animações do Comando Direto */
#dcHud .dc-hit { position: fixed; inset: 0; pointer-events: none; opacity: 0; --hit: .7;
  background: radial-gradient(ellipse at center, rgba(200, 0, 0, 0) 45%, rgba(200, 10, 0, .55) 80%, rgba(150, 0, 0, .85) 100%); }
#dcHud .dc-hit.on { animation: dcHit .55s ease-out; }
@keyframes dcHit { 0% { opacity: var(--hit); } 25% { opacity: calc(var(--hit) * .8); } 100% { opacity: 0; } }
#dcHud .dc-cross.kick { animation: dcKick .18s ease-out; }
@keyframes dcKick { 0% { transform: scale(1.45); border-color: #ffd27a; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { #dcHud .dc-cross.kick { animation: none; } }
#duelHud .du-t.pop { animation: duPop .45s ease-out; }
@keyframes duPop { 0% { transform: scale(1.5); filter: brightness(1.8); } 100% { transform: scale(1); filter: none; } }
.du-kill { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%); font: 400 46px "Black Ops One", sans-serif; color: #ffd27a; text-shadow: 0 3px 0 #6b3d00, 0 0 24px rgba(255, 170, 60, .7); opacity: 0; pointer-events: none; z-index: 42; white-space: nowrap; }
.du-kill.on { animation: duKill 1.3s ease-out; }
@keyframes duKill { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }
body.mobile .du-kill { font-size: 32px; }

/* convite durante a partida grátis (visitante) */
#guestPill { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); z-index: 45; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 22px;
  background: rgba(12, 16, 10, .9); border: 1px solid #ffc061; color: #ffd27a; font: 700 14px "Saira Condensed", sans-serif; letter-spacing: .3px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .5); animation: pillIn .4s ease-out; white-space: nowrap; }
#guestPill.hidden { display: none; }
@keyframes pillIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
body.mobile #guestPill { top: calc(76px + env(safe-area-inset-top)); font-size: 12px; padding: 6px 11px; max-width: calc(100vw - 20px); }
body.mobile:not(.duel) #guestPill { top: calc(40px + env(safe-area-inset-top)); }
#guestPill .gp-short { display: none; }
/* missão no celular: versão curta no canto, entre o cartão da missão e o guia do Sargento */
body.mobile.camp:not(.duel) #guestPill { top: calc(104px + env(safe-area-inset-top)); left: 8px; transform: none; animation: none; }
body.mobile.camp:not(.duel) #guestPill .gp-full { display: none; } body.mobile.camp:not(.duel) #guestPill .gp-short { display: inline; }
