/* ======================================================
   TRAVA GLOBAL — CONGELA SITE DURANTE LOADING
====================================================== */

html.site-locked * ,
html.site-locked *::before,
html.site-locked *::after {
  animation-play-state: paused !important;
  transition: none !important;
}

html.site-locked {
  pointer-events: none;
}

html.site-locked #loading-screen,
html.site-locked #loading-screen * {
  pointer-events: auto;
  animation-play-state: running !important;
}

body.loading-lock {
  overflow: hidden;
}

/* ======================================================
   LOADING BASE
====================================================== */

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999999;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  font-family: Cinzel, serif;
  color: #e6d3a3;

  background: radial-gradient(circle at center, #0b0b0b, #000);
  overflow: hidden;
}

/* ======================================================
   TÍTULO
====================================================== */

#loading-title {
  font-size: 26px;
  letter-spacing: 4px;
  margin-bottom: 18px;
}

/* ======================================================
   TEXTO LORE PADRÃO
====================================================== */

#loading-lore {
  font-size: 15px;
  max-width: 520px;
  text-align: center;
  line-height: 1.6;
  letter-spacing: 1px;
  margin-bottom: 30px;
  padding: 0 20px;

  color: #d8d8d8;
  opacity: .85;
}

/* ======================================================
   FRASE RARA — MU ONLINE / DARK FANTASY
====================================================== */

#loading-lore.rare-text {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.08em;
  line-height: 1.6;

  background: linear-gradient(
    120deg,
    #8c6a1f,
    #d4af37,
    #fff1b8,
    #d4af37,
    #8c6a1f
  );

  background-size: 280% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;

  text-shadow:
    0 0 6px rgba(212,175,55,.25),
    0 0 14px rgba(212,175,55,.15);

  opacity: 0;
  transform: scale(.96);
  filter: none;

  animation:
    rareIntro 1.1s ease-out forwards,
    goldShimmer 4s ease-in-out infinite,
    rarePulseText 3s ease-in-out infinite;
}

/* ======================================================
   AVISO DE FRASE RARA
====================================================== */

#rare-notice {
  margin-bottom: 14px;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;

  color: #d4af37;
  opacity: 0;

  animation: rareNoticeFade .6s ease forwards;
}

@keyframes rareNoticeFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======================================================
   ANIMAÇÕES — TEXTO RARO
====================================================== */

@keyframes rareIntro {
  0% {
    opacity: 0;
    transform: scale(.94);
    filter: none;
  }
  60% {
    opacity: 1;
    transform: scale(1.02);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes goldShimmer {
  from { background-position: 0% 50%; }
  to   { background-position: 280% 50%; }
}

@keyframes rarePulseText {
  0%, 100% {
    text-shadow:
      0 0 6px rgba(212,175,55,.25),
      0 0 14px rgba(212,175,55,.15);
  }
  50% {
    text-shadow:
      0 0 10px rgba(255,220,140,.5),
      0 0 22px rgba(212,175,55,.35);
  }
}

/* ======================================================
   FAÍSCAS DOURADAS — RARIDADE
====================================================== */

.rare-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.rare-sparks span {
  position: absolute;
  bottom: -20px;

  width: 2px;
  height: 14px;

  background: linear-gradient(
    to top,
    transparent,
    rgba(255, 190, 90, 0.95)
  );

  opacity: 0;

  animation-name: sparkRise;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.rare-sparks span:nth-child(odd) {
  animation-duration: 1.6s;
}

.rare-sparks span:nth-child(even) {
  animation-duration: 2.2s;
}

.rare-sparks span:nth-child(3n) {
  animation-duration: 2.8s;
}

.rare-sparks span:nth-child(4n) {
  animation-delay: 0.8s;
}

.rare-sparks span:nth-child(5n) {
  animation-delay: 1.4s;
}

.rare-sparks span:nth-child(6n) {
  animation-delay: 2s;
}

@keyframes sparkRise {
  0% {
    transform: translateY(0) scaleY(0.6);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  100% {
    transform: translateY(-160px) scaleY(1.2);
    opacity: 0;
  }
}

/* ======================================================
   BACKGROUND RARO
====================================================== */

#loading-screen.rare-bg {
  background:
    radial-gradient(circle at center,
      rgb(17, 17, 17),
      #000 70%
    );

  animation: rareBgPulse 4s ease-in-out infinite;
}

@keyframes rareBgPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

/* ======================================================
   BARRA DE LOADING
====================================================== */

#loading-bar {
  width: 320px;
  height: 8px;
  background: rgba(255,255,255,.1);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(255,180,90,.25);
}

#loading-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffb86c, #ffdd9e);
  transition: width .25s ease;
}

/* ======================================================
   PORCENTAGEM
====================================================== */

#loading-percent {
  margin-top: 15px;
  font-size: 13px;
  opacity: .85;
}

/* ======================================================
   INSTRUÇÕES
====================================================== */

#loading-skip {
  margin-top: 20px;
  font-size: 11px;
  opacity: .45;
}

/* ======================================================
   PAUSE
====================================================== */

#loading-screen.paused {
  filter: brightness(.85);
}

/* ======================================================
   INDICADOR DE PAUSE
====================================================== */

#pause-indicator {
  position: absolute;
  top: 20px;
  right: 24px;

  font-size: 22px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.85);

  opacity: 0;
  transform: scale(.85);
  transition: opacity .25s ease, transform .25s ease;

  pointer-events: none;
}

#loading-screen.paused #pause-indicator {
  opacity: 1;
  transform: scale(1);
}

/* ======================================================
   MEDIA QUERIES - MOBILE RESPONSIVE
====================================================== */

