/* AUREON — responsividade, teclado e botões (camada adicional, carregada por último).
   Não reescreve telas: refina regras existentes para 320–430 px, áreas seguras, teclado móvel e estados dos botões.
   Para voltar ao comportamento anterior basta remover o <link> deste arquivo do index.html. */

/* ---------- teclado e altura visível ---------- */
/* No celular o app fica ancorado no topo (e não centralizado): quando o teclado reduz a área visível,
   o app (que já acompanha a Visual Viewport) ocupa exatamente o espaço acima do teclado. */
@media (max-width:499px){body{align-items:flex-start}}
/* com o teclado aberto, a barra de navegação sai para não roubar espaço do campo */
#app.kb-open #nav{display:none}
#app.kb-open .screen{padding-bottom:16px}
/* pouca altura com o teclado aberto (ex.: 320×568): na sala, o palco recolhe enquanto se digita no chat */
#app.kb-open.kb-baixo .screen[data-screen="room"] .stage{display:none}
/* iPhone: campos com fonte menor que 16 px provocam zoom automático e "pulos" da tela ao tocar */
@supports (-webkit-touch-callout:none){
  input:not([type=checkbox]):not([type=radio]):not([type=range]),textarea,select{font-size:16px!important}
}
textarea{resize:none}

/* ---------- janelas (sheets) sempre dentro da área visível ---------- */
.sheet{max-height:min(88%,calc(100% - env(safe-area-inset-top) - 10px))}
.sheet-body{padding-bottom:calc(20px + env(safe-area-inset-bottom));overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#app.kb-open .sheet{max-height:calc(100% - 8px)}
#app.kb-open .sheet-body{padding-bottom:14px}

/* ---------- botões: compactos, proporcionais, com estados claros ---------- */
.btn{min-height:40px;padding:0 16px;font-size:13.5px;letter-spacing:-.1px;border-radius:12px;-webkit-user-select:none;user-select:none;touch-action:manipulation}
.btn.sm{min-height:32px;padding:0 12px;font-size:12.5px;border-radius:10px}
.btn.block{min-height:42px}
.btn:focus-visible,.icon-btn:focus-visible,.chip:focus-visible{outline:2px solid #22d8ff;outline-offset:2px}
.btn[disabled],.btn[aria-disabled="true"]{opacity:.55;filter:saturate(.55);box-shadow:none!important;cursor:not-allowed;transform:none!important}
.icon-btn{touch-action:manipulation}
#app:not([data-theme="aurora"]) .btn.primary{background:linear-gradient(100deg,#2c5cff,#1f86ff 55%,#14b6ee);box-shadow:0 4px 14px rgba(26,120,255,.32),inset 0 1px 0 rgba(255,255,255,.22)}
#app:not([data-theme="aurora"]) .btn.soft{background:rgba(18,34,80,.62);border:1px solid rgba(110,180,255,.26);color:#d8e7ff}
#app:not([data-theme="aurora"]) .btn.primary:active,#app:not([data-theme="aurora"]) .btn.soft:active{filter:brightness(1.1)}
@media (hover:hover){#app:not([data-theme="aurora"]) .btn.primary:hover{filter:brightness(1.07)}}

/* ---------- telas estreitas ---------- */
@media (max-width:375px){
  .ptabs{justify-content:space-between}
  .ptab{flex:1 1 0;min-width:0;padding:11px 4px;font-size:13px}
  .title{font-size:21px}
  .backbar h2{font-size:18px}
  .hero h2{font-size:19px}
}
@media (max-width:340px){
  .ptab{font-size:12px;padding:10px 2px}
  .btn{padding:0 12px}
  .icon-btn{width:32px;height:32px}
  .stat b{font-size:17px}
}

/* ---------- orientação deitada (pouca altura) ---------- */
@media (max-height:480px) and (orientation:landscape){
  .sheet{max-height:calc(100% - 6px)}
  .hero{min-height:150px}
}
