/* =========================================================
   LOAD SCREEN — PSWG "Grooves"
   Тёмный, минималистичный. Монохром + тёплый янтарный акцент.
   ========================================================= */

.loadscreen-overlay {
  --accent:     #c9a678;                     /* приглушённый янтарь */
  --accent-soft: rgba(201, 166, 120, 0.25);
  --fg:         #e8e6e1;                     /* тёплый off-white */
  --fg-dim:     rgba(232, 230, 225, 0.42);
  --fg-faint:   rgba(232, 230, 225, 0.14);
  --line:       rgba(232, 230, 225, 0.08);

  position: fixed; inset: 0;
  z-index: 99999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #08080a;
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.8s cubic-bezier(.4, 0, .2, 1);
}
.loadscreen-overlay.is-hidden  { opacity: 0; pointer-events: none; }
.loadscreen-overlay.is-removed { display: none; }

/* ── Film grain ── */
.loadscreen-grain {
  position: absolute; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: lsGrain 8s steps(6) infinite;
}
@keyframes lsGrain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-6%, -4%); }
  40%  { transform: translate(-9%, 6%); }
  60%  { transform: translate(5%, -8%); }
  80%  { transform: translate(-4%, 10%); }
  100% { transform: translate(0, 0); }
}

/* ── Виньетка + мягкое тёплое пятно ── */
.loadscreen-vignette {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 55% 45% at 50% 45%, rgba(201,166,120,0.045) 0%, transparent 70%),
    radial-gradient(ellipse 100% 80% at 50% 50%, transparent 25%, rgba(0,0,0,0.65) 100%);
}

/* ── Центральный блок ── */
.loadscreen-center {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center;
}

/* ── Кольца-бороздки ── */
.loadscreen-rings {
  position: relative;
  width: 280px; height: 280px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  animation: lsFadeIn 1.4s ease-out both;
}
@keyframes lsFadeIn { to { opacity: 1; } }

.loadscreen-ring {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px solid var(--line);
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(0deg);
}

/* Разные размеры + скорости + направления */
.loadscreen-ring.r1 {
  width: 78px;  height: 78px;
  border-color: rgba(232, 230, 225, 0.18);
  animation: lsSpin  32s linear infinite;
}
.loadscreen-ring.r2 {
  width: 118px; height: 118px;
  border-color: rgba(232, 230, 225, 0.13);
  animation: lsSpin  56s linear infinite reverse;
}
.loadscreen-ring.r3 {
  width: 168px; height: 168px;
  border-color: rgba(232, 230, 225, 0.09);
  animation: lsSpin  88s linear infinite;
}
.loadscreen-ring.r4 {
  width: 224px; height: 224px;
  border-color: rgba(232, 230, 225, 0.06);
  animation: lsSpin 132s linear infinite reverse;
}
.loadscreen-ring.r5 {
  width: 280px; height: 280px;
  border-color: rgba(232, 230, 225, 0.035);
  border-style: dashed;
  border-width: 1px;
  animation: lsSpin 200s linear infinite;
}

/* «Метка» — точка на кольце, чтобы вращение было заметно */
.loadscreen-ring::before {
  content: '';
  position: absolute;
  top: -2px; left: 50%;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--fg-faint);
  transform: translateX(-50%);
}
.loadscreen-ring.r1::before {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-soft);
  animation: lsDotPulse 3.6s ease-in-out infinite;
}
@keyframes lsDotPulse {
  0%, 100% { transform: translateX(-50%) scale(1);   opacity: 1;    }
  50%      { transform: translateX(-50%) scale(1.5); opacity: 0.65; }
}

@keyframes lsSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Логотип ── */
.loadscreen-logo {
  width: 44px; height: 44px;
  border-radius: 11px;
  object-fit: contain;
  filter: grayscale(0.25) brightness(1.05);
  opacity: 0;
  animation: lsLogo 1.8s cubic-bezier(.2,.9,.3,1) 0.25s both;
  z-index: 2;
}
@keyframes lsLogo {
  from { opacity: 0; transform: scale(0.7); filter: blur(8px); }
  to   { opacity: 0.92; transform: scale(1); filter: blur(0); }
}

/* ── Бренд ── */
.loadscreen-brand {
  margin-top: 32px;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 12px;
  text-indent: 12px;               /* компенсация правого отступа от трекинга */
  color: var(--fg);
  opacity: 0;
  animation: lsRise 1s ease-out 0.55s both;
}
.loadscreen-brand-sub {
  margin-top: 12px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 3.5px;
  text-indent: 3.5px;
  text-transform: uppercase;
  color: var(--fg-dim);
  opacity: 0;
  animation: lsRise 1s ease-out 0.85s both;
}
@keyframes lsRise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ── Прогресс ── */
.loadscreen-bar-wrap {
  margin-top: 52px;
  width: min(260px, 70vw);
  display: flex; flex-direction: column;
  gap: 14px;
  opacity: 0;
  animation: lsRise 1s ease-out 1.15s both;
}
.loadscreen-bar {
  position: relative;
  height: 1px;
  background: var(--fg-faint);
  overflow: visible;
}
.loadscreen-bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 1px;
  width: 0%;
  background: var(--fg);
  transition: width 0.5s cubic-bezier(.4, 0, .2, 1);
}
/* Тлеющая точка на конце */
.loadscreen-bar-fill::after {
  content: '';
  position: absolute;
  top: 50%; right: 0;
  width: 5px; height: 5px;
  margin-right: -2.5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 6px var(--accent),
    0 0 14px var(--accent-soft),
    0 0 24px var(--accent-soft);
}

/* ── Статус + процент ── */
.loadscreen-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.loadscreen-status {
  transition: opacity 0.4s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72%;
}
.loadscreen-percent {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  color: var(--fg-dim);
}

/* ── Skip ── */
.loadscreen-skip {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--fg-dim);
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 3px;
  text-indent: 3px;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, color 0.25s;
}
.loadscreen-skip.show { opacity: 1; pointer-events: auto; }
.loadscreen-skip:hover { color: var(--fg); }

/* ── Мобильная адаптация ── */
@media (max-width: 480px) {
  .loadscreen-rings      { width: 220px; height: 220px; }
  .loadscreen-ring.r5    { width: 220px; height: 220px; }
  .loadscreen-ring.r4    { width: 178px; height: 178px; }
  .loadscreen-ring.r3    { width: 134px; height: 134px; }
  .loadscreen-ring.r2    { width:  94px; height:  94px; }
  .loadscreen-ring.r1    { width:  64px; height:  64px; }
  .loadscreen-logo       { width: 36px; height: 36px; border-radius: 9px; }
  .loadscreen-brand      { font-size: 13px; letter-spacing: 9px; text-indent: 9px; margin-top: 26px; }
  .loadscreen-brand-sub  { font-size: 9px; letter-spacing: 3px; text-indent: 3px; }
  .loadscreen-bar-wrap   { margin-top: 40px; width: 72vw; }
}