/* ═══ Premium oyun yükleme ekranı (karakter & mağaza) ═══ */
.nova-screen-loader{
  position: fixed;
  inset: 0;
  z-index: 100300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
.nova-screen-loader--open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.nova-screen-loader--closing{
  opacity: 0;
  pointer-events: none;
}
.nova-screen-loader--closing .nova-screen-loader__stage{
  animation: novaLoaderStageOut .5s cubic-bezier(.4, 0, .2, 1) both;
}

/* —— Arka plan katmanları —— */
.nova-screen-loader__backdrop{
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #050810;
}
.nova-screen-loader__mesh{
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(56, 189, 248, .35), transparent 55%),
    radial-gradient(ellipse 60% 45% at 100% 40%, rgba(168, 85, 247, .28), transparent 50%),
    radial-gradient(ellipse 55% 40% at 0% 70%, rgba(34, 211, 238, .2), transparent 48%),
    radial-gradient(ellipse 70% 55% at 50% 100%, rgba(99, 102, 241, .22), transparent 52%);
  animation: novaLoaderMeshDrift 14s ease-in-out infinite alternate;
}
@keyframes novaLoaderMeshDrift{
  0%{ transform: translate3d(0, 0, 0) scale(1); }
  100%{ transform: translate3d(-2%, 1%, 0) scale(1.06); }
}
.nova-screen-loader__aurora{
  position: absolute;
  inset: 0;
  opacity: .65;
  background: linear-gradient(
    125deg,
    transparent 0%,
    rgba(34, 211, 238, .08) 25%,
    rgba(129, 140, 248, .12) 50%,
    rgba(192, 132, 252, .1) 75%,
    transparent 100%
  );
  background-size: 240% 100%;
  animation: novaLoaderAurora 6s ease-in-out infinite;
}
@keyframes novaLoaderAurora{
  0%, 100%{ background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
}
.nova-screen-loader__grid{
  position: absolute;
  inset: 0;
  opacity: .14;
  background-image:
    linear-gradient(rgba(148, 163, 184, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .12) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 65% at 50% 45%, #000 20%, transparent 72%);
  animation: novaLoaderGridPulse 4s ease-in-out infinite;
}
@keyframes novaLoaderGridPulse{
  0%, 100%{ opacity: .1; }
  50%{ opacity: .18; }
}
.nova-screen-loader__vignette{
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 75% 70% at 50% 42%, transparent 35%, rgba(2, 6, 23, .75) 100%);
  pointer-events: none;
}
.nova-screen-loader__scanlines{
  position: absolute;
  inset: 0;
  opacity: .04;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, .45) 2px,
    rgba(0, 0, 0, .45) 4px
  );
  pointer-events: none;
}
.nova-screen-loader__particles{
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.nova-screen-loader__particle{
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  font-size: calc(10px * var(--scale, 1));
  color: rgba(186, 230, 253, .55);
  text-shadow: 0 0 12px rgba(56, 189, 248, .6);
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  animation: novaLoaderParticle var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}
@keyframes novaLoaderParticle{
  0%, 100%{ opacity: 0; transform: translate(-50%, -50%) scale(calc(var(--scale, 1) * .6)); }
  15%{ opacity: .85; }
  50%{ opacity: .35; transform: translate(-50%, calc(-50% - 18px)) scale(var(--scale, 1)); }
  85%{ opacity: .7; }
}

/* —— Merkez sahne —— */
.nova-screen-loader__stage{
  position: relative;
  z-index: 2;
  width: min(480px, 94vw);
  text-align: center;
  padding: clamp(8px, 2vw, 16px);
  animation: novaLoaderStageIn .65s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes novaLoaderStageIn{
  from{
    opacity: 0;
    transform: translateY(28px) scale(.92);
    filter: blur(6px);
  }
  to{
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
@keyframes novaLoaderStageOut{
  to{
    opacity: 0;
    transform: translateY(-12px) scale(1.04);
    filter: blur(8px);
  }
}
.nova-screen-loader__flare{
  position: absolute;
  width: 180px;
  height: 280px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  filter: blur(40px);
  opacity: .45;
  pointer-events: none;
}
.nova-screen-loader__flare--l{
  left: -8%;
  background: radial-gradient(circle, rgba(34, 211, 238, .5), transparent 70%);
  animation: novaLoaderFlareL 5s ease-in-out infinite;
}
.nova-screen-loader__flare--r{
  right: -8%;
  background: radial-gradient(circle, rgba(168, 85, 247, .45), transparent 70%);
  animation: novaLoaderFlareR 5.5s ease-in-out infinite;
}
@keyframes novaLoaderFlareL{
  0%, 100%{ opacity: .35; transform: translateY(-50%) scale(1); }
  50%{ opacity: .55; transform: translateY(-48%) scale(1.08); }
}
@keyframes novaLoaderFlareR{
  0%, 100%{ opacity: .4; transform: translateY(-50%) scale(1.05); }
  50%{ opacity: .25; transform: translateY(-52%) scale(.95); }
}

.nova-screen-loader__brand{
  margin: 0 0 clamp(18px, 4vw, 28px);
  font-size: clamp(.62rem, 2.4vw, .72rem);
  font-weight: 900;
  letter-spacing: .38em;
  text-indent: .38em;
  color: rgba(148, 163, 184, .75);
  text-transform: uppercase;
}
.nova-screen-loader__brand span{
  background: linear-gradient(90deg, #67e8f9, #a78bfa, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-left: .35em;
}

/* —— Emblem / portal —— */
.nova-screen-loader__emblem{
  position: relative;
  width: clamp(120px, 28vw, 148px);
  height: clamp(120px, 28vw, 148px);
  margin: 0 auto clamp(22px, 5vw, 32px);
}
.nova-screen-loader__ring{
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  box-sizing: border-box;
}
.nova-screen-loader__ring--outer{
  inset: 0;
  border-color: rgba(56, 189, 248, .25);
  border-top-color: rgba(34, 211, 238, .85);
  border-right-color: rgba(129, 140, 248, .5);
  box-shadow:
    0 0 30px rgba(34, 211, 238, .25),
    inset 0 0 24px rgba(99, 102, 241, .15);
  animation: novaLoaderSpin 3.2s linear infinite;
}
.nova-screen-loader__ring--mid{
  inset: 14px;
  border-color: rgba(168, 85, 247, .2);
  border-bottom-color: rgba(192, 132, 252, .75);
  border-left-color: rgba(99, 102, 241, .45);
  animation: novaLoaderSpinRev 2.1s linear infinite;
}
.nova-screen-loader__ring--inner{
  inset: 28px;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .06);
  animation: novaLoaderSpin 4.5s linear infinite;
}
@keyframes novaLoaderSpin{
  to{ transform: rotate(360deg); }
}
@keyframes novaLoaderSpinRev{
  to{ transform: rotate(-360deg); }
}
.nova-screen-loader__core{
  position: absolute;
  inset: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .22), transparent 42%),
    linear-gradient(155deg, #1e3a5f 0%, #0f172a 45%, #1a1040 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .14) inset,
    0 12px 40px rgba(2, 6, 23, .65),
    0 0 48px rgba(99, 102, 241, .35);
  animation: novaLoaderCorePulse 2.4s ease-in-out infinite;
}
@keyframes novaLoaderCorePulse{
  0%, 100%{ transform: scale(1); box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset, 0 12px 40px rgba(2,6,23,.65), 0 0 40px rgba(99,102,241,.3); }
  50%{ transform: scale(1.04); box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset, 0 16px 48px rgba(2,6,23,.7), 0 0 56px rgba(129,140,248,.45); }
}
.nova-screen-loader__icon{
  font-size: clamp(1.65rem, 6vw, 2.1rem);
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .4));
  animation: novaLoaderIconFloat 2.8s ease-in-out infinite;
}
@keyframes novaLoaderIconFloat{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-4px); }
}
.nova-screen-loader__spark{
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 14px 3px rgba(186, 230, 253, .9);
  animation: novaLoaderSpark 2s ease-in-out infinite;
}
.nova-screen-loader__spark--a{ top: 8%; left: 50%; animation-delay: 0s; }
.nova-screen-loader__spark--b{ bottom: 12%; right: 10%; animation-delay: .65s; }
.nova-screen-loader__spark--c{ bottom: 18%; left: 8%; animation-delay: 1.2s; }
@keyframes novaLoaderSpark{
  0%, 100%{ opacity: .2; transform: scale(.6); }
  50%{ opacity: 1; transform: scale(1.2); }
}

