:root {
  --bg: #0f1219;
  --card: #181c26;
  --text: #e8eaef;
  --muted: #8b93a7;
  --accent: #6c7cff;
  --accent-hover: #8490ff;
  --online: #22c55e;
  --radius: 16px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: radial-gradient(1200px 800px at 20% -10%, #252a3d 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

.page {
  max-width: 420px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.phase.hidden {
  display: none;
}

.phase {
  text-align: center;
}

.avatar-wrap {
  position: relative;
  width: 120px;
  margin: 0 auto 0.25rem;
}

.avatar-wrap .skeleton-photo,
.avatar-wrap .profile-photo {
  margin: 0;
}

.online-pin {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--card);
  pointer-events: none;
}

.online-pin__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--online);
  animation: online-pulse 2.2s ease-out infinite;
}

@keyframes online-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  55% {
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
  }
}

.skeleton-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 0.5rem;
  background: linear-gradient(110deg, #2a3144 8%, #3a4258 18%, #2a3144 33%);
  background-size: 200% 100%;
  animation: shine 1.2s ease-in-out infinite;
}

/* Реальне фото в колі: без shine (інакше їздить background-position і не збігається з <img>) */
.skeleton-photo.has-image {
  animation: none;
  background-repeat: no-repeat;
}

.skeleton-lines {
  max-width: 240px;
  margin: 0 auto 1rem;
}

.sk {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: linear-gradient(110deg, #2a3144 8%, #3a4258 18%, #2a3144 33%);
  background-size: 200% 100%;
  animation: shine 1.2s ease-in-out infinite;
}

.sk-wide { width: 100%; }
.sk-mid { width: 72%; margin-left: auto; margin-right: auto; }
.sk-narrow { width: 48%; margin-left: auto; margin-right: auto; }

@keyframes shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.loading-text {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.5rem 0 1rem;
}

.progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  max-width: 200px;
  margin: 0 auto;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  transition: width 0.2s ease;
}

.profile-name-below {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  margin: 0 auto 0.5rem;
  display: block;
  /* box-shadow замість border: інакше при border-box область crop стає меншою за 120×120 і змінюється кадрування */
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.profile-photo.placeholder {
  background: linear-gradient(145deg, #3a4258, #2a3144);
}

.error-msg {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--text);
}

.error-msg .profile-name {
  color: #fff;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.register-free-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.locked-gallery {
  margin-top: 1.35rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.locked-gallery__caption {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
  padding: 0 0.25rem;
}

.locked-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  max-width: 280px;
  margin: 0 auto;
}

.locked-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: #232836;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.locked-thumb__fill {
  position: absolute;
  inset: -14px;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(11px) brightness(0.5) saturate(0.85);
  transform: scale(1.06);
}

.locked-thumb__fill--fallback {
  inset: 0;
  transform: none;
  filter: none;
}

/* Окремі завантажені прев’ю — легше розмиття, щоб видно було різні кадри */
.locked-thumb__fill--user {
  filter: blur(5px) brightness(0.55) saturate(0.9);
  transform: scale(1.04);
}

.locked-thumb__img {
  display: block;
  position: absolute;
  inset: -14px;
  width: calc(100% + 28px);
  height: calc(100% + 28px);
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.locked-thumb__img--user {
  filter: blur(5px) brightness(0.55) saturate(0.9);
  transform: scale(1.04);
}

.locked-thumb__fill--fb0 {
  background-image: linear-gradient(140deg, #2a3144, #383050);
}

.locked-thumb__fill--fb1 {
  background-image: linear-gradient(140deg, #303448, #403045);
}

.locked-thumb__fill--fb2 {
  background-image: linear-gradient(140deg, #283040, #353a52);
}

.locked-thumb__fill--fb3 {
  background-image: linear-gradient(140deg, #322838, #2c3646);
}

.locked-thumb__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}

.locked-thumb__lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.88);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

@media (max-width: 340px) {
  .locked-gallery__grid {
    gap: 0.35rem;
  }

  .locked-thumb__lock svg {
    width: 18px;
    height: 18px;
  }
}
