/* ============================================================
   Princess D — Support Center
   Неоновая тема. Все цвета берутся из CSS-переменных,
   которые подставляет PHP из data/content.json.
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #efe7ff;
  background: var(--c-bg, #06030f);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------------- Фон ---------------- */

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background:
    radial-gradient(1200px 800px at 50% -10%, color-mix(in srgb, var(--c-secondary) 26%, transparent), transparent 70%),
    radial-gradient(900px 700px at 90% 110%, color-mix(in srgb, var(--c-primary) 22%, transparent), transparent 70%),
    var(--c-bg);
}

.bg-image {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      color-mix(in srgb, var(--c-bg) 92%, transparent),
      color-mix(in srgb, var(--c-bg) 70%, transparent) 45%,
      color-mix(in srgb, var(--c-bg) 95%, transparent));
}

.bg-grid {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -20%;
  height: 90%;
  background-image:
    linear-gradient(color-mix(in srgb, var(--c-primary) 34%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--c-secondary) 30%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(420px) rotateX(66deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 78%);
  opacity: .35;
  animation: gridScroll 9s linear infinite;
}

@keyframes gridScroll {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 64px, 64px 0; }
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  will-change: transform;
}
.orb-1 {
  width: 46vmax; height: 46vmax;
  top: -18vmax; left: -12vmax;
  background: radial-gradient(circle at 30% 30%, var(--c-primary), transparent 62%);
  animation: drift1 22s ease-in-out infinite;
}
.orb-2 {
  width: 40vmax; height: 40vmax;
  bottom: -16vmax; right: -14vmax;
  background: radial-gradient(circle at 60% 40%, var(--c-secondary), transparent 62%);
  animation: drift2 27s ease-in-out infinite;
}
.orb-3 {
  width: 28vmax; height: 28vmax;
  top: 40%; left: 55%;
  background: radial-gradient(circle at 50% 50%, var(--c-accent), transparent 60%);
  opacity: .26;
  animation: drift3 19s ease-in-out infinite;
}

@keyframes drift1 {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50%     { transform: translate3d(6vmax,4vmax,0) scale(1.12); }
}
@keyframes drift2 {
  0%,100% { transform: translate3d(0,0,0) scale(1.05); }
  50%     { transform: translate3d(-7vmax,-5vmax,0) scale(.92); }
}
@keyframes drift3 {
  0%,100% { transform: translate3d(-50%,-50%,0) scale(1); }
  50%     { transform: translate3d(-58%,-42%,0) scale(1.2); }
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(2,0,8,.72) 100%);
}

body.fx-scanlines::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.032) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
  opacity: .55;
}

#stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

#cursor-glow {
  position: fixed;
  z-index: -1;
  width: 420px; height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--c-primary) 30%, transparent), transparent 65%);
  filter: blur(40px);
  opacity: 0;
  transition: opacity .5s ease;
}

/* ---------------- Каркас ---------------- */

.wrap {
  position: relative;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: clamp(36px, 8vw, 84px) clamp(16px, 5vw, 28px) 56px;
}

/* ---------------- Герб / эмблема ---------------- */

.hero { text-align: center; }

.crest {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto clamp(20px, 4vw, 30px);
  display: grid;
  place-items: center;
}

.crest-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--c-primary) 60deg,
    var(--c-accent) 140deg,
    var(--c-secondary) 230deg,
    transparent 320deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: spin 7s linear infinite;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--c-primary) 60%, transparent));
}
.crest-ring--slow {
  inset: 13px;
  animation: spin 11s linear infinite reverse;
  opacity: .7;
}

@keyframes spin { to { transform: rotate(360deg); } }

.crest-core {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,.30), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--c-secondary) 55%, #120726), color-mix(in srgb, var(--c-primary) 45%, #1a0730));
  border: 1px solid color-mix(in srgb, var(--c-accent) 45%, transparent);
  box-shadow:
    0 0 0 6px rgba(255,255,255,.03),
    0 0 34px color-mix(in srgb, var(--c-primary) 55%, transparent),
    inset 0 0 26px rgba(255,255,255,.14);
  animation: crestPulse 4.5s ease-in-out infinite;
}

.crest-core img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.crest-emoji { font-size: 44px; line-height: 1; filter: drop-shadow(0 3px 10px rgba(0,0,0,.5)); }

