:root {
  --profile-bg: #070b16;
  --profile-bg-2: #0d1730;
  --profile-surface: rgba(20, 35, 67, 0.78);
  --profile-surface-strong: rgba(20, 35, 67, 0.96);
  --profile-surface-soft: rgba(13, 23, 48, 0.72);
  --profile-line: rgba(140, 180, 255, 0.18);
  --profile-line-strong: rgba(125, 217, 255, 0.34);
  --profile-text: #f7f9ff;
  --profile-muted: #aab6d0;
  --profile-soft: #dce8ff;
  --profile-cyan: #25c4f4;
  --profile-soft-blue: #7dd9ff;
  --profile-blue: #1d4f91;
  --profile-gold: #f4b928;
  --profile-warm-gold: #ffd76a;
  --profile-green: #58e6b0;
  --profile-coral: #ff6b83;
  --profile-purple: #9b7cff;
  --profile-radius-xl: 30px;
  --profile-radius-lg: 22px;
  --profile-radius-md: 16px;
  --profile-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --profile-font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --profile-font-body: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.student-profile-page {
  min-height: 100vh;
  margin: 0;
  color: var(--profile-text);
  background:
    radial-gradient(900px 500px at 8% -4%, rgba(37, 196, 244, 0.2), transparent 64%),
    radial-gradient(720px 420px at 98% 0%, rgba(244, 185, 40, 0.12), transparent 62%),
    radial-gradient(740px 380px at 50% 100%, rgba(29, 79, 145, 0.2), transparent 64%),
    linear-gradient(180deg, var(--profile-bg), #091226 50%, #0d1730 100%);
  font-family: var(--profile-font-body);
  overflow-x: hidden;
}

body.student-profile-page::selection {
  color: #04111d;
  background: var(--profile-soft-blue);
}

.profile-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.profile-light {
  position: absolute;
  width: 42vw;
  height: 42vw;
  min-width: 360px;
  min-height: 360px;
  border-radius: 999px;
  opacity: 0.42;
  filter: blur(44px);
  transform: translateZ(0);
}

.profile-light-a {
  top: -18%;
  left: -14%;
  background: rgba(37, 196, 244, 0.28);
  animation: profileFloat 14s ease-in-out infinite;
}

.profile-light-b {
  right: -12%;
  top: 12%;
  background: rgba(244, 185, 40, 0.17);
  animation: profileFloat 18s ease-in-out infinite reverse;
}

.profile-grid {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(140, 180, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 180, 255, 0.16) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 18%, #000, transparent 70%);
}

.profile-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.profile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.profile-back-link {
  justify-self: start;
}

.profile-back-link,
.profile-inline-action,
.profile-actions-panel a,
.profile-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--profile-line);
  border-radius: 999px;
  color: var(--profile-text);
  background: rgba(20, 35, 67, 0.68);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.profile-back-link {
  padding: 10px 15px;
}

.profile-back-link:hover,
.profile-inline-action:hover,
.profile-actions-panel a:hover,
.profile-load-more:hover {
  transform: translateY(-1px);
  border-color: var(--profile-line-strong);
  background: rgba(37, 196, 244, 0.12);
  box-shadow: 0 16px 34px rgba(2, 8, 23, 0.28);
}

.profile-back-link:focus-visible,
.profile-section-nav a:focus-visible,
.profile-actions-panel a:focus-visible,
.filter-bar button:focus-visible,
.profile-load-more:focus-visible,
.recent-test-toggle:focus-visible,
.profile-inline-action:focus-visible {
  outline: 3px solid rgba(125, 217, 255, 0.68);
  outline-offset: 3px;
}

.profile-privacy-note {
  margin: 0;
  color: var(--profile-muted);
  font-size: 13px;
  font-weight: 700;
}

.profile-section-nav {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid rgba(140, 180, 255, 0.16);
  border-radius: 999px;
  background: rgba(7, 11, 22, 0.7);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
  scrollbar-width: none;
}

.profile-section-nav::-webkit-scrollbar {
  display: none;
}

.profile-section-nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--profile-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.profile-section-nav a.is-active,
.profile-section-nav a:hover {
  color: var(--profile-text);
  border-color: rgba(125, 217, 255, 0.24);
  background: rgba(37, 196, 244, 0.12);
}

.profile-hero,
.profile-section,
.profile-state-card {
  position: relative;
  border: 1px solid var(--profile-line);
  border-radius: var(--profile-radius-xl);
  background:
    linear-gradient(145deg, rgba(20, 35, 67, 0.78), rgba(8, 15, 32, 0.92));
  box-shadow: var(--profile-shadow);
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.85fr) minmax(180px, 0.38fr);
  gap: 22px;
  align-items: stretch;
  padding: 24px;
  overflow: visible;
  isolation: isolate;
  min-height: 330px;
}

.profile-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.72;
  background:
    radial-gradient(500px 280px at 14% 20%, rgba(37, 196, 244, 0.18), transparent 72%),
    radial-gradient(520px 260px at 70% 8%, rgba(255, 215, 106, 0.14), transparent 70%),
    linear-gradient(110deg, rgba(7, 11, 22, 0.08), rgba(125, 217, 255, 0.06));
}

.profile-hero-left,
.profile-rank-identity,
.profile-actions-panel {
  position: relative;
  z-index: 1;
}

.profile-identity-copy {
  position: relative;
  z-index: 3;
}

.profile-hero-left {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.profile-avatar-frame {
  position: relative;
  width: clamp(150px, 18vw, 220px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  transform-style: preserve-3d;
  transition: transform 180ms ease;
}

.profile-avatar-frame .frame-layer {
  position: absolute;
  inset: -13%;
  z-index: 4;
  display: none;
  background-image: var(--frame);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.34));
}

.profile-avatar-frame.has-frame .frame-layer {
  display: block;
}

