/* Profile dashboard. One layout for desktop and a separate app-style layout
   for phones (below 900px). Site-wide sheets restyle headings, paragraphs,
   buttons and inputs with !important, so the same is used here on the text
   and control properties those sheets touch. */

html { scroll-behavior: smooth; }

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

#profile-dashboard {
  --pf-blue: #1257e0;
  --pf-blue-dark: #0a45d8;
  --pf-navy: #0b2a6f;
  --pf-ink: #101c3a;
  --pf-text: #44536f;
  --pf-muted: #6a7a99;
  --pf-line: #e3eaf7;
  --pf-card: #ffffff;
  --pf-gold: #f5a623;
  --pf-radius: 16px;
  --pf-shadow: 0 8px 22px rgba(28, 57, 108, .07);
  margin: 0;
  background: linear-gradient(180deg, #eef4ff 0%, #f6f9ff 46%, #eef3fc 100%) fixed;
  color: var(--pf-ink);
  font-family: Inter, Arial, sans-serif;
}

#profile-dashboard::before,
#profile-dashboard::after { content: none !important; }

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

#profile-dashboard .hidden.hidden { display: none !important; }

#profile-dashboard .pf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#profile-dashboard :is(h1, h2, h3, p, ul, ol) { margin: 0; padding: 0; }
#profile-dashboard :is(ul, ol) { list-style: none; }
#profile-dashboard p { hyphens: manual !important; }

.pf-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: min(100% - 48px, 1500px);
  margin: 0 auto;
  padding: 26px 0 40px;
}

/* ------------------------------------------------------------------ */
/* Shared pieces                                                       */
/* ------------------------------------------------------------------ */
.pf-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--pf-line);
  border-radius: var(--pf-radius);
  background: var(--pf-card);
  box-shadow: var(--pf-shadow);
}

.pf-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

#profile-dashboard .pf-panel__head h2,
#profile-dashboard .pf-rank-card__head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--pf-ink) !important;
  font: 700 17px/1.25 Inter, Arial, sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.pf-panel__head h2 lucide-icon { width: 24px; height: 24px; color: var(--pf-blue); }

#profile-dashboard .pf-pill-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 34px !important;
  padding: 0 14px !important;
  border: 1px solid #cfdcf5 !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: var(--pf-blue) !important;
  font: 600 12.5px/1 Inter, Arial, sans-serif !important;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease;
}

#profile-dashboard .pf-pill-btn:hover { border-color: #9fbcf3 !important; background: #f2f7ff !important; }
#profile-dashboard .pf-pill-btn lucide-icon { width: 15px; height: 15px; }
#profile-dashboard .pf-pill-btn--dark { border-color: rgba(255, 255, 255, .28) !important; background: rgba(255, 255, 255, .08) !important; color: #fff !important; }
#profile-dashboard .pf-pill-btn--dark:hover { border-color: rgba(255, 255, 255, .6) !important; background: rgba(255, 255, 255, .16) !important; }
#profile-dashboard :is(.pf-pill-btn, .pf-btn, .pf-eye-btn, .pf-copy-btn, .pf-modal-close):focus-visible { outline: 2px solid var(--pf-blue); outline-offset: 2px; }
#profile-dashboard .pf-rank-card :focus-visible { outline-color: #ffd45c; }

#profile-dashboard .pf-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px !important;
  padding: 0 20px !important;
  border-radius: 10px !important;
  font: 600 14px/1 Inter, Arial, sans-serif !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color .16s ease, box-shadow .16s ease, border-color .16s ease;
}

/* Site-wide button rules add offsets and lifts; none apply on this page. */
#profile-dashboard :is(.pf-btn, .pf-pill-btn, .pf-eye-btn, .pf-copy-btn) {
  position: static !important;
  margin: 0 !important;
  transform: none !important;
  width: auto;
}

#profile-dashboard .pf-form .pf-btn { width: 100% !important; }

#profile-dashboard .pf-btn lucide-icon { width: 18px; height: 18px; }
#profile-dashboard .pf-btn--primary { background: linear-gradient(180deg, #1c6bff, #0f52e0) !important; box-shadow: 0 8px 16px rgba(18, 87, 224, .24) !important; color: #fff !important; }
#profile-dashboard .pf-btn--primary:hover { background: linear-gradient(180deg, #1560ee, #0b47c9) !important; }
#profile-dashboard .pf-btn--ghost { border: 1px solid #cfdcf5 !important; background: #fff !important; box-shadow: none !important; color: var(--pf-ink) !important; }
#profile-dashboard .pf-btn--ghost:hover { background: #f2f7ff !important; }
#profile-dashboard .pf-btn--danger { border: 1px solid #f3c4c9 !important; background: #fff5f6 !important; box-shadow: none !important; color: #c62434 !important; }
#profile-dashboard .pf-btn--danger:hover { background: #ffe9ec !important; }
#profile-dashboard .pf-btn:disabled { opacity: .55; cursor: not-allowed; }