/* —— Metin —— */
.nova-screen-loader__title{
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1.05rem, 4.5vw, 1.45rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #f8fafc;
  text-shadow:
    0 0 24px rgba(56, 189, 248, .45),
    0 2px 4px rgba(0, 0, 0, .5);
  background: linear-gradient(
    105deg,
    #f8fafc 0%,
    #e0f2fe 22%,
    #c4b5fd 45%,
    #f8fafc 55%,
    #bae6fd 78%,
    #f8fafc 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: novaLoaderTitleShine 3.2s linear infinite;
}
@keyframes novaLoaderTitleShine{
  0%{ background-position: 0% center; }
  100%{ background-position: 220% center; }
}
.nova-screen-loader__sub{
  margin: clamp(10px, 2.5vw, 14px) 0 0;
  font-size: clamp(.82rem, 3.2vw, .98rem);
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, .92);
}
.nova-screen-loader__sub{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 .05em;
}
.nova-screen-loader__dots{
  display: inline-block;
  width: 1.25em;
  text-align: left;
  color: rgba(186, 230, 253, .85);
}
.nova-screen-loader__dots::before{
  content: "";
  animation: novaLoaderDotBlink 1.5s steps(4, end) infinite;
}
@keyframes novaLoaderDotBlink{
  0%{ content: ""; }
  25%{ content: "."; }
  50%{ content: ".."; }
  75%, 100%{ content: "..."; }
}

