/* =========================================================
   Tournament Site — Profile Page Stylesheet
   Loaded AFTER styles.css and home.css so it inherits the same
   header, bottom-nav, and color/type tokens. This file only
   adds rules specific to the Profile tab.
   ========================================================= */

.profile-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 28px 64px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 16px;
}

/* ---------- 1. Profile Header ---------- */

.profile-header {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-clip);
  padding: 24px 28px;
}

.profile-header__identity {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.profile-avatar-lg {
  position: relative;
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 50%;
  background: var(--crimson);
  color: var(--bg-void);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.profile-avatar-lg__status {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  background: var(--success);
  border-radius: 50%;
  border: 3px solid var(--panel);
}

.profile-username {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: 0.01em;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.profile-meta__sep {
  color: var(--border);
}

.profile-header__edit {
  position: relative;
  z-index: 2;
  width: auto;
  min-height: auto;
  flex: none;
  padding: 11px 22px;
}

/* =========================================================
   Profile Tab: Cascading Waterfall Synchronization (Top -> Bottom)
   - Syncs meteors & 3D glyphs across all bars on Profile tab
   - Keeps interactive children on z-index: 2
   ========================================================= */
.site-header { --bar-delay: 0s; }
.profile-header { --bar-delay: -1.8s; }
.zorc-card { --bar-delay: -3.6s; }
.zorc-history { --bar-delay: -5.4s; }
.team-panel { --bar-delay: -7.2s; }
.settings-list { --bar-delay: -9.0s; }

:is(.profile-header, .zorc-card, .zorc-history, .team-panel, .settings-list) {
  position: relative !important;
  overflow: hidden !important;
}

:is(.profile-header, .zorc-card, .zorc-history, .team-panel, .settings-list) > :not(.bar-celestial-particles):not(.profile-header__particles) {
  position: relative;
  z-index: 2;
}

/* =========================================================
   ZOR Profile Header: Celestial Meteors, Stars & Space Particles
   - Active in MAX Mode for BOTH Dark and Light Modes
   - Staggered sequence: Top-Right Corner -> Bottom-Left Corner
   - Suppressed completely in Performance Mode (Zero overhead)
   ========================================================= */

/* Dark Mode Tokens (Deep Space Neon) */
:root,
html[data-theme="dark"],
html.theme-dark {
  --ph-meteor-head: #FFFFFF;
  --ph-meteor-mid: #00E5FF;
  --ph-meteor-trail: rgba(0, 180, 216, 0.45);
  --ph-meteor-core: #FFFFFF;
  --ph-meteor-glow: #00E5FF;
  --ph-meteor-glow-secondary: rgba(0, 229, 255, 0.65);
  --ph-star-color: #7DF9FF;
  --ph-star-glow: rgba(0, 240, 255, 0.85);
  --ph-nebula-color: rgba(0, 229, 255, 0.10);
  --ph-nebula-core: rgba(0, 180, 216, 0.05);
}

/* Light Mode Tokens (Vivid High-Contrast Cyber Neon & Ruby Starlight) */
html[data-theme="light"],
html.theme-light {
  --ph-meteor-head: #0077B6;
  --ph-meteor-mid: #0096C7;
  --ph-meteor-trail: rgba(232, 40, 63, 0.40);
  --ph-meteor-core: #00B4D8;
  --ph-meteor-glow: rgba(0, 150, 199, 0.85);
  --ph-meteor-glow-secondary: rgba(232, 40, 63, 0.55);
  --ph-star-color: #0096C7;
  --ph-star-glow: rgba(0, 180, 216, 0.80);
  --ph-nebula-color: rgba(0, 180, 216, 0.12);
  --ph-nebula-core: rgba(232, 40, 63, 0.06);
}

/* Particles Container */
:is(.bar-celestial-particles, .profile-header__particles),
.bar-celestial-particles,
.profile-header__particles {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  pointer-events: none !important;
  z-index: 1 !important;
  border-radius: inherit;
  contain: paint;
}

/* Soft Celestial Origin Nebula at Upper-Right */
.ph-particles-nebula {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 320px;
  height: 220px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 85% 15%, var(--ph-nebula-color) 0%, var(--ph-nebula-core) 45%, transparent 75%);
  filter: blur(14px);
  opacity: 0.85;
}

/* Base Shooting Star / Meteor */
.ph-meteor {
  position: absolute;
  height: 2px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--ph-meteor-trail) 35%,
    var(--ph-meteor-mid) 75%,
    var(--ph-meteor-head) 100%
  );
  filter: drop-shadow(0 0 4px var(--ph-meteor-glow));
}

