/* Cândido Adventure V9.9.16 — correção restrita à interface e ao login.
   O cabeçalho original pode ter sido movido para dentro de uma sala, por isso
   não basta selecionar .wrap > header.top. Mantê-lo no DOM permite reutilizar
   os handlers de áudio, presença e sessão sem criar novos controles. */
html body.ca-v9914-ui-active header.top,
html body.ca-v9914-ui-active header.top.hall-shared-header,
html body.ca-v9914-ui-active header.top.arena-shared-header,
html body.ca-v9914-ui-active #ca-imagination-header,
html body.ca-v9914-ui-active #ca-adventure-plaza .plaza-nav,
html body.ca-v9914-ui-active #ca-adventure-plaza .plaza-logo,
html body.ca-v9914-ui-active #candido-arena .arena-island-nav,
html body.ca-v9914-ui-active #ca-hall .hall-nav,
html body.ca-v9914-ui-active #ca-dream-rooms .ha-island-nav,
html body.ca-v9914-ui-active #ca-ha .ha-island-nav,
html body.ca-v9914-ui-active #ca-ha>header.top{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
/* Não ocultar os menus de falas, apenas os botões originais. */
html body.ca-v9914-ui-active #ca-adventure-plaza :is(#plaza-talk-toggle,#plaza-inventory,#plaza-power-toggle),
html body.ca-v9914-ui-active #candido-arena :is(#arena-speech-toggle,#arena-power-toggle,#arena-inventory,#arena-inventory-toggle),
html body.ca-v9914-ui-active #ca-hall :is(#hall-talk-toggle,#hall-power-toggle,#hall-inventory),
html body.ca-v9914-ui-active #ca-dream-rooms :is(#ca-room-speech-toggle,#ca-room-power-toggle,#ca-room-inventory),
html body.ca-v9914-ui-active #ca-ha :is(#ha-speech-toggle,#ha-power-toggle),
html body.ca-v9914-ui-active :is(#ca-adventure-plaza,#candido-arena,#ca-hall,#ca-dream-rooms,#ca-ha) :is(.ca-room-inventory-button,.ca-equip-power-button){
  display:none!important;visibility:hidden!important;pointer-events:none!important;
}
/* O inventário e os poderes ainda funcionam por chamadas diretas aos handlers. */
html body.ca-v9914-ui-active #ca-v9914-ui,
html body.ca-v9914-ui-active #ca-v9914-ui .ca-v9914-actions,
html body.ca-v9914-ui-active #ca-v9914-ui .ca-v9914-status{display:flex!important;visibility:visible!important}
html body.ca-v9914-ui-active #ca-v9914-ui[hidden]{display:none!important}
/* Mobile retrato: reduzir logo e subir a faixa superior um pouco. */
@media(max-width:1023px) and (orientation:portrait){
 #ca-v9914-ui .ca-v9914-logo{width:min(45vw,300px)!important;max-height:14vh!important;top:2px!important}
 #ca-v9914-ui .ca-v9914-status{top:clamp(112px,15vh,192px)!important;right:5px!important}
 #ca-v9914-ui .ca-v9914-actions{bottom:clamp(112px,17vh,230px)!important}
}
@media(max-width:1023px) and (orientation:landscape), (hover:none) and (orientation:landscape){
 #ca-v9914-ui .ca-v9914-logo{width:min(10.5vw,100px)!important;max-height:64px!important}
}
/* Login: imagens reais dentro dos botões, não sprites de CSS (que eram
   sobrescritos por gradientes de versões antigas). */
