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

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #000000;
  -webkit-font-smoothing: antialiased;
  background-color: #b8cdb4;
}

/* Фон-картинка — на iOS рендерится чётче, чем CSS background */
.page-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
  filter: brightness(0.86);
  transform: translateZ(0);
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 28px 14px 40px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Светлая карточка — контраст на тёмном фоне */
.profile-card {
  width: 100%;
  max-width: 300px;
  padding: 26px 22px 22px;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Аватар + пульсирующее кольцо + LIVE */
.avatar-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 16px;
}

.avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #e53935;
  animation: pulse-ring 2.2s ease-out infinite;
  pointer-events: none;
}

.avatar-ring::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(229, 57, 53, 0.4);
  animation: pulse-ring 2.2s ease-out 1.1s infinite;
}

.avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.live-badge {
  position: absolute;
  bottom: 2px;
  right: -10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, #ef5350 0%, #c62828 100%);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(198, 40, 40, 0.45);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: live-blink 1.4s ease-in-out infinite;
}

.title {
  margin: 0 0 4px;
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.25;
  color: #000000;
}

.username {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #2481cc;
}

.description {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: #666666;
}

.subtitle {
  margin: 0 0 20px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #888888;
}

/* Кнопка — овальная, с иконкой TG */
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 210px;
  max-width: 92%;
  margin: 0 auto;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  border-radius: 50px;
  overflow: hidden;
  background: linear-gradient(
    110deg,
    #0077b3 0%,
    #00a8e8 25%,
    #0088cc 50%,
    #00b4ff 75%,
    #0077b3 100%
  );
  background-size: 220% 100%;
  animation: btn-shimmer 3.5s ease-in-out infinite;
  box-shadow: 0 4px 18px rgba(0, 136, 204, 0.45);
  transition: transform 0.15s ease;
}

.button-icon {
  flex-shrink: 0;
  opacity: 0.95;
}

.button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: btn-glint 3.5s ease-in-out infinite;
}

.button:active {
  transform: scale(0.98);
}

.hint {
  margin: 12px 0 0;
  font-size: 0.72rem;
  color: #999999;
}

/* Отзывы — тени + плавание */
.reviews {
  width: 100%;
  max-width: 340px;
}

.reviews-title {
  margin: 0 0 14px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7c6e;
  text-align: center;
}

.reviews-collage {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tg-msg {
  position: relative;
  padding: 10px 12px 22px;
  background: #ffffff;
  border-radius: 12px 12px 12px 4px;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.22),
    0 2px 6px rgba(0, 0, 0, 0.1);
  animation: float-msg 4s ease-in-out infinite;
}

.tg-msg::before {
  content: '';
  position: absolute;
  left: -6px;
  bottom: 8px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-right-color: #ffffff;
  border-left: 0;
}

.tg-name {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2481cc;
}

.tg-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #1a1a1a;
}

.tg-text strong {
  color: #2e7d32;
  font-weight: 600;
}

.tg-time {
  position: absolute;
  right: 10px;
  bottom: 6px;
  font-size: 0.65rem;
  color: #a0a0a0;
}

.msg-1 {
  margin-right: 18px;
  --tilt: -0.6deg;
  animation-delay: 0s;
}

.msg-2 {
  margin-left: 22px;
  --tilt: 0.5deg;
  border-radius: 12px 12px 4px 12px;
  animation-delay: 0.6s;
}

.msg-2::before {
  left: auto;
  right: -6px;
  border-right: 0;
  border-left: 6px solid #ffffff;
}

.msg-3 {
  margin-right: 8px;
  --tilt: -0.3deg;
  animation-delay: 1.2s;
}

.msg-4 {
  margin-left: 14px;
  --tilt: 0.7deg;
  border-radius: 12px 12px 4px 12px;
  animation-delay: 1.8s;
}

.msg-4::before {
  left: auto;
  right: -6px;
  border-right: 0;
  border-left: 6px solid #ffffff;
}

.msg-5 {
  margin-right: 12px;
  --tilt: -0.4deg;
  animation-delay: 2.4s;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes btn-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes btn-glint {
  0%, 100% { left: -80%; }
  50% { left: 130%; }
}

@keyframes float-msg {
  0%, 100% {
    transform: translateY(0) rotate(var(--tilt, 0deg));
  }
  50% {
    transform: translateY(-6px) rotate(var(--tilt, 0deg));
  }
}

@media (max-width: 380px) {
  .page {
    padding: 22px 12px 32px;
    gap: 24px;
  }

  .profile-card {
    max-width: 280px;
    padding: 22px 18px 18px;
  }

  .avatar-wrap,
  .avatar {
    width: 96px;
    height: 96px;
  }

  .title {
    font-size: 1.12rem;
  }

  .msg-2,
  .msg-4 {
    margin-left: 10px;
  }

  .msg-1,
  .msg-3,
  .msg-5 {
    margin-right: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-ring,
  .avatar-ring::after,
  .live-dot,
  .button,
  .button::after,
  .tg-msg {
    animation: none;
  }
}