/* Glowing Meteor Core / Star Head */
.ph-meteor::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(50%, -50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ph-meteor-core);
  box-shadow: 0 0 6px var(--ph-meteor-glow), 0 0 12px var(--ph-meteor-glow-secondary);
}

/* Sequenced Meteors (11s Master Loop) */
.ph-meteor--1 {
  top: -5px;
  right: 8%;
  width: 85px;
  animation: phMeteor1 11s infinite linear;
}

.ph-meteor--2 {
  top: 15px;
  right: -25px;
  width: 115px;
  height: 2.5px;
  animation: phMeteor2 11s infinite linear;
}

.ph-meteor--3 {
  top: -20px;
  right: 28%;
  width: 70px;
  animation: phMeteor3 11s infinite linear;
}

.ph-meteor--4 {
  top: 30px;
  right: -15px;
  width: 125px;
  height: 2.5px;
  animation: phMeteor4 11s infinite linear;
}

.ph-meteor--5 {
  top: -15px;
  right: 45%;
  width: 95px;
  animation: phMeteor5 11s infinite linear;
}

/* Stardust Space Particles */
.ph-star {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: var(--ph-star-color);
  box-shadow: 0 0 6px var(--ph-star-glow);
  opacity: 0;
  will-change: transform, opacity;
}

.ph-star--1 {
  top: 15%;
  right: 12%;
  width: 3px;
  height: 3px;
  animation: phStarDrift1 7s infinite ease-in-out;
}

.ph-star--2 {
  top: 32%;
  right: 6%;
  width: 4px;
  height: 4px;
  animation: phStarDrift2 8.5s infinite ease-in-out 1.2s;
}

.ph-star--3 {
  top: 8%;
  right: 32%;
  width: 2.5px;
  height: 2.5px;
  animation: phStarDrift1 6.5s infinite ease-in-out 3s;
}

.ph-star--4 {
  top: 48%;
  right: 18%;
  width: 3.5px;
  height: 3.5px;
  animation: phStarDrift2 9s infinite ease-in-out 4.5s;
}

.ph-star--5 {
  top: 22%;
  right: 50%;
  width: 3px;
  height: 3px;
  animation: phStarDrift1 8s infinite ease-in-out 6s;
}

.ph-star--6 {
  top: 65%;
  right: 10%;
  width: 2.5px;
  height: 2.5px;
  animation: phStarDrift2 7.5s infinite ease-in-out 2.5s;
}

/* Keyframes: Sequenced Meteors Top-Right -> Bottom-Left */
@keyframes phMeteor1 {
  0% {
    transform: translate3d(0, 0, 0) rotate(136deg);
    opacity: 0;
  }
  2% {
    opacity: 1;
  }
  14% {
    opacity: 1;
  }
  16% {
    transform: translate3d(-750px, 420px, 0) rotate(136deg);
    opacity: 0;
  }
  16.001%, 100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(136deg);
  }
}

@keyframes phMeteor2 {
  0%, 19.999% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(140deg);
  }
  20% {
    transform: translate3d(0, 0, 0) rotate(140deg);
    opacity: 0;
  }
  22% {
    opacity: 1;
  }
  34% {
    opacity: 1;
  }
  36% {
    transform: translate3d(-850px, 460px, 0) rotate(140deg);
    opacity: 0;
  }
  36.001%, 100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(140deg);
  }
}

@keyframes phMeteor3 {
  0%, 39.999% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(133deg);
  }
  40% {
    transform: translate3d(0, 0, 0) rotate(133deg);
    opacity: 0;
  }
  42% {
    opacity: 1;
  }
  52% {
    opacity: 1;
  }
  54% {
    transform: translate3d(-680px, 390px, 0) rotate(133deg);
    opacity: 0;
  }
  54.001%, 100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(133deg);
  }
}

@keyframes phMeteor4 {
  0%, 59.999% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(142deg);
  }
  60% {
    transform: translate3d(0, 0, 0) rotate(142deg);
    opacity: 0;
  }
  62% {
    opacity: 1;
  }
  74% {
    opacity: 1;
  }
  76% {
    transform: translate3d(-920px, 490px, 0) rotate(142deg);
    opacity: 0;
  }
  76.001%, 100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(142deg);
  }
}