/* —— İlerleme çubuğu —— */
.nova-screen-loader__progress{
  margin: clamp(22px, 5vw, 30px) auto 0;
  width: min(320px, 78vw);
}
.nova-screen-loader__progress-track{
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .85);
  border: 1px solid rgba(148, 163, 184, .25);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .35) inset,
    0 4px 20px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.nova-screen-loader__progress-fill{
  position: absolute;
  inset: 1px auto 1px 1px;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0891b2, #6366f1, #a855f7, #22d3ee);
  background-size: 200% 100%;
  box-shadow: 0 0 16px rgba(99, 102, 241, .65);
  animation:
    novaLoaderBarSlide 1.35s ease-in-out infinite,
    novaLoaderBarHue 2.5s linear infinite;
}
.nova-screen-loader__progress-shine{
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, .35) 48%,
    transparent 100%
  );
  animation: novaLoaderBarShine 1.35s ease-in-out infinite;
}
@keyframes novaLoaderBarSlide{
  0%{ transform: translateX(-95%); }
  100%{ transform: translateX(240%); }
}
@keyframes novaLoaderBarHue{
  0%{ background-position: 0% 50%; }
  100%{ background-position: 200% 50%; }
}
@keyframes novaLoaderBarShine{
  0%{ transform: translateX(-100%); opacity: 0; }
  40%{ opacity: 1; }
  100%{ transform: translateX(200%); opacity: 0; }
}

/* Mağaza teması — hafif altın vurgu */
.nova-screen-loader[data-loader-kind="store"] .nova-screen-loader__ring--outer{
  border-top-color: rgba(251, 191, 36, .9);
  border-right-color: rgba(245, 158, 11, .45);
  box-shadow: 0 0 30px rgba(245, 158, 11, .28), inset 0 0 24px rgba(251, 191, 36, .12);
}
.nova-screen-loader[data-loader-kind="store"] .nova-screen-loader__title{
  background: linear-gradient(
    105deg,
    #fffbeb 0%,
    #fde68a 30%,
    #f8fafc 50%,
    #fcd34d 75%,
    #fffbeb 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
}
.nova-screen-loader[data-loader-kind="store"] .nova-screen-loader__progress-fill{
  background: linear-gradient(90deg, #d97706, #f59e0b, #fde047, #f59e0b);
  background-size: 200% 100%;
}

/* Arkadaki panel soluk */
body.nova-screen-loader-active .character-inventory-surface,
body.nova-screen-loader-active .profile-change-content.nova-store-shell{
  opacity: .2;
  pointer-events: none;
  filter: blur(4px) saturate(.7);
  transform: scale(.98);
  transition: opacity .35s ease, filter .35s ease, transform .35s ease;
}

/* Mağaza açılışı — daha hafif, cihazı yormayan yükleme */
.nova-screen-loader[data-loader-kind="store"] .nova-screen-loader__particles,
.nova-screen-loader[data-loader-kind="store"] .nova-screen-loader__scanlines,
.nova-screen-loader[data-loader-kind="store"] .nova-screen-loader__flare{
  display: none;
}
.nova-screen-loader[data-loader-kind="store"] .nova-screen-loader__mesh{
  opacity: .72;
}
.nova-screen-loader[data-loader-kind="store"] .nova-screen-loader__aurora{
  opacity: .55;
}
.nova-screen-loader[data-loader-kind="store"] .nova-screen-loader__ring--outer,
.nova-screen-loader[data-loader-kind="store"] .nova-screen-loader__ring--mid{
  animation-duration: 2.8s;
}
.nova-screen-loader[data-loader-kind="store"] .nova-screen-loader__spark{
  display: none;
}

@media (prefers-reduced-motion: reduce){
  .nova-screen-loader__mesh,
  .nova-screen-loader__aurora,
  .nova-screen-loader__grid,
  .nova-screen-loader__particle,
  .nova-screen-loader__ring,
  .nova-screen-loader__core,
  .nova-screen-loader__icon,
  .nova-screen-loader__spark,
  .nova-screen-loader__title,
  .nova-screen-loader__progress-fill,
  .nova-screen-loader__progress-shine,
  .nova-screen-loader__flare{
    animation: none !important;
  }
  .nova-screen-loader__title{
    color: #f8fafc;
    background: none;
    -webkit-text-fill-color: #f8fafc;
  }
}
