/* V9.9.15 — posições oficiais conforme as três referências do estudante.
   Os elementos antigos permanecem somente para reutilização dos handlers, sem apresentação dupla. */
#ca-v9914-ui[hidden]{display:none!important}
#ca-v9914-ui{position:fixed;inset:0;z-index:1500000;pointer-events:none;font-family:'Trebuchet MS',Arial,sans-serif}
#ca-v9914-ui *{box-sizing:border-box}
#ca-v9914-ui .ca-v9914-logo{position:absolute;top:4px;left:8px;width:clamp(130px,11vw,200px);height:auto;max-height:120px;object-fit:contain;pointer-events:none;filter:drop-shadow(0 2px 4px #001c4677)}
#ca-v9914-ui :is(.ca-v9914-actions,.ca-v9914-status){position:absolute;display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-start;gap:clamp(4px,.55vw,10px);pointer-events:auto;background:transparent!important;border:0!important;box-shadow:none!important;margin:0!important;padding:0!important}
/* Desktop: posição VERDE (superior direita) e VERMELHA (inferior esquerda). */
#ca-v9914-ui .ca-v9914-actions{left:max(10px,calc((100vw - 1670px)/2 + 100px));bottom:clamp(6px,3vh,38px)}
#ca-v9914-ui .ca-v9914-status{top:clamp(2px,.8vh,12px);right:max(8px,calc((100vw - 1670px)/2 + 95px))}
#ca-v9914-ui .ca-v9914-button{position:relative;display:grid;place-items:center;flex:0 0 auto;width:clamp(59px,5vw,83px);height:clamp(59px,5vw,83px);padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;cursor:pointer;touch-action:manipulation;transition:transform .15s ease,filter .15s ease}
#ca-v9914-ui .ca-v9914-button img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;pointer-events:none;user-select:none;-webkit-user-drag:none}
#ca-v9914-ui .ca-v9914-button.counter{width:clamp(102px,8.4vw,145px);cursor:default}
#ca-v9914-ui .ca-v9914-button:disabled{opacity:.9}
#ca-v9914-ui .ca-v9914-button[data-action=efeito]:disabled{opacity:.54;filter:grayscale(.3)}
#ca-v9914-ui .ca-v9914-value{position:absolute;left:65%;top:49%;transform:translate(-5%,-50%);color:#fff;font-size:clamp(13px,1.18vw,19px);font-weight:900;font-variant-numeric:tabular-nums;text-shadow:0 1px 3px #001b3a;pointer-events:none}
#ca-v9914-ui .ca-v9914-button:hover:not(:disabled){transform:translateY(-3px) scale(1.045);filter:brightness(1.13) drop-shadow(0 2px 3px #ffe39088)}
#ca-v9914-ui .ca-v9914-button:active:not(:disabled){transform:scale(.95)}
#ca-v9914-ui .ca-v9914-button:focus-visible{outline:3px solid #ffe078!important;outline-offset:2px;border-radius:8px!important}
/* Todos os menus de fala na região LARANJA, sem alterar conteúdo/funções. */
body.ca-v9914-ui-active #ca-adventure-plaza #plaza-talk-menu,
body.ca-v9914-ui-active #candido-arena #arena-speech-menu,
body.ca-v9914-ui-active #ca-hall #hall-talk-menu,
body.ca-v9914-ui-active #ca-dream-rooms .ha-speech-menu,
body.ca-v9914-ui-active #ca-ha #ha-speech-menu{
 position:fixed!important;top:14vh!important;bottom:auto!important;left:max(10px,calc((100vw - 1670px)/2 + 95px))!important;right:auto!important;
 width:clamp(220px,22vw,420px)!important;max-width:calc(100vw - 24px)!important;max-height:68vh!important;overflow-y:auto!important;overflow-x:hidden!important;
 margin:0!important;transform:none!important;z-index:1700000!important;pointer-events:auto!important;box-sizing:border-box!important;
}
body.ca-v9914-ui-active #ca-adventure-plaza #plaza-talk-menu[hidden],
body.ca-v9914-ui-active #candido-arena #arena-speech-menu[hidden],
body.ca-v9914-ui-active #ca-hall #hall-talk-menu[hidden],
body.ca-v9914-ui-active #ca-dream-rooms .ha-speech-menu[hidden],
body.ca-v9914-ui-active #ca-ha #ha-speech-menu[hidden]{display:none!important}
/* Esconder somente os controles antigos substituídos, enquanto o HUD único está ativo. */
body.ca-v9914-ui-active > .wrap > header.top,
body.ca-v9914-ui-active #ca-imagination-header,
body.ca-v9914-ui-active #ca-adventure-plaza .plaza-nav,
body.ca-v9914-ui-active #ca-adventure-plaza .plaza-logo,
body.ca-v9914-ui-active #candido-arena .arena-island-nav,
body.ca-v9914-ui-active #ca-hall .hall-nav,
body.ca-v9914-ui-active #ca-dream-rooms .ha-island-nav,
body.ca-v9914-ui-active #ca-ha .ha-island-nav,
body.ca-v9914-ui-active #ca-adventure-plaza .plaza-control > button,
body.ca-v9914-ui-active #candido-arena .arena-speech-controls > button,
body.ca-v9914-ui-active #ca-hall .hall-control > button,
body.ca-v9914-ui-active #ca-dream-rooms .ha-speech > button,
body.ca-v9914-ui-active #ca-ha .ha-speech > button,   /* V42: Halloween Mysteries — 💬, mapa, ASA, Advent e efeito da coluna antiga */
body.ca-v9914-ui-active :is(#ca-adventure-plaza,#candido-arena,#ca-hall,#ca-dream-rooms,#ca-ha) .ca-room-inventory-button,
body.ca-v9914-ui-active :is(#ca-adventure-plaza,#candido-arena,#ca-hall,#ca-dream-rooms,#ca-ha) .ca-equip-power-button{
 visibility:hidden!important;opacity:0!important;pointer-events:none!important;
}
/* Mobile horizontal: posição relativa ao cenário centralizado conforme a imagem 03. */
@media(max-width:1023px) and (orientation:landscape), (hover:none) and (orientation:landscape), (max-height:650px) and (orientation:landscape){
 #ca-v9914-ui .ca-v9914-logo{top:2px;left:5px;width:min(12vw,115px);max-height:72px}
 #ca-v9914-ui :is(.ca-v9914-actions,.ca-v9914-status){gap:clamp(3px,.5vw,7px)}
 #ca-v9914-ui .ca-v9914-actions{left:16.5vw;bottom:3px}
 #ca-v9914-ui .ca-v9914-status{top:2px;right:15vw}
 #ca-v9914-ui .ca-v9914-button{width:clamp(36px,8vh,57px);height:clamp(36px,8vh,57px)}
 #ca-v9914-ui .ca-v9914-button.counter{width:clamp(65px,13vh,90px)}
 #ca-v9914-ui .ca-v9914-value{font-size:clamp(10px,2.3vh,14px)}
 body.ca-v9914-ui-active #ca-adventure-plaza #plaza-talk-menu,
 body.ca-v9914-ui-active #candido-arena #arena-speech-menu,
 body.ca-v9914-ui-active #ca-hall #hall-talk-menu,
 body.ca-v9914-ui-active #ca-dream-rooms .ha-speech-menu,
 body.ca-v9914-ui-active #ca-ha #ha-speech-menu{
   left:16.5vw!important;top:auto!important;bottom:clamp(52px,17vh,105px)!important;
   width:min(26vw,270px)!important;max-height:55vh!important;
 }
}
/* Mobile vertical: marcações verde (topo abaixo da logo), laranja (meio), vermelho (baixo). */
@media(max-width:1023px) and (orientation:portrait){
 #ca-v9914-ui .ca-v9914-logo{top:4px;left:50%;transform:translateX(-50%);width:min(55vw,370px);max-height:20vh}
 #ca-v9914-ui .ca-v9914-status{top:clamp(155px,19vh,245px);right:5px;gap:2px}
 #ca-v9914-ui .ca-v9914-button{width:clamp(42px,9.3vw,63px);height:clamp(42px,9.3vw,63px)}
 #ca-v9914-ui .ca-v9914-button.counter{width:clamp(61px,14.5vw,93px)}
 #ca-v9914-ui .ca-v9914-value{font-size:clamp(10px,2.6vw,15px)}
 #ca-v9914-ui .ca-v9914-actions{flex-direction:row;left:7px;bottom:clamp(112px,17vh,230px);gap:4px}
 body.ca-v9914-ui-active #ca-adventure-plaza #plaza-talk-menu,
 body.ca-v9914-ui-active #candido-arena #arena-speech-menu,
 body.ca-v9914-ui-active #ca-hall #hall-talk-menu,
 body.ca-v9914-ui-active #ca-dream-rooms .ha-speech-menu,
 body.ca-v9914-ui-active #ca-ha #ha-speech-menu{
  left:8px!important;top:auto!important;bottom:clamp(138px,17vh,242px)!important;
  width:min(47vw,340px)!important;max-height:36vh!important;
 }
}
body.ca-v9914-loading #ca-v9914-ui,body[data-screen=login] #ca-v9914-ui{display:none!important}
@media(prefers-reduced-motion:reduce){#ca-v9914-ui .ca-v9914-button{transition:none}}

/* V9.9.17 — ajustes finos solicitados. */
@media(min-width:1024px){
 #ca-v9914-ui .ca-v9914-button[data-action="stars"] .ca-v9914-value{left:50%!important;top:49%!important;transform:translate(-50%,-50%)!important;min-width:3ch!important;width:calc(100% - 34px)!important;text-align:center!important}
}

/* V9.9.20 — sem equipamento: não renderizar botão Efeitos.
   A ausência do botão não deixa espaço vazio no alinhamento flex. */
#ca-v9914-ui .ca-v9914-actions .ca-v9914-button[data-action="efeito"][hidden]{display:none!important;visibility:hidden!important;pointer-events:none!important}
/* V24 — botão da ASA (primeiro da barra): sem ser agente não existe nem ocupa espaço. */
#ca-v9914-ui .ca-v9914-actions .ca-v9914-button[data-action="asa"][hidden]{display:none!important;visibility:hidden!important;pointer-events:none!important}
/* V42 — selo vermelho do botão Amigos (pedidos recebidos) e ícone do poder da vez no botão de efeito (mais de um equipado). */
#ca-v9914-ui .ca-v9914-badge{position:absolute;top:-3px;right:-3px;min-width:1.55em;height:1.55em;padding:0 .3em;display:grid;place-items:center;border-radius:999px;border:2px solid #fff;background:#e5303f;color:#fff;font:900 clamp(10px,.9vw,13px)/1 'Trebuchet MS',Arial,sans-serif;box-shadow:0 2px 4px #0007;pointer-events:none}
#ca-v9914-ui .ca-v9914-badge[hidden],#ca-v9914-ui .ca-v9914-next[hidden]{display:none!important}
#ca-v9914-ui .ca-v9914-next{position:absolute;right:-2px;bottom:-2px;width:1.7em;height:1.7em;display:grid;place-items:center;border-radius:50%;border:2px solid #ffd978;background:#0d2c6c;font:400 clamp(10px,1vw,15px)/1 'Segoe UI Emoji','Apple Color Emoji','Noto Color Emoji',sans-serif;box-shadow:0 2px 4px #0007;pointer-events:none}
@media(max-width:1023px) and (orientation:landscape),(hover:none) and (orientation:landscape),(max-height:650px) and (orientation:landscape){
 #ca-v9914-ui .ca-v9914-badge{top:-2px;right:-2px;font-size:clamp(8px,1.9vh,11px)}
 #ca-v9914-ui .ca-v9914-next{font-size:clamp(8px,1.9vh,12px)}
}
/* Pequeno ajuste à direita, sem escapar da arte no desktop. */
@media(min-width:1024px){
 #ca-v9914-ui .ca-v9914-button[data-action="stars"] .ca-v9914-value{
   left:57%!important;top:49%!important;
   width:calc(100% - 38px)!important;min-width:0!important;
   text-align:center!important;transform:translate(-50%,-50%)!important;
 }
}