@keyframes phMeteor5 {
  0%, 79.999% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(137deg);
  }
  80% {
    transform: translate3d(0, 0, 0) rotate(137deg);
    opacity: 0;
  }
  82% {
    opacity: 1;
  }
  94% {
    opacity: 1;
  }
  96% {
    transform: translate3d(-620px, 360px, 0) rotate(137deg);
    opacity: 0;
  }
  96.001%, 100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(137deg);
  }
}

/* Keyframes: Gentle Stardust Drift Top-Right -> Bottom-Left */
@keyframes phStarDrift1 {
  0% {
    transform: translate3d(0, 0, 0) scale(0.6);
    opacity: 0;
  }
  15% {
    opacity: 0.85;
    transform: translate3d(-60px, 35px, 0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate3d(-180px, 110px, 0) scale(1.15);
  }
  85% {
    opacity: 0.7;
    transform: translate3d(-300px, 180px, 0) scale(0.9);
  }
  100% {
    transform: translate3d(-380px, 230px, 0) scale(0.5);
    opacity: 0;
  }
}

@keyframes phStarDrift2 {
  0% {
    transform: translate3d(0, 0, 0) scale(0.5);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
    transform: translate3d(-80px, 45px, 0) scale(1.1);
  }
  60% {
    opacity: 0.95;
    transform: translate3d(-240px, 140px, 0) scale(1);
  }
  85% {
    opacity: 0.6;
    transform: translate3d(-360px, 210px, 0) scale(0.85);
  }
  100% {
    transform: translate3d(-460px, 270px, 0) scale(0.4);
    opacity: 0;
  }
}

/* =========================================================
   3D Rotating RED "S" & Blue "X" Glyphs
   - Continuously travels in sequence from Top-Right to Bottom-Left
   - Slowly rotates on X and Y axes
   - Active in MAX mode, completely hidden in Performance mode
   ========================================================= */
.ph-glyph {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  font-family: var(--font-display, "Chakra Petch", sans-serif);
  font-weight: 800;
  pointer-events: none !important;
  user-select: none !important;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  display: flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  z-index: 1 !important;
}

.ph-glyph__inner {
  display: inline-block;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Red "S" styling & animations */
.ph-glyph--red {
  color: #FF2A4D;
  text-shadow:
    0 0 8px rgba(255, 42, 77, 0.95),
    0 0 16px rgba(232, 40, 63, 0.7),
    0 0 24px rgba(232, 40, 63, 0.4);
  font-size: 19px;
  animation: phGlyphTravelRed 11s infinite linear;
  animation-delay: calc(0s + var(--bar-delay, 0s));
}

.ph-glyph--red .ph-glyph__inner {
  animation: glyphTumble3D 9s infinite linear;
}

/* Blue "X" styling & animations */
.ph-glyph--blue {
  color: #00E5FF;
  text-shadow:
    0 0 8px rgba(0, 229, 255, 0.95),
    0 0 16px rgba(0, 180, 216, 0.7),
    0 0 24px rgba(0, 150, 199, 0.4);
  font-size: 19px;
  animation: phGlyphTravelBlue 11s infinite linear;
  animation-delay: calc(0s + var(--bar-delay, 0s));
}

.ph-glyph--blue .ph-glyph__inner {
  animation: glyphTumble3DAlt 11s infinite linear;
}

/* Subtle secondary pair for wider bars */
.ph-glyph--sub.ph-glyph--red {
  animation: phGlyphTravelRedSub 11s infinite linear;
  animation-delay: calc(0s + var(--bar-delay, 0s));
  font-size: 15px;
}

.ph-glyph--sub.ph-glyph--blue {
  animation: phGlyphTravelBlueSub 11s infinite linear;
  animation-delay: calc(0s + var(--bar-delay, 0s));
  font-size: 15px;
}

/* Light mode overrides for high contrast & elegance */
html[data-theme="light"] .ph-glyph--red,
html.theme-light .ph-glyph--red {
  color: #E8283F;
  text-shadow: 0 0 10px rgba(232, 40, 63, 0.65), 0 0 20px rgba(232, 40, 63, 0.35);
  filter: drop-shadow(0 2px 4px rgba(232, 40, 63, 0.45));
}

html[data-theme="light"] .ph-glyph--blue,
html.theme-light .ph-glyph--blue {
  color: #0088CC;
  text-shadow: 0 0 10px rgba(0, 136, 204, 0.65), 0 0 20px rgba(0, 180, 216, 0.35);
  filter: drop-shadow(0 2px 4px rgba(0, 136, 204, 0.45));
}

/* Top Bar (.site-header) specific travel: Right-to-Left across header */
.site-header .ph-glyph--red {
  animation-name: phHeaderGlyphTravelRed;
  font-size: 15px;
}

.site-header .ph-glyph--blue {
  animation-name: phHeaderGlyphTravelBlue;
  font-size: 15px;
}

/* Keyframes: Card Travel Top-Right to Bottom-Left */
@keyframes phGlyphTravelRed {
  0%, 15.999% {
    opacity: 0;
    transform: translate3d(20px, -20px, 0);
  }
  16% {
    opacity: 0;
    transform: translate3d(20px, -20px, 0);
  }
  20% {
    opacity: 0.95;
  }
  42% {
    opacity: 0.95;
  }
  48% {
    opacity: 0;
    transform: translate3d(-640px, 380px, 0);
  }
  48.001%, 100% {
    opacity: 0;
    transform: translate3d(20px, -20px, 0);
  }
}

@keyframes phGlyphTravelBlue {
  0%, 55.999% {
    opacity: 0;
    transform: translate3d(20px, -10px, 0);
  }
  56% {
    opacity: 0;
    transform: translate3d(20px, -10px, 0);
  }
  60% {
    opacity: 0.95;
  }
  82% {
    opacity: 0.95;
  }
  88% {
    opacity: 0;
    transform: translate3d(-680px, 400px, 0);
  }
  88.001%, 100% {
    opacity: 0;
    transform: translate3d(20px, -10px, 0);
  }
}

@keyframes phGlyphTravelRedSub {
  0%, 65.999% {
    opacity: 0;
    transform: translate3d(30px, -15px, 0);
  }
  66% {
    opacity: 0;
    transform: translate3d(30px, -15px, 0);
  }
  70% {
    opacity: 0.75;
  }
  92% {
    opacity: 0.75;
  }
  98% {
    opacity: 0;
    transform: translate3d(-580px, 340px, 0);
  }
  98.001%, 100% {
    opacity: 0;
    transform: translate3d(30px, -15px, 0);
  }
}

@keyframes phGlyphTravelBlueSub {
  0%, 25.999% {
    opacity: 0;
    transform: translate3d(30px, -5px, 0);
  }
  26% {
    opacity: 0;
    transform: translate3d(30px, -5px, 0);
  }
  30% {
    opacity: 0.75;
  }
  52% {
    opacity: 0.75;
  }
  58% {
    opacity: 0;
    transform: translate3d(-620px, 360px, 0);
  }
  58.001%, 100% {
    opacity: 0;
    transform: translate3d(30px, -5px, 0);
  }
}

/* Keyframes: Header Travel Right to Left across header */
@keyframes phHeaderGlyphTravelRed {
  0%, 15.999% {
    opacity: 0;
    transform: translate3d(20px, 12px, 0);
  }
  16% {
    opacity: 0;
    transform: translate3d(20px, 12px, 0);
  }
  20% {
    opacity: 0.95;
  }
  42% {
    opacity: 0.95;
  }
  48% {
    opacity: 0;
    transform: translate3d(-780px, 36px, 0);
  }
  48.001%, 100% {
    opacity: 0;
    transform: translate3d(20px, 12px, 0);
  }
}

@keyframes phHeaderGlyphTravelBlue {
  0%, 55.999% {
    opacity: 0;
    transform: translate3d(20px, 18px, 0);
  }
  56% {
    opacity: 0;
    transform: translate3d(20px, 18px, 0);
  }
  60% {
    opacity: 0.95;
  }
  82% {
    opacity: 0.95;
  }
  88% {
    opacity: 0;
    transform: translate3d(-820px, 32px, 0);
  }
  88.001%, 100% {
    opacity: 0;
    transform: translate3d(20px, 18px, 0);
  }
}

/* 3D Slow Rotation along X & Y axes */
@keyframes glyphTumble3D {
  0% {
    transform: perspective(350px) rotateX(0deg) rotateY(0deg) scale(0.92);
  }
  25% {
    transform: perspective(350px) rotateX(85deg) rotateY(120deg) scale(1.05);
  }
  50% {
    transform: perspective(350px) rotateX(190deg) rotateY(240deg) scale(1.12);
  }
  75% {
    transform: perspective(350px) rotateX(285deg) rotateY(320deg) scale(1.02);
  }
  100% {
    transform: perspective(350px) rotateX(360deg) rotateY(360deg) scale(0.92);
  }
}

@keyframes glyphTumble3DAlt {
  0% {
    transform: perspective(350px) rotateX(0deg) rotateY(0deg) scale(0.95);
  }
  25% {
    transform: perspective(350px) rotateX(-90deg) rotateY(-110deg) scale(1.10);
  }
  50% {
    transform: perspective(350px) rotateX(-180deg) rotateY(-230deg) scale(1.05);
  }
  75% {
    transform: perspective(350px) rotateX(-270deg) rotateY(-330deg) scale(1.15);
  }
  100% {
    transform: perspective(350px) rotateX(-360deg) rotateY(-360deg) scale(0.95);
  }
}

/* Responsive adjustment for Mobile screens (<= 768px) */
@media (max-width: 768px) {
  .ph-glyph--red {
    font-size: 16px;
  }
  .ph-glyph--blue {
    font-size: 16px;
  }
  .site-header .ph-glyph--red,
  .site-header .ph-glyph--blue {
    font-size: 13px;
  }
  @keyframes phGlyphTravelRed {
    0%, 15.999% { opacity: 0; transform: translate3d(15px, -10px, 0); }
    16% { opacity: 0; transform: translate3d(15px, -10px, 0); }
    20% { opacity: 0.95; }
    42% { opacity: 0.95; }
    48% { opacity: 0; transform: translate3d(-340px, 260px, 0); }
    48.001%, 100% { opacity: 0; transform: translate3d(15px, -10px, 0); }
  }
  @keyframes phGlyphTravelBlue {
    0%, 55.999% { opacity: 0; transform: translate3d(15px, -5px, 0); }
    56% { opacity: 0; transform: translate3d(15px, -5px, 0); }
    60% { opacity: 0.95; }
    82% { opacity: 0.95; }
    88% { opacity: 0; transform: translate3d(-360px, 280px, 0); }
    88.001%, 100% { opacity: 0; transform: translate3d(15px, -5px, 0); }
  }
  @keyframes phHeaderGlyphTravelRed {
    0%, 15.999% { opacity: 0; transform: translate3d(10px, 10px, 0); }
    16% { opacity: 0; transform: translate3d(10px, 10px, 0); }
    20% { opacity: 0.95; }
    42% { opacity: 0.95; }
    48% { opacity: 0; transform: translate3d(-320px, 15px, 0); }
    48.001%, 100% { opacity: 0; transform: translate3d(10px, 10px, 0); }
  }
  @keyframes phHeaderGlyphTravelBlue {
    0%, 55.999% { opacity: 0; transform: translate3d(10px, 14px, 0); }
    56% { opacity: 0; transform: translate3d(10px, 14px, 0); }
    60% { opacity: 0.95; }
    82% { opacity: 0.95; }
    88% { opacity: 0; transform: translate3d(-340px, 18px, 0); }
    88.001%, 100% { opacity: 0; transform: translate3d(10px, 14px, 0); }
  }
}

/* =========================================================
   Performance Mode Suppression & Accessibility
   - Completely hides particles and glyphs in Performance mode
   - Zero animation, zero CPU/GPU overhead
   ========================================================= */
html.perf-mode-performance :is(.bar-celestial-particles, .profile-header__particles, .ph-glyph, .ph-meteor, .ph-star, .ph-particles-nebula),
html[data-perf-mode="performance"] :is(.bar-celestial-particles, .profile-header__particles, .ph-glyph, .ph-meteor, .ph-star, .ph-particles-nebula),
html.perf-mode-performance .bar-celestial-particles,
html[data-perf-mode="performance"] .bar-celestial-particles,
html.perf-mode-performance .profile-header__particles,
html[data-perf-mode="performance"] .profile-header__particles,
html.perf-mode-performance .ph-glyph,
html[data-perf-mode="performance"] .ph-glyph,
html.perf-mode-performance .ph-meteor,
html[data-perf-mode="performance"] .ph-meteor,
html.perf-mode-performance .ph-star,
html[data-perf-mode="performance"] .ph-star {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  :is(.bar-celestial-particles, .profile-header__particles),
  .bar-celestial-particles,
  .profile-header__particles,
  .ph-glyph {
    display: none !important;
  }
}

/* ---------- 2. Main Statistics ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-clip);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card__label {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
}

/* ---------- 3. Team ---------- */

.team-panel {
  padding: 22px 24px;
}

.team-panel__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.team-logo {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: var(--radius-clip);
  background: var(--panel-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--cyan);
}

.team-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.team-panel__identity h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 4px;
}

.team-role {
  font-size: 12px;
  color: var(--text-muted);
}

.team-members__label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.team-members ul {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  font-size: 13px;
}

.team-members li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Member name with the player's UID shown right beside it */
.team-member__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member__uid {
  flex: none;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.team-members__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex: none;
}

.team-panel__cta {
  width: auto;
  min-height: auto;
  padding: 11px 22px;
}

/* Empty state, used if a player has no team yet */
.team-panel--empty {
  align-items: center;
  text-align: center;
  gap: 12px;
}

.team-panel--empty p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.team-panel--empty .team-panel__actions {
  display: flex;
  gap: 12px;
}

/* ---------- 4. Settings ---------- */

.settings-list {
  padding: 6px 24px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

a.settings-row {
  cursor: pointer;
}

/* Only remove top border from Edit Profile */
.settings-list > a.settings-row[href*="edit-profile"],
.settings-row:first-child {
  border-top: none !important;
}

.settings-row__label-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.settings-row__auth-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2.5px 8px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--cyan);
}