.pf-track { flex: 1 1 auto; height: 7px; border-radius: 999px; background: #e3ebfa; overflow: hidden; }
.pf-track__fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1c6bff, #0f52e0); transition: width .7s ease; }
.pf-track--dark { background: rgba(255, 255, 255, .14); }
.pf-track--dark .pf-track__fill { background: linear-gradient(90deg, #2f8bff, #58b4ff); }

#profile-dashboard .pf-status-text { min-height: 0; color: var(--pf-text); font: 500 12.5px/1.4 Inter, Arial, sans-serif !important; }
#profile-dashboard .pf-status-text:empty { display: none; }

/* ------------------------------------------------------------------ */
/* Welcome banner                                                      */
/* ------------------------------------------------------------------ */
.pf-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(230px, 1fr) minmax(300px, 1.5fr) minmax(250px, 300px);
  align-items: center;
  gap: 0 26px;
  min-height: 216px;
  padding: 22px 22px 22px 30px;
  border: 1px solid #dbe6fb;
  border-radius: 18px;
  background:
    radial-gradient(60% 120% at 62% 100%, rgba(120, 170, 255, .36), transparent 62%),
    radial-gradient(40% 90% at 4% 0%, rgba(255, 255, 255, .9), transparent 70%),
    linear-gradient(110deg, #e9f1ff 0%, #dce9ff 46%, #eaf2ff 100%);
  box-shadow: var(--pf-shadow);
}

.pf-hero__avatar { position: relative; width: 124px; height: 124px; }

.pf-hero__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px #1c6bff, 0 10px 22px rgba(18, 87, 224, .22);
  object-fit: cover;
  cursor: pointer;
}

#profile-dashboard .pf-hero__avatar-edit {
  all: unset;
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--pf-blue) !important;
  color: #fff !important;
  cursor: pointer;
}

.pf-hero__avatar-edit lucide-icon { width: 15px; height: 15px; }
.pf-hero__info { position: relative; z-index: 2; min-width: 0; }
#profile-dashboard .pf-hero__welcome { color: var(--pf-text) !important; font: 500 14px/1.2 Inter, Arial, sans-serif !important; }

#profile-dashboard .pf-hero__name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  color: var(--pf-navy) !important;
  font: 800 clamp(26px, 2.6vw, 38px)/1.1 Inter, Arial, sans-serif !important;
  letter-spacing: -.01em !important;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.pf-hero__verified { flex: 0 0 auto; width: 24px; height: 24px; color: var(--pf-blue); }
.pf-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 14px;
  border-radius: 999px;
  font: 600 12.5px/1 Inter, Arial, sans-serif;
  white-space: nowrap;
}

.pf-chip lucide-icon { width: 15px; height: 15px; }
.pf-chip--level { background: linear-gradient(120deg, #0f52e0, #0b2a6f); color: #fff; }
.pf-chip--level lucide-icon { color: #ffd45c; }
.pf-chip--role { border: 1px solid #e6ecf8; background: #fff; color: var(--pf-ink); }
.pf-chip--role lucide-icon { color: var(--pf-gold); }

.pf-hero__meta { display: grid; gap: 6px; margin-top: 12px !important; }

#profile-dashboard .pf-hero__meta li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--pf-ink);
  font: 500 12.5px/1.3 Inter, Arial, sans-serif !important;
}

.pf-hero__meta li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-hero__meta lucide-icon { width: 15px; height: 15px; color: var(--pf-blue); }
.pf-dot { flex: 0 0 auto; width: 9px; height: 9px; margin: 0 3px; border-radius: 50%; background: #22b35e; }

#profile-dashboard .pf-copy-btn {
  all: unset;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--pf-muted) !important;
  cursor: pointer;
}

#profile-dashboard .pf-copy-btn:hover { background: rgba(18, 87, 224, .1) !important; color: var(--pf-blue) !important; }
.pf-copy-btn lucide-icon { width: 14px; height: 14px; color: inherit; }

.pf-hero__art { position: relative; align-self: stretch; min-width: 0; }

.pf-hero__mascot {
  position: absolute;
  left: 0;
  bottom: -22px;
  width: auto;
  max-width: none;
  height: calc(100% + 50px);
  filter: drop-shadow(0 14px 18px rgba(18, 61, 150, .2));
}

#profile-dashboard .pf-hero__motto {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%) rotate(-7deg);
  color: var(--pf-navy) !important;
  font: 700 clamp(22px, 2vw, 30px)/1.08 Caveat, "Segoe Script", cursive !important;
  white-space: nowrap;
}

.pf-hero__motto::after {
  content: "";
  display: block;
  width: 70%;
  height: 3px;
  margin: 6px 0 0 20%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--pf-gold));
}