.profile-avatar-img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid rgba(247, 249, 255, 0.22);
  border-radius: 50%;
  background: #dce8ff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.rank-aura {
  position: absolute;
  inset: -18%;
  z-index: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(125, 217, 255, 0.28), transparent 56%),
    conic-gradient(from 120deg, rgba(37, 196, 244, 0.08), rgba(255, 215, 106, 0.35), rgba(125, 217, 255, 0.08));
  filter: blur(4px);
  animation: auraPulse 4.8s ease-in-out infinite;
}

.rank-particle {
  position: absolute;
  z-index: 5;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--profile-soft-blue);
  box-shadow: 0 0 20px rgba(125, 217, 255, 0.85);
  animation: particleDrift 7s ease-in-out infinite;
}

.particle-one {
  left: 8%;
  top: 20%;
}

.particle-two {
  right: 2%;
  top: 40%;
  width: 6px;
  height: 6px;
  animation-delay: -2s;
}

.particle-three {
  left: 42%;
  bottom: 3%;
  width: 5px;
  height: 5px;
  animation-delay: -4s;
}

.profile-badge-chip {
  position: absolute;
  right: 5%;
  bottom: 2%;
  z-index: 6;
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(7, 11, 22, 0.68);
  border: 1px solid rgba(255, 215, 106, 0.28);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.profile-badge-chip.show {
  display: flex;
}

.profile-badge-chip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-badge-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  color: #081221;
  background: linear-gradient(135deg, var(--profile-warm-gold), var(--profile-gold));
  font-size: 12px;
  font-weight: 1000;
}

.profile-identity-copy {
  min-width: 0;
}

.profile-kicker,
.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--profile-soft-blue);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-name {
  margin: 8px 0 0;
  color: var(--profile-text);
  font-family: var(--profile-font-display);
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
}

.premium-name {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  vertical-align: middle;
}

.premium-name-text {
  overflow-wrap: anywhere;
}

.premium-user-badge,
.profile-premium-indicator img {
  width: 1.18em;
  height: 1.18em;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 10px rgba(255, 215, 106, 0.7));
}

.premium-badge-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.premium-badge-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 30;
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 215, 106, 0.28);
  border-radius: 14px;
  color: var(--profile-text);
  background: rgba(7, 11, 22, 0.94);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.premium-badge-tooltip small {
  display: block;
  margin-top: 2px;
  color: var(--profile-muted);
  font-size: 11px;
  font-weight: 700;
}

.premium-badge-wrap:hover .premium-badge-tooltip,
.premium-badge-wrap:focus-within .premium-badge-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.profile-private-email,
.profile-last-login,
.profile-section-head p,
.performance-card p,
.reward-card small,
.stat-sub,
.rank-progress-footer p,
.profile-rank-meta,
.recent-test-meta,
.mmr-event-meta,
.activity-meta,
.collection-panel p {
  color: var(--profile-muted);
}

.profile-private-email,
.profile-last-login {
  margin: 9px 0 0;
  font-size: 14px;
  font-weight: 750;
}

.profile-title-slot {
  margin-top: 14px;
}

.profile-premium-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 215, 106, 0.32);
  border-radius: 999px;
  color: #fff5ce;
  background: rgba(244, 185, 40, 0.12);
  font-size: 12px;
  font-weight: 1000;
}

.integrity-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin-top: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(140, 180, 255, 0.34);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(7, 11, 22, 0.96), rgba(15, 30, 60, 0.94));
  color: #f7fbff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.integrity-shield,
.fair-play-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px 14px 18px 18px;
  border: 1px solid currentColor;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.integrity-shield {
  width: 28px;
  height: 30px;
}

.integrity-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 80;
  width: min(280px, 80vw);
  padding: 10px 12px;
  border: 1px solid rgba(140, 180, 255, 0.34);
  border-radius: 12px;
  background: #070b16;
  color: #f7f9ff;
  font-size: 12px;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42);
}

.integrity-badge:hover .integrity-tooltip,
.integrity-badge:focus .integrity-tooltip,
.integrity-badge:focus-within .integrity-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.integrity-unrated {
  color: #cbd5e1;
  border-color: rgba(203, 213, 225, 0.28);
}

.integrity-fair {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.36);
}

.integrity-trusted {
  color: #67e8f9;
  border-color: rgba(34, 211, 238, 0.42);
  box-shadow: 0 14px 34px rgba(37, 196, 244, 0.14);
}

.integrity-verified {
  color: #ffd76a;
  border-color: rgba(244, 185, 40, 0.5);
  box-shadow: 0 14px 38px rgba(244, 185, 40, 0.16);
}

.integrity-under-review {
  color: #fff7d6;
  border-color: rgba(251, 191, 36, 0.72);
  background:
    radial-gradient(circle at 18% 20%, rgba(251, 191, 36, 0.26), transparent 42%),
    linear-gradient(135deg, rgba(69, 38, 10, 0.98), rgba(17, 24, 39, 0.96));
  box-shadow: 0 16px 36px rgba(120, 53, 15, 0.32), inset 0 1px 0 rgba(255, 247, 214, 0.16);
}

.integrity-restricted {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.52);
}

.fair-play-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(140, 180, 255, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 20%, rgba(37, 196, 244, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(13, 23, 48, 0.94), rgba(7, 11, 22, 0.9));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.fair-play-shield {
  width: 64px;
  height: 70px;
  background: rgba(255, 255, 255, 0.04);
}

.fair-play-level {
  color: var(--profile-text);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 950;
  line-height: 1;
}

.fair-play-meta {
  margin-top: 8px;
  color: var(--profile-muted);
  font-weight: 700;
}

.fair-play-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fair-play-stats div {
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(140, 180, 255, 0.14);
}

.fair-play-stats span {
  display: block;
  color: var(--profile-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fair-play-stats strong {
  display: block;
  margin-top: 6px;
  color: var(--profile-text);
  font-size: 20px;
  font-weight: 950;
}

.profile-rank-identity {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(125, 217, 255, 0.18);
  border-radius: 26px;
  background:
    radial-gradient(260px 160px at 30% 16%, rgba(125, 217, 255, 0.18), transparent 70%),
    rgba(7, 11, 22, 0.35);
}

.rank-crest-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 108px;
  border: 1px solid rgba(255, 215, 106, 0.2);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 215, 106, 0.16), transparent 60%),
    linear-gradient(145deg, rgba(20, 35, 67, 0.84), rgba(7, 11, 22, 0.7));
}

