/* ==========================================================================
   THE WEB LEGENDS OF UCSAL - ESTILOS GERAIS & SISTEMA DE BATALHA RPG
   ========================================================================== */

:root {
  --primary-color: #2D3E56;
  --primary-light: #435a75;
  --secondary-color: #ABCFE5;
  --accent-gold: #f1c40f;
  --accent-red: #e74c3c;
  --accent-green: #2ecc71;
  --accent-purple: #9b59b6;
  --dark-bg: #0d131a;
  --text-light: #ffffff;
  --text-dark: #1a252f;
  --font-pixel: 'Press Start 2P', monospace;
  --font-main: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background-color: var(--dark-bg);
  color: var(--text-light);
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ==========================================================================
   BOTÃO DE ÁUDIO GLOBAL
   ========================================================================== */
.botao-audio {
  position: fixed;
  top: 15px;
  right: 20px;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(45, 62, 86, 0.85);
  border: 2px solid var(--secondary-color);
  color: white;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.botao-audio:hover {
  transform: scale(1.1);
  background: var(--primary-light);
  border-color: #ffffff;
}

/* ==========================================================================
   1. TELA INICIAL / LOGIN MMORPG
   ========================================================================== */
#tela-inicial {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(rgba(10, 15, 25, 0.4), rgba(10, 15, 25, 0.65)), url('img/cenario1.png') center/cover no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  transition: opacity 0.5s ease;
}

.painel-login-mmorpg {
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid rgba(171, 207, 229, 0.45);
  border-radius: 14px;
  padding: 24px 32px;
  width: 92%;
  max-width: 510px;
  max-height: 94vh;
  overflow-y: auto;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.85), inset 0 0 20px rgba(171, 207, 229, 0.1);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #edf2f7;
  font-family: 'JetBrains Mono', monospace;
  animation: fadeInDown 0.8s ease-out;
}

.servidor-status-linha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

.label-servidor {
  color: #8da4be;
}

.nome-servidor {
  color: #abcfd5;
  font-weight: 600;
}

.ping-servidor {
  color: #2ecc71;
  font-weight: 700;
}

/* Abas Login / Registrar */
.abas-autenticacao {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(8, 12, 20, 0.7);
  padding: 5px;
  border-radius: 10px;
  border: 1px solid rgba(171, 207, 229, 0.2);
}

