.profile-page { overflow: auto; height: auto; min-height: 100vh; }
.pf { max-width: 1000px; width: 100%; min-width: 0; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
/* téléphone : la page reste à la largeur de l'écran ; un tableau trop large défile dans son cadre */
.pf > *, .pf .card { min-width: 0; }
.pf .card:has(table) { overflow-x: auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 10px; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--accent); min-height: 1em; margin: 0; }

.auth { max-width: 360px; margin: 40px auto; }
.auth form { display: flex; flex-direction: column; gap: 10px; }
.auth label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.auth input { font: inherit; color: var(--text); background: var(--mat-2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tabs button { flex: 1; }
.tabs button.on { box-shadow: inset 0 -2px 0 var(--accent); }

.head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 20px; }
.head p { margin: 2px 0 0; }
.kpis { display: flex; gap: 22px; margin-left: auto; }
.kpis div { display: flex; flex-direction: column; align-items: center; }
.kpis b { font-size: 20px; }
.kpis span { font-size: 11px; color: var(--muted); }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.plan { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.plan.current { border-color: var(--accent); }
.plan h3 { margin: 0; font-size: 14px; display: flex; justify-content: space-between; }
.plan ul { margin: 0; padding-left: 16px; font-size: 12px; color: var(--muted); }

.chart { width: 100%; min-height: 60px; }
.chart svg { width: 100%; height: 220px; display: block; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 10px; }
.chart .cum { stroke: var(--select); fill: none; stroke-width: 2; }
.chart .roll { stroke: var(--gold); fill: none; stroke-width: 1.5; stroke-dasharray: 4 3; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 4px; }
.locked { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; }
.by-opp { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.by-opp span { font-size: 12px; background: var(--mat-2); border-radius: 6px; padding: 4px 8px; }

.games { width: 100%; border-collapse: collapse; font-size: 13px; }
.games th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.games td { padding: 6px; border-bottom: 1px solid var(--line); }
.win { color: var(--good); font-weight: 700; }
.loss { color: var(--accent); font-weight: 700; }

.moves { width: 100%; border-collapse: collapse; font-size: 12px; }
.moves td, .moves th { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.moves tr.mistake { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.bar-wrap { height: 6px; background: var(--mat-2); border-radius: 3px; margin: 8px 0; overflow: hidden; }
.bar-wrap div { height: 100%; background: var(--select); transition: width .4s; }

@media (max-width: 640px) {
  .games th:nth-child(4), .games td:nth-child(4), .games th:nth-child(5), .games td:nth-child(5) { display: none; }
  .kpis { margin-left: 0; }
}

.games a.btn { display: inline-block; padding: 4px 10px; border-radius: 6px; background: var(--mat-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 12px; white-space: nowrap; }
.games a.btn:hover { border-color: var(--select); }
.head a.btn { margin-left: auto; padding: 6px 12px; border-radius: 6px; background: var(--mat-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 13px; }
.head a.btn:hover { border-color: var(--select); }

/* administration des inscriptions */
.badge-status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.badge-status.pending { background: #a8892f; color: #fff; }
.badge-status.approved { background: #2f8f5b; color: #fff; }
.badge-status.rejected { background: #b8423a; color: #fff; }
tr.pending td { background: color-mix(in srgb, #a8892f 12%, transparent); }

.optcgsim-accounts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.opt-acc { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.optcgsim-linked { list-style: none; padding: 0; margin: 4px 0 12px; display: flex; flex-direction: column; gap: 4px; }
.optcgsim-linked li { display: flex; align-items: center; gap: 10px; }
.opt-acc { cursor: default; }

.logs-actions { gap: 8px; flex-wrap: wrap; }
.logs-help { margin-top: 8px; }
.logs-help summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.logs-help ol { margin: 6px 0; padding-left: 20px; }

/* onglet Team : matchups à travailler (team contre méta) */
.gaps-filters { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.gaps-filters label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.gaps-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 6px; }
.gaps-kpis div { background: rgba(255, 255, 255, .04); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; }
.gaps-kpis b { font-size: 22px; }
.gaps-kpis span { font-size: 12px; color: var(--muted); }
.gaps-kpis .bad b { color: var(--danger, #E0636B); }
.gaps-kpis .good b { color: var(--good); }
.gaps-title { font-size: 14px; margin: 14px 0 4px; color: var(--muted); font-weight: 600; }
.gap-row { display: grid; grid-template-columns: minmax(0, 2fr) 52px 90px 90px minmax(0, 1.2fr); gap: 8px; align-items: center;
  padding: 8px 4px; border-top: 1px solid rgba(255, 255, 255, .06); color: inherit; text-decoration: none; font-size: 13px; }
.gap-row:hover { background: rgba(217, 172, 89, .06); }
.gap-mu { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.gap-mu small { flex-basis: 100%; }
.gap-n { color: var(--muted); }
.gap-bar { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.gap-bar i { display: block; height: 8px; border-radius: 2px; background: var(--muted); }
.gap-bar.bad, .gap-bar.bad b { color: var(--danger, #E0636B); } .gap-bar.bad i { background: var(--danger, #E0636B); }
.gap-bar.good, .gap-bar.good b { color: var(--good); } .gap-bar.good i { background: var(--good); }
@media (max-width: 640px) {
  .gap-row { grid-template-columns: minmax(0, 1fr) auto; }
  .gap-row .gap-n, .gap-row > span:nth-child(4) { display: none; }
  .gap-bar { grid-column: 1 / -1; }
}

/* Stats : préparation de tournoi */
.tp-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 10px 0; }
.tp-controls label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); min-width: 0; }
.tp-controls input { min-width: 220px; max-width: 100%; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .05); border-radius: 999px; padding: 3px 6px 3px 4px; }
.tp-mu-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-mu-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.tp-table { margin: 10px 0; }
.tp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.tp-cols h3 { font-size: 14px; margin: 8px 0 6px; }
.tp-games td { padding: 5px 6px; }
.tp-badge { font-size: 12px; color: var(--accent); }
.tp-summary a { color: inherit; text-decoration: none; }
@media (max-width: 760px) {
  .tp-cols { grid-template-columns: minmax(0, 1fr); }
  .tp-summary .tp-rep { display: none; }
  .tp-controls input { min-width: 0; width: 100%; }
  .tp-controls label { flex: 1 1 100%; }
}
.tp-filters { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-start; }
.tp-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tp-f-title { font-size: 12px; color: var(--muted); }
.tp-dates { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-dates label { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.tp-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.tp-checks label { display: inline-flex; align-items: center; gap: 4px; }
#tp-presets button.on, #tp-order button.on { border-color: var(--accent); color: var(--accent); }
.tp-fold { border-top: 1px solid rgba(255, 255, 255, .06); }
.tp-fold > summary { cursor: pointer; list-style: none; padding: 6px 0; }
.tp-fold > summary::-webkit-details-marker { display: none; }
.tp-fold > summary h3 { display: inline; margin: 0; }
.tp-fold > summary::before { content: "▸ "; color: var(--muted); }
.tp-fold[open] > summary::before { content: "▾ "; }
.tp-scroll { max-height: 320px; overflow-y: auto; padding-right: 4px; }
.tp-filters { overflow: visible; position: relative; z-index: 5; }

/* Decks de la team (onglet Decks) */
.dt-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; overflow: visible; position: relative; z-index: 5; }
.dt-head h2 { margin: 0 0 4px; }
.dt-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.dt-filters label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.dt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; align-items: start; }
.dt-leader { margin: 0; }
.dt-leader-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.dt-leader-img img { width: 52px; height: 52px; object-fit: cover; object-position: 50% 22%; border-radius: 50%; display: block; }
.dt-leader-title { flex: 1; min-width: 0; }
.dt-leader-title h2 { margin: 0; font-size: 17px; }
.dt-leader-title h2 a { color: inherit; text-decoration: none; }
.dt-leader-title h2 a:hover { color: var(--accent); }
.dt-kpis { display: flex; gap: 14px; }
.dt-kpis div { display: flex; flex-direction: column; align-items: center; font-size: 12px; min-width: 56px; }
.dt-kpis span { color: var(--muted); }
.dt-kpis b { font-size: 18px; }
.dt-decks td { padding: 5px 6px; }
.dt-decks a { color: inherit; }
.dt-core { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 8px; }
.dt-core-card { position: relative; width: 64px; }
.dt-core-card img { width: 64px; border-radius: 4px; display: block; }
.dt-core-n, .dt-core-l { position: absolute; font-size: 11px; font-weight: 700; background: rgba(12, 17, 27, .85); padding: 0 4px; border-radius: 3px; }
.dt-core-n { right: 2px; bottom: 2px; color: var(--accent); }
.dt-core-l { left: 2px; top: 2px; color: var(--muted); }
@media (max-width: 560px) {
  .dt-leader-head { flex-wrap: wrap; }
  .dt-decks td:nth-child(4) { display: none; }
}

/* Stats › Cartes */
.ct-filters { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: flex-end; overflow: visible; position: relative; z-index: 5; }
.ct-filters > label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.ct-wrap { overflow-x: auto; }
.ct-table th[data-k] { cursor: pointer; white-space: nowrap; }
.ct-table th[data-k]::after { content: attr(data-arrow); }
.ct-table td { white-space: nowrap; }
.ct-row { cursor: pointer; }
.ct-row:hover { background: rgba(217, 172, 89, .06); }
.ct-table tr.weak > td { opacity: .45; }
.ct-table .neg { color: var(--danger, #E0636B); }
.ct-table .pos { color: var(--good); }
.ct-detail > td { background: rgba(255, 255, 255, .03); padding: 6px 12px 10px; }
#ct-presets button.on, #ct-scope button.on { border-color: var(--accent); color: var(--accent); }
.ct-groups th { font-size: 11px; color: var(--muted); text-align: left; border-bottom: none; }
.ct-g-meta, .ct-table .ct-m { background: rgba(217, 172, 89, .05); }
.ct-qty { margin: 2px 0 8px; } .ct-qty > span { margin-right: 6px; }
