.profile-page {
  --profile-surface: rgba(15, 30, 52, 0.94);
  --profile-card: #142540;
  --profile-card-light: #192d4b;
  --profile-cyan: #35e0f2;
  --profile-purple: #a278ff;
  --profile-muted: #b7c3d6;
  --profile-line: rgba(130, 165, 205, 0.18);
}

body .page-content.profile-page {
  margin-top: 110px;
  padding: 46px;
  overflow: hidden;
  border: 1px solid var(--profile-line);
  background:
    radial-gradient(ellipse at 86% 0%, rgba(162, 120, 255, 0.11), transparent 34%),
    linear-gradient(155deg, #0d1a2e 0%, #091526 100%);
}

.profile-page-heading,
.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.profile-page-heading {
  align-items: center;
  margin-bottom: 28px;
}

.profile-eyebrow,
.rank-card-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--profile-cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
}

.profile-page-heading h2,
.profile-section-title h2 {
  color: #f5f8ff;
  font-size: 28px;
  font-weight: 700;
}

.profile-page-heading h2 em,
.profile-section-title h2 em {
  color: var(--profile-cyan);
  font-style: normal;
}

.demo-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(162, 120, 255, 0.3);
  border-radius: 30px;
  background: rgba(162, 120, 255, 0.1);
  color: #d3c4ff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.profile-hero {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 210px;
  align-items: center;
  gap: 32px;
  padding: 30px;
  border: 1px solid var(--profile-line);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 0% 50%, rgba(53, 224, 242, 0.1), transparent 55%),
    linear-gradient(120deg, #13243e, #101c31);
}

.profile-avatar-wrap {
  position: relative;
  width: 142px;
  height: 142px;
}

.profile-avatar {
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid rgba(53, 224, 242, 0.72);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 28px rgba(53, 224, 242, 0.2);
}

.avatar-level {
  position: absolute;
  right: -7px;
  bottom: 8px;
  padding: 6px 10px;
  border: 2px solid #13243e;
  border-radius: 20px;
  background: var(--profile-purple);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.profile-intro {
  min-width: 0;
}

.online-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--profile-cyan);
  font-size: 12px;
  font-weight: 600;
}

.online-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--profile-cyan);
  box-shadow: 0 0 10px rgba(53, 224, 242, 0.65);
}

.profile-intro h1 {
  margin: 0 0 8px;
  color: #f5f8ff;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
}

.profile-intro > p {
  max-width: 620px;
  color: var(--profile-muted);
  font-size: 13px;
  line-height: 1.8;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
}

.profile-meta span {
  color: #d1d9e7;
  font-size: 12px;
}

.profile-meta i {
  margin-right: 6px;
  color: var(--profile-purple);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 19px;
}

.profile-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 24px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.profile-button:hover {
  transform: translateY(-2px);
}

.profile-button-primary {
  background: var(--profile-cyan);
  box-shadow: 0 0 18px rgba(53, 224, 242, 0.2);
  color: #081322;
}

.profile-button-primary:hover {
  background: #75f0fb;
  box-shadow: 0 0 24px rgba(53, 224, 242, 0.38);
  color: #081322;
}

.profile-button-secondary {
  border-color: rgba(162, 120, 255, 0.45);
  background: rgba(162, 120, 255, 0.08);
  color: #d8caff;
}

.profile-button-secondary:hover {
  border-color: var(--profile-purple);
  background: rgba(162, 120, 255, 0.17);
  color: #fff;
}

.profile-action-status {
  min-height: 18px;
  margin-top: 7px;
  color: var(--profile-cyan);
  font-size: 11px;
  line-height: 1.5;
}

.rank-card {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  border: 1px solid rgba(162, 120, 255, 0.3);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(162, 120, 255, 0.13), rgba(20, 37, 64, 0.86));
  text-align: center;
}

.rank-card-kicker {
  margin-bottom: 12px;
  color: #c9b7ff;
  font-size: 9px;
  letter-spacing: 1.5px;
}