.aba-auth {
  background: transparent;
  border: 1px solid transparent;
  color: #8da4be;
  padding: 10px 12px;
  border-radius: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.aba-auth:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.aba-auth.ativa {
  background: linear-gradient(135deg, #1d6fa5, #0f3d6e);
  color: #ffffff;
  border-color: rgba(108, 178, 235, 0.6);
  box-shadow: 0 3px 12px rgba(29, 111, 165, 0.4);
}

/* Mensagem de Feedback (Erro / Sucesso) */
.mensagem-auth {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  font-weight: 600;
}

.mensagem-auth.msg-erro {
  background: rgba(231, 76, 60, 0.18);
  border: 1px solid rgba(231, 76, 60, 0.6);
  color: #ff9b93;
}

.mensagem-auth.msg-sucesso {
  background: rgba(46, 204, 113, 0.18);
  border: 1px solid rgba(46, 204, 113, 0.6);
  color: #82e0aa;
}

.secao-auth {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.form-login-grupo {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-linha {
  display: flex;
  align-items: center;
  background: rgba(10, 15, 25, 0.78);
  border: 1px solid rgba(171, 207, 229, 0.3);
  border-radius: 8px;
  overflow: hidden;
  padding: 0 14px;
  transition: border-color 0.2s ease;
}

.input-linha:focus-within {
  border-color: #6cb2eb;
  box-shadow: 0 0 8px rgba(108, 178, 235, 0.25);
}

.input-linha label {
  width: 75px;
  color: #8da4be;
  font-size: 13px;
  text-align: left;
  font-weight: 600;
}

.input-linha input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  padding: 10px 8px;
  font-size: 14.5px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
}

.opcoes-login-linha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: #8da4be;
}

.opcoes-termos-registro {
  justify-content: flex-start;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: #3498db;
  cursor: pointer;
}

.link-termos-inline {
  background: none;
  border: none;
  padding: 0;
  color: #6cb2eb;
  font-family: 'JetBrains Mono', monospace;
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.link-termos-inline:hover {
  color: #a3d4ff;
}

.btn-entrar-mmorpg {
  background: linear-gradient(135deg, #1d6fa5, #004085);
  color: #ffffff;
  border: 2px solid #6cb2eb;
  padding: 12px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(0, 123, 255, 0.4);
  transition: all 0.2s ease;
  letter-spacing: 0.8px;
}

.btn-entrar-mmorpg:hover {
  background: linear-gradient(135deg, #2583c2, #0056b3);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.7);
  transform: translateY(-2px);
}

.btn-registrar-mmorpg {
  background: linear-gradient(135deg, #1e8449, #145a32);
  border-color: #58d68d;
  box-shadow: 0 5px 20px rgba(46, 204, 113, 0.35);
}

.btn-registrar-mmorpg:hover {
  background: linear-gradient(135deg, #27ae60, #1e8449);
  box-shadow: 0 8px 25px rgba(46, 204, 113, 0.6);
}

.troca-modo-auth {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

/* Divisor e Botão Google OAuth */
.divisor-oauth {
  display: flex;
  align-items: center;
  text-align: center;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.divisor-oauth::before,
.divisor-oauth::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.divisor-oauth span {
  padding: 0 10px;
}

.btn-google-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #ffffff;
  color: #1f2937;
  border: 2px solid #e2e8f0;
  border-radius: 30px;
  padding: 10px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.btn-google-oauth:hover {
  background: #f8fafc;
  border-color: #6cb2eb;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.icone-google {
  flex-shrink: 0;
}

.rodape-seguranca {
  display: flex;
  justify-content: center;
}

.btn-badge-termos {
  background: rgba(29, 111, 165, 0.15);
  border: 1px solid rgba(108, 178, 235, 0.35);
  color: #a3c9e8;
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-badge-termos:hover {
  background: rgba(29, 111, 165, 0.35);
  color: #ffffff;
  border-color: #6cb2eb;
}

/* Modais de Autenticação (Google OAuth & Termos de Segurança) */
.modal-overlay-auth {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 10, 18, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: 15px;
}

.modal-card-google {
  background: #111827;
  border: 2px solid rgba(171, 207, 229, 0.35);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 430px;
  color: #f3f4f6;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.google-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.google-modal-header h3 {
  margin: 4px 0 0;
  font-size: 18px;
  color: #ffffff;
}

.google-modal-header p {
  margin: 0;
  font-size: 12.5px;
  color: #9ca3af;
}

.lista-contas-google {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conta-google-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 14px;
  color: #f9fafb;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.conta-google-item:hover {
  background: rgba(55, 65, 81, 0.95);
  border-color: #60a5fa;
  transform: translateX(3px);
}

.avatar-google-conta {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.avatar-google-conta.avatar-roxo {
  background: #7c3aed;
}

.info-google-conta {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.info-google-conta span {
  font-size: 11.5px;
  color: #9ca3af;
}

.outra-conta-google-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.titulo-outra-conta {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 600;
}

.outra-conta-google-form input {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(171, 207, 229, 0.3);
  border-radius: 8px;
  padding: 9px 12px;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
}

.outra-conta-google-form input:focus {
  border-color: #60a5fa;
}

.btn-confirmar-google {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-confirmar-google:hover {
  background: #1d4ed8;
}

.google-modal-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
}

.google-modal-footer small {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.4;
}

.btn-fechar-modal-google {
  align-self: flex-end;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #d1d5db;
  border-radius: 6px;
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  cursor: pointer;
}

.btn-fechar-modal-google:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Modal de Termos de Segurança */
.modal-card-termos {
  background: #0f172a;
  border: 2px solid #6cb2eb;
  border-radius: 14px;
  padding: 24px 28px;
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #e2e8f0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.termos-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(108, 178, 235, 0.3);
  padding-bottom: 12px;
}

.icone-escudo-termos {
  font-size: 30px;
}

.termos-header h3 {
  margin: 0;
  font-size: 16px;
  color: #6cb2eb;
}

.termos-header small {
  color: #94a3b8;
  font-size: 11.5px;
}

.termos-corpo {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 6px;
  max-height: 52vh;
}

.termo-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(171, 207, 229, 0.18);
  border-left: 3px solid #3498db;
  border-radius: 8px;
  padding: 10px 14px;
}

.termo-item h4 {
  margin: 0 0 5px;
  font-size: 13px;
  color: #f8fafc;
}

.termo-item p {
  margin: 0;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}

.termo-item code {
  background: rgba(52, 152, 219, 0.2);
  color: #7dd3fc;
  padding: 1px 5px;
  border-radius: 4px;
}

.termos-acoes {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.btn-aceitar-termos {
  background: linear-gradient(135deg, #1e8449, #145a32);
  color: #ffffff;
  border: 1px solid #58d68d;
  border-radius: 8px;
  padding: 10px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-aceitar-termos:hover {
  background: linear-gradient(135deg, #27ae60, #1e8449);
  transform: translateY(-1px);
}

.btn-fechar-termos {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  cursor: pointer;
}

.btn-fechar-termos:hover {
  background: rgba(255, 255, 255, 0.16);
}

.creditos {
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
  text-align: center;
}

.creditos small {
  font-size: 11px;
  color: #718096;
}

/* ==========================================================================
/* ==========================================================================
   CENÁRIOS & OVERLAYS (RENDERIZAÇÃO OTIMIZADA POR GPU)
   ========================================================================== */
.cenario {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--dark-bg);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: opacity, transform;
  contain: layout style paint;
  animation: entradaCenarioSuave 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes entradaCenarioSuave {
  0% {
    opacity: 0;
    transform: scale3d(1.02, 1.02, 1);
  }
  100% {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

#cenario1 {
  background-image: url('img/cenario1.png');
}

#cenario2 {
  background-image: url('img/cenario2.png');
}

#cenario3 {
  background-image: url('img/cenario3.png');
}

.overlay-vinheta {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(8, 12, 20, 0.38) 0%, rgba(8, 12, 20, 0) 22%, rgba(8, 12, 20, 0) 72%, rgba(8, 12, 20, 0.65) 100%),
    radial-gradient(circle at center, rgba(0, 0, 0, 0.05) 42%, rgba(5, 9, 15, 0.72) 100%);
  pointer-events: none;
}

.overlay-alarme {
  background: radial-gradient(circle, rgba(231, 76, 60, 0.15) 30%, rgba(13, 19, 26, 0.85) 100%);
  animation: pulsoAlarme 2s infinite alternate ease-in-out;
}

@keyframes pulsoAlarme {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.cenario-titulo {
  position: absolute;
  top: 25px;
  left: 30px;
  background: rgba(13, 19, 26, 0.85);
  border-left: 4px solid var(--secondary-color);
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--secondary-color);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  z-index: 5;
}

.alarme-texto {
  border-left-color: var(--accent-red);
  color: #ff7675;
  animation: blinkTexto 1.5s infinite;
}

@keyframes blinkTexto {
  50% { opacity: 0.6; }
}

/* ==========================================================================
   NPCS & SPRITES (ACELERAÇÃO 3D & NITIDEZ)
   ========================================================================== */
.npc-container {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
  cursor: pointer;
  backface-visibility: hidden;
  will-change: transform;
}

.npc-container img,
.boss-container img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform, filter;
  -webkit-user-drag: none;
}

#npc1 {
  width: auto;
  max-width: 480px;
  height: 65vh;
  object-fit: contain;
  filter: drop-shadow(0 10px 25px rgba(0,0,0,0.6));
  transition: transform 0.3s ease, filter 0.3s ease;
}

#container-npc1:hover #npc1 {
  transform: scale3d(1.03, 1.03, 1);
  filter: drop-shadow(0 0 20px rgba(171, 207, 229, 0.5));
}

.balao-interacao {
  background: #ffffff;
  color: #1a252f;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  margin-bottom: 8px;
  animation: flutuarBalao 1.5s infinite ease-in-out;
}

@keyframes flutuarBalao {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -8px, 0); }
}

/* Estilos para a Professora Janete */
/* Estilos para o Coordenador Osbaldo */
#npc2 {
  width: auto;
  max-width: 420px;
  height: 55vh;
  object-fit: contain;
  filter: drop-shadow(0 15px 30px rgba(0,0,0,0.7));
  animation: idleNpc 3s infinite ease-in-out;
}

#npc-janete {
  width: auto;
  max-width: 500px;
  height: 65vh;
  object-fit: contain;
  filter: drop-shadow(0 15px 30px rgba(0,0,0,0.7));
  animation: idleNpc 3s infinite ease-in-out;
}

/* Painel de Mini-game de Cálculo */
.painel-mini-game {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  width: 90%;
  max-width: 500px;
}

.calculo-card {
  background: rgba(18, 28, 42, 0.95);
  border: 4px solid var(--accent-purple);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 0 40px rgba(155, 89, 182, 0.4);
  backdrop-filter: blur(10px);
}

.calculo-card h3 {
  margin: 0 0 15px 0;
  color: var(--accent-purple);
  font-family: var(--font-pixel);
  font-size: 18px;
}

#pergunta-calculo {
  font-size: 20px;
  margin-bottom: 25px;
  line-height: 1.4;
}

.opcoes-calculo {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.opcoes-calculo button {
  background: #2D3E56;
  color: white;
  border: 2px solid var(--accent-purple);
  padding: 12px;
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.opcoes-calculo button:hover {
  background: var(--accent-purple);
  transform: scale(1.02);
}

#feedback-calculo {
  margin-top: 15px;
  font-weight: bold;
  min-height: 20px;
}

.feedback-correto { color: var(--accent-green); }
.feedback-errado { color: var(--accent-red); }

#cenario-janete {
  background-image: url('img/fundo-de-janete.png');
  background-size: cover;
  background-position: center center;
  background-color: #1a252f;
}

#cenario4 {
  background-image: url('img/cenario4.png');
  background-size: cover;
  background-position: center center;
}

#cenario5 {
  background-image: url('img/cenario5(lami pegando fogo).png');
  background-size: cover;
  background-position: center center;
}

#npc4-marcio {
  width: auto;
  max-width: 480px;
  height: 60vh;
  object-fit: contain;
  filter: drop-shadow(0 15px 30px rgba(0,0,0,0.8));
  animation: idleNpc 3s infinite ease-in-out;
}

#npc-mago-final {
  width: auto;
  max-width: 500px;
  height: 60vh;
  object-fit: contain;
  filter: drop-shadow(0 15px 35px rgba(231, 76, 60, 0.7));
  animation: idleBoss 2.5s infinite ease-in-out;
}

/* Boss Ronnie */
.boss-container {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 6;
  pointer-events: none;
  backface-visibility: hidden;
  will-change: transform;
}

#npc3-ronnie, #npc3-fight {
  width: auto;
  max-width: 460px;
  height: 48vh;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.8));
  transition: transform 0.2s ease, filter 0.2s ease;
}