@keyframes crestPulse {
  0%,100% { box-shadow: 0 0 0 6px rgba(255,255,255,.03), 0 0 30px color-mix(in srgb, var(--c-primary) 50%, transparent), inset 0 0 24px rgba(255,255,255,.12); }
  50%     { box-shadow: 0 0 0 10px rgba(255,255,255,.05), 0 0 56px color-mix(in srgb, var(--c-primary) 78%, transparent), inset 0 0 34px rgba(255,255,255,.2); }
}

.crest-sparks { position: absolute; inset: 0; animation: spin 14s linear infinite; }
.crest-sparks i {
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 5px;
  margin: -2.5px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 12px var(--c-accent), 0 0 22px var(--c-accent);
  transform: rotate(var(--a)) translateY(-74px);
  animation: sparkBlink 2.6s ease-in-out infinite;
}
.crest-sparks i:nth-child(2) { animation-delay: .4s; }
.crest-sparks i:nth-child(3) { animation-delay: .8s; }
.crest-sparks i:nth-child(4) { animation-delay: 1.2s; }
.crest-sparks i:nth-child(5) { animation-delay: 1.6s; }

@keyframes sparkBlink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------------- Бейдж ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 12px;
  margin-bottom: 18px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--c-accent) 88%, #fff);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid color-mix(in srgb, var(--c-accent) 32%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 22px color-mix(in srgb, var(--c-accent) 20%, transparent);
}

.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #35f0a0;
  box-shadow: 0 0 0 0 rgba(53,240,160,.7);
  animation: livePulse 1.8s ease-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(53,240,160,.7); }
  70%  { box-shadow: 0 0 0 9px rgba(53,240,160,0); }
  100% { box-shadow: 0 0 0 0 rgba(53,240,160,0); }
}

/* ---------------- Заголовок ---------------- */

.title {
  position: relative;
  margin: 0;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 900;
  font-size: clamp(40px, 11vw, 74px);
  line-height: 1.02;
  letter-spacing: .015em;
  background: linear-gradient(180deg, #fff 8%, var(--c-accent) 52%, color-mix(in srgb, var(--c-primary) 85%, #fff) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--c-primary) 55%, transparent));
  animation: titleFlicker 7s ease-in-out infinite;
}

.title::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  background: none;
  color: transparent;
  text-shadow:
    0 0 26px color-mix(in srgb, var(--c-primary) 75%, transparent),
    0 0 60px color-mix(in srgb, var(--c-secondary) 55%, transparent);
}

@keyframes titleFlicker {
  0%, 92%, 100% { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--c-primary) 55%, transparent)); }
  93%  { filter: drop-shadow(0 0 6px  color-mix(in srgb, var(--c-primary) 30%, transparent)); opacity: .85; }
  95%  { filter: drop-shadow(0 0 30px color-mix(in srgb, var(--c-primary) 85%, transparent)); opacity: 1; }
  97%  { filter: drop-shadow(0 0 8px  color-mix(in srgb, var(--c-primary) 35%, transparent)); opacity: .9; }
}

.subtitle {
  margin: 12px 0 0;
  font-size: clamp(13px, 3.4vw, 15px);
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--c-secondary) 45%, #cbb9ff);
}

.lead {
  margin: 20px auto 0;
  max-width: 46ch;
  font-size: clamp(14.5px, 3.7vw, 16.5px);
  line-height: 1.65;
  color: rgba(232,222,255,.76);
}

/* ---------------- Статистика ---------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 30px 0 8px;
}

.stat {
  padding: 14px 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  transition: transform .35s cubic-bezier(.2,.8,.3,1), border-color .35s, box-shadow .35s;
}
.stat:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c-primary) 45%, transparent);
  box-shadow: 0 10px 34px -14px color-mix(in srgb, var(--c-primary) 80%, transparent);
}

.stat-value {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(17px, 4.6vw, 22px);
  font-weight: 700;
  color: var(--c-accent);
  text-shadow: 0 0 16px color-mix(in srgb, var(--c-accent) 55%, transparent);
}
.stat-label {
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(220,210,245,.55);
}

/* ---------------- Кнопки-ссылки ---------------- */

.links {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: clamp(30px, 6vw, 44px);
}

.btn {
  --btn: var(--c-primary);
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  border: 1px solid color-mix(in srgb, var(--btn) 34%, transparent);
  backdrop-filter: blur(14px);
  box-shadow:
    0 8px 30px -18px color-mix(in srgb, var(--btn) 90%, transparent),
    inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .3s cubic-bezier(.2,.8,.3,1), box-shadow .3s, border-color .3s;
}