/* V9.9.49 — espaçamento uniforme entre Fala, Inventário, Efeito e Mapa.
   Nenhuma barra ou botão extra é criado. Controles ocultos não ocupam espaço. */
#ca-v9914-ui .ca-v9914-actions {
 display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;
 align-items:center!important;column-gap:clamp(7px,.65vw,11px)!important;
 row-gap:0!important;
}
#ca-v9914-ui .ca-v9914-actions>.ca-v9914-button{
 flex-shrink:0!important;margin:0!important;
}
/* Números menores, centralizados na região do contador, não no ícone. */
#ca-v9914-ui .ca-v9914-status .ca-v9914-button.counter .ca-v9914-value{
 top:50%!important;left:66%!important;
 width:44%!important;min-width:0!important;max-width:44%!important;
 transform:translate(-50%,-50%)!important;
 display:flex!important;align-items:center!important;justify-content:center!important;
 padding:0!important;margin:0!important;
 text-align:center!important;white-space:nowrap!important;
 font-size:clamp(10px,.78vw,13px)!important;
 font-weight:900!important;line-height:1!important;
 letter-spacing:-.025em!important;overflow:visible!important;
}
@media(max-width:1023px) and (orientation:landscape),
       (hover:none) and (orientation:landscape),
       (max-height:650px) and (orientation:landscape){
 #ca-v9914-ui .ca-v9914-actions{column-gap:clamp(5px,.9vw,8px)!important}
 #ca-v9914-ui .ca-v9914-status .ca-v9914-button.counter .ca-v9914-value{
  font-size:clamp(8px,1.8vh,11px)!important;
 }
}
@media(max-width:1023px) and (orientation:portrait){
 #ca-v9914-ui .ca-v9914-actions{column-gap:5px!important}
 #ca-v9914-ui .ca-v9914-status .ca-v9914-button.counter .ca-v9914-value{
  font-size:clamp(8px,2vw,11px)!important;
 }
}


/* V14.42 — os mesmos botões gráficos do Salão agora atendem Central e Loja. */
body.ca-v9914-ui-active #ca-adventure-interiors #ci-speech:not([hidden]){
 position:fixed!important;display:grid!important;left:max(10px,calc((100vw - 1670px)/2 + 95px))!important;
 top:14vh!important;bottom:auto!important;width:clamp(220px,22vw,420px)!important;
 max-width:calc(100vw - 24px)!important;max-height:68vh!important;overflow:auto!important;
 z-index:1700000!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;
}
@media(max-width:1023px) and (orientation:landscape), (hover:none) and (orientation:landscape), (max-height:650px) and (orientation:landscape){
 body.ca-v9914-ui-active #ca-adventure-interiors #ci-speech:not([hidden]){
 left:16.5vw!important;top:auto!important;bottom:clamp(52px,17vh,105px)!important;
 width:min(26vw,270px)!important;max-height:55vh!important}
}
@media(max-width:1023px) and (orientation:portrait){
 body.ca-v9914-ui-active #ca-adventure-interiors #ci-speech:not([hidden]){
 left:8px!important;top:auto!important;bottom:clamp(138px,17vh,242px)!important;
 width:min(47vw,340px)!important;max-height:36vh!important}
}