.rank-emblem {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin-bottom: 9px;
  border: 1px solid rgba(162, 120, 255, 0.65);
  border-radius: 16px;
  background: rgba(162, 120, 255, 0.16);
  box-shadow: 0 0 20px rgba(162, 120, 255, 0.18);
  color: #d8caff;
  font-size: 22px;
  transform: rotate(45deg);
}

.rank-emblem i {
  transform: rotate(-45deg);
}

.rank-card > strong {
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.7px;
}

.rank-card > span:not(.rank-card-kicker) {
  margin-top: 5px;
  color: var(--profile-muted);
  font-size: 9px;
}

.rank-progress {
  width: 100%;
  height: 5px;
  margin: 16px 0 7px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
}

.rank-progress span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--profile-cyan), var(--profile-purple));
  box-shadow: 0 0 12px rgba(53, 224, 242, 0.36);
}

.rank-card small {
  color: var(--profile-muted);
  font-size: 9px;
}

.profile-section {
  margin-top: 42px;
}

.section-title-row {
  margin-bottom: 20px;
}

.profile-section-title h2 {
  font-size: 25px;
}

.section-title-row > p {
  color: var(--profile-muted);
  font-size: 11px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  display: flex;
  min-height: 102px;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--profile-line);
  border-radius: 17px;
  background: var(--profile-card);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover,
.favorite-card:hover,
.clip-card:hover {
  transform: translateY(-4px);
  border-color: rgba(53, 224, 242, 0.45);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22), 0 0 18px rgba(53, 224, 242, 0.08);
}

.stat-icon,
.activity-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(53, 224, 242, 0.24);
  border-radius: 13px;
  background: rgba(53, 224, 242, 0.1);
  color: var(--profile-cyan);
  font-size: 17px;
}

.stat-icon.purple,
.activity-icon.purple {
  border-color: rgba(162, 120, 255, 0.3);
  background: rgba(162, 120, 255, 0.12);
  color: #c8b2ff;
}

.stat-card strong,
.stat-card div > span {
  display: block;
}

.stat-card strong {
  color: #f5f8ff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card strong small {
  color: var(--profile-muted);
  font-size: 11px;
  font-weight: 500;
}

.stat-card div > span {
  margin-top: 5px;
  color: var(--profile-muted);
  font-size: 10px;
}