.settings-row svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  flex: none;
}

.settings-row--danger,
.settings-row--danger span {
  color: var(--crimson) !important;
}

.settings-row--danger svg {
  stroke: var(--crimson) !important;
}

/* ---------- Logout confirm dialog ---------- */

.logout-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(5, 6, 10, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: logout-fade-in 0.2s ease-out;
}

.logout-overlay[hidden] {
  display: none;
}

@keyframes logout-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.logout-dialog {
  width: 100%;
  max-width: 340px;
  padding: 24px 22px 20px;
  border-radius: 14px;
  background: linear-gradient(165deg, #161820 0%, #0e1016 100%);
  border: 1px solid rgba(232, 40, 63, 0.45);
  box-shadow:
    0 0 20px rgba(232, 40, 63, 0.25),
    0 12px 32px rgba(0, 0, 0, 0.55);
  text-align: center;
  animation: logout-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.logout-dialog--info {
  border: 1px solid rgba(0, 240, 255, 0.45);
  box-shadow:
    0 0 20px rgba(0, 240, 255, 0.2),
    0 12px 32px rgba(0, 0, 0, 0.55);
}

@keyframes logout-pop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.logout-dialog__title {
  margin: 0 0 8px;
  font-family: var(--font-display, inherit);
  font-size: 18px;
  font-weight: 700;
  color: #f4f6fb;
}

.logout-dialog__text {
  margin: 0 0 20px;
  font-size: 14.5px;
  line-height: 1.5;
  color: rgba(240, 244, 255, 0.85);
}

.logout-dialog__actions {
  display: flex;
  gap: 10px;
}

.logout-dialog__btn {
  flex: 1;
  min-height: 44px;
  border-radius: 10px;
  font-family: var(--font-display, inherit);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.logout-dialog__btn:active {
  transform: scale(0.97);
}

.logout-dialog__btn--no {
  background: rgba(255, 255, 255, 0.08);
  color: #e8ecf6;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.logout-dialog__btn--yes {
  background: linear-gradient(135deg, #e8283f 0%, #c41e33 100%);
  color: #fff;
  box-shadow: 0 0 14px rgba(232, 40, 63, 0.4);
}

html.logout-open body,
html.modal-open body {
  overflow: hidden;
}

/* ---------- Language Modal ---------- */
.lang-overlay {
  position: fixed;
  inset: 0;
  z-index: 145;
  background: rgba(5, 6, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: logout-fade-in 0.2s ease-out;
}

.lang-overlay[hidden] {
  display: none !important;
}

.lang-dialog {
  width: 100%;
  max-width: 380px;
  padding: 24px 22px 20px;
  border-radius: 16px;
  background: linear-gradient(165deg, #151822 0%, #0d0f15 100%);
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow:
    0 0 28px rgba(0, 240, 255, 0.18),
    0 16px 40px rgba(0, 0, 0, 0.7);
  animation: logout-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.lang-dialog__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.lang-dialog__icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  flex-shrink: 0;
}

.lang-dialog__icon-wrap svg {
  width: 20px;
  height: 20px;
}

.lang-dialog__title {
  margin: 0;
  font-family: var(--font-display, inherit);
  font-size: 19px;
  font-weight: 700;
  color: #f4f6fb;
  flex: 1;
  letter-spacing: 0.02em;
}

.lang-dialog__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-dialog__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.lang-dialog__close svg {
  width: 18px;
  height: 18px;
}

.lang-dialog__desc {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(240, 244, 255, 0.72);
}

.lang-dialog__options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.lang-option-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e8ecf6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.lang-option-btn * {
  pointer-events: none;
}

.lang-option-btn:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.35);
  transform: translateY(-1px);
}

.lang-option-btn:active {
  transform: scale(0.98);
}

.lang-option-btn.is-active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.14) 0%, rgba(232, 40, 63, 0.08) 100%);
  border-color: rgba(0, 240, 255, 0.65);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.lang-option-btn__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-option-btn__flag {
  font-size: 24px;
  line-height: 1;
}

.lang-option-btn__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-option-btn__title {
  font-family: var(--font-display, inherit);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.lang-option-btn__sub {
  font-size: 12px;
  color: var(--text-muted);
}

.lang-option-btn__check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cyan);
  color: #06080d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.lang-option-btn__check svg {
  width: 14px;
  height: 14px;
}

.lang-dialog__footer {
  display: flex;
  justify-content: flex-end;
}

.lang-dialog__cancel-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-display, inherit);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-dialog__cancel-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

/* ---------- Security Modal ---------- */
.security-overlay {
  position: fixed;
  inset: 0;
  z-index: 145;
  background: rgba(5, 6, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: logout-fade-in 0.2s ease-out;
}

.security-overlay[hidden] {
  display: none !important;
}

.security-dialog {
  width: 100%;
  max-width: 380px;
  padding: 24px 22px 20px;
  border-radius: 16px;
  background: linear-gradient(165deg, #151822 0%, #0d0f15 100%);
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow:
    0 0 28px rgba(0, 240, 255, 0.18),
    0 16px 40px rgba(0, 0, 0, 0.7);
  animation: logout-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.security-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.security-dialog__icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  flex-shrink: 0;
}

.security-dialog__icon-wrap svg {
  width: 22px;
  height: 22px;
}

.security-dialog__title {
  margin: 0;
  font-family: var(--font-display, inherit);
  font-size: 19px;
  font-weight: 700;
  color: #f4f6fb;
  letter-spacing: 0.02em;
  flex: 1;
  text-align: left;
  padding-left: 12px;
}

.security-dialog__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.security-dialog__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.security-dialog__close svg {
  width: 18px;
  height: 18px;
}

.security-dialog__text {
  margin: 0 0 22px;
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(240, 244, 255, 0.82);
  text-align: left;
}

.security-dialog__footer {
  display: flex;
  justify-content: flex-end;
}

.security-dialog__btn {
  padding: 10px 24px;
  min-width: 110px;
  border-radius: 8px;
  font-family: var(--font-display, inherit);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #06080d;
  background: var(--cyan);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.45);
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.security-dialog__btn:hover {
  background: #3ff1ff;
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.65);
}

.security-dialog__btn:active {
  transform: scale(0.97);
}

.settings-row__lang-badge {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.06em;
}

button.settings-row {
  width: 100%;
  text-align: left;
  background: transparent;
  font: inherit;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .profile-main {
    padding: 24px 16px calc(var(--nav-height-mobile) + 32px);
    gap: 28px;
  }

  .profile-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
  }

  .profile-header__edit {
    width: 100%;
  }

  .team-panel__cta {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .team-members ul {
    grid-template-columns: 1fr;
  }

  .profile-username {
    font-size: 22px;
  }

  .profile-avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 20px;
  }
}