html body #login button[data-login-mode],
html body #login #loginFields button[onclick="login()"]{
  position:relative!important;display:inline-block!important;flex:0 1 auto!important;
  width:clamp(155px,25vw,270px)!important;max-width:100%!important;
  height:auto!important;aspect-ratio:664/253!important;
  padding:0!important;margin:0!important;border:0!important;border-radius:0!important;
  background:none!important;background-image:none!important;box-shadow:none!important;
  color:transparent!important;font-size:0!important;line-height:0!important;
  text-shadow:none!important;overflow:visible!important;cursor:pointer!important;
}
html body #login #loginFields button[onclick="login()"]{margin-top:9px!important}
html body #login button[data-login-mode] .ca-v9916-art,
html body #login #loginFields button[onclick="login()"] .ca-v9916-art{
  display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
  object-fit:fill!important;max-width:none!important;max-height:none!important;
  pointer-events:none!important;user-select:none!important;border:0!important;
}
html body #login button[data-login-mode] img.ca-v9916-art.ca-v9916-selected,
html body #login #loginFields button[onclick="login()"] img.ca-v9916-art.ca-v9916-selected{display:none!important}
html body #login button[data-login-mode].is-selected .ca-v9916-art.ca-v9916-normal,
html body #login #loginFields button[onclick="login()"]:is(:hover,:active,:focus-visible) .ca-v9916-art.ca-v9916-normal{display:none!important}
html body #login button[data-login-mode].is-selected .ca-v9916-art.ca-v9916-selected,
html body #login #loginFields button[onclick="login()"]:is(:hover,:active,:focus-visible) .ca-v9916-art.ca-v9916-selected{display:block!important}
html body #login button[data-login-mode]:active,
html body #login #loginFields button[onclick="login()"]:active{transform:translateY(2px)!important}
html body #login #loginFields button[onclick="login()"]:focus-visible{outline:3px solid #ffe172!important;outline-offset:3px!important}
html body #login button[data-login-mode]:focus-visible{outline:none!important}
@media(max-width:620px){
 html body #login button[data-login-mode]{width:min(43vw,205px)!important}
 html body #login #loginFields button[onclick="login()"]{width:min(52vw,240px)!important}
 html body:has(#login:not(.hidden)) header.top .brand-logo{width:min(68vw,340px)!important}
}

/* V9.9.18 — login sem moldura/recorte estranho nos botões de modo. */
html body #login button[data-login-mode]:hover,
html body #login button[data-login-mode]:focus,
html body #login button[data-login-mode]:focus-visible{transform:none!important;filter:none!important;box-shadow:none!important;background:none!important}

/* V9.9.20 — login: usar exclusivamente as imagens oficiais e a interação
   do botão Entrar. A regra global .btn.is-selected verde não se aplica aqui. */
html body #login button[data-login-mode],
html body #login button[data-login-mode]:is(.is-selected,[aria-pressed="true"],:hover,:focus,:focus-visible){
  background:transparent!important;background-image:none!important;
  border:0!important;outline:none!important;border-radius:0!important;
  box-shadow:none!important;overflow:visible!important;
  filter:none!important;transform:none!important;
  transition:transform .12s ease,filter .12s ease!important;
}
html body #login button[data-login-mode]::before,
html body #login button[data-login-mode]::after{
  content:none!important;display:none!important;border:0!important;
  box-shadow:none!important;animation:none!important;
}
/* Estado normal, selecionado e hover. A moldura é SOMENTE a da imagem PNG. */
html body #login button[data-login-mode] img.ca-v9916-art.ca-v9916-normal{display:block!important}
html body #login button[data-login-mode] img.ca-v9916-art.ca-v9916-selected{display:none!important}
html body #login button[data-login-mode]:is(.is-selected,:hover,:focus-visible) img.ca-v9916-art.ca-v9916-normal{display:none!important}
html body #login button[data-login-mode]:is(.is-selected,:hover,:focus-visible) img.ca-v9916-art.ca-v9916-selected{display:block!important}
html body #login button[data-login-mode]:hover:not(:disabled){transform:translateY(-2px)!important;filter:brightness(1.05)!important}
html body #login button[data-login-mode]:active:not(:disabled){transform:translateY(2px)!important;filter:brightness(.92)!important}
/* Contorno só na navegação por teclado; nunca borda verde de seleção. */
html body #login button[data-login-mode]:focus-visible{outline:2px solid #ffda75!important;outline-offset:3px!important}