.favorite-games {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.favorite-card {
  overflow: hidden;
  border: 1px solid var(--profile-line);
  border-radius: 17px;
  background: var(--profile-card);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.favorite-card > img {
  display: block;
  width: 100%;
  height: 175px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.favorite-card:hover > img {
  transform: scale(1.04);
}

.favorite-card-content {
  position: relative;
  padding: 16px;
}

.game-tag {
  display: inline-block;
  margin-bottom: 7px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(53, 224, 242, 0.11);
  color: var(--profile-cyan);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.game-tag.purple-tag {
  background: rgba(162, 120, 255, 0.13);
  color: #c8b2ff;
}

.favorite-card h3,
.clip-details h3 {
  color: #f5f8ff;
  font-size: 15px;
  font-weight: 700;
}

.favorite-card p {
  margin-top: 7px;
  color: var(--profile-muted);
  font-size: 10px;
  line-height: 1.5;
}

.favorite-card p i {
  margin-right: 4px;
  color: var(--profile-purple);
}

.text-link {
  color: var(--profile-cyan);
  font-size: 11px;
  font-weight: 600;
}

.text-link i {
  margin-left: 5px;
  transition: transform 0.2s ease;
}

.text-link:hover i {
  transform: translateX(3px);
}

.clip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.clip-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--profile-line);
  border-radius: 16px;
  background: var(--profile-card);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.clip-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.48;
  background: #0a1424;
}

.clip-thumb > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.clip-card:hover .clip-thumb > img {
  transform: scale(1.06);
}

.clip-thumb::after {
  position: absolute;
  z-index: 0;
  background: linear-gradient(0deg, rgba(5, 12, 24, 0.55), transparent 55%);
  content: "";
  inset: 0;
  pointer-events: none;
}

.clip-duration,
.clip-demo-chip {
  position: absolute;
  z-index: 1;
  bottom: 9px;
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(5, 12, 24, 0.78);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
}

.clip-duration {
  left: 9px;
}

.clip-demo-chip {
  right: 9px;
  color: var(--profile-cyan);
  letter-spacing: 0.7px;
}

.clip-preview-button {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(8, 19, 34, 0.76);
  box-shadow: 0 0 18px rgba(53, 224, 242, 0.23);
  color: var(--profile-cyan);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.clip-preview-button:hover {
  background: var(--profile-cyan);
  box-shadow: 0 0 23px rgba(53, 224, 242, 0.5);
  color: #081322;
  transform: translate(-50%, -50%) scale(1.08);
}

.clip-details {
  padding: 12px;
}

.clip-details h3 {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-details > span {
  display: block;
  margin-top: 6px;
  color: var(--profile-muted);
  font-size: 9px;
}

.clip-details > span i {
  margin-right: 4px;
  color: var(--profile-cyan);
}

.activity-list {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--profile-line);
  border-radius: 17px;
  background: var(--profile-card);
}

.activity-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--profile-line);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item strong {
  color: #f5f8ff;
  font-size: 12px;
}

.activity-item p {
  margin-top: 3px;
  color: var(--profile-muted);
  font-size: 10px;
  line-height: 1.5;
}

.activity-item time {
  color: #91a1b9;
  font-size: 10px;
  white-space: nowrap;
}

.clip-dialog {
  width: min(560px, calc(100% - 32px));
  max-width: none;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(53, 224, 242, 0.35);
  border-radius: 20px;
  background: #101d32;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 30px rgba(53, 224, 242, 0.1);
  color: #f5f8ff;
}

.clip-dialog::backdrop {
  background: rgba(3, 8, 16, 0.78);
  backdrop-filter: blur(5px);
}

.clip-dialog-content {
  position: relative;
  padding: 22px;
}

.clip-dialog-content > img {
  display: block;
  width: 100%;
  max-height: 300px;
  margin-bottom: 17px;
  border-radius: 13px;
  object-fit: cover;
}

.clip-dialog-close {
  position: absolute;
  z-index: 1;
  top: 30px;
  right: 30px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(8, 19, 34, 0.86);
  color: #fff;
  cursor: pointer;
}

.clip-dialog-close:hover {
  border-color: var(--profile-cyan);
  color: var(--profile-cyan);
}

.clip-dialog h2 {
  margin-top: 12px;
  color: #f5f8ff;
  font-size: 21px;
}

.clip-dialog p {
  margin-top: 5px;
  color: var(--profile-muted);
  font-size: 12px;
}

.profile-page button:focus-visible,
.profile-page a:focus-visible,
.clip-dialog button:focus-visible {
  outline: 2px solid var(--profile-purple);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .profile-hero {
    grid-template-columns: 125px minmax(0, 1fr);
  }

  .profile-avatar-wrap {
    width: 120px;
    height: 120px;
  }

  .rank-card {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .rank-progress {
    max-width: 360px;
  }

  .clip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  body .page-content.profile-page {
    margin-top: 100px;
    padding: 28px 20px;
  }

  .profile-page-heading,
  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-page-heading {
    gap: 12px;
  }

  .profile-page-heading h2,
  .profile-section-title h2 {
    font-size: 24px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 18px;
    padding: 24px 18px;
    text-align: center;
  }

  .profile-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .profile-meta,
  .profile-actions {
    justify-content: center;
  }

  .rank-card {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .favorite-games {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .favorite-card > img {
    height: 145px;
  }

  .activity-item {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    padding: 15px;
  }

  .activity-item time {
    grid-column: 2;
  }
}

@media (max-width: 480px) {
  body .page-content.profile-page {
    padding: 24px 14px;
  }

  .stats-grid,
  .favorite-games,
  .clip-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 84px;
  }

  .favorite-card > img {
    height: 190px;
  }

  .clip-thumb {
    aspect-ratio: 1.7;
  }

  .profile-actions {
    width: 100%;
    flex-direction: column;
  }

  .profile-button {
    width: 100%;
  }

  .clip-dialog-content {
    padding: 16px;
  }

  .clip-dialog-close {
    top: 23px;
    right: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-page *,
  .profile-page *::before,
  .profile-page *::after,
  .clip-dialog * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
