:root {
  --bg: #0b0f14;
  --surface: rgba(26, 35, 50, 0.72);
  --surface-solid: #1a2332;
  --border: rgba(148, 163, 184, 0.14);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #c4b5fd;
  --accent2: #38bdf8;
  --gold: #fcd34d;
  --ok: #86efac;
  --err: #f8b4b4;
  --radius: 16px;
  --font: "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ─── Фон ─── */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: float 14s ease-in-out infinite;
}

.orb-a {
  width: 420px;
  height: 420px;
  background: #6366f1;
  top: -120px;
  left: -80px;
}

.orb-b {
  width: 380px;
  height: 380px;
  background: #0ea5e9;
  bottom: -100px;
  right: -60px;
  animation-delay: -7s;
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black, transparent);
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, 18px) scale(1.05); }
}

/* ─── Анимации появления ─── */
.anim-in {
  animation: fadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-d1 { animation-delay: 0.08s; }
.anim-d2 { animation-delay: 0.16s; }

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Gate (лендинг) — поверх страницы, не сдвигает каталог ─── */
.gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.gate[hidden] {
  display: none !important;
}

.gate.leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.75rem 1.75rem;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.logo {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.gate-title {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ddd6fe 0%, #fff 55%, #bae6fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gate-sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ─── Голова игрока ─── */
.head-stage {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 1.5rem;
}

.head-stage-sm {
  width: 56px;
  height: 56px;
  margin: 0;
  flex-shrink: 0;
}

.head-ring {
  position: absolute;
  inset: -4px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  opacity: 0.55;
  animation: pulseRing 2.5s ease-in-out infinite;
}

.head-stage-sm .head-ring {
  border-radius: 12px;
  inset: -2px;
}

@keyframes pulseRing {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.02); }
}

.head-img,
.head-placeholder {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  object-fit: cover;
  image-rendering: pixelated;
}

.head-stage-sm .head-img,
.head-stage-sm .head-placeholder {
  border-radius: 10px;
}

.head-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border: 1px solid var(--border);
  font-size: 2rem;
  font-weight: 700;
  color: var(--muted);
  transition: opacity 0.25s ease;
}

.head-placeholder.hidden,
.head-img[hidden] {
  display: none;
}

.head-stage.has-head .head-placeholder {
  display: none;
}

/* ─── Форма gate ─── */
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gate-form input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gate-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 181, 253, 0.2);
}

.gate-form input::placeholder {
  color: #64748b;
}

.gate-form button[type="submit"] {
  position: relative;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.35);
}

.gate-form button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.45);
}

.gate-form button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.gate-error {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--err);
}

/* ─── Shop ─── */
.shop {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}

.shop[hidden] {
  display: none !important;
}

.shop.visible {
  animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.player-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.player-name {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.player-rank {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.player-rank .rank-label {
  color: var(--muted);
}

.player-rank .rank-name {
  font-weight: 600;
}

.rank-id-pathfinder .rank-name { color: #fcd34d; }
.rank-id-seeker .rank-name { color: #38bdf8; }
.rank-id-keeper .rank-name { color: #c4b5fd; }

.rank-id-archon .rank-name {
  background: linear-gradient(135deg, #fcd34d 0%, #ddd6fe 45%, #f0abfc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rank-id-player .rank-name,
.rank-id-none .rank-name {
  color: var(--muted);
}

.btn-ghost {
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(196, 181, 253, 0.08);
}

.section {
  margin-bottom: 2rem;
}

.section-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.section-sub {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.staff-notice {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(248, 180, 180, 0.35);
  background: rgba(248, 180, 180, 0.08);
  color: #fecaca;
  font-size: 0.9rem;
  line-height: 1.45;
}

.staff-notice[hidden] {
  display: none !important;
}

.tiers {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.pay-section {
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pay-providers {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.pay-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.pay-option:hover {
  border-color: rgba(196, 181, 253, 0.45);
}

.pay-option.active {
  border-color: var(--accent);
  background: rgba(196, 181, 253, 0.12);
  box-shadow: 0 0 0 1px rgba(196, 181, 253, 0.25);
}

.pay-option-name {
  font-size: 1rem;
  font-weight: 600;
}

.pay-option-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.tier .tier-tagline {
  margin: 0 0 0.65rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.tier .tier-stats {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.tier ul.perk-list {
  margin: 1rem 0;
  padding: 0;
  list-style: none;
  flex: 1;
}

.tier ul.perk-list li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.55rem;
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.tier ul.perk-list li.perk-includes {
  font-weight: 600;
  color: var(--ok);
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.2);
}

.tier ul.perk-list li.perk-empty {
  color: var(--muted);
  font-style: italic;
}

.tier ul.perk-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tier-color, var(--accent));
}

.tier ul.perk-list li.perk-includes::before {
  background: var(--ok);
}

.tier {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.tier:hover {
  transform: translateY(-4px);
  border-color: rgba(196, 181, 253, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.tier:nth-child(1) { animation-delay: 0.05s; }
.tier:nth-child(2) { animation-delay: 0.12s; }
.tier:nth-child(3) { animation-delay: 0.19s; }
.tier:nth-child(4) { animation-delay: 0.26s; }

.tier-id-pathfinder { --tier-color: #fcd34d; }
.tier-id-seeker { --tier-color: #38bdf8; }
.tier-id-keeper { --tier-color: #c4b5fd; }
.tier-id-archon { --tier-color: #f0abfc; }

.tier h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--tier-color, var(--text));
}

.tier-id-archon h3 {
  background: linear-gradient(135deg, #fcd34d 0%, #ddd6fe 48%, #f0abfc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.tier .price {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--accent2);
  line-height: 1.2;
}

.tier .upgrade {
  font-size: 0.82rem;
  color: var(--ok);
  margin-top: 0.25rem;
}

.tier button.buy {
  width: 100%;
  margin-top: auto;
  padding: 0.75rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}

.tier button.buy:hover:not(:disabled) {
  transform: translateY(-1px);
}

.tier button.buy:disabled {
  background: #334155;
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
}

.card-recent {
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.recent {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.4s ease both;
}

.recent li:last-child {
  border-bottom: none;
}

.recent img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.recent .recent-body {
  flex: 1;
  min-width: 0;
}

.recent strong {
  color: var(--text);
}

.recent .muted {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.recent-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding-top: 1rem;
}

.site-footer .dot {
  margin: 0 0.4rem;
  opacity: 0.5;
}

@media (max-width: 520px) {
  .gate-card {
    padding: 1.5rem 1.25rem;
  }

  .shop-header {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-ghost {
    width: 100%;
    text-align: center;
  }
}
