/* profile.css */

.profTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.profTopRight {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profShareBtn {
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.profShareBtn:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Player card */
.profCard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 20px 0 16px;
  position: relative;
}
.profAvatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4aa0ff, #a078ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.profCardInfo {
  flex: 1;
  min-width: 0;
}
.profName {
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profTitle {
  color: #4aa0ff;
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}
.profJoined {
  font-size: 12px;
  margin-top: 4px;
}
.profLevelBadge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #4aa0ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profLevelNum {
  font-size: 24px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1;
}
.profLevelLabel {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 520px) {
  .profCard { padding: 16px; gap: 14px; }
  .profAvatar { width: 48px; height: 48px; font-size: 20px; }
  .profName { font-size: 18px; }
  .profLevelBadge { width: 52px; height: 52px; }
  .profLevelNum { font-size: 20px; }
}

/* XP bar */
.profXPSection {
  margin: 0 0 24px;
}
.profXPHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.profXPLabel {
  font-size: 14px;
  font-weight: 600;
}
.profXPNums {
  font-size: 13px;
  color: var(--muted);
}
.profXPBar {
  height: 10px;
  background: var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.profXPFill {
  height: 100%;
  background: linear-gradient(90deg, #4aa0ff, #a078ff);
  border-radius: 5px;
  transition: width .5s ease;
}
.profXPSub {
  font-size: 12px;
  margin-top: 4px;
}

/* Stats grid */
.profSectionTitle {
  font-size: 18px;
  margin: 0 0 14px;
}
.profStatsGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.profStatCard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
}
.profStatIcon {
  font-size: 24px;
  margin-bottom: 6px;
}
.profStatVal {
  font-size: 24px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.profStatLabel {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

@media (max-width: 520px) {
  .profStatsGrid { grid-template-columns: repeat(2, 1fr); }
  .profStatVal { font-size: 20px; }
}

/* Achievements row */
.profAchSection { margin-bottom: 28px; }
.profAchHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.profAchHeader .profSectionTitle { margin: 0; }
.profViewAll {
  color: #4aa0ff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.profViewAll:hover { text-decoration: underline; }

.profAchRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profAchBadge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform .15s;
}
.profAchBadge:hover {
  transform: scale(1.1);
}
.profAchBadge.locked {
  opacity: .3;
  filter: grayscale(1);
}
.profAchSub {
  font-size: 13px;
  margin-top: 10px;
}

/* XP History */
.profXPHistory { margin-bottom: 28px; }
.profXPList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profXPItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}
.profXPItemSource {
  color: var(--text);
}
.profXPItemAmount {
  font-weight: 700;
  color: #4aa0ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.profXPItemDate {
  font-size: 11px;
  color: var(--muted);
  margin-left: 10px;
}
.profEmptyState {
  text-align: center;
  padding: 24px;
  font-size: 14px;
}

/* Share dialog */
.profShareDialog {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  max-width: 420px;
  width: 90%;
}
.profShareDialog::backdrop {
  background: rgba(0,0,0,.6);
}
.profShareContent {
  padding: 24px;
}
.profShareTitle {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}
.profShareText {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 16px;
  max-height: 240px;
  overflow-y: auto;
}
.profShareActions {
  display: flex;
  gap: 10px;
}
.profShareCopyBtn,
.profShareCloseBtn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.profShareCopyBtn {
  background: #4aa0ff;
  color: #fff;
  border-color: #4aa0ff;
}
.profShareCloseBtn {
  background: transparent;
  color: var(--text);
}

/* Card entrance animations */
@keyframes profFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.profCard { animation: profFadeUp .4s ease both; }
.profXPSection { animation: profFadeUp .4s .05s ease both; }
.profStats { animation: profFadeUp .4s .1s ease both; }
.profAchSection { animation: profFadeUp .4s .15s ease both; }
.profXPHistory { animation: profFadeUp .4s .2s ease both; }
@media (prefers-reduced-motion: reduce) {
  .profCard, .profXPSection, .profStats, .profAchSection, .profXPHistory { animation: none; }
}

/* Stat card hover */
.profStatCard {
  transition: transform .15s, border-color .15s;
}
.profStatCard:hover {
  transform: translateY(-2px);
  border-color: rgba(74, 160, 255, .25);
}

/* Welcome banner for new users */
.profWelcome {
  background: linear-gradient(135deg, rgba(74,160,255,.08), rgba(160,120,255,.08));
  border: 1px solid rgba(74,160,255,.2);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
  text-align: center;
  animation: profFadeUp .5s ease both;
}
.profWelcomeTitle {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.profWelcomeDesc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 420px;
  margin: 0 auto 14px;
}
.profWelcomeCTA {
  display: inline-block;
  padding: 10px 22px;
  background: linear-gradient(135deg, #4aa0ff, #6d8fff);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: opacity .15s;
}
.profWelcomeCTA:hover { opacity: .85; }

/* Level badge glow when active */
.profLevelBadge.active {
  box-shadow: 0 0 0 4px rgba(74, 160, 255, .15);
}

/* Light theme */
:root[data-theme="light"] .profWelcome {
  background: linear-gradient(135deg, rgba(74,160,255,.05), rgba(160,120,255,.05));
}
:root[data-theme="light"] .profStatCard:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* Footer */
.footer { margin-top: 40px; }
.footlinks { text-align: center; margin-bottom: 8px; }
.footlinks a { color: var(--muted); text-decoration: none; font-size: 13px; }
.footlinks a:hover { color: var(--text); }
.sep { color: var(--muted); margin: 0 6px; font-size: 12px; }
.fineprint { text-align: center; font-size: 12px; color: var(--muted); }