.rank-crest {
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.4));
}

.rank-crest[src=""],
.rank-crest:not([src]) {
  display: none;
}

.profile-rank-name {
  margin-top: 8px;
  color: var(--profile-text);
  font-family: var(--profile-font-display);
  font-size: clamp(30px, 3.3vw, 48px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.profile-mmr-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
}

.profile-mmr-value {
  color: var(--profile-warm-gold);
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 1000;
  line-height: 0.95;
}

.profile-mmr-label {
  color: var(--profile-muted);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.12em;
}

.profile-rank-track,
.progress-energy-track,
.mini-scale {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(170, 182, 208, 0.16);
}

.profile-rank-track {
  height: 11px;
  margin-top: 16px;
}

.profile-rank-track-fill,
.progress-energy-fill,
.mini-scale span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--profile-cyan), #7c5cff, var(--profile-warm-gold));
  box-shadow: 0 0 22px rgba(37, 196, 244, 0.38);
  transition: width 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-actions-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: center;
}

.profile-actions-panel a {
  width: 100%;
  padding: 10px 14px;
}

.profile-state-card {
  margin-top: 16px;
  padding: 16px 18px;
  color: var(--profile-muted);
  font-weight: 850;
}

.profile-state-error {
  color: #ffd5dc;
  border-color: rgba(255, 107, 131, 0.36);
  background: rgba(255, 107, 131, 0.12);
}

.profile-section {
  margin-top: 18px;
  padding: 22px;
}

.profile-section-head {
  margin-bottom: 16px;
}

.profile-section-head h2,
.profile-section-head h3 {
  margin: 6px 0 0;
  color: var(--profile-text);
  font-family: var(--profile-font-display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.profile-section-head h2 {
  font-size: clamp(30px, 3vw, 46px);
}

.profile-section-head h3 {
  font-size: 26px;
}

.profile-section-head p,
.collection-panel p {
  max-width: 740px;
  margin: 8px 0 0;
  line-height: 1.55;
  font-size: 14px;
  font-weight: 700;
}

.inline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.compact-head {
  margin-bottom: 14px;
}

.profile-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.profile-stat-card,
.performance-card,
.reward-card,
.collection-panel,
.rank-progression-card,
.recent-test-item,
.mmr-event-row,
.activity-item {
  border: 1px solid rgba(140, 180, 255, 0.16);
  border-radius: var(--profile-radius-lg);
  background:
    linear-gradient(145deg, rgba(20, 35, 67, 0.72), rgba(7, 11, 22, 0.62));
}

.profile-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 126px;
  padding: 16px;
  overflow: hidden;
}

.profile-stat-card.stat-mmr {
  border-color: rgba(255, 215, 106, 0.26);
  background:
    radial-gradient(220px 120px at 18% 4%, rgba(244, 185, 40, 0.16), transparent 70%),
    linear-gradient(145deg, rgba(20, 35, 67, 0.82), rgba(7, 11, 22, 0.64));
}

.profile-stat-card.stat-best,
.profile-stat-card.stat-average {
  border-color: rgba(37, 196, 244, 0.24);
}

.profile-stat-card.stat-streak {
  border-color: rgba(88, 230, 176, 0.22);
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid rgba(125, 217, 255, 0.2);
  border-radius: 16px;
  color: var(--profile-soft);
  background: rgba(37, 196, 244, 0.1);
  font-size: 11px;
  font-weight: 1000;
}

.stat-currency-img {
  width: 58px;
  max-height: 58px;
  object-fit: contain;
  flex: 0 0 58px;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.24));
}

.stat-value {
  display: block;
  margin-top: 6px;
  color: var(--profile-text);
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 1000;
  line-height: 1;
}

.stat-value.compact {
  font-size: 18px;
}

.stat-sub {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 750;
}

.stat-ring {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #0d1730 55%, transparent 57%),
    conic-gradient(var(--profile-cyan) var(--score), rgba(170, 182, 208, 0.18) 0);
  color: var(--profile-text);
  font-weight: 1000;
}

.mini-scale {
  width: 58px;
  height: 9px;
  flex: 0 0 58px;
}

.rank-progression-card {
  padding: 20px;
  overflow: hidden;
}

.rank-stage-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.rank-stage {
  padding: 15px;
  border: 1px solid rgba(140, 180, 255, 0.14);
  border-radius: 18px;
  background: rgba(7, 11, 22, 0.34);
}

.rank-stage.current {
  border-color: rgba(255, 215, 106, 0.28);
  background: rgba(244, 185, 40, 0.08);
}

.rank-stage span,
.rank-stage small {
  display: block;
  color: var(--profile-muted);
  font-size: 12px;
  font-weight: 800;
}

.rank-stage strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--profile-text);
  font-size: 22px;
  font-weight: 1000;
}

.progress-energy-track {
  height: 18px;
  margin-top: 18px;
}

.rank-progress-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
}

.rank-progress-footer span {
  color: var(--profile-warm-gold);
  font-size: 24px;
  font-weight: 1000;
}

.rank-progress-footer p {
  margin: 0;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.performance-card {
  min-height: 160px;
  padding: 18px;
}

.performance-card.primary {
  border-color: rgba(255, 215, 106, 0.26);
  background:
    radial-gradient(220px 130px at 12% 8%, rgba(244, 185, 40, 0.16), transparent 70%),
    linear-gradient(145deg, rgba(20, 35, 67, 0.82), rgba(7, 11, 22, 0.64));
}

.performance-card strong {
  display: block;
  margin-top: 12px;
  color: var(--profile-text);
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 1000;
  line-height: 1;
}

.performance-card p {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.48;
}

.skill-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.skill-row {
  padding: 14px;
  border: 1px solid rgba(140, 180, 255, 0.14);
  border-radius: 18px;
  background: rgba(7, 11, 22, 0.34);
}

.skill-row strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--profile-text);
  font-size: 14px;
  font-weight: 1000;
}

.skill-row span {
  color: var(--profile-muted);
  font-size: 12px;
  font-weight: 800;
}

.skill-meter {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(170, 182, 208, 0.16);
}

.skill-meter i {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--profile-cyan), var(--profile-warm-gold));
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter-bar button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(140, 180, 255, 0.16);
  border-radius: 999px;
  color: var(--profile-muted);
  background: rgba(7, 11, 22, 0.42);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 1000;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.filter-bar button.is-active,
.filter-bar button:hover {
  color: var(--profile-text);
  border-color: rgba(125, 217, 255, 0.28);
  background: rgba(37, 196, 244, 0.14);
}

.recent-tests-list,
.mmr-event-list,
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-test-item,
.mmr-event-row,
.activity-item {
  padding: 14px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.recent-test-item:hover,
.mmr-event-row:hover,
.activity-item:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 217, 255, 0.28);
  background: linear-gradient(145deg, rgba(20, 35, 67, 0.86), rgba(7, 11, 22, 0.7));
}

.recent-test-main,
.mmr-event-main,
.activity-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recent-test-title,
.mmr-event-title,
.activity-title {
  color: var(--profile-text);
  font-size: 15px;
  font-weight: 1000;
}

.recent-test-meta,
.mmr-event-meta,
.activity-meta {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 750;
}

.band-badge,
.mmr-gain-badge,
.activity-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding: 9px 12px;
  border: 1px solid rgba(125, 217, 255, 0.22);
  border-radius: 999px;
  color: var(--profile-text);
  background: rgba(37, 196, 244, 0.12);
  font-size: 12px;
  font-weight: 1000;
  white-space: nowrap;
}

.band-badge.strong,
.mmr-gain-badge.positive {
  border-color: rgba(88, 230, 176, 0.28);
  color: #b8ffe4;
  background: rgba(88, 230, 176, 0.12);
}

.mmr-gain-badge.negative {
  border-color: rgba(255, 107, 131, 0.32);
  color: #ffd5dc;
  background: rgba(255, 107, 131, 0.12);
}

.recent-test-toggle {
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(140, 180, 255, 0.14);
  border-radius: 999px;
  color: var(--profile-muted);
  background: rgba(7, 11, 22, 0.34);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.recent-test-details {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.recent-test-item.is-expanded .recent-test-details {
  display: grid;
}

.detail-chip {
  padding: 10px;
  border: 1px solid rgba(140, 180, 255, 0.12);
  border-radius: 14px;
  color: var(--profile-muted);
  background: rgba(7, 11, 22, 0.32);
  font-size: 12px;
  font-weight: 800;
}

.detail-chip strong {
  display: block;
  margin-top: 4px;
  color: var(--profile-text);
  font-size: 16px;
}

.profile-load-more {
  width: fit-content;
  margin: 16px auto 0;
  padding: 10px 16px;
  cursor: pointer;
}

.active-rewards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.reward-card {
  min-height: 230px;
  padding: 16px;
  overflow: hidden;
  transform-style: preserve-3d;
}

.reward-card[data-rarity="rare"] {
  border-color: rgba(37, 196, 244, 0.24);
}

.reward-card[data-rarity="epic"] {
  border-color: rgba(155, 124, 255, 0.26);
}

.reward-card[data-rarity="legendary"],
.reward-card[data-rarity="ascendant"],
.reward-card[data-rarity="immortal"],
.reward-card[data-rarity="ethereal"] {
  border-color: rgba(255, 215, 106, 0.28);
}

.reward-preview {
  display: grid;
  place-items: center;
  height: 120px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid rgba(140, 180, 255, 0.14);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 20%, rgba(125, 217, 255, 0.18), transparent 62%),
    rgba(7, 11, 22, 0.34);
}

.reward-preview img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.34));
}

.reward-preview img[src=""],
.reward-preview img:not([src]) {
  display: none;
}

.reward-theme-preview,
.reward-title-preview {
  color: var(--profile-soft);
  font-size: 32px;
  font-weight: 1000;
  letter-spacing: 0;
}

.reward-card strong {
  display: block;
  min-height: 42px;
  margin-top: 8px;
  color: var(--profile-text);
  font-size: 17px;
  font-weight: 1000;
  line-height: 1.2;
}

.reward-card small {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
}

.collection-panel {
  margin-top: 14px;
  padding: 18px;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.achievement-card {
  display: block;
  min-height: 160px;
  padding: 14px;
  border: 1px solid rgba(140, 180, 255, 0.14);
  border-radius: 18px;
  color: inherit;
  background: rgba(7, 11, 22, 0.34);
  text-decoration: none;
}

.achievement-ring {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #0d1730 56%, transparent 58%),
    conic-gradient(var(--profile-cyan) var(--pct), rgba(170, 182, 208, 0.16) 0);
  color: var(--profile-text);
  font-size: 14px;
  font-weight: 1000;
}

.achievement-card strong {
  display: block;
  margin-top: 12px;
  color: var(--profile-text);
  font-size: 15px;
  font-weight: 1000;
}

.achievement-card span {
  display: block;
  margin-top: 6px;
  color: var(--profile-muted);
  font-size: 12px;
  font-weight: 750;
}

.season-summary-card {
  border-color: rgba(255, 215, 106, 0.22);
  background:
    radial-gradient(260px 160px at 8% 0%, rgba(244, 185, 40, 0.14), transparent 72%),
    linear-gradient(145deg, rgba(20, 35, 67, 0.76), rgba(7, 11, 22, 0.62));
}

.season-summary-reward {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 215, 106, 0.2);
  border-radius: 18px;
  background: rgba(244, 185, 40, 0.08);
}

.season-summary-reward img {
  width: 82px;
  height: auto;
  object-fit: contain;
}

.season-summary-reward strong {
  display: block;
  color: var(--profile-text);
  font-size: 30px;
  font-weight: 1000;
}

.season-summary-reward span {
  display: block;
  margin-top: 4px;
  color: var(--profile-muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-inline-action {
  width: fit-content;
  margin-top: 14px;
  padding: 10px 14px;
}

.unlocked-ranks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rank-unlock-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(140, 180, 255, 0.16);
  border-radius: 999px;
  color: var(--profile-text);
  background: rgba(37, 196, 244, 0.1);
  font-size: 12px;
  font-weight: 900;
}

.rank-unlock-pill img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.mmr-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.mmr-summary-card {
  padding: 14px;
  border: 1px solid rgba(140, 180, 255, 0.14);
  border-radius: 18px;
  background: rgba(7, 11, 22, 0.34);
}

.mmr-summary-card strong {
  display: block;
  margin-top: 8px;
  color: var(--profile-text);
  font-size: 22px;
  font-weight: 1000;
}

.mmr-chart {
  min-height: 180px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(140, 180, 255, 0.14);
  border-radius: 22px;
  background: rgba(7, 11, 22, 0.34);
}

.mmr-chart svg {
  width: 100%;
  height: 170px;
  display: block;
}

.mmr-event-row.is-admin {
  border-color: rgba(255, 107, 131, 0.28);
  background:
    radial-gradient(220px 120px at 0% 0%, rgba(255, 107, 131, 0.12), transparent 70%),
    linear-gradient(145deg, rgba(20, 35, 67, 0.74), rgba(7, 11, 22, 0.62));
}

.activity-timeline {
  position: relative;
  padding-left: 18px;
}

.activity-timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(var(--profile-cyan), rgba(255, 215, 106, 0.4));
}

.activity-item {
  position: relative;
}

.activity-item::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 22px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--profile-bg);
  border-radius: 50%;
  background: var(--profile-cyan);
  box-shadow: 0 0 14px rgba(37, 196, 244, 0.55);
}

.activity-tag {
  min-width: auto;
  color: var(--profile-soft-blue);
}

.empty-state {
  padding: 24px;
  border: 1px dashed rgba(140, 180, 255, 0.24);
  border-radius: 18px;
  color: var(--profile-muted);
  background: rgba(7, 11, 22, 0.32);
  text-align: center;
  font-weight: 800;
}

.profile-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.profile-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes profileFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(4%, 3%, 0) scale(1.08);
  }
}

@keyframes auraPulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes particleDrift {
  0%, 100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.55;
  }
  50% {
    transform: translate3d(14px, -12px, 0);
    opacity: 1;
  }
}

@media (max-width: 1100px) {
  .profile-hero {
    grid-template-columns: 1fr;
  }

  .profile-actions-panel {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .profile-overview-grid,
  .performance-grid,
  .active-rewards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skill-breakdown,
  .achievement-grid,
  .mmr-summary-grid,
  .fair-play-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fair-play-main {
    grid-column: span 1;
  }

  .fair-play-stats {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .profile-shell {
    width: min(100% - 22px, 640px);
    padding-top: 14px;
  }

  .profile-topbar,
  .inline-head,
  .recent-test-main,
  .mmr-event-main,
  .activity-main,
  .rank-progress-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-privacy-note {
    display: none;
  }

  .profile-section-nav {
    top: 6px;
    border-radius: 18px;
  }

  .profile-hero,
  .profile-section {
    border-radius: 24px;
    padding: 16px;
  }

  .profile-hero-left {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-avatar-frame {
    width: min(62vw, 190px);
    align-self: center;
  }

  .profile-name {
    font-size: clamp(36px, 13vw, 54px);
  }

  .profile-rank-identity {
    grid-template-columns: 88px minmax(0, 1fr);
    padding: 14px;
  }

  .rank-crest-shell {
    width: 88px;
    height: 88px;
    border-radius: 22px;
  }

  .rank-crest {
    width: 68px;
    height: 68px;
  }

  .profile-actions-panel {
    grid-template-columns: 1fr 1fr;
  }

  .profile-overview-grid,
  .performance-grid,
  .active-rewards-grid,
  .skill-breakdown,
  .achievement-grid,
  .mmr-summary-grid,
  .fair-play-card,
  .fair-play-stats,
  .rank-stage-row,
  .recent-test-details {
    grid-template-columns: 1fr;
  }

  .fair-play-shield {
    width: 58px;
    height: 64px;
  }

  .profile-stat-card {
    min-height: 112px;
  }

  .filter-bar {
    justify-content: flex-start;
    width: 100%;
  }

  .band-badge,
  .mmr-gain-badge {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .profile-actions-panel {
    grid-template-columns: 1fr;
  }

  .profile-rank-identity {
    grid-template-columns: 1fr;
  }

  .rank-crest-shell {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .profile-reveal {
    opacity: 1;
    transform: none;
  }

  .rank-particle,
  .profile-light {
    display: none;
  }
}

/* Profile clarity refresh — compact hierarchy shared with the game dashboard. */
html[data-profile-theme="light"] {
  --profile-bg: #edf4f9;
  --profile-bg-2: #e5eff6;
  --profile-surface: rgba(255, 255, 255, 0.86);
  --profile-surface-strong: rgba(255, 255, 255, 0.96);
  --profile-surface-soft: rgba(245, 250, 253, 0.84);
  --profile-line: rgba(39, 67, 92, 0.14);
  --profile-line-strong: rgba(17, 133, 181, 0.32);
  --profile-text: #17283c;
  --profile-muted: #61748a;
  --profile-soft: #334b63;
  --profile-blue: #147da6;
  --profile-shadow: 0 26px 70px rgba(58, 74, 88, 0.15);
}

html {
  background: var(--profile-bg);
}

body.student-profile-page {
  background: var(--profile-bg);
  -webkit-font-smoothing: antialiased;
}

html[data-profile-theme="light"] body.student-profile-page {
  background:
    radial-gradient(900px 500px at 8% -4%, rgba(14, 165, 233, 0.13), transparent 64%),
    radial-gradient(720px 420px at 98% 0%, rgba(139, 92, 246, 0.08), transparent 62%),
    linear-gradient(180deg, #f4f9fc, #edf4f9 52%, #e7f0f6);
}

.profile-light-a,
.profile-light-b {
  animation: none;
}

.profile-shell {
  width: min(1380px, calc(100% - 40px));
  padding-top: 18px;
}

.profile-topbar {
  min-height: 52px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  margin-bottom: 12px;
}

.profile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--profile-text);
  text-decoration: none;
}

.profile-brand img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  box-shadow: 0 0 28px rgba(37, 196, 244, 0.18);
}

.profile-brand span {
  display: grid;
  gap: 3px;
}

.profile-brand strong {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-brand small {
  color: var(--profile-muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.profile-topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-theme-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--profile-line);
  border-radius: 12px;
  color: var(--profile-text);
  background: rgba(11, 21, 38, 0.58);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.profile-theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--profile-line-strong);
}

.profile-theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-sun-icon {
  display: none;
}

html[data-profile-theme="light"] .profile-theme-toggle {
  background: rgba(255, 255, 255, 0.7);
}

html[data-profile-theme="light"] .profile-back-link,
html[data-profile-theme="light"] .profile-inline-action,
html[data-profile-theme="light"] .profile-load-more {
  color: var(--profile-text);
  background: rgba(255, 255, 255, 0.7);
}

html[data-profile-theme="light"] .profile-premium-indicator {
  color: #8a5a00;
  background: rgba(244, 185, 40, 0.1);
}

html[data-profile-theme="light"] .profile-theme-toggle .profile-moon-icon {
  display: none;
}

html[data-profile-theme="light"] .profile-theme-toggle .profile-sun-icon {
  display: block;
}

.profile-privacy-note {
  color: var(--profile-muted);
  font-size: 10px;
  font-weight: 850;
}

.profile-section-nav {
  top: 8px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 6px;
  border-radius: 16px;
}

.profile-section-nav a {
  min-height: 32px;
  padding: 7px 14px;
  font-size: 11px;
}

html[data-profile-theme="light"] .profile-section-nav {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 34px rgba(58, 74, 88, 0.12);
}

.profile-hero {
  min-height: 292px;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.76fr);
  gap: 20px;
  padding: 26px 28px 20px;
  overflow: hidden;
}

.profile-hero-left {
  gap: clamp(22px, 3vw, 38px);
}

.profile-avatar-frame {
  width: clamp(142px, 14vw, 188px);
}

.profile-name,
.profile-rank-name,
.profile-section-head h2,
.profile-section-head h3 {
  font-family: var(--profile-font-body);
  letter-spacing: -0.045em;
}

.profile-name {
  margin-top: 9px;
  font-size: clamp(38px, 4.5vw, 62px);
}

.profile-private-email {
  display: none;
}

.profile-last-login {
  margin-top: 10px;
  font-size: 12px;
}

.profile-identity-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.profile-title-slot,
.profile-premium-indicator,
.integrity-badge {
  margin-top: 0;
}

.profile-premium-indicator,
.integrity-badge {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 10px;
}

.profile-rank-identity {
  grid-template-columns: 102px minmax(0, 1fr);
  padding: 18px;
  border-radius: 22px;
}

.rank-crest-shell {
  width: 102px;
  height: 102px;
  border-radius: 24px;
}

.profile-rank-name {
  font-size: clamp(27px, 2.8vw, 40px);
}

.profile-mmr-value {
  font-size: clamp(34px, 3.6vw, 50px);
}

.profile-actions-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.45fr repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-self: auto;
}

.profile-actions-panel a {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(7, 11, 22, 0.42);
  font-size: 11px;
}

.profile-actions-panel a.is-primary {
  color: #04111d;
  border-color: rgba(125, 217, 255, 0.72);
  background: linear-gradient(135deg, var(--profile-soft-blue), var(--profile-cyan));
  box-shadow: 0 12px 28px rgba(37, 196, 244, 0.18);
}

.profile-actions-panel a.is-primary:hover {
  background: linear-gradient(135deg, #a8eaff, #52d7ff);
}

html[data-profile-theme="light"] .profile-hero,
html[data-profile-theme="light"] .profile-section,
html[data-profile-theme="light"] .profile-state-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.91), rgba(242, 248, 251, 0.88));
}

html[data-profile-theme="light"] .profile-hero-bg {
  background:
    radial-gradient(500px 280px at 14% 20%, rgba(14, 165, 233, 0.12), transparent 72%),
    radial-gradient(520px 260px at 70% 8%, rgba(244, 185, 40, 0.09), transparent 70%);
}

html[data-profile-theme="light"] .profile-rank-identity,
html[data-profile-theme="light"] .rank-crest-shell,
html[data-profile-theme="light"] .profile-actions-panel a:not(.is-primary) {
  background: rgba(255, 255, 255, 0.62);
}

.profile-section {
  margin-top: 14px;
  padding: 24px;
  border-radius: 24px;
}

.profile-section-head {
  margin-bottom: 14px;
}

.profile-section-head h2 {
  margin-top: 5px;
  font-size: clamp(27px, 2.7vw, 38px);
}

.profile-section-head h3 {
  font-size: 23px;
}

.profile-section-head > p:not(.profile-accessible-copy) {
  display: none;
}

.profile-accessible-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.profile-overview-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.profile-stat-card {
  min-height: 104px;
  gap: 11px;
  padding: 14px;
  border-radius: 18px;
}

.profile-stat-card.stat-level {
  border-color: rgba(155, 124, 255, 0.3);
  background:
    radial-gradient(180px 100px at 8% 0%, rgba(155, 124, 255, 0.16), transparent 70%),
    linear-gradient(145deg, rgba(20, 35, 67, 0.76), rgba(7, 11, 22, 0.62));
}

.stat-icon {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 13px;
}

.stat-ring {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
}

.stat-value {
  font-size: clamp(23px, 2.2vw, 31px);
}

.stat-value.compact {
  font-size: 14px;
}

.stat-sub {
  max-width: 170px;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.profile-more-stats {
  margin-top: 10px;
}

.profile-more-stats > summary {
  width: max-content;
  padding: 8px 0;
  color: var(--profile-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.profile-more-stats > summary::marker {
  color: var(--profile-cyan);
}

.profile-more-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.profile-more-stats-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--profile-line);
  border-radius: 14px;
  background: rgba(7, 11, 22, 0.26);
}

.profile-more-stats-grid span,
.profile-more-stats-grid small,
.profile-more-stats-grid strong {
  display: block;
}

.profile-more-stats-grid span {
  color: var(--profile-muted);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-more-stats-grid strong {
  margin-top: 5px;
  color: var(--profile-text);
  font-size: 22px;
}

.profile-more-stats-grid small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--profile-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-section-compact {
  display: grid;
  grid-template-columns: minmax(150px, 0.3fr) minmax(0, 1.7fr);
  align-items: center;
  gap: 18px;
}

.profile-section-compact .profile-section-head {
  margin: 0;
}

.fair-play-card {
  grid-template-columns: auto minmax(0, 1fr) minmax(300px, 0.9fr);
  padding: 16px;
  border-radius: 19px;
}

.fair-play-shield {
  width: 50px;
  height: 56px;
}

.fair-play-level {
  font-size: clamp(22px, 2.4vw, 30px);
}

.fair-play-meta {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.fair-play-stats div {
  padding: 10px;
  border-radius: 13px;
}

.fair-play-stats span {
  font-size: 8px;
}

.fair-play-stats strong {
  font-size: 17px;
}

.rank-progression-card {
  padding: 16px;
  border-radius: 19px;
}

.rank-stage {
  padding: 12px;
  border-radius: 14px;
}

.rank-stage strong {
  margin: 5px 0 4px;
  font-size: 18px;
}

.progress-energy-track {
  height: 12px;
  margin-top: 14px;
}

.rank-progress-footer {
  margin-top: 9px;
}

.rank-progress-footer span {
  font-size: 20px;
}

.performance-grid {
  gap: 10px;
}

.performance-card {
  min-height: 124px;
  padding: 15px;
  border-radius: 18px;
}

.performance-card strong {
  margin-top: 9px;
  font-size: clamp(21px, 2.3vw, 30px);
}

.performance-card p {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.skill-breakdown {
  gap: 8px;
  margin-top: 10px;
}

.skill-row {
  padding: 11px;
  border-radius: 14px;
}

.profile-subsection {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--profile-line);
}

.profile-subsection .profile-section-head h2 {
  font-size: 24px;
}

.recent-test-item,
.mmr-event-row,
.activity-item {
  padding: 12px 14px;
  border-radius: 16px;
}

.recent-test-meta,
.mmr-event-meta,
.activity-meta {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.profile-disclosure {
  padding: 0;
  overflow: hidden;
}

.profile-disclosure-summary {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  cursor: pointer;
  list-style: none;
}

.profile-disclosure-summary::-webkit-details-marker {
  display: none;
}

.profile-disclosure-summary > span:first-child {
  display: grid;
  gap: 5px;
}

.profile-disclosure-summary small {
  color: var(--profile-cyan);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.profile-disclosure-summary strong {
  color: var(--profile-text);
  font-size: clamp(26px, 2.7vw, 36px);
  letter-spacing: -0.045em;
}

.profile-disclosure-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--profile-muted);
  font-size: 11px;
  font-weight: 900;
}

.profile-disclosure-action i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--profile-line);
  border-radius: 50%;
  color: var(--profile-text);
  background: rgba(37, 196, 244, 0.08);
  font-size: 21px;
  font-style: normal;
  font-weight: 500;
  transition: transform 180ms ease;
}

.profile-disclosure[open] .profile-disclosure-action i {
  transform: rotate(45deg);
}

.profile-disclosure[open] .profile-disclosure-summary {
  border-bottom: 1px solid var(--profile-line);
}

.profile-disclosure-body {
  padding: 22px 24px 24px;
}

.profile-compact-title {
  margin-bottom: 14px;
}

.active-rewards-grid {
  gap: 10px;
}

.reward-card {
  min-height: 194px;
  padding: 13px;
  border-radius: 18px;
}

.reward-preview {
  height: 92px;
  margin-bottom: 11px;
  border-radius: 15px;
}

.reward-preview img {
  width: 74px;
  height: 74px;
}

.reward-card strong {
  min-height: 0;
  margin-top: 6px;
  font-size: 15px;
}

.collection-panel {
  padding: 15px;
  border-radius: 18px;
}

.achievement-card {
  min-height: 130px;
  padding: 12px;
  border-radius: 15px;
}

.achievement-ring {
  width: 52px;
  height: 52px;
}

.mmr-summary-grid {
  gap: 8px;
}

.mmr-summary-card {
  padding: 11px;
  border-radius: 14px;
}

.mmr-summary-card strong {
  font-size: 19px;
}

html[data-profile-theme="light"] .profile-stat-card,
html[data-profile-theme="light"] .performance-card,
html[data-profile-theme="light"] .reward-card,
html[data-profile-theme="light"] .collection-panel,
html[data-profile-theme="light"] .rank-progression-card,
html[data-profile-theme="light"] .recent-test-item,
html[data-profile-theme="light"] .mmr-event-row,
html[data-profile-theme="light"] .activity-item,
html[data-profile-theme="light"] .fair-play-card,
html[data-profile-theme="light"] .skill-row,
html[data-profile-theme="light"] .rank-stage,
html[data-profile-theme="light"] .mmr-summary-card,
html[data-profile-theme="light"] .mmr-chart,
html[data-profile-theme="light"] .achievement-card,
html[data-profile-theme="light"] .profile-more-stats-grid > div {
  background: rgba(255, 255, 255, 0.62);
}

html[data-profile-theme="light"] .profile-stat-card.stat-level,
html[data-profile-theme="light"] .profile-stat-card.stat-mmr,
html[data-profile-theme="light"] .performance-card.primary,
html[data-profile-theme="light"] .season-summary-card {
  background:
    radial-gradient(220px 130px at 10% 4%, rgba(14, 165, 233, 0.1), transparent 70%),
    rgba(255, 255, 255, 0.72);
}

html[data-profile-theme="light"] .filter-bar button,
html[data-profile-theme="light"] .recent-test-toggle,
html[data-profile-theme="light"] .detail-chip {
  color: var(--profile-muted);
  background: rgba(238, 246, 250, 0.9);
}

html[data-profile-theme="light"] .filter-bar button.is-active,
html[data-profile-theme="light"] .filter-bar button:hover {
  color: var(--profile-text);
  background: rgba(14, 165, 233, 0.11);
}

html[data-profile-theme="light"] .stat-ring,
html[data-profile-theme="light"] .achievement-ring {
  background:
    radial-gradient(circle, #f7fbfd 55%, transparent 57%),
    conic-gradient(var(--profile-cyan) var(--score, var(--pct)), rgba(75, 99, 122, 0.14) 0);
}

html[data-profile-theme="light"] .integrity-tooltip,
html[data-profile-theme="light"] .premium-badge-tooltip {
  color: #f7f9ff;
  background: #17283c;
}

@media (max-width: 1100px) {
  .profile-hero {
    grid-template-columns: 1fr;
  }

  .profile-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-section-compact {
    grid-template-columns: 1fr;
  }

  .profile-actions-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .profile-shell {
    width: min(100% - 20px, 640px);
  }

  .profile-topbar {
    grid-template-columns: 1fr auto;
  }

  .profile-brand {
    display: none;
  }

  .profile-topbar-actions {
    grid-column: 2;
  }

  .profile-theme-toggle span,
  .profile-privacy-note {
    display: none;
  }

  .profile-theme-toggle {
    width: 40px;
    padding: 0;
  }

  .profile-section-nav {
    width: 100%;
    margin-bottom: 10px;
    border-radius: 14px;
  }

  .profile-hero {
    padding: 18px;
  }

  .profile-hero-left {
    align-items: center;
    text-align: center;
  }

  .profile-identity-status {
    justify-content: center;
  }

  .profile-actions-panel {
    grid-template-columns: 1fr 1fr;
  }

  .profile-actions-panel a.is-primary {
    grid-column: 1 / -1;
  }

  .profile-overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profile-more-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profile-section {
    padding: 17px;
  }

  .profile-disclosure {
    padding: 0;
  }

  .profile-disclosure-summary {
    min-height: 82px;
    padding: 17px;
  }

  .profile-disclosure-body {
    padding: 17px;
  }

  .fair-play-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .fair-play-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .performance-grid,
  .skill-breakdown,
  .active-rewards-grid,
  .achievement-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rank-stage-row {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .profile-overview-grid,
  .profile-more-stats-grid,
  .performance-grid,
  .skill-breakdown,
  .active-rewards-grid,
  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .profile-stat-card {
    min-height: 94px;
  }

  .profile-rank-identity {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .rank-crest-shell {
    width: 78px;
    height: 78px;
  }

  .rank-crest {
    width: 61px;
    height: 61px;
  }

  .rank-stage-row {
    grid-template-columns: 1fr;
  }

  .fair-play-card,
  .fair-play-stats {
    grid-template-columns: 1fr;
  }

  .profile-disclosure-action {
    font-size: 0;
  }

  .profile-disclosure-action i {
    font-size: 21px;
  }
}
/* Social gifts are cosmetic profile collectibles selected from Dashboard Friends. */
.profile-name-gift{
  position:relative;
  width:34px;
  height:34px;
  flex:0 0 auto;
  display:inline-grid;
  place-items:center;
  margin-left:8px;
  border:1px solid rgba(183,137,255,.34);
  border-radius:11px;
  background:linear-gradient(145deg,rgba(157,95,255,.2),rgba(62,158,255,.12));
  box-shadow:0 12px 28px rgba(64,31,132,.25),inset 0 1px rgba(255,255,255,.12);
  font-size:19px;
  line-height:1;
  cursor:help;
}
.profile-name-gift .premium-badge-tooltip{
  left:50%;right:auto;width:max-content;min-width:190px;max-width:min(270px,calc(100vw - 24px));
  line-height:1.35;letter-spacing:0;white-space:normal;word-break:normal;overflow-wrap:break-word;
  font-family:var(--profile-font-body);text-transform:none;transform:translate(-50%,8px)
}
.profile-name-gift .premium-badge-tooltip strong{display:block;font-size:12px;line-height:1.35;white-space:normal}
.profile-name-gift .premium-badge-tooltip small{display:block;margin-top:4px;font-size:11px;line-height:1.4;white-space:normal;word-break:normal}
.profile-name-gift .premium-badge-tooltip small span{color:var(--profile-cyan);font-weight:900}
.profile-name-gift .premium-badge-tooltip em{display:block;margin-top:4px;color:var(--profile-muted);font-size:9px;font-style:normal;font-weight:750;line-height:1.35}
.profile-name-gift>img{width:100%;height:100%;display:block;object-fit:contain;filter:drop-shadow(0 8px 10px rgba(24,13,59,.38))}
.profile-name-gift:hover .premium-badge-tooltip,
.profile-name-gift:focus .premium-badge-tooltip{opacity:1;visibility:visible;transform:translate(-50%,0)}
.profile-social-gifts{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:8px 0 2px}
.profile-social-gift{
  width:26px;height:26px;display:inline-grid;place-items:center;
  border:1px solid rgba(151,174,219,.2);border-radius:8px;
  background:rgba(91,121,178,.08);font-size:14px;line-height:1;
  filter:drop-shadow(0 5px 7px rgba(5,8,19,.22));
}
.profile-social-gift>img{width:100%;height:100%;display:block;object-fit:contain;filter:drop-shadow(0 5px 7px rgba(5,8,19,.28))}
.profile-social-gift.is-active{border-color:rgba(181,125,255,.62);background:rgba(155,93,255,.16);box-shadow:0 0 0 2px rgba(155,93,255,.1)}
@media(max-width:720px){.profile-name-gift{width:29px;height:29px;margin-left:6px;border-radius:9px;font-size:16px}.profile-social-gift{width:23px;height:23px;font-size:13px}}
