/* Pantalla de presentacion (splash) del login: logo -> clic -> el escudo gira y se aleja,
   y el login nace del mismo punto girando en sentido inverso.
   Estados en <html>: ao-splash-on (splash visible) / ao-splash-in (login entrando). */
html.ao-splash-on #loginModal { visibility: hidden; }

.ao-splash {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: #000; cursor: pointer; outline: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.ao-splash[hidden] { display: none; }

.ao-splash-logo {
  width: min(520px, 78vw, calc((100vh - 96px) * .6667));
  aspect-ratio: 2 / 3;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}
.ao-splash-logo img {
  display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(212,175,55,.18)) drop-shadow(0 0 30px rgba(91,151,191,.10));
  animation: aoSplashGlow 5.5s ease-in-out infinite;
}
.ao-splash-hint {
  font: 600 13px/1 Tahoma, Arial, sans-serif; letter-spacing: .34em; text-transform: uppercase;
  color: #cdb26a; text-shadow: 0 0 10px rgba(212,175,55,.35);
  animation: aoSplashHint 2.4s ease-in-out infinite;
}
.ao-splash:hover .ao-splash-hint, .ao-splash:focus-visible .ao-splash-hint { color: #f0d98a; }

/* Salida: el escudo gira dos vueltas sobre su eje vertical y se aleja hacia el fondo. */
.ao-splash.leaving { cursor: default; animation: aoSplashBg .9s linear forwards; }
.ao-splash.leaving .ao-splash-logo { animation: aoSplashOut .9s cubic-bezier(.55,.05,.85,.45) forwards; }
.ao-splash.leaving .ao-splash-hint { animation: aoSplashHintOut .25s ease forwards; }

/* Entrada del login: nace pequeno desde el mismo punto y crece girando al reves. */
html.ao-splash-in #loginModal { pointer-events: none; }
html.ao-splash-in #loginModal .modal-box {
  transform-origin: 50% 50%;
  animation: aoLoginIn .8s cubic-bezier(.15,.7,.25,1) both;
}

/* Destello dorado en el punto donde el logo desaparece y nace el login. */
.ao-splash-flash {
  position: fixed; left: 50%; top: 50%; z-index: 100001; pointer-events: none;
  width: 46vmin; height: 46vmin; margin: -23vmin 0 0 -23vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,228,150,.95) 0%, rgba(212,175,55,.45) 28%, rgba(212,175,55,0) 68%);
  opacity: 0; transform: scale(.1);
}
.ao-splash-flash.go { animation: aoSplashFlash .55s ease-out forwards; }

@keyframes aoSplashGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(212,175,55,.14)) drop-shadow(0 0 26px rgba(91,151,191,.08)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 16px rgba(212,175,55,.30)) drop-shadow(0 0 44px rgba(91,151,191,.16)); transform: scale(1.012); }
}
@keyframes aoSplashHint { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes aoSplashHintOut { to { opacity: 0; } }
@keyframes aoSplashOut {
  0%   { transform: perspective(1100px) rotateY(0deg) scale(1); opacity: 1; }
  70%  { opacity: .9; }
  100% { transform: perspective(1100px) rotateY(720deg) scale(.03); opacity: 0; }
}
@keyframes aoSplashBg { 0%, 65% { opacity: 1; } 100% { opacity: 0; } }
@keyframes aoLoginIn {
  0%   { transform: perspective(1100px) rotateY(-720deg) scale(.03); opacity: 0; }
  25%  { opacity: .9; }
  100% { transform: perspective(1100px) rotateY(0deg) scale(1); opacity: 1; }
}
@keyframes aoSplashFlash {
  0%   { opacity: 0; transform: scale(.1); }
  30%  { opacity: .9; }
  100% { opacity: 0; transform: scale(1.5); }
}

/* Accesos directos (Wiki / Discord) abajo a la derecha; no inician la entrada al juego. */
.ao-splash-links {
  position: absolute; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 10px;
}
.ao-splash-link {
  display: inline-flex; align-items: center; justify-content: center; height: 38px; min-width: 38px; padding: 0 16px;
  box-sizing: border-box; border: 1px solid rgba(212,175,55,.55); border-radius: 4px; background: rgba(20,16,6,.78);
  color: #cdb26a; font: 700 13px/1 Tahoma, Arial, sans-serif; letter-spacing: .18em; text-decoration: none;
  cursor: pointer; transition: color .15s, border-color .15s, background .15s, box-shadow .15s;
}
.ao-splash-link svg { width: 22px; height: 22px; display: block; }
.ao-splash-link-icon { padding: 0 8px; }
.ao-splash-link:hover, .ao-splash-link:focus-visible {
  color: #f0d98a; border-color: #f0d98a; background: rgba(48,38,12,.9); box-shadow: 0 0 12px rgba(212,175,55,.35); outline: none;
}
.ao-splash.leaving .ao-splash-links { animation: aoSplashHintOut .25s ease forwards; pointer-events: none; }