/* ============================================================
   Page Profil, façon app iOS : avatar et anneau de niveau, chiffres,
   listes groupées. Aplats uniquement (aucun dégradé).
   ============================================================ */

.pf2-panel {
  --pf-card: var(--m-card, #16181d);
  --pf-line: var(--m-hairline, rgba(255, 255, 255, 0.08));
  --pf-muted: var(--muted, #aab3c0);
  display: flex;
  flex-direction: column;
}

.pf2-head {
  padding-bottom: 0 !important;
  border: 0 !important;
}

.pf2-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.1rem 1rem 0.6rem;
}

.pf2-bar > strong {
  grid-column: 2;
  font-size: 1rem;
}

.pf2-bar:has(> strong) {
  grid-template-columns: 1fr auto 1fr;
}

.pf2-bar:has(> strong) > :last-child {
  justify-self: end;
}

.pf2-textbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  justify-self: start;
  padding: 0.45rem 0.2rem;
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
}

.pf2-bar > .pf2-textbtn:not(.back) {
  justify-self: end;
}

.pf2-textbtn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pf2-round {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
}

.pf2-round svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.pf2-body {
  flex: 1;
  padding: 0 1rem calc(2rem + env(safe-area-inset-bottom, 0px)) !important;
}

/* ---------- En-tête ---------- */

.pf2-hero {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0 1.2rem;
  text-align: center;
}

.pf2-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 7.2rem;
  height: 7.2rem;
  margin-bottom: 0.5rem;
}

.pf2-avatar svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pf2-avatar circle {
  fill: none;
  stroke-width: 5;
}

.pf2-avatar .track {
  stroke: rgba(255, 255, 255, 0.08);
}

.pf2-avatar .value {
  stroke: var(--accent);
  stroke-linecap: round;
}

.pf2-initial {
  display: grid;
  place-items: center;
  width: 5.9rem;
  height: 5.9rem;
  background: color-mix(in srgb, var(--accent) 16%, var(--pf-card));
  border-radius: 50%;
  color: var(--accent);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pf2-lvl {
  position: absolute;
  right: 0.1rem;
  bottom: 0.15rem;
  min-width: 2rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent);
  border: 3px solid var(--bg, #0b0c0f);
  border-radius: 999px;
  color: var(--accent-ink, #0b0c0f);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.2;
}

.pf2-hero h2 {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pf2-title {
  margin: 0;
  color: var(--pf-muted);
  font-size: 1rem;
  font-weight: 600;
}

.pf2-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.pf2-chip {
  padding: 0.28rem 0.7rem;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  color: var(--pf-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.pf2-chip.premium {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

/* ---------- Chiffres ---------- */

.pf2-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--pf-card);
  border: 1px solid var(--pf-line);
  border-radius: 20px;
}

.pf2-stats div {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  padding: 0.95rem 0.2rem;
  text-align: center;
}

.pf2-stats div + div {
  border-left: 1px solid var(--pf-line);
}

.pf2-stats strong {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pf2-stats span {
  color: var(--pf-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

/* ---------- Listes groupées ---------- */

.pf2-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 1.5rem 0.3rem 0.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pf2-h span {
  color: var(--pf-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.pf2-group {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  background: var(--pf-card);
  border: 1px solid var(--pf-line);
  border-radius: 20px;
  color: inherit;
  font: inherit;
  text-align: left;
}

.pf2-group > * + * {
  border-top: 1px solid var(--pf-line);
}

.pf2-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.2rem;
  padding: 0.55rem 1rem;
  background: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.pf2-row > span:not(.pf2-ric) {
  flex: 1;
}

.pf2-row em {
  color: var(--pf-muted);
  font-size: 0.88rem;
  font-style: normal;
  font-weight: 600;
}

.pf2-row > svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--pf-muted);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}

.pf2-ric {
  display: grid;
  flex: none;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 9px;
  color: #fff;
}

.pf2-ric svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pf2-ric.violet { background: #8e5cf7; }
.pf2-ric.orange { background: #ff9f0a; }
.pf2-ric.green { background: #30b158; }

.pf2-meter {
  display: block;
  height: 0.5rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.pf2-meter.sm {
  height: 0.32rem;
  margin-top: 0.4rem;
}

.pf2-meter i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

/* Niveau */

.pf2-level {
  display: grid;
  gap: 0.55rem;
  padding: 0.95rem 1rem;
}

.pf2-level-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.pf2-level-top strong {
  font-size: 1.05rem;
}

.pf2-level-top span,
.pf2-level small {
  color: var(--pf-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Quêtes */

.pf2-quest,
.pf2-next {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
}

.pf2-qic {
  display: grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  font-size: 1rem;
}

.pf2-quest.done .pf2-qic {
  background: var(--accent);
  color: var(--accent-ink, #0b0c0f);
}

.pf2-qic svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pf2-qmain {
  display: grid;
  flex: 1;
  min-width: 0;
}

.pf2-qmain strong {
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf2-qmain small {
  color: var(--pf-muted);
  font-size: 0.8rem;
}

.pf2-quest.done .pf2-qmain strong {
  color: var(--pf-muted);
}

.pf2-quest em,
.pf2-next em {
  flex: none;
  color: var(--pf-muted);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 700;
}

.pf2-quest.done em {
  color: var(--accent);
}

/* Objectif */

.pf2-goal {
  display: grid;
  gap: 0.7rem;
  padding: 0.95rem 1rem;
  cursor: pointer;
}

.pf2-goal > * + * {
  border-top: 0;
}

.pf2-goal-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.pf2-goal-top strong {
  flex: 1;
  font-size: 1.3rem;
  font-weight: 800;
}

.pf2-goal-top em {
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 700;
}

.pf2-goal-legend {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  color: var(--pf-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.pf2-goal-legend b {
  color: var(--text);
}

/* Activité */

.pf2-activity {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.95rem 1rem;
}

.pf2-activity > * + * {
  border-top: 0;
}

.pf2-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
}

.pf2-grid span {
  display: grid;
  gap: 4px;
}

.pf2-grid i {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
}

.pf2-grid i.on {
  background: rgb(var(--tone));
}

.pf2-grid i.today {
  outline: 1.5px solid var(--text);
  outline-offset: 1px;
}

.pf2-grid i.future {
  opacity: 0.3;
}

.pf2-grid-legend {
  display: grid;
  gap: 4px;
  grid-auto-rows: 1fr;
  color: var(--pf-muted);
  font-size: 0.62rem;
  font-weight: 700;
}

.pf2-grid-legend span {
  display: grid;
  align-items: center;
}

/* Trophées */

.pf2-medals {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.9rem 0.7rem 0.7rem;
  scrollbar-width: none;
}

.pf2-medals::-webkit-scrollbar {
  display: none;
}

.pf2-medals button {
  display: grid;
  flex: 0 0 4.8rem;
  justify-items: center;
  gap: 0.35rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.pf2-medals small {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pf2-empty {
  margin: 0;
  padding: 1rem;
  color: var(--pf-muted);
  font-size: 0.9rem;
}

.pf2-challenges {
  margin-top: 1.5rem;
}

/* ---------- Modifier le profil ---------- */

.pf2-field {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.2rem;
  padding: 0.35rem 1rem;
}

.pf2-field > span {
  flex: none;
  min-width: 6.5rem;
  font-size: 0.98rem;
  font-weight: 600;
}

.pf2-field input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0;
  background: none;
  border: 0;
  color: var(--pf-muted);
  font: inherit;
  font-size: 0.98rem;
  text-align: right;
}

.pf2-field input:focus {
  color: var(--text);
  outline: none;
}

.pf2-field input::-webkit-date-and-time-value {
  text-align: right;
}

.pf2-seg {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 0.2rem;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
}

.pf2-seg button {
  flex: 1;
  max-width: 6rem;
  padding: 0.4rem 0.6rem;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--pf-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.pf2-seg button.on {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text);
}

.pf2-foot {
  margin: 0.55rem 0.3rem 0;
  color: var(--pf-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.pf2-stats strong small {
  color: var(--pf-muted);
  font-size: 0.75rem;
  font-weight: 700;
}