.btn--primary { --btn: var(--c-primary); }
.btn--violet  { --btn: var(--c-secondary); }
.btn--gold    { --btn: var(--c-accent); }
.btn--cyan    { --btn: #3ad6ff; }
.btn--green   { --btn: #35f0a0; }
.btn--ghost   { --btn: #b8a8e8; background: rgba(255,255,255,.02); }

.btn:hover,
.btn:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--btn) 75%, transparent);
  box-shadow:
    0 18px 46px -20px color-mix(in srgb, var(--btn) 100%, transparent),
    0 0 26px -8px color-mix(in srgb, var(--btn) 60%, transparent),
    inset 0 1px 0 rgba(255,255,255,.14);
  outline: none;
}
.btn:active { transform: translateY(-1px) scale(.995); }

.btn-glow {
  position: absolute;
  inset: -40% -10%;
  z-index: -1;
  background: radial-gradient(ellipse at 12% 50%, color-mix(in srgb, var(--btn) 42%, transparent), transparent 62%);
  opacity: .5;
  transition: opacity .35s;
}
.btn:hover .btn-glow { opacity: 1; }

.btn-icon {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  font-size: 21px;
  border-radius: 14px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--btn) 34%, transparent), color-mix(in srgb, var(--btn) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--btn) 40%, transparent);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--btn) 25%, transparent);
  transition: transform .35s cubic-bezier(.2,.8,.3,1);
}
.btn:hover .btn-icon { transform: scale(1.08) rotate(-5deg); }

.btn-text { flex: 1 1 auto; min-width: 0; }

.btn-label {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  text-shadow: 0 0 18px color-mix(in srgb, var(--btn) 45%, transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: rgba(226,216,250,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  border-radius: 999px;
  color: #06030f;
  background: var(--btn);
  box-shadow: 0 0 16px color-mix(in srgb, var(--btn) 70%, transparent);
  animation: badgeGlow 2.4s ease-in-out infinite;
}
@keyframes badgeGlow { 0%,100% { opacity: .85; } 50% { opacity: 1; } }

.btn-arrow {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--btn) 80%, #fff);
  opacity: .55;
  transition: transform .3s cubic-bezier(.2,.8,.3,1), opacity .3s;
}
.btn:hover .btn-arrow { transform: translateX(4px); opacity: 1; }

.btn-shine {
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
  pointer-events: none;
}
.btn:hover .btn-shine { animation: shine 1.1s ease forwards; }
@keyframes shine { to { left: 160%; } }

.empty {
  padding: 22px;
  text-align: center;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.16);
  color: rgba(230,220,250,.6);
}
.empty a { color: var(--c-accent); text-decoration: underline; }

/* ---------------- Примечание ---------------- */

.note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 26px;
  padding: 14px 16px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(226,216,250,.66);
  background: rgba(255,255,255,.028);
  border: 1px solid rgba(255,255,255,.07);
}
.note-icon { flex: 0 0 auto; font-size: 15px; }

/* ---------------- Подвал ---------------- */

.foot {
  margin-top: clamp(38px, 8vw, 58px);
  padding-top: 26px;
  border-top: 1px solid rgba(255,255,255,.07);
  text-align: center;
}
.foot-text {
  margin: 0 auto;
  max-width: 48ch;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(224,214,248,.6);
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 16px;
}
.foot-links a {
  position: relative;
  font-size: 13px;
  font-weight: 600;
  color: rgba(232,222,255,.78);
  transition: color .25s;
}
.foot-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--c-primary);
  transform: scaleX(0);
  transition: transform .3s cubic-bezier(.2,.8,.3,1);
}
.foot-links a:hover { color: #fff; }
.foot-links a:hover::after { transform: scaleX(1); }

.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-top: 20px;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: rgba(210,200,235,.42);
}
.foot-disc {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(230,220,250,.6);
}

/* ---------------- Появление ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: revealIn .8s cubic-bezier(.2,.8,.3,1) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes revealIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Адаптив / доступность ---------------- */

@media (max-width: 420px) {
  .btn { padding: 13px 13px; gap: 11px; }
  .btn-icon { width: 42px; height: 42px; font-size: 19px; }
  .btn-label { font-size: 14.5px; }
  .stats { gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Фолбэк для браузеров без color-mix */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .btn { border-color: rgba(255,255,255,.16); }
  .badge { border-color: rgba(255,207,77,.35); color: #ffcf4d; }
}