#npc3-fight {
  animation: idleBoss 2.5s infinite ease-in-out;
}

@keyframes idleNpc {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -5px, 0); }
}

@keyframes idleBoss {
  0%, 100% { transform: translate3d(0, 0, 0) scale3d(1, 1, 1); }
  50% { transform: translate3d(0, -8px, 0) scale3d(1.02, 1.02, 1); }
}

/* Animações de combate do Ronnie */
.boss-dano {
  animation: danoBossAnim 0.4s ease !important;
  filter: drop-shadow(0 0 35px var(--accent-red)) brightness(1.5) !important;
}

@keyframes danoBossAnim {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-20px, 0, 0) rotate(-3deg); }
  40% { transform: translate3d(20px, 0, 0) rotate(3deg); }
  60% { transform: translate3d(-10px, 0, 0); }
  80% { transform: translate3d(10px, 0, 0); }
}

.boss-ataque {
  animation: ataqueBossAnim 0.5s ease !important;
}

@keyframes ataqueBossAnim {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(30px) scale(1.1); filter: drop-shadow(0 0 30px #9b59b6); }
}

/* Dano flutuante */
.flutuante-dano {
  position: absolute;
  top: 15%;
  font-family: var(--font-pixel);
  font-size: 26px;
  font-weight: 800;
  pointer-events: none;
  z-index: 25;
  opacity: 0;
}

.flutuante-anim {
  animation: subirDesaparecer 1s ease-out forwards;
}

@keyframes subirDesaparecer {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  20% { transform: translateY(-20px) scale(1.2); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-60px) scale(1); opacity: 0; }
}