/* Wallet card: dark banner version (desktop) and tile version (phones) */
#profile-dashboard .pf-wallet-card {
  position: relative;
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 18px 20px;
  border-radius: 16px;
  background:
    radial-gradient(80% 90% at 100% 0%, rgba(245, 166, 35, .3), transparent 60%),
    linear-gradient(135deg, #0d2f7d 0%, #061b4f 100%);
  box-shadow: 0 14px 28px rgba(6, 27, 79, .3);
  color: #fff !important;
  text-decoration: none !important;
  overflow: hidden;
}

.pf-wallet-card__head { display: flex; align-items: center; gap: 10px; font: 700 15px/1.2 Inter, Arial, sans-serif; }
.pf-wallet-card__head lucide-icon { width: 26px; height: 26px; color: #ffd45c; }

.pf-coin { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 4px 10px rgba(0, 0, 0, .28); }

#profile-dashboard .pf-wallet-card strong { margin-top: 8px; color: #fff; font: 800 26px/1.1 Inter, Arial, sans-serif !important; }
#profile-dashboard .pf-wallet-card [data-wallet-ge] { color: rgba(255, 255, 255, .86); font: 500 13px/1.3 Inter, Arial, sans-serif !important; }

.pf-wallet-card__cta {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  min-height: 32px;
  margin-top: 10px;
  padding: 0 16px;
  border: 1px solid rgba(255, 224, 138, .7);
  border-radius: 9px;
  color: #fff;
  font: 600 12.5px/1 Inter, Arial, sans-serif;
}

.pf-wallet-card__cta lucide-icon { width: 15px; height: 15px; }


/* ------------------------------------------------------------------ */
/* Today at a glance                                                   */
/* ------------------------------------------------------------------ */
#profile-dashboard .pf-stats { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 14px !important; min-height: 96px; }

#profile-dashboard .pf-stat {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--pf-line);
  border-radius: var(--pf-radius);
  background: var(--pf-card);
  box-shadow: var(--pf-shadow);
  color: var(--pf-ink) !important;
  text-decoration: none !important;
}

.pf-stat--wallet { display: none !important; }

.pf-stat__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #edf3ff;
  color: var(--pf-blue);
}

