/* Profil et statistiques. */
.pf-avatar { overflow: hidden; }
.pf-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ---------- Profil ---------- */
.pf-ico { display: inline-flex; }
.pf-ico svg { width: 16px; height: 16px; }
.pf-flame, .st-flame { display: inline-flex; }
.pf-flame svg, .st-flame svg { width: 13px; height: 13px; }
.pf-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: stretch; }
.pf-card { padding: 22px; background: linear-gradient(180deg, #1c1c1c, #121212 60%, #0c0c0c); box-shadow: inset 0 0 0 1px var(--gold-ring); }
.pf-avatar { width: 58px; height: 58px; font-size: 28px; }
.pf-name { font-size: 36px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-level { margin-top: 18px; padding-top: 16px; border-top: 1px dashed rgba(212,175,55,.3); }
.pf-lvl { font-size: 26px; color: var(--ink); }
.pf-xp { font-size: 28px; }
.pf-left { margin-top: 9px; font-size: 13px; font-weight: 700; color: var(--ink); }
.pf-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pf-hero { flex: 1; }
.pf-hero .h-right { font-size: 44px; }
.pf-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-stub { padding: 14px 16px; }
.pf-stub-row { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.pf-stub-v { font-size: 34px; line-height: 1.05; margin: 4px 0 2px; }
.pf-stub-of { font-size: 20px; }
.pf-stub .meta { font-size: 12.5px; }

.pf-swatch { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; flex: none;
  background: repeating-conic-gradient(var(--d) 0 25%, var(--l) 0 50%) 0 0 / 50% 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.pf-swatch img { position: absolute; left: 18%; top: 18%; width: 64%; height: 64%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,0,0,.45)); }
.pf-swatch.locked { filter: grayscale(1) brightness(.55); }
.pf-medal { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 35%, #3a2f12, #15120a 70%); box-shadow: inset 0 0 0 1.5px var(--gold-ring); }
.pf-medal img { width: 68%; height: 68%; object-fit: contain; }
.pf-medal.locked { background: var(--surface); box-shadow: inset 0 0 0 1px var(--ring); }
.pf-medal.locked img { filter: grayscale(1) brightness(.5); }

.pf-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pf-board { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.pf-board-name { font: 22px/1 var(--display); letter-spacing: .8px; margin-top: 4px; }
.pf-board-state { font-size: 12px; font-weight: 700; }
.pf-progress { height: 4px; }
.pf-progress > i { background: var(--faint); }

.pf-ratings { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pf-rating { padding: 14px 16px 10px; }
.pf-cadence { font-size: 22px; margin-top: 4px; }
.pf-elo { font-size: 42px; line-height: 1; color: var(--ink); }
.pf-delta { font-size: 22px; margin-bottom: 3px; }
.pf-spark { margin-top: 8px; }
.pf-spark svg.spark { height: 44px; }
.pf-note { margin-top: 10px; font-size: 12.5px; }

.pf-skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.pf-skill { display: flex; flex-direction: column; gap: 10px; }
.pf-dots { display: flex; gap: 6px; }
.pf-dots i { flex: 1; height: 8px; border-radius: 4px; background: var(--track); }
.pf-dots i.on { background: var(--gold); }
.pf-dots.none i { background: transparent; box-shadow: inset 0 0 0 1px var(--track); }

.pf-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.pf-set { padding: 16px 18px 6px; }
.pf-set .list { margin-top: 6px; }
.list > .pf-row { gap: 12px; padding: 12px 2px; }
.pf-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-row-label { font-weight: 650; color: var(--ivory); }
.pf-row-label.red { color: var(--red-text); }
.pf-row-label.gold { color: var(--ink); }
.pf-row-sub { font-size: 12.5px; line-height: 1.4; }
.pf-row-value { color: var(--text2); font-size: 13.5px; font-weight: 650; white-space: nowrap; }
.pf-row .switch { display: inline-block; }
.pf-row.off .switch { opacity: .4; }
.pf-row.off .pf-row-label { color: var(--text2); }
.pf-chev { width: 8px; height: 8px; border-top: 2px solid var(--faint); border-right: 2px solid var(--faint); transform: rotate(45deg); margin-right: 4px; flex: none; }
.pf-plat { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--raised); color: var(--ink); font: 16px/1 var(--display); letter-spacing: .5px; box-shadow: inset 0 0 0 1px var(--hair); flex: none; }
.pf-plus { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(212,175,55,.1); color: var(--gold); font-size: 20px; font-weight: 700; flex: none; }
.pf-version { margin-top: 26px; text-align: center; font-size: 12px; }

/* Fenêtres du profil (ajoutées au <body>, hors de la page) */
.pf-sheet-title { font-size: 30px; }
.pf-rewards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.pf-reward { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); cursor: pointer; text-align: left; color: inherit; }
.pf-reward:hover { box-shadow: inset 0 0 0 1px var(--ring); }
.pf-reward > .pf-swatch, .pf-reward > .pf-medal { width: 42px; }
.pf-reward-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-reward-name { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.pf-reward-state { font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; }
.pf-reward.locked .pf-reward-name { color: var(--text2); }
.pf-reward-big { width: 84px; }
.pf-minutes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.pf-minutes button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 0; border: 0; border-radius: 12px; background: var(--raised); color: var(--ivory); cursor: pointer; box-shadow: inset 0 0 0 1px var(--hair); }
.pf-minutes button b { font: 30px/1 var(--display); font-weight: 400; }
.pf-minutes button span { font-size: 12px; font-weight: 700; color: var(--meta); }
.pf-minutes button[aria-checked="true"] { background: var(--gold); color: #120e04; }
.pf-minutes button[aria-checked="true"] span { color: #120e04; }
.pf-options { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pf-opt-text { flex: 1; min-width: 0; }
.pf-opt .c-title, .pf-opt .c-sub { display: block; }
.pf-opt > .pf-swatch { width: 44px; }
.pf-group { margin-top: 18px; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: var(--text2); }

/* ---------- Statistiques ---------- */
.st .up { color: var(--ink); }
.st .down { color: var(--red-text); }
.st-small { font-size: 12.5px; line-height: 1.45; }
.st-top { align-items: center; }
.st-ref { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.st-ref .num { font-size: 30px; color: var(--ink); }
.st-ref .meta { font-size: 12px; }
.st-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.st-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.st-head { flex-wrap: wrap; }
.st-head .seg { margin-left: auto; }
.st-foot { margin-top: 10px; font-size: 12.5px; }
.st-empty { margin-top: 12px; font-size: 13.5px; line-height: 1.5; }
.st-h { font-size: 32px; margin-top: 6px; }
.st-card-h { font-size: 26px; }

/* Postes */
.st-postes { padding: 20px; background: linear-gradient(180deg, #1c1c1c, #121212 55%, #0c0c0c); }
.st-mean-tag { display: flex; justify-content: center; margin-top: 16px; }
.st-mean-tag span, .st-mean-tag b { display: inline-flex; align-items: center; height: 26px; background: var(--gold); color: #1d1606; }
.st-mean-tag span { padding: 0 6px 0 10px; border-radius: 7px 0 0 7px; font-size: 9.5px; font-weight: 800; letter-spacing: 1px; }
.st-mean-tag b { padding: 0 10px 0 2px; border-radius: 0 7px 7px 0; font-size: 19px; color: #000; font-weight: 400; }
.st-poste-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.st-poste { display: grid; grid-template-columns: 112px minmax(0, 1fr) 74px; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.st-poste:hover { background: rgba(255,255,255,.03); }
.st-poste.on { background: rgba(212,175,55,.12); box-shadow: inset 0 0 0 1px rgba(212,175,55,.45); }
.st-poste-l { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-poste.on .st-poste-l { color: var(--ink); }
.st-track { position: relative; height: 44px; background: linear-gradient(90deg, transparent calc(25% - .5px), rgba(242,239,233,.07) 0 calc(25% + .5px), transparent 0 calc(75% - .5px), rgba(242,239,233,.07) 0 calc(75% + .5px), transparent 0); }
.st-track::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(212,175,55,.55); }
.st-track i { position: absolute; top: 15px; height: 14px; }
.st-track i.up { background: linear-gradient(90deg, var(--gold-deep), var(--ink)); border-radius: 0 4px 4px 0; }
.st-track i.down { background: linear-gradient(90deg, var(--red), #6e2427); border-radius: 4px 0 0 4px; }
.st-poste-v { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.st-poste-v b { font-size: 19px; font-weight: 400; }
.st-poste-v small { font-size: 10px; font-weight: 800; letter-spacing: .5px; }
.st-axis { display: grid; grid-template-columns: 112px minmax(0, 1fr) 74px; gap: 10px; padding: 4px 10px 0; font-size: 9.5px; font-weight: 800; letter-spacing: 1px; }
.st-axis .down { grid-column: 2; grid-row: 1; justify-self: start; }
.st-axis .up { grid-column: 2; grid-row: 1; justify-self: end; }
.st-detail { margin-top: 16px; padding-top: 16px; border-top: 1px dashed rgba(212,175,55,.3); }
.st-detail-t { font-size: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.st-detail-d { font-size: 26px; }
.st-rate { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 7px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); flex: none; }
.st-rate span { font-size: 9px; font-weight: 800; letter-spacing: 1px; color: var(--meta); }
.st-rate b { font-size: 17px; font-weight: 400; }
.st-metric { margin-top: 12px; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.38); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.st-compare { display: grid; grid-template-columns: 96px minmax(0, 1fr) 52px; align-items: center; gap: 10px; margin-top: 10px; }
.st-compare-l { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--text2); }
.st-compare-bar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.st-compare-bar i { display: block; height: 100%; border-radius: 4px; }
.st-compare-bar i.up { background: var(--ink); }
.st-compare-bar i.down { background: var(--red); }
.st-compare-bar i.base { background: var(--disabled); }
.st-compare-v { text-align: right; font-size: 18px; }
.st-compare-v.base { color: var(--text2); }

/* Bulletin : moitié ivoire (atouts), moitié ébène (chantiers) */
.st-bulletin { border-radius: 18px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--hair); }
.st-bul-light { padding: 18px 20px 16px; background: linear-gradient(180deg, #f6f3ec, #e9e4d8); color: #16130d; border-bottom: 2px dashed rgba(212,175,55,.6); }
.st-bul-dark { padding: 16px 20px 18px; background: linear-gradient(180deg, #161616, #0c0c0c); }
.st-bul-over { font-size: 10.5px; font-weight: 800; letter-spacing: 1.8px; color: #6b5d33; }
.st-bul-h { font-size: 30px; margin-top: 5px; }
.st-bul-light .st-bul-s { color: #5c5446; }
.st-bul-s { font-size: 12.5px; color: var(--meta); margin-top: 2px; line-height: 1.45; }
.st-bul-rows { display: flex; flex-direction: column; margin-top: 8px; }
.st-bul-row { padding: 9px 0; border-top: 1px solid rgba(0,0,0,.1); }
.st-bul-dark .st-bul-row { border-top-color: var(--hair); }
.st-bul-v { font-size: 20px; white-space: nowrap; }
.st-bul-dark .st-bul-v { color: var(--ink); }

/* Résultats */
.st-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.st-tabs button { border: 0; padding: 6px 10px; border-radius: 8px; background: var(--surface); color: var(--meta); font-size: 12px; font-weight: 750; cursor: pointer; box-shadow: inset 0 0 0 1px var(--hair); }
.st-tabs button.none { color: var(--disabled); }
.st-tabs button[aria-selected="true"] { background: rgba(212,175,55,.12); color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold-ring); }
.st-big { font-size: 56px; line-height: .9; }
.st-delta { font-size: 12px; font-weight: 800; letter-spacing: .4px; padding-bottom: 6px; }
.st-kpis { display: flex; gap: 22px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair); }
.st-kv { font-size: 26px; }
.st-score { font-size: 30px; color: var(--ink); }
.st-wdl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.st-wdl .kpi { padding: 10px 12px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); }
.st-wdl-bar { display: flex; gap: 3px; height: 6px; margin-top: 10px; border-radius: 3px; overflow: hidden; }
.st-wdl-bar i.w { background: var(--green); } .st-wdl-bar i.d { background: var(--faint); } .st-wdl-bar i.l { background: var(--red); }
.st-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.st-color { padding: 12px 14px; border-radius: 12px; background: linear-gradient(180deg, #f6f3ec, #e4dfd2); color: #16130d; }
.st-color.dark { background: var(--raised); color: var(--ivory); box-shadow: inset 0 0 0 1px var(--ring); }
.st-color-o { font-size: 9.5px; font-weight: 800; letter-spacing: 1.3px; color: #6b5d33; }
.st-color.dark .st-color-o { color: var(--ink); }
.st-color-v { font-size: 32px; margin-top: 4px; }
.st-color-n { font-size: 12px; font-weight: 600; margin-top: 2px; }
.st-color .faint { color: #7d786e; }
.st-opp { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.st-opp-t { font-size: 18px; font-weight: 400; }
.st-opp-v { font-size: 20px; }
.st-opp-bar { position: relative; height: 8px; margin-top: 6px; border-radius: 4px; background: var(--track); }
.st-opp-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.st-opp-bar i.up { background: var(--ink); } .st-opp-bar i.down { background: var(--red); }
.st-opp-bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ivory); border-radius: 1px; }

/* Où ça bascule */
.st-hist-wrap { position: relative; margin-top: 18px; padding-top: 18px; }
.st-win-l { position: absolute; top: 0; text-align: center; font-size: 9px; font-weight: 800; letter-spacing: 1px; color: var(--red-text); white-space: nowrap; border-bottom: 1px solid rgba(229,72,77,.5); padding-bottom: 3px; }
.st-hist { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.st-hist i { flex: 1; min-width: 0; border-radius: 2px 2px 0 0; background: rgba(242,239,233,.28); }
.st-hist i.win { background: var(--red); }
.st-hist i.zero { background: rgba(242,239,233,.08); }
.st-phases { display: flex; gap: 4px; margin-top: 8px; }
.st-phase { min-width: 0; display: flex; flex-direction: column; gap: 1px; padding-top: 6px; border-top: 2px solid rgba(242,239,233,.18); font-size: 11px; color: var(--meta); }
.st-phase b { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--text2); }
.st-phase.on { border-top-color: var(--red); }
.st-phase.on b, .st-phase.on .st-phase-v { color: var(--red-text); }
.st-phase-v { font-size: 18px; color: var(--ivory); }
.list > .st-kind { padding: 9px 2px; gap: 12px; }
.st-kind-bar { width: 38%; height: 6px; }
.st-kind-v { width: 34px; text-align: right; font-size: 20px; }

/* Ouvertures */
.st-openings { padding: 6px 18px; }
.list > .st-op { display: block; padding: 0; }
.st-op-btn { display: block; width: 100%; padding: 12px 2px; border: 0; background: none; color: inherit; text-align: left; font: inherit; }
button.st-op-btn { cursor: pointer; }
button.st-op-btn:hover { background: rgba(255,255,255,.02); }
.st-op-name { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; font-size: 9px; font-weight: 800; letter-spacing: 1px; flex: none; }
.st .st-badge.up { background: var(--ink); color: #0b0b0b; }
.st .st-badge.down { background: var(--red); color: #fff; }
.st-op-v { font-size: 22px; }
.st-op-bar { position: relative; flex: 1; height: 6px; border-radius: 3px; background: #1f1f1f; }
.st-op-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--faint); }
.st-op-bar i.up { background: var(--ink); } .st-op-bar i.down { background: var(--red); }
.st-op-bar b { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: rgba(242,239,233,.4); }
.st-op-n { width: 78px; text-align: right; white-space: nowrap; }
.st-op-curve { padding: 0 2px 12px; }
svg.st-curve { display: block; width: 100%; max-width: 520px; height: auto; margin-bottom: 6px; }

/* Entraînement */
.st-strip { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 12px; }
.st-strip .kpi { padding: 16px; }
.st-strip .kpi .v { font-size: 36px; }
.st-strip-main { box-shadow: inset 0 0 0 1px var(--gold-ring); }
.st-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 9.5px; font-weight: 800; letter-spacing: 1px; color: var(--meta); }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend i { display: inline-block; }
.st-legend i.ring { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--faint); }
.st-legend i.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.st-legend i.tick { width: 2px; height: 12px; border-radius: 1px; background: var(--ivory); }
.list > .st-theme { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 2px 10px; }
.st-theme-d { font-size: 20px; }
.st-dumb { position: relative; height: 22px; margin: 2px 6px; background: linear-gradient(transparent 10px, var(--track) 10px 12px, transparent 12px); }
.st-dumb .tick { position: absolute; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; background: var(--ivory); border-radius: 1px; opacity: .8; }
.st-dumb .seg { position: absolute; top: 9px; height: 4px; border-radius: 2px; }
.st-dumb .seg.up { background: rgba(232,201,107,.5); } .st-dumb .seg.down { background: rgba(229,72,77,.5); }
.st-dumb i { position: absolute; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; }
.st-dumb i.ring { background: var(--card); box-shadow: inset 0 0 0 2px var(--faint); }
.st-dumb i.dot.up { background: var(--ink); } .st-dumb i.dot.down { background: var(--red); }
.st-reg-v { font-size: 34px; color: var(--ink); }
.st-reg-of { font-size: 19px; }
.st-cal { --cols: 15; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 4px; margin-top: 14px; }
.st-cal[data-n="7"] { --cols: 7; }
.st-cal[data-n="90"] { --cols: 18; }
.st-cal i { aspect-ratio: 1; border-radius: 4px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); }
.st-cal i.on { background: var(--gold); box-shadow: none; }
.st-cal[data-n="7"] i { border-radius: 8px; max-height: 44px; }

@media (max-width: 1000px) {
  .pf-top, .st-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pf-strip, .st-colors { grid-template-columns: 1fr 1fr; }
  .pf-rewards { grid-template-columns: 1fr; }
  .pf-settings, .st-two { grid-template-columns: 1fr; }
  .st-strip { grid-template-columns: 1fr 1fr; }
  .st-strip-main { grid-column: 1 / -1; grid-row: 1; }
  .st-poste, .st-axis { grid-template-columns: 84px minmax(0, 1fr) 62px; gap: 8px; }
  .st-poste-l { font-size: 16px; }
  .st-wdl .kpi .v { font-size: 32px; }
  .st-cal[data-n="90"] { --cols: 15; }
  .st-big { font-size: 46px; }
}
/* Le titre du bandeau récompenses tient dans sa demi-colonne. */
.pf-hero .h-title { font-size: clamp(32px, 3.4vw, 50px); overflow-wrap: anywhere; }
.pf-hero .h-right { font-size: 34px; }
