/* Cândido Adventure V14.8 — correção restrita à sobreposição de controles
   nos menus da Hall e ao X da Central do Aventureiro / Mural.
   NÃO modifica hotspot, funções, ranking, pontuação ou Firebase. */

/* Não deixar botões/atalhos da Adventure Plaza visíveis enquanto o jogador
   está no Salão ou com uma janela da Central / Mural aberta. A antiga barra
   retorna automaticamente quando a janela ou o Salão é fechado. */
html body:has(#ca-hall:not([hidden])) #ca-adventure-plaza :is(
 .plaza-control,.plaza-nav,.plaza-hotspot,.plaza-message,header.top.plaza-shared-header
),
html body:has(#ca-center-backdrop.ca-open) #ca-adventure-plaza :is(
 .plaza-control,.plaza-hotspot,header.top.plaza-shared-header
){
 display:none!important;visibility:hidden!important;pointer-events:none!important;
}

/* Guia das Estrelas e The Global Tree: nenhuma barra da praça, da Hall,
   nem botão de caminhar/clicar passa por cima das janelas ilustradas. */
html body:has(#ca-hall #hall-modal:not([hidden])) #ca-adventure-plaza :is(
 .plaza-control,.plaza-nav,.plaza-hotspot,.plaza-message,header.top.plaza-shared-header
),
html body #ca-hall:has(#hall-modal:not([hidden])) :is(
 .hall-control,.hall-nav,.hall-hotspot,.hall-message,header.top.hall-shared-header
){
 display:none!important;visibility:hidden!important;pointer-events:none!important;
}
html body #ca-hall #hall-modal:not([hidden]){
 z-index:200000!important;
}

/* O Mural do cenário e a Central usam o mesmo diálogo #ca-center.
   O X já existente conserva onclick="closeAdventureCenter()"; corrigimos
   somente a apresentação, inclusive quando um CSS antigo apagou o ícone. */
html body #ca-center-backdrop.ca-open #ca-center .ca-head{
 position:relative!important;display:flex!important;align-items:center!important;
 box-sizing:border-box!important;padding-right:clamp(52px,6vw,72px)!important;
 min-height:52px!important;
}
html body #ca-center-backdrop.ca-open #ca-center .ca-head > button.ca-close{
 position:absolute!important;top:0!important;right:0!important;left:auto!important;bottom:auto!important;
 box-sizing:border-box!important;display:grid!important;place-items:center!important;
 width:clamp(40px,4.5vw,54px)!important;height:clamp(40px,4.5vw,54px)!important;
 min-width:40px!important;min-height:40px!important;max-width:54px!important;max-height:54px!important;
 margin:0!important;padding:0!important;flex:none!important;z-index:1000!important;
 border:0!important;border-radius:0!important;
 background:transparent url('ca-x-mapa-oficial-v9955.png') center/contain no-repeat!important;
 box-shadow:none!important;outline-offset:2px!important;
 color:transparent!important;font:0/0 Arial,sans-serif!important;text-shadow:none!important;
 text-indent:0!important;overflow:visible!important;
 opacity:1!important;visibility:visible!important;pointer-events:auto!important;cursor:pointer!important;
}
html body #ca-center-backdrop.ca-open #ca-center .ca-head > button.ca-close:is(:hover,:focus-visible){
 filter:brightness(1.13)!important;
}
html body #ca-center-backdrop.ca-open #ca-center .ca-head > button.ca-close:focus-visible{
 outline:3px solid #ffe16e!important;
}
/* PNG indisponível? A verificação já existente da V14.7 identifica isso;
   apresentar um × legível em vez de deixar o usuário sem saída. */
html.ca-v147-x-missing body #ca-center-backdrop.ca-open #ca-center .ca-head > button.ca-close{
 background:linear-gradient(#ffdf8e,#e9a83e)!important;
 border:2px solid #ffe8aa!important;border-radius:50%!important;
}
html.ca-v147-x-missing body #ca-center-backdrop.ca-open #ca-center .ca-head > button.ca-close::after{
 content:'×'!important;position:absolute!important;inset:0!important;
 display:grid!important;place-items:center!important;
 color:#173966!important;font:900 32px/1 Arial,sans-serif!important;
 text-indent:0!important;opacity:1!important;visibility:visible!important;
}