/* ==========================================================================
   LEGENDA INICIAL NARRATIVA
   ========================================================================== */
.legenda-narrativa {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(10, 15, 25, 0.95);
  border-top: 4px solid var(--secondary-color);
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
}

.legenda-narrativa p {
  margin: 0 0 10px 0;
  font-size: 22px;
  color: #ffffff;
  text-align: center;
  max-width: 900px;
  line-height: 1.5;
}

.dica-continuar {
  font-size: 13px;
  color: var(--secondary-color);
  animation: piscar 1s infinite;
}

@keyframes piscar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ==========================================================================
   CAIXA DE DIÁLOGO UNIVERSAL
   ========================================================================== */
#caixa-dialogo {
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 950px;
  min-height: 160px;
  background: rgba(18, 28, 42, 0.95);
  border: 3px solid var(--secondary-color);
  border-radius: 16px;
  padding: 20px 25px;
  z-index: 150;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(171, 207, 229, 0.2);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 25px;
  cursor: pointer;
}

.avatar-caixa {
  width: 110px;
  height: 110px;
  border-radius: 14px;
  overflow: hidden;
  background: #111a24;
  border: 3px solid var(--secondary-color);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
}

.avatar-caixa img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.dialogo-conteudo {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.cabecalho-dialogo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#nome-personagem {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  background: #2D3E56;
  padding: 4px 14px;
  border-radius: 6px;
  border-left: 3px solid var(--secondary-color);
  letter-spacing: 1px;
}

.dica-tecla {
  font-size: 12px;
  color: #8da4be;
}

#texto-dialogo {
  margin: 0;
  font-size: 19px;
  line-height: 1.5;
  color: #edf2f7;
  min-height: 55px;
}

.indicador-continuar {
  position: absolute;
  right: 0;
  bottom: -10px;
  color: var(--secondary-color);
  font-size: 16px;
  animation: piscarSeta 0.8s infinite alternate;
}

@keyframes piscarSeta {
  0% { transform: translateY(0); opacity: 0.3; }
  100% { transform: translateY(5px); opacity: 1; }
}

/* Formulário de Input de Nome */
#container-input-nome {
  margin-top: 15px;
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 500px;
}

#nome-jogador {
  flex: 1;
  height: 46px;
  background: rgba(10, 16, 24, 0.9);
  color: #ffffff;
  border: 2px solid var(--secondary-color);
  border-radius: 10px;
  padding: 0 15px;
  font-family: var(--font-main);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#nome-jogador:focus {
  border-color: #ffffff;
  box-shadow: 0 0 15px rgba(171, 207, 229, 0.4);
}

#botao-confirmar {
  height: 46px;
  padding: 0 24px;
  background: #2D3E56;
  color: #ffffff;
  border: 2px solid var(--secondary-color);
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

#botao-confirmar:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* ==========================================================================
   ARENA DE BATALHA RPG (CENÁRIO 3)
   ========================================================================== */
#arena-batalha {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 40px;
  z-index: 10;
  pointer-events: none;
}

#arena-batalha > * {
  pointer-events: auto;
}

/* HUD do Boss */
.hud-boss {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: rgba(13, 19, 26, 0.88);
  border: 2px solid #9b59b6;
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(155, 89, 182, 0.25);
  backdrop-filter: blur(5px);
}

.info-boss {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nome-boss {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge-status {
  font-size: 11px;
  background: #8e44ad;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.barra-vida-container {
  width: 100%;
  height: 20px;
  background: #222;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.barra-vida-progresso {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #e74c3c, #9b59b6);
  transition: width 0.4s ease-out;
}

.texto-vida {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 1px 1px 2px #000;
}

/* Terminal de Logs no Centro-Direita */
.terminal-batalha {
  position: absolute;
  top: 95px;
  right: 40px;
  width: 380px;
  height: 170px;
  background: rgba(10, 15, 20, 0.92);
  border: 2px solid #2ecc71;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.terminal-cabecalho {
  background: #142018;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(46, 204, 113, 0.3);
}

.circulo {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.circulo.red { background: #e74c3c; }
.circulo.yellow { background: #f1c40f; }
.circulo.green { background: #2ecc71; }

.terminal-titulo {
  font-size: 11px;
  color: #a8d5ba;
  margin-left: 6px;
  font-family: var(--font-main);
}

.terminal-log {
  padding: 10px 14px;
  overflow-y: auto;
  flex-grow: 1;
  font-size: 13px;
  line-height: 1.4;
  color: #2ecc71;
  font-family: var(--font-main);
  scroll-behavior: smooth;
}

.terminal-log p {
  margin: 0 0 6px 0;
}

.linha-aluno { color: #5dade2; }
.linha-boss { color: #f1948a; }
.linha-sistema { color: #f7dc6f; font-weight: bold; }

/* HUD do Jogador e Painel de Ações na Parte Inferior */
.hud-jogador {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto 10px auto;
  background: rgba(18, 28, 42, 0.94);
  border: 3px solid var(--secondary-color);
  border-radius: 16px;
  padding: 15px 25px;
  display: flex;
  gap: 25px;
  align-items: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
}

.status-jogador {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nome-jogador-display {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icone-aluno {
  font-size: 22px;
}

.barras-jogador {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.barra-grupo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.label-barra {
  font-size: 12px;
  font-weight: 800;
  width: 25px;
  letter-spacing: 1px;
}

.barra-container {
  flex: 1;
  height: 16px;
  background: #111a24;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.barra-progresso {
  height: 100%;
  transition: width 0.3s ease;
}

.barra-hp-fill {
  background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.barra-mp-fill {
  background: linear-gradient(90deg, #3498db, #2980b9);
}

.texto-barra {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 1px 1px 2px #000;
}

/* Grade de Botões de Ação - Layout Aprimorado */
.painel-acoes {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.grupo-acoes {
  display: flex;
  gap: 10px;
}

.grupo-acoes .btn-acao {
  flex: 1;
}

.btn-acao {
  background: #1b2838;
  border: 2px solid #3d566e;
  border-radius: 10px;
  padding: 10px 12px;
  color: #ffffff;
  font-family: var(--font-main);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
  min-height: 70px;
}

.btn-acao:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--secondary-color);
  background: #25394f;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-acao:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

.acao-titulo {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.acao-desc {
  font-size: 10px;
  color: #9ab0c7;
  line-height: 1.2;
}

.btn-ataque { border-left: 4px solid #f39c12; }
.btn-magia { border-left: 4px solid #3498db; }
.btn-defesa { border-left: 4px solid #2ecc71; }
.btn-supremo { border-left: 4px solid #e74c3c; }
.btn-item { border-left: 4px solid #e67e22; }
.btn-especial { border-left: 4px solid #9b59b6; }
.btn-suporte { border-left: 4px solid #f1c40f; }

/* Efeito de Responsividade Insana do Ronnie */
.responsividade-insana {
  animation: insanaAnim 0.5s infinite alternate ease-in-out !important;
  filter: hue-rotate(90deg) contrast(1.5) drop-shadow(0 0 40px var(--accent-purple)) !important;
}

@keyframes insanaAnim {
  0% { transform: scale(1.05) rotate(-2deg) skewX(-2deg); }
  100% { transform: scale(1.1) rotate(2deg) skewX(2deg); }
}

.corpo-insano {
  animation: tremorInsano 0.2s infinite;
  filter: sepia(0.3) saturate(1.5);
}

@keyframes tremorInsano {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-0.5deg); }
  20% { transform: translate(-3px, 0px) rotate(0.5deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(0.5deg); }
  50% { transform: translate(-1px, 2px) rotate(-0.5deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-0.5deg); }
  80% { transform: translate(-1px, -1px) rotate(0.5deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-0.5deg); }
}

/* ==========================================================================
   MODAIS DE FIM DE JOGO (VITÓRIA & DERROTA)
   ========================================================================== */
.modal-fim {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 12, 18, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  backdrop-filter: blur(8px);
}

.card-fim {
  background: #131c28;
  border: 3px solid;
  border-radius: 20px;
  padding: 40px 50px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9);
  animation: scaleUp 0.4s ease-out;
}

@keyframes scaleUp {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.card-vitoria {
  border-color: var(--accent-gold);
  box-shadow: 0 0 40px rgba(241, 196, 15, 0.3);
}

.card-derrota {
  border-color: var(--accent-red);
  box-shadow: 0 0 40px rgba(231, 76, 60, 0.3);
}

.icone-trofeu {
  font-size: 60px;
  margin-bottom: 15px;
  animation: balancarTrofeu 2s infinite ease-in-out;
}

@keyframes balancarTrofeu {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.icone-derrota {
  font-size: 55px;
  color: var(--accent-red);
  font-weight: 800;
  font-family: var(--font-pixel);
  margin-bottom: 15px;
}

.card-fim h2 {
  margin: 0 0 8px 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
}

.subtitulo-vitoria { color: var(--accent-gold); margin: 0 0 15px 0; font-size: 18px; }
.subtitulo-derrota { color: #e74c3c; margin: 0 0 15px 0; font-size: 18px; }

.card-fim p {
  color: #cfd9e8;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 25px;
}

.estatisticas-fim {
  display: flex;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.4);
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 25px;
  font-size: 14px;
}

.acoes-derrota {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.btn-reiniciar {
  background: linear-gradient(135deg, #2D3E56 0%, #1a2533 100%);
  color: #fff;
  border: 2px solid var(--secondary-color);
  border-radius: 50px;
  padding: 14px 35px;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.25s ease;
}

.btn-reiniciar:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(171, 207, 229, 0.4);
}

.btn-tentar-novamente {
  background: linear-gradient(135deg, #c0392b 0%, #962d22 100%);
  border-color: #e74c3c;
}

.btn-tentar-novamente:hover {
  background: #e74c3c;
  box-shadow: 0 5px 20px rgba(231, 76, 60, 0.5);
}

.btn-secundario {
  background: transparent;
  color: #a0aec0;
  border: 2px solid #4a5568;
  border-radius: 50px;
  padding: 14px 25px;
  font-family: var(--font-main);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secundario:hover {
  border-color: #ffffff;
  color: #ffffff;
}

/* ==========================================================================
   OVERLAY DE FLASH & ANIMAÇÕES AUXILIARES
   ========================================================================== */
.overlay-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 99;
  transition: opacity 0.3s ease;
}

.flash-ativo {
  opacity: 0.85;
  transition: opacity 0.05s ease;
}

/* Shake de tela */
.screen-shake {
  animation: tremorTela 0.3s ease;
}

@keyframes tremorTela {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 6px); }
  40% { transform: translate(8px, -6px); }
  60% { transform: translate(-6px, -4px); }
  80% { transform: translate(6px, 4px); }
}

/* Animações gerais */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   RESPONSIVIDADE MULTI-TELAS (Ultra-Wide, Desktops, Tablets, Celulares)
   ========================================================================== */

/* Suporte a Dynamic Viewport Height (dvh) para navegadores mobile modernos */
@supports (height: 100dvh) {
  #tela-inicial,
  .cenario,
  .modal-overlay-auth,
  .modal-fim,
  .overlay-flash {
    height: 100dvh;
  }
}

button,
input,
label {
  touch-action: manipulation;
}

/* 1. Monitores Grandes / Ultra-Wide / 2K e 4K (1440px+) */
@media (min-width: 1440px) {
  .painel-login-mmorpg {
    max-width: 560px;
    padding: 32px 40px;
    gap: 18px;
  }

  #caixa-dialogo {
    max-width: 1120px;
    min-height: 180px;
    padding: 24px 32px;
  }

  .avatar-caixa {
    width: 125px;
    height: 125px;
  }

  #texto-dialogo {
    font-size: 21px;
  }

  .hud-boss {
    max-width: 700px;
  }

  .terminal-batalha {
    width: 440px;
    height: 200px;
    right: 50px;
  }

  .hud-jogador {
    max-width: 1220px;
    padding: 20px 30px;
  }
}

/* 2. Notebooks e Telas Médias (até 1200px) */
@media (max-width: 1200px) {
  #arena-batalha {
    padding: 16px 20px;
  }

  .terminal-batalha {
    width: 310px;
    height: 145px;
    right: 20px;
    top: 85px;
  }

  .hud-jogador {
    max-width: 96%;
    padding: 14px 18px;
    gap: 18px;
  }

  .status-jogador {
    min-width: 190px;
  }
}

/* 3. Tablets e Telas Intermediárias (até 900px) */
@media (max-width: 900px) {
  .cenario-titulo {
    top: 16px;
    left: 16px;
    right: 76px;
    font-size: 12px;
    padding: 7px 14px;
    letter-spacing: 1px;
  }

  /* Arena de Batalha adaptada para Tablet */
  #arena-batalha {
    padding: 12px 14px;
    justify-content: space-between;
  }

  .hud-boss {
    max-width: calc(100% - 65px);
    margin: 0;
    padding: 10px 14px;
  }

  /* Terminal compacto integrado abaixo do HUD do Boss */
  .terminal-batalha {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-width: 100%;
    height: 82px;
    margin: 6px 0 auto 0;
  }

  .terminal-cabecalho {
    padding: 4px 10px;
  }

  .terminal-log {
    padding: 6px 10px;
    font-size: 11.5px;
  }

  .boss-container {
    top: 165px;
  }

  #npc3-ronnie,
  #npc3-fight,
  #npc-mago-final {
    max-height: 32vh;
    max-width: 75vw;
  }

  /* Empilha status do jogador acima das ações em tablets/celulares */
  .hud-jogador {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 4px;
  }

  .status-jogador {
    min-width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .nome-jogador-display {
    font-size: 15px;
    white-space: nowrap;
  }

  .barras-jogador {
    flex: 1;
    flex-direction: row;
    gap: 12px;
  }

  .barra-grupo {
    flex: 1;
  }

  .painel-acoes {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .btn-acao {
    min-height: 56px;
    padding: 8px 10px;
  }

  /* Caixa de Diálogo em Tablets */
  #caixa-dialogo {
    width: 95%;
    padding: 14px 18px;
    gap: 16px;
    min-height: 135px;
  }

  .avatar-caixa {
    width: 82px;
    height: 82px;
  }

  #texto-dialogo {
    font-size: 16px;
  }
}

/* 4. Tablets Compactos e Celulares Maiores (até 768px) */
@media (max-width: 768px) {
  .botao-audio {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .painel-login-mmorpg {
    width: 94%;
    padding: 20px 22px;
    gap: 12px;
    max-height: 92dvh;
  }

  .servidor-status-linha {
    font-size: 12px;
    padding: 8px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }

  #npc1,
  #npc2,
  #npc-janete,
  #npc4-marcio {
    max-width: 85vw;
    height: 52vh;
  }

  .legenda-narrativa {
    padding: 20px 20px;
  }

  .legenda-narrativa p {
    font-size: 17px;
  }

  .calculo-card {
    padding: 22px 18px;
  }

  .calculo-card h3 {
    font-size: 15px;
  }

  #pergunta-calculo,
  #pergunta-prog {
    font-size: 16px;
    margin-bottom: 18px;
  }

  .card-fim {
    width: 92%;
    padding: 28px 24px;
    max-height: 90dvh;
    overflow-y: auto;
  }

  .card-fim h2 {
    font-size: 24px;
  }

  .estatisticas-fim {
    flex-direction: column;
    gap: 8px;
  }

  .acoes-derrota {
    flex-direction: column;
    gap: 10px;
  }

  .btn-reiniciar,
  .btn-secundario {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* 5. Smartphones / Celulares em Retrato (até 480px) */
@media (max-width: 480px) {
  #tela-inicial {
    padding: 8px;
    align-items: center;
  }

  .painel-login-mmorpg {
    width: 96%;
    padding: 16px 14px;
    gap: 10px;
    border-radius: 12px;
    max-height: 94dvh;
  }

  .servidor-status-linha {
    font-size: 11px;
    padding: 7px 9px;
  }

  .abas-autenticacao {
    padding: 4px;
    gap: 6px;
  }

  .aba-auth {
    padding: 8px 6px;
    font-size: 12px;
  }

  .input-linha {
    padding: 0 10px;
  }

  .input-linha label {
    width: 60px;
    font-size: 12px;
  }

  /* 16px evita zoom automático indesejado no iOS Safari ao focar no input */
  .input-linha input {
    font-size: 16px;
    padding: 9px 6px;
  }

  .opcoes-login-linha {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 11.5px;
  }

  .btn-entrar-mmorpg {
    padding: 11px;
    font-size: 14.5px;
  }

  .btn-google-oauth {
    padding: 9px 12px;
    font-size: 13px;
  }

  .btn-badge-termos {
    font-size: 10.5px;
    padding: 6px 10px;
    text-align: center;
    line-height: 1.3;
  }

  /* Modais Google e Termos no Celular */
  .modal-overlay-auth {
    padding: 10px;
  }

  .modal-card-google,
  .modal-card-termos {
    padding: 16px 14px;
    max-height: 90dvh;
    gap: 12px;
  }

  .termos-header h3 {
    font-size: 13.5px;
  }

  .termos-corpo {
    max-height: 55dvh;
  }

  .termos-acoes {
    flex-direction: column;
    gap: 8px;
  }

  .btn-aceitar-termos,
  .btn-fechar-termos {
    width: 100%;
    text-align: center;
  }

  /* Cenários e Diálogo no Celular */
  .cenario-titulo {
    top: 12px;
    left: 10px;
    right: 60px;
    font-size: 10.5px;
    padding: 6px 10px;
    letter-spacing: 0.5px;
  }

  #npc1,
  #npc2,
  #npc-janete,
  #npc4-marcio {
    max-width: 92vw;
    height: 48vh;
  }

  .legenda-narrativa {
    padding: 16px 14px;
  }

  .legenda-narrativa p {
    font-size: 14.5px;
    line-height: 1.45;
  }

  #caixa-dialogo {
    bottom: 8px;
    width: 96%;
    padding: 12px;
    gap: 10px;
    border-radius: 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .avatar-caixa {
    width: 56px;
    height: 56px;
    border-radius: 10px;
  }

  .dialogo-conteudo {
    width: 100%;
  }

  .cabecalho-dialogo {
    flex-wrap: wrap;
    gap: 6px;
  }

  #nome-personagem {
    font-size: 14px;
    padding: 3px 10px;
  }

  .dica-tecla {
    font-size: 10px;
  }

  #texto-dialogo {
    font-size: 14px;
    line-height: 1.4;
    min-height: 42px;
  }

  #container-input-nome {
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }

  #nome-jogador,
  #botao-confirmar {
    width: 100%;
    height: 42px;
    font-size: 15px;
  }

  /* Arena de Batalha no Celular */
  #arena-batalha {
    padding: 8px;
  }

  .hud-boss {
    max-width: calc(100% - 52px);
    padding: 8px 10px;
  }

  .nome-boss {
    font-size: 13px;
  }

  .barra-vida-container {
    height: 16px;
  }

  .terminal-batalha {
    height: 68px;
    margin-top: 4px;
  }

  .terminal-log {
    font-size: 11px;
    padding: 5px 8px;
  }

  .boss-container {
    top: 142px;
  }

  #npc3-ronnie,
  #npc3-fight,
  #npc-mago-final {
    max-height: 24vh;
    max-width: 72vw;
  }

  .hud-jogador {
    padding: 10px;
    gap: 8px;
    border-radius: 12px;
    max-height: 52dvh;
    overflow-y: auto;
  }

  .status-jogador {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nome-jogador-display {
    font-size: 13.5px;
  }

  .barras-jogador {
    flex-direction: row;
    gap: 8px;
  }

  /* Em telas de celular, cada grupo de 2 botões ocupa uma linha inteira (grade 2x4 limpa) */
  .painel-acoes {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .grupo-acoes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .btn-item {
    grid-column: auto;
  }

  .btn-acao {
    min-height: 48px;
    padding: 6px 8px;
    border-radius: 8px;
  }

  .acao-titulo {
    font-size: 11px;
    white-space: normal;
    line-height: 1.15;
  }

  .acao-desc {
    font-size: 9.5px;
  }
}

/* 6. Celulares Muito Pequenos (até 360px) */
@media (max-width: 360px) {
  .painel-login-mmorpg {
    padding: 12px 10px;
    gap: 8px;
  }

  .input-linha {
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 10px;
  }

  .input-linha label {
    width: 100%;
    font-size: 11px;
    margin-bottom: 2px;
  }

  .input-linha input {
    width: 100%;
    padding: 4px 0;
    font-size: 15px;
  }

  .grupo-acoes {
    grid-template-columns: 1fr;
  }
}

/* 7. Modo Paisagem / Horizontal em Celulares (Altura reduzida) */
@media (max-height: 560px) and (orientation: landscape) {
  .painel-login-mmorpg {
    padding: 12px 20px;
    gap: 8px;
    max-width: 580px;
    max-height: 94dvh;
  }

  .form-login-grupo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .input-linha input {
    padding: 7px 6px;
    font-size: 13px;
  }

  .btn-entrar-mmorpg,
  .btn-google-oauth {
    padding: 8px 14px;
    font-size: 13px;
  }

  #npc1,
  #npc2,
  #npc-janete,
  #npc4-marcio {
    height: 62vh;
  }

  #caixa-dialogo {
    bottom: 6px;
    min-height: 95px;
    padding: 10px 16px;
    flex-direction: row;
  }

  .avatar-caixa {
    width: 60px;
    height: 60px;
  }

  #texto-dialogo {
    font-size: 14px;
    min-height: 36px;
  }

  .terminal-batalha {
    display: none;
  }

  .boss-container {
    top: 52px;
  }

  #npc3-ronnie,
  #npc3-fight,
  #npc-mago-final {
    max-height: 34vh;
  }

  .hud-jogador {
    padding: 8px 12px;
    gap: 6px;
    max-height: 46dvh;
    overflow-y: auto;
  }

  .painel-acoes {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .btn-acao {
    min-height: 40px;
    padding: 4px 8px;
  }
}