/* Tablets */
@media screen and (max-width: 1024px) {
  #loading-title {
    font-size: 24px;
    letter-spacing: 3.5px;
    margin-bottom: 16px;
  }

  #loading-lore {
    font-size: 14px;
    max-width: 480px;
    padding: 0 30px;
    margin-bottom: 28px;
  }

  #loading-lore.rare-text {
    font-size: 15px;
  }

  #rare-notice {
    font-size: 10px;
    letter-spacing: 3.5px;
    margin-bottom: 12px;
  }

  #loading-bar {
    width: 300px;
    height: 7px;
  }

  #loading-percent {
    font-size: 12px;
    margin-top: 14px;
  }

  #loading-skip {
    font-size: 10px;
    margin-top: 18px;
  }

  #pause-indicator {
    font-size: 20px;
    top: 18px;
    right: 20px;
  }

  .rare-sparks span {
    height: 12px;
  }
}

/* Smartphones */
@media screen and (max-width: 768px) {
  #loading-title {
    font-size: 22px;
    letter-spacing: 3px;
    margin-bottom: 14px;
    padding: 0 20px;
    text-align: center;
  }

  #loading-lore {
    font-size: 13px;
    max-width: 90%;
    padding: 0 25px;
    margin-bottom: 26px;
    line-height: 1.5;
  }

  #loading-lore.rare-text {
    font-size: 14px;
    letter-spacing: 0.06em;
  }

  #rare-notice {
    font-size: 9px;
    letter-spacing: 3px;
    margin-bottom: 10px;
  }

  #loading-bar {
    width: 280px;
    height: 6px;
  }

  #loading-progress {
    transition: width .2s ease;
  }

  #loading-percent {
    font-size: 11px;
    margin-top: 12px;
  }

  #loading-skip {
    font-size: 9px;
    margin-top: 16px;
    padding: 0 20px;
    text-align: center;
  }

  #pause-indicator {
    font-size: 18px;
    top: 15px;
    right: 18px;
  }

  .rare-sparks span {
    width: 1.5px;
    height: 10px;
  }

  @keyframes sparkRise {
    0% {
      transform: translateY(0) scaleY(0.6);
      opacity: 0;
    }
    20% {
      opacity: 1;
    }
    100% {
      transform: translateY(-120px) scaleY(1.2);
      opacity: 0;
    }
  }
}

/* Smartphones médios */
@media screen and (max-width: 480px) {
  #loading-title {
    font-size: 20px;
    letter-spacing: 2.5px;
    margin-bottom: 12px;
    padding: 0 15px;
  }

  #loading-lore {
    font-size: 12px;
    max-width: 95%;
    padding: 0 20px;
    margin-bottom: 24px;
    line-height: 1.4;
  }

  #loading-lore.rare-text {
    font-size: 13px;
    letter-spacing: 0.05em;
  }

  #rare-notice {
    font-size: 8px;
    letter-spacing: 2.5px;
    margin-bottom: 8px;
  }

  #loading-bar {
    width: calc(100vw - 60px);
    max-width: 260px;
    height: 6px;
  }

  #loading-percent {
    font-size: 10px;
    margin-top: 10px;
  }

  #loading-skip {
    font-size: 8px;
    margin-top: 14px;
    padding: 0 15px;
  }

  #pause-indicator {
    font-size: 16px;
    top: 12px;
    right: 15px;
    letter-spacing: 1.5px;
  }

  .rare-sparks span {
    width: 1.5px;
    height: 8px;
  }

  @keyframes sparkRise {
    0% {
      transform: translateY(0) scaleY(0.6);
      opacity: 0;
    }
    20% {
      opacity: 1;
    }
    100% {
      transform: translateY(-100px) scaleY(1.2);
      opacity: 0;
    }
  }
}

/* Smartphones pequenos */
@media screen and (max-width: 360px) {
  #loading-title {
    font-size: 18px;
    letter-spacing: 2px;
    margin-bottom: 10px;
    padding: 0 10px;
  }

  #loading-lore {
    font-size: 11px;
    padding: 0 15px;
    margin-bottom: 20px;
    line-height: 1.3;
  }

  #loading-lore.rare-text {
    font-size: 12px;
    letter-spacing: 0.04em;
  }

  #rare-notice {
    font-size: 7px;
    letter-spacing: 2px;
    margin-bottom: 6px;
  }

  #loading-bar {
    width: calc(100vw - 40px);
    max-width: 240px;
    height: 5px;
  }

  #loading-percent {
    font-size: 9px;
    margin-top: 8px;
  }

  #loading-skip {
    font-size: 7px;
    margin-top: 12px;
    padding: 0 10px;
  }

  #pause-indicator {
    font-size: 14px;
    top: 10px;
    right: 12px;
    letter-spacing: 1px;
  }

  .rare-sparks span {
    width: 1px;
    height: 6px;
  }

  @keyframes sparkRise {
    0% {
      transform: translateY(0) scaleY(0.6);
      opacity: 0;
    }
    20% {
      opacity: 1;
    }
    100% {
      transform: translateY(-80px) scaleY(1.2);
      opacity: 0;
    }
  }
}

/* Landscape mode - smartphones deitados */
@media screen and (max-height: 500px) and (orientation: landscape) {
  #loading-title {
    font-size: 16px;
    margin-bottom: 8px;
  }

  #loading-lore {
    font-size: 11px;
    margin-bottom: 15px;
    max-width: 70%;
  }

  #loading-lore.rare-text {
    font-size: 12px;
  }

  #rare-notice {
    font-size: 7px;
    margin-bottom: 6px;
  }

  #loading-bar {
    height: 5px;
    width: 240px;
  }

  #loading-percent {
    font-size: 9px;
    margin-top: 8px;
  }

  #loading-skip {
    font-size: 7px;
    margin-top: 10px;
  }

  .rare-sparks span {
    height: 6px;
  }
}