/* Estilos próprios da página (antes ficavam num <style> dentro do index.html). */
body {
  background-color: #0a0812;
  color: #e2e8f0;
  font-family: 'Inter', sans-serif;
}
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #0f0c1c;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #2e234d;
  border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #9333ea;
}
.parchment-box {
  background: linear-gradient(135deg, #f7f1e5 0%, #ebe0cc 100%);
  color: #2b1f0d;
  border: 1px solid #c9b084;
}
.purple-card {
  background-color: #171229;
  border: 1px solid #2e234d;
}
.purple-card-active {
  background-color: #241a3d;
  border: 1px solid #a855f7;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

/* Anel do seletor de modelo de IA: verde neon quando carregado; âmbar crescendo do topo para os dois lados enquanto carrega */
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.model-ring { display: inline-flex; padding: 2px; border-radius: 10px; background: rgba(129,140,248,.35);
  transition: --ang .6s linear, box-shadow .5s ease, background-color .5s ease; }
.model-ring > select { border: 0 !important; border-radius: 8px; outline: none; margin: 0 !important; background-color: #1e1b4b !important; }
.model-ring.ready { background: #22c55e; box-shadow: 0 0 6px 1px rgba(34,197,94,.85), 0 0 16px 3px rgba(34,197,94,.45); }
.model-ring.loading { box-shadow: 0 0 8px 1px rgba(245,158,11,.55);
  background: conic-gradient(from 0deg, #f59e0b 0deg var(--ang), rgba(129,140,248,.30) var(--ang) calc(360deg - var(--ang)), #f59e0b calc(360deg - var(--ang)) 360deg); }
.model-ring.closing { background: #f59e0b; box-shadow: 0 0 10px 2px rgba(245,158,11,.8); }
.model-ring.error { background: #ef4444; box-shadow: 0 0 6px 1px rgba(239,68,68,.7); }

/* ===== ABERTURA (splash) e artes de marca =====
   Tudo aqui fica em CSS de arquivo (a política de segurança da página não aceita estilo inline). */
#splash { position: fixed; inset: 0; z-index: 9999; overflow: hidden; background: #140f24; color: #fde68a;
  transition: opacity .8s ease, visibility .8s; animation: splash-reserva .01s linear 9s forwards; }
#splash.saindo { opacity: 0; visibility: hidden; pointer-events: none; }
/* celular (retrato): a fachada da Taverna ocupa a largura e a mesma arte, borrada, preenche o resto da tela */
#splash .splash-fundo { position: absolute; inset: -40px; background: url(/static/img/marca/brasao.webp) center / cover no-repeat;
  filter: blur(26px) brightness(.7) saturate(1.2); }
#splash .splash-arte { position: absolute; left: 0; right: 0; margin: 0 auto; width: min(100vw, 680px); height: min(100vw, 680px);
  top: calc(42% - min(100vw, 680px) / 2); background: url(/static/img/marca/brasao.webp) center / cover no-repeat;
  animation: splash-entrada 1.1s ease-out both;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent); }
/* computador (paisagem): a arte larga cobre a tela inteira */
@media (min-aspect-ratio: 5/4) {
  #splash .splash-fundo { display: none; }
  #splash .splash-arte { inset: 0; margin: 0; width: auto; height: auto; background: url(/static/img/marca/splash-paisagem.webp) center / cover no-repeat; animation: splash-zoom 14s ease-out both; -webkit-mask-image: none; mask-image: none; }
}
#splash::after { content: ""; position: absolute; inset: auto 0 0 0; height: 38%; pointer-events: none;
  background: linear-gradient(to top, rgba(10,8,18,.92), rgba(10,8,18,.55) 55%, rgba(10,8,18,0)); }
#splash .splash-rodape { position: absolute; z-index: 2; left: 0; right: 0; bottom: max(28px, env(safe-area-inset-bottom)); padding: 0 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
#splash .splash-frase { font-family: 'Cinzel', serif; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: clamp(12px, 2.2vw, 17px);
  color: #fcd34d; text-shadow: 0 2px 14px rgba(0,0,0,.9), 0 0 22px rgba(245,158,11,.45); }
#splash .splash-barra { width: min(300px, 62vw); height: 4px; border-radius: 999px; background: rgba(251,191,36,.18); overflow: hidden; }
#splash .splash-barra i { display: block; height: 100%; width: 40%; border-radius: 999px;
  background: linear-gradient(90deg, transparent, #fbbf24, #a855f7, transparent); animation: splash-barra 1.5s ease-in-out infinite; }
#splash .splash-dica { font-size: 11px; color: rgba(233,213,255,.75); text-shadow: 0 1px 8px rgba(0,0,0,.9); }
@keyframes splash-entrada { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }
@keyframes splash-zoom { from { transform: scale(1); } to { transform: scale(1.07); } }
@keyframes splash-barra { from { transform: translateX(-120%); } to { transform: translateX(300%); } }
@keyframes splash-reserva { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* Tela de entrada: foto da taverna ao fundo, escurecida, com lento movimento de câmera */
.fundo-entrada { position: relative; isolation: isolate; }
.fundo-entrada::before { content: ""; position: fixed; inset: 0; z-index: -1; background:
  linear-gradient(rgba(10,8,18,.62), rgba(10,8,18,.88)), url(/static/img/marca/arte-celebracao-1.webp) center / cover no-repeat;
  animation: entrada-zoom 40s ease-in-out infinite alternate; }
@media (min-aspect-ratio: 5/4) {
  .fundo-entrada::before { background: linear-gradient(rgba(10,8,18,.58), rgba(10,8,18,.86)), url(/static/img/marca/arte-festa-1.webp) center / cover no-repeat; }
}
@keyframes entrada-zoom { from { transform: scale(1); } to { transform: scale(1.08); } }

/* Artes das telas de espera (rodízio com fade e zoom lento) */
.arte-carregamento { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.8s ease; transform: scale(1.04); }
.arte-carregamento.ativa { opacity: 1; animation: arte-zoom 16s ease-out forwards; }
@keyframes arte-zoom { from { transform: scale(1.04); } to { transform: scale(1.14); } }

@media (prefers-reduced-motion: reduce) {
  #splash .splash-arte, #splash .splash-barra i, .fundo-entrada::before, .arte-carregamento.ativa { animation: none; }
}

/* INTERRUPTOR de RPG (InterruptorRpg no app.js): apagado fica fosco; ligado acende em dourado com brilho */
.interruptor-rpg { position: relative; flex: none; width: 44px; height: 24px; border-radius: 999px; border: 1px solid rgba(147,51,234,.45);
  background: rgba(30,27,75,.8); cursor: pointer; transition: background .25s, border-color .25s, box-shadow .25s; padding: 0; }
.interruptor-rpg i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #6b5b95;
  transition: transform .25s, background .25s, box-shadow .25s; }
.interruptor-rpg.ligado { background: rgba(120,53,15,.65); border-color: #f59e0b; box-shadow: 0 0 6px 1px rgba(245,158,11,.7), 0 0 16px 3px rgba(245,158,11,.35); }
.interruptor-rpg.ligado i { transform: translateX(20px); background: #fbbf24; box-shadow: 0 0 8px 2px rgba(251,191,36,.9); }
.interruptor-rpg:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.interruptor-rpg:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .interruptor-rpg, .interruptor-rpg i { transition: none; } }

/* SELETOR de RPG (SeletorRpg no app.js): lista suspensa em pergaminho escuro com filete dourado, no lugar do <select> do navegador */
.seletor-rpg { position: relative; }
.seletor-rpg-botao { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 10px;
  border: 1px solid rgba(217,119,6,.45); background: linear-gradient(180deg, rgba(46,16,101,.55), rgba(24,16,48,.9)); color: #e9d5ff; font-size: 12px; text-align: left;
  cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.seletor-rpg-botao:hover, .seletor-rpg-botao:focus-visible, .seletor-rpg.aberto .seletor-rpg-botao { border-color: #fbbf24; box-shadow: 0 0 8px 1px rgba(245,158,11,.4); outline: none; }
.seletor-rpg-botao.escolhido { color: #fde68a; }
.seletor-rpg-seta { color: #f59e0b; font-size: 10px; transition: transform .2s; }
.seletor-rpg.aberto .seletor-rpg-seta { transform: rotate(180deg); }
.seletor-rpg-lista { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 14rem; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  border-radius: 12px; border: 1px solid rgba(217,119,6,.6); background: #140f24; box-shadow: 0 10px 28px rgba(0,0,0,.6), 0 0 14px rgba(245,158,11,.18); }
.seletor-rpg-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; color: #d8b4fe; font-size: 12px; cursor: pointer; }
.seletor-rpg-item small { display: block; color: #a78bfa; font-size: 10px; }
.seletor-rpg-item .marca { width: 10px; color: transparent; font-size: 9px; }
.seletor-rpg-item.ativo { background: rgba(124,58,237,.35); color: #fff; }
.seletor-rpg-item.escolhido { color: #fde68a; }
.seletor-rpg-item.escolhido .marca { color: #f59e0b; }
@media (max-width: 639px) { .seletor-rpg-botao, .seletor-rpg-item { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .seletor-rpg-botao, .seletor-rpg-seta { transition: none; } }