.pf-stat__icon lucide-icon { width: 28px; height: 28px; }
.pf-stat__coin { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 50%; }
.pf-stat--streak .pf-stat__icon { background: #fff1e4; color: #f2651c; }
.pf-stat--practice .pf-stat__icon,
.pf-stat--wallet .pf-stat__icon { background: #fff6dd; color: var(--pf-gold); }
.pf-stat__copy { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
.pf-stat__label { color: var(--pf-ink); font: 600 12.5px/1.2 Inter, Arial, sans-serif; }
#profile-dashboard .pf-stat__value { color: var(--pf-navy); font: 800 20px/1.2 Inter, Arial, sans-serif !important; }
.pf-stat--practice .pf-stat__value { color: #1e9a52 !important; }
.pf-stat__sub { color: var(--pf-muted); font: 500 12px/1.2 Inter, Arial, sans-serif; }
.pf-stat__bar { display: flex; align-items: center; gap: 12px; margin-top: 5px; }
.pf-stat__bar span { flex: 0 0 auto; color: var(--pf-ink); font: 600 12px/1 Inter, Arial, sans-serif; }
.pf-stat--practice .pf-track__fill { background: linear-gradient(90deg, #35c26f, #1e9a52); }
.pf-stat__dots { display: flex; gap: 8px; margin-top: 7px; }
.pf-stat__dots i { width: 10px; height: 10px; border-radius: 50%; background: #d9e4f8; }
.pf-stat__dots i.is-lit { background: #f58a1f; }
.pf-stat__go { flex: 0 0 auto; width: 30px; height: 30px; padding: 7px; box-sizing: border-box; border: 1px solid var(--pf-line); border-radius: 50%; color: var(--pf-blue); }

/* ------------------------------------------------------------------ */
/* Quick links (phones only)                                           */
/* ------------------------------------------------------------------ */
.pf-quick { display: none; }

/* ------------------------------------------------------------------ */
/* Account panels                                                      */
/* ------------------------------------------------------------------ */
.pf-account { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.05fr) minmax(0, 1.2fr); gap: 14px; scroll-margin-top: 16px; }
.pf-details { display: grid; }

.pf-detail-row {
  display: grid;
  grid-template-columns: 20px auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 3px 0;
  border-top: 1px solid #eef2fa;
}

.pf-detail-row:first-child { border-top: 0; }
.pf-detail-row lucide-icon { width: 17px; height: 17px; color: var(--pf-blue); }
.pf-detail-row span { color: var(--pf-text); font: 500 13px/1.3 Inter, Arial, sans-serif; }
.pf-pref {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e6ecf8;
  border-radius: 12px;
  background: #f8faff;
  cursor: pointer;
}

.pf-pref input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--pf-blue); cursor: pointer; }
.pf-pref span { display: grid; gap: 3px; min-width: 0; }
#profile-dashboard .pf-pref strong { color: var(--pf-ink); font: 600 13.5px/1.3 Inter, Arial, sans-serif !important; }
.pf-pref small { color: var(--pf-muted); font: 400 12px/1.4 Inter, Arial, sans-serif; }
#profile-dashboard .pf-privacy-link { margin-top: 10px; color: var(--pf-muted); font: 500 12.5px/1.4 Inter, Arial, sans-serif !important; }
.pf-privacy-link a { color: var(--pf-blue); }

#profile-dashboard .pf-detail-row strong { color: var(--pf-ink); font: 600 13px/1.3 Inter, Arial, sans-serif !important; text-align: right; overflow-wrap: anywhere; }

.pf-form,
.pf-form__fields { display: grid; gap: 12px; }
.pf-field { display: grid; gap: 6px; min-width: 0; }
#profile-dashboard .pf-field label { color: var(--pf-text) !important; font: 500 12.5px/1.2 Inter, Arial, sans-serif !important; }

.pf-input-group {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid #d9e3f5;
  border-radius: 10px;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.pf-input-group:focus-within { border-color: var(--pf-blue); box-shadow: 0 0 0 3px rgba(18, 87, 224, .14); }
.pf-input-prefix { flex: 0 0 auto; padding: 0 12px; border-right: 1px solid #e6ecf8; color: var(--pf-ink); font: 600 14px/1 Inter, Arial, sans-serif; }

#profile-dashboard .pf-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 13px !important;
  border: 1px solid #d9e3f5 !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: var(--pf-ink) !important;
  font: 500 14px/1.2 Inter, Arial, sans-serif !important;
}

#profile-dashboard .pf-input:focus { border-color: var(--pf-blue) !important; outline: 0 !important; box-shadow: 0 0 0 3px rgba(18, 87, 224, .14) !important; }
#profile-dashboard .pf-input-group .pf-input,
#profile-dashboard .pf-input-group .pf-input:focus { flex: 1 1 auto; border: 0 !important; box-shadow: none !important; background: transparent !important; }
#profile-dashboard .pf-input::placeholder { color: #8795b1; }
#profile-dashboard .pf-input.locked-field { background: #f3f6fc !important; color: var(--pf-muted) !important; cursor: not-allowed; }

#profile-dashboard .pf-eye-btn {
  all: unset;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--pf-muted) !important;
  cursor: pointer;
}

.pf-eye-btn lucide-icon { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ */
/* Rank, podium and leaderboard                                        */
/* ------------------------------------------------------------------ */
.pf-ranks { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; }

.pf-rank-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border-radius: var(--pf-radius);
  background:
    radial-gradient(70% 80% at 0% 100%, rgba(47, 139, 255, .3), transparent 62%),
    linear-gradient(140deg, #0c2c78 0%, #06194a 100%);
  box-shadow: 0 14px 28px rgba(6, 27, 79, .26);
  color: #fff;
}

.pf-rank-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
#profile-dashboard .pf-rank-card__head h2 { color: #fff !important; }
.pf-rank-card__head h2 lucide-icon { width: 26px; height: 26px; color: #ffd45c; }
.pf-rank-card__body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); flex: 1 1 auto; align-items: center; gap: 12px; }

.pf-rank-now {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
}

/* The rank badge is a tall crest with its name on it, so it keeps its own shape. */
.pf-rank-now img { width: 96px; height: 144px; border-radius: 0; object-fit: contain; filter: drop-shadow(0 0 14px rgba(88, 180, 255, .55)); animation: pf-badge-float 4.6s ease-in-out infinite; }
@keyframes pf-badge-float {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 12px rgba(88, 180, 255, .45)); }
  50% { transform: translateY(-5px); filter: drop-shadow(0 0 22px rgba(120, 200, 255, .8)); }
}
@media (prefers-reduced-motion: reduce) { .pf-rank-now img { animation: none; } }
.pf-rank-now__copy { display: grid; gap: 2px; min-width: 0; }
.pf-rank-now__copy span { color: rgba(255, 255, 255, .86); font: 500 15px/1.2 Inter, Arial, sans-serif; }
#profile-dashboard .pf-rank-now__copy strong { color: #fff; font: 800 26px/1.1 Inter, Arial, sans-serif !important; }
.pf-rank-now__xp { grid-column: 1 / -1; color: #fff; font: 700 15px/1.2 Inter, Arial, sans-serif; }
.pf-rank-now__bar { display: flex; grid-column: 1 / -1; align-items: center; gap: 10px; }
.pf-rank-now__bar span { flex: 0 0 auto; color: #7fc0ff; font: 700 13px/1 Inter, Arial, sans-serif; }
.pf-rank-now__next { grid-column: 1 / -1; color: rgba(255, 255, 255, .66); font: 500 11.5px/1.3 Inter, Arial, sans-serif; }

.pf-tiers { display: grid; align-content: center; gap: 4px; }

.pf-tiers li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  color: #fff;
  font: 600 13px/1 Inter, Arial, sans-serif;
}

.pf-tiers li.is-current { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.pf-tiers img { width: 26px; height: 34px; object-fit: contain; }
.pf-tiers em { color: rgba(255, 255, 255, .78); font: 500 12px/1 Inter, Arial, sans-serif; font-style: normal; }

.pf-podium {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 18px 0;
  border: 1px solid #f4e3bd;
  border-radius: var(--pf-radius);
  background:
    radial-gradient(circle at 14% 34%, rgba(245, 166, 35, .22) 0 3px, transparent 4px),
    radial-gradient(circle at 86% 30%, rgba(245, 166, 35, .22) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 62%, rgba(18, 87, 224, .16) 0 3px, transparent 4px),
    radial-gradient(circle at 30% 70%, rgba(18, 87, 224, .16) 0 3px, transparent 4px),
    linear-gradient(180deg, #fff6e2 0%, #fffaf0 48%, #ffeecd 100%);
  box-shadow: var(--pf-shadow);
  overflow: hidden;
}

.pf-podium .pf-panel__head { margin-bottom: 0; }
.pf-podium .pf-panel__head h2 lucide-icon { color: var(--pf-gold); }
.pf-podium__stage { position: relative; width: 100%; max-width: 520px; margin: auto auto 0; aspect-ratio: 900 / 670; }
.pf-podium-art { position: absolute; left: 6%; bottom: 0; width: 88%; height: auto; }

.pf-podium-learner {
  position: absolute;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 5px;
  width: 30%;
  transform: translateX(-50%);
}

.pf-podium-learner--1 { left: 50%; bottom: 51.5%; }
.pf-podium-learner--2 { left: 22.5%; bottom: 38.5%; }
.pf-podium-learner--3 { left: 78%; bottom: 33%; }

.pf-podium-learner img,
.pf-podium-empty-avatar {
  width: clamp(44px, 46%, 76px);
  aspect-ratio: 1;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #eaf2ff;
  box-shadow: 0 6px 14px rgba(28, 57, 108, .2);
  object-fit: cover;
}

.pf-podium-learner--1 img { width: clamp(52px, 56%, 90px); border-color: #ffd45c; }
.pf-podium-empty-avatar { display: grid; place-items: center; color: #9fb0d1; }

.pf-podium-learner-copy {
  display: grid;
  gap: 2px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 4px 10px rgba(28, 57, 108, .1);
  text-align: center;
}

#profile-dashboard .pf-podium-learner-copy strong { color: var(--pf-ink); font: 700 12px/1.2 Inter, Arial, sans-serif !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-podium-learner-copy span { color: var(--pf-text); font: 500 11px/1.2 Inter, Arial, sans-serif; }
.pf-podium-crown { order: 3; width: 22px; height: 22px; color: var(--pf-gold); }

.pf-leaders { display: flex; flex-direction: column; }
.pf-leaders .pf-panel__head h2 lucide-icon { color: var(--pf-gold); }

.pf-leaders__cols,
.pf-leader-item { display: grid; grid-template-columns: 28px 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.pf-leaders__cols { padding: 0 8px 6px; color: var(--pf-muted); font: 500 11.5px/1 Inter, Arial, sans-serif; }
.pf-leaders__cols span:nth-child(2) { grid-column: 2 / 4; }
.pf-leaders__list { display: grid; align-content: start; flex: 1 1 auto; gap: 2px; }
.pf-leader-item { min-height: 38px; padding: 2px 8px; border-radius: 9px; }
.pf-leader-item:first-child { background: #fff6dd; }
.pf-leader-item--me { margin-top: 8px; background: #edf3ff; }

.pf-leader-rank-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--pf-ink);
  font: 700 12px/1 Inter, Arial, sans-serif;
}

.pf-leader-rank-num.gold { background: #f5a623; color: #fff; }
.pf-leader-rank-num.silver { background: #b4bfd2; color: #fff; }
.pf-leader-rank-num.bronze { background: #d98a4e; color: #fff; }
.pf-leader-avatar { width: 32px; height: 32px; border-radius: 50%; background: #eaf2ff; object-fit: cover; }
.pf-leader-name { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--pf-ink); font: 700 12.5px/1.2 Inter, Arial, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-you-badge { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; background: var(--pf-blue); color: #fff; font: 700 10.5px/1.2 Inter, Arial, sans-serif; }
.pf-leader-xp { color: var(--pf-ink); font: 700 12.5px/1 Inter, Arial, sans-serif; white-space: nowrap; }
#profile-dashboard .pf-leaders__reset { display: flex; align-items: center; gap: 5px; margin-top: 10px; color: var(--pf-muted) !important; font: 500 11.5px/1.2 Inter, Arial, sans-serif !important; }
.pf-leaders__reset lucide-icon { width: 14px; height: 14px; }
.pf-leaders__reset strong { color: var(--pf-ink); font-weight: 700; }

/* ------------------------------------------------------------------ */
/* Performance snapshot                                                */
/* ------------------------------------------------------------------ */
.pf-snapshot { scroll-margin-top: 16px; }
#profile-dashboard .pf-snap-grid { display: grid !important; grid-template-columns: repeat(8, minmax(0, 1fr)) !important; gap: 10px !important; }

.pf-snap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #edf1f9;
  border-radius: 12px;
  background: #fbfcff;
}

.pf-snap--extra { display: none; }
.pf-snap-grid.is-expanded .pf-snap--extra { display: flex; }
.pf-snap > div { display: grid; gap: 3px; min-width: 0; }
.pf-snap__icon { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 50%; }
.pf-snap__icon lucide-icon { width: 20px; height: 20px; }
.pf-snap__icon--blue { background: #edf3ff; color: var(--pf-blue); }
.pf-snap__icon--green { background: #e6f7ee; color: #1e9a52; }
.pf-snap__icon--gold { background: #fff6dd; color: #d98e0b; }
.pf-snap__icon--orange { background: #fff1e4; color: #f2651c; }
.pf-snap__icon--purple { background: #f1ecff; color: #6b4fe0; }
.pf-snap__icon--red { background: #ffecee; color: #c62434; }
.pf-snap__label { color: var(--pf-text); font: 500 11.5px/1.25 Inter, Arial, sans-serif; }
#profile-dashboard .pf-snap__value { color: var(--pf-ink); font: 800 15px/1.2 Inter, Arial, sans-serif !important; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ */
/* Wallet history                                                      */
/* ------------------------------------------------------------------ */
.pf-history { scroll-margin-top: 16px; }

.pf-tx-head,
.pf-tx-row { display: grid; grid-template-columns: 84px minmax(0, 1.6fr) minmax(0, 1.1fr) minmax(0, .8fr) minmax(0, .8fr); align-items: center; gap: 12px; }
.pf-tx-head { padding: 0 10px 8px; border-bottom: 1px solid var(--pf-line); color: var(--pf-muted); font: 600 11.5px/1 Inter, Arial, sans-serif; }
.pf-tx-head span:nth-child(n + 4),
.pf-tx-row > div:nth-child(n + 4) { text-align: right; }
.pf-tx-row { min-height: 42px; padding: 4px 10px; border-bottom: 1px solid #f0f4fb; color: var(--pf-ink); font: 500 13px/1.3 Inter, Arial, sans-serif; }
.pf-tx-row:last-child { border-bottom: 0; }

/* "View More" opens the whole history inside its own scrolling area. At
   either end the wheel carries on to the page, so the list never traps it. */
.pf-tx-list.is-scrollable {
  max-height: 440px;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: auto;
  scrollbar-width: thin;
  scrollbar-color: #b9c9ea transparent;
}

/* Touch screens and small screens: a list that scrolls inside a page that
   also scrolls is awkward under a finger, so the history simply opens in
   full and the page itself does the scrolling. */
@media (hover: none), (pointer: coarse), (max-width: 900px) {
  .pf-tx-list.is-scrollable {
    max-height: none;
    padding-right: 0;
    overflow: visible;
  }
}

.pf-tx-list.is-scrollable::-webkit-scrollbar { width: 8px; }
.pf-tx-list.is-scrollable::-webkit-scrollbar-thumb { border-radius: 999px; background: #b9c9ea; }
.pf-tx-type { display: inline-flex; align-items: center; min-height: 22px; padding: 0 10px; border-radius: 999px; font: 700 11px/1 Inter, Arial, sans-serif; }
.pf-tx-type--credit { background: #e6f7ee; color: #16844e; }
.pf-tx-type--debit { background: #ffecee; color: #c62434; }
.pf-tx-date { color: var(--pf-muted); font-size: 12px; }
.pf-tx-amount--credit { color: #16844e; font-weight: 700; }
.pf-tx-amount--debit { color: #c62434; font-weight: 700; }
.pf-tx-balance { font-weight: 600; }

/* ------------------------------------------------------------------ */
/* Session                                                             */
/* ------------------------------------------------------------------ */
.pf-session { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 4px; }
#profile-dashboard .pf-session__home { margin-right: auto !important; }

/* ------------------------------------------------------------------ */
/* Dialogs                                                             */
/* ------------------------------------------------------------------ */
.pf-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 20, 54, .55);
}

.pf-modal-body {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(100%, 460px);
  max-height: calc(100vh - 36px);
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 60px rgba(6, 20, 54, .35);
  overflow-y: auto;
}

#profile-dashboard .pf-modal-title { color: var(--pf-ink) !important; font: 700 19px/1.25 Inter, Arial, sans-serif !important; }

#profile-dashboard .pf-modal-close {
  all: unset;
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef3fc !important;
  color: var(--pf-ink) !important;
  font: 500 22px/1 Arial, sans-serif !important;
  cursor: pointer;
}

.pf-avatar-large { width: min(100%, 300px); height: auto; margin: 0 auto; border-radius: 18px; }
.pf-avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 84px)); justify-content: center; gap: 10px; max-height: min(46vh, 340px); padding: 4px; overflow-y: auto; }
.pf-avatar-item { width: 100%; aspect-ratio: 1; border: 3px solid transparent; border-radius: 50%; background: #eaf2ff; object-fit: cover; cursor: pointer; }
.pf-avatar-item.active { border-color: var(--pf-blue); box-shadow: 0 0 0 3px rgba(18, 87, 224, .18); }
.pf-delete-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #ffecee; color: #c62434; }
.pf-delete-icon lucide-icon { width: 26px; height: 26px; }
#profile-dashboard .pf-delete-warning { color: var(--pf-text) !important; font: 400 14px/1.5 Inter, Arial, sans-serif !important; }
body.modal-open { overflow: hidden; }

/* ------------------------------------------------------------------ */
/* Medium screens                                                      */
/* ------------------------------------------------------------------ */
@media (max-width: 1420px) {
  .pf-hero { grid-template-columns: auto minmax(220px, 1fr) minmax(240px, 1.1fr) minmax(230px, 270px); }
  #profile-dashboard .pf-hero__motto { display: none; }
  .pf-hero__mascot { left: 50%; transform: translateX(-50%); }
  .pf-hero { overflow: visible; }
  #profile-dashboard .pf-snap-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .pf-rank-now img { width: 70px; height: 105px; }
  #profile-dashboard .pf-rank-now__copy strong { font-size: 22px !important; }
  .pf-rank-card__body { grid-template-columns: minmax(0, 1fr) minmax(138px, .9fr); }
  .pf-tiers li { gap: 8px; padding: 0 8px; font-size: 12.5px; }
}

@media (max-width: 1180px) {
  .pf-ranks { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pf-rank-card { grid-column: 1 / -1; }
  .pf-account { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pf-account > :first-child { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ */
/* Phones: app-style layout                                            */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .pf-page { gap: 12px; width: min(100% - 24px, 640px); padding: 14px 0 28px; }

  .pf-hero {
    grid-template-columns: minmax(0, 1fr) 44%;
    grid-template-areas: "avatar art" "info art";
    align-items: start;
    gap: 8px 0;
    min-height: 0;
    padding: 16px 0 16px 16px;
    overflow: hidden;
  }

  .pf-hero__avatar { grid-area: avatar; width: 52px; height: 52px; }
  .pf-hero__avatar img { border-width: 2px; box-shadow: 0 0 0 2px #1c6bff; }
  #profile-dashboard .pf-hero__avatar-edit { right: -6px; bottom: -6px; width: 24px; height: 24px; border-width: 2px; }
  .pf-hero__avatar-edit lucide-icon { width: 11px; height: 11px; }
  .pf-hero__info { grid-area: info; }
  #profile-dashboard .pf-hero__welcome { font-size: 13px !important; }
  #profile-dashboard .pf-hero__name { font-size: clamp(21px, 6.4vw, 30px) !important; }
  .pf-hero__verified { width: 19px; height: 19px; }
  .pf-hero__chips { gap: 6px; margin-top: 8px; }
  .pf-chip { min-height: 26px; padding: 0 10px; font-size: 11.5px; }
  #profile-dashboard .pf-hero__meta li { font-size: 11.5px !important; }
  .pf-hero__art { grid-area: art; align-self: stretch; min-height: 150px; }
  .pf-hero__mascot { left: auto; right: 0; bottom: -16px; width: 100%; height: calc(100% + 16px); object-fit: contain; object-position: right bottom; transform: none; }
  #profile-dashboard .pf-hero__motto { display: none; }
  .pf-wallet-card--hero { display: none !important; }

  #profile-dashboard .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  #profile-dashboard .pf-stat { gap: 10px; padding: 12px; }
  .pf-stat--wallet { display: flex !important; }
  .pf-stat--practice { display: none !important; }
  .pf-stat__icon,
  .pf-stat__coin { width: 42px; height: 42px; }
  .pf-stat__icon lucide-icon { width: 22px; height: 22px; }
  .pf-stat__label { font-size: 12px; }
  #profile-dashboard .pf-stat__value { font-size: 17px !important; }
  .pf-stat__sub { font-size: 11px; }
  .pf-stat__bar { gap: 8px; }
  .pf-stat__bar span { font-size: 11px; }
  .pf-stat__dots { gap: 4px; }
  .pf-stat__dots i { width: 8px; height: 8px; }
  .pf-stat__go { width: 26px; height: 26px; padding: 6px; }

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

  #profile-dashboard .pf-quick__item {
    position: relative;
    display: grid;
    align-content: start;
    gap: 9px;
    min-width: 0;
    min-height: 86px;
    padding: 10px;
    border: 1px solid var(--pf-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--pf-shadow);
    color: var(--pf-ink) !important;
    font: 600 12px/1.25 Inter, Arial, sans-serif !important;
    text-decoration: none !important;
  }

  .pf-quick__item > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #fff; }
  .pf-quick__item > span lucide-icon { width: 20px; height: 20px; }
  .pf-quick__go { position: absolute; top: 12px; right: 8px; width: 16px; height: 16px; color: var(--pf-blue); }
  .pf-quick__item--green > span { background: linear-gradient(140deg, #35c26f, #159a4d); }
  .pf-quick__item--blue > span { background: linear-gradient(140deg, #3b8dff, #1257e0); }
  .pf-quick__item--orange > span { background: linear-gradient(140deg, #ffa53b, #f2761c); }
  .pf-quick__item--purple > span { background: linear-gradient(140deg, #9a6bff, #6b4fe0); }
  .pf-quick__item--pink > span { background: linear-gradient(140deg, #ff5fa2, #e0257a); }
  .pf-quick__item--gold > span { background: linear-gradient(140deg, #ffcc4d, #f5a623); }
  .pf-quick__item--cyan > span { background: linear-gradient(140deg, #35c4f5, #0e93d6); }
  .pf-quick__item--red > span { background: linear-gradient(140deg, #ff6b6b, #e0353f); }

  .pf-ranks { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pf-rank-card { grid-column: auto; padding: 14px; }
  .pf-rank-card__body { grid-template-columns: minmax(0, 1fr); }
  .pf-tiers { display: none !important; }
  .pf-rank-now { padding: 0; border: 0; background: transparent; gap: 8px 12px; }
  .pf-rank-now img { width: 72px; height: 72px; }
  .pf-rank-now__copy span { font-size: 13px; }
  #profile-dashboard .pf-rank-now__copy strong { font-size: 21px !important; }
  .pf-rank-now__xp { font-size: 13px; }
  .pf-podium,
  .pf-leaders { grid-column: 1 / -1; }
  .pf-podium { padding: 14px 14px 0; }
  .pf-podium__stage { max-width: 460px; aspect-ratio: 900 / 760; }
  .pf-podium-learner--1 { bottom: 45.5%; }
  .pf-podium-learner--2 { bottom: 34%; }
  .pf-podium-learner--3 { bottom: 29%; }

  .pf-page > .pf-ranks { order: 3; }
  .pf-page > .pf-snapshot { order: 4; }
  .pf-page > .pf-account { order: 5; }
  .pf-page > .pf-history { order: 6; }
  .pf-page > .pf-session { order: 7; }

  .pf-account { grid-template-columns: minmax(0, 1fr); }
  .pf-panel { padding: 14px; }
  #profile-dashboard .pf-panel__head h2,
  #profile-dashboard .pf-rank-card__head h2 { font-size: 15.5px !important; }
  #profile-dashboard .pf-snap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
  .pf-snap { gap: 9px; padding: 9px; }
  .pf-snap__icon { width: 34px; height: 34px; }
  .pf-snap:nth-child(n + 7):not(.pf-snap--extra) { display: none; }
  .pf-snap-grid.is-expanded .pf-snap:nth-child(n + 7) { display: flex; }

  .pf-tx-head { display: none; }
  .pf-tx-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 4px; }
  .pf-tx-row > div:nth-child(3) { grid-column: 2; grid-row: 2; }
  .pf-tx-row > div:nth-child(4) { grid-column: 3; grid-row: 1; }
  .pf-tx-row > div:nth-child(5) { grid-column: 3; grid-row: 2; color: var(--pf-muted); font-size: 11.5px; }
  .pf-tx-row > div:nth-child(1) { grid-row: 1 / span 2; }

  .pf-session { justify-content: stretch; }
  .pf-session .pf-btn { flex: 1 1 140px; }
  #profile-dashboard .pf-session__home { margin-right: 0 !important; }
}

@media (max-width: 520px) {
  #profile-dashboard .pf-snap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .pf-quick { gap: 8px; }
  #profile-dashboard .pf-quick__item { min-height: 82px; padding: 9px 8px; font-size: 11.5px !important; }
  .pf-quick__item > span { width: 34px; height: 34px; }
}

@media (max-width: 380px) {
  .pf-page { width: calc(100% - 16px); }
  #profile-dashboard .pf-stats { gap: 8px !important; }
  #profile-dashboard .pf-stat { gap: 8px; padding: 10px 8px; }
  .pf-stat__icon,
  .pf-stat__coin { width: 36px; height: 36px; }
  .pf-stat__go { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-track__fill { transition: none; }
}
