/* Pages membres publiques (views/account/player.php, players.php)
   Style propre à ces pages, sobre et sombre : cartes anthracite à filet fin,
   un seul accent (vert). Écrase le fond / la police de style.css. */

:root {
    --m-bg:     #111312;
    --m-card:   #191c1b;
    --m-ink:    #ecefed;
    --m-soft:   #9aa39f;
    --m-faint:  #66706b;
    --m-line:   #2a2f2d;
    --m-tint:   #222725;
    --m-accent: #4fb89a;
    --m-accent-hover: #6fcaaf;
    --m-accent-tint: #1d322b;
    --m-on-accent: #0d1a16;
    --m-warm:   #f0915c;
    --m-bar-mid: #2f7a64;
    --m-bar-low: #3a413e;
}

html, body {
    margin: 0;
    color-scheme: dark;
    background: var(--m-bg);
    color: var(--m-ink);
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}

body { min-height: 100vh; }

.m-page *, .m-page *::before, .m-page *::after { box-sizing: border-box; }

/* ── Barre du haut ── */
.m-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    background: var(--m-card);
    border-bottom: 1px solid var(--m-line);
}

.m-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--m-ink);
    text-decoration: none;
    letter-spacing: -.3px;
}

.m-brand span { color: var(--m-accent); margin-right: 6px; }

.m-top nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: auto;
}

.m-top nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--m-soft);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: color .15s, background .15s;
}

.m-top nav a:hover { color: var(--m-ink); background: var(--m-tint); }
.m-top nav a.m-cta { color: var(--m-on-accent); font-weight: 600; background: var(--m-accent); }
.m-top nav a.m-cta:hover { background: var(--m-accent-hover); }

/* ── Mise en page ── */
.m-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 36px 20px 80px;
}

.m-back {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--m-soft);
    text-decoration: none;
}

.m-back:hover { color: var(--m-accent); }

.m-title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    margin: 0 0 22px;
}

.m-title em { font-style: normal; color: var(--m-accent); }

.m-card {
    background: var(--m-card);
    border: 1px solid var(--m-line);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 18px;
}

.m-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
}

.m-tag {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--m-soft);
}

.m-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--m-accent);
    text-decoration: none;
    white-space: nowrap;
}

.m-link:hover { text-decoration: underline; }

.m-empty { margin: 0; color: var(--m-soft); font-size: 15px; }

/* ── Identité ── */
.m-hero { display: flex; align-items: center; gap: 18px; }

.m-avatar {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--m-accent);
    background: var(--m-accent-tint);
    border-radius: 50%;
}

.m-hero h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.5px;
    margin: 0 0 4px;
    overflow-wrap: anywhere;
}

.m-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--m-soft);
}

.m-me {
    font-size: 12px;
    font-weight: 600;
    color: var(--m-accent);
    background: var(--m-accent-tint);
    border-radius: 999px;
    padding: 2px 10px;
}

.m-hero a { color: var(--m-soft); }
.m-hero a:hover { color: var(--m-accent); }

/* ── Statistiques ── */
.m-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.m-stat {
    border-radius: 10px;
    padding: 14px 16px;
    background: var(--m-tint);
}

.m-stat.wide { grid-column: 1 / -1; background: var(--m-accent-tint); }

.m-stat-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--m-soft);
}

.m-stat-value {
    display: block;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.5px;
    line-height: 1.2;
}

.m-stat.wide .m-stat-value { font-size: 42px; color: var(--m-accent); }
.m-stat.streak .m-stat-value { color: var(--m-warm); }
.m-stat-value small { font-size: 16px; font-weight: 500; color: var(--m-faint); letter-spacing: 0; }
.m-stat-sub { display: block; font-size: 13px; color: var(--m-faint); }

/* ── Derniers défis ── */
.m-sub {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--m-soft);
    margin: 26px 0 12px;
}

.m-recent { display: flex; flex-direction: column; gap: 10px; }

.m-recent-row {
    display: grid;
    grid-template-columns: 92px 1fr 44px;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--m-soft);
}

.m-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--m-tint);
    overflow: hidden;
}

.m-bar span { display: block; height: 100%; border-radius: 999px; }
.m-bar .good { background: var(--m-accent); }
.m-bar .mid  { background: var(--m-bar-mid); }
.m-bar .low  { background: var(--m-bar-low); }
.m-recent-score { text-align: right; font-weight: 600; color: var(--m-ink); }

/* ── Liste des membres ── */
.m-search { display: flex; gap: 10px; margin-bottom: 22px; }

.m-search input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 15px;
    color: var(--m-ink);
    background: var(--m-card);
    border: 1px solid var(--m-line);
    border-radius: 10px;
    padding: 10px 14px;
    outline: none;
    transition: border-color .15s;
}

.m-search input:focus { border-color: var(--m-accent); }

.m-search button {
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--m-on-accent);
    background: var(--m-accent);
    border: none;
    border-radius: 10px;
    padding: 0 18px;
    cursor: pointer;
    transition: background .15s;
}

.m-search button:hover { background: var(--m-accent-hover); }

.m-list { display: flex; flex-direction: column; }

.m-member {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 8px;
    color: var(--m-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--m-line);
    border-radius: 8px;
    transition: background .15s;
}

.m-member:last-child { border-bottom: none; }
.m-member:hover { background: var(--m-tint); }
.m-member.is-me { background: var(--m-accent-tint); }

.m-rank {
    width: 24px;
    flex-shrink: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--m-faint);
}

.m-rank.r1, .m-rank.r2, .m-rank.r3 { color: var(--m-accent); font-weight: 700; }
.m-rank:empty { width: 0; margin-right: -14px; }

.m-member-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: var(--m-accent);
    background: var(--m-accent-tint);
    border-radius: 50%;
}

.m-member-name {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.m-member-meta {
    text-align: right;
    font-size: 12px;
    color: var(--m-faint);
    white-space: nowrap;
}

.m-member-meta strong { display: block; font-size: 17px; font-weight: 700; color: var(--m-ink); }

@media (max-width: 520px) {
    .m-top { padding: 12px 16px; flex-wrap: wrap; }
    .m-top nav { margin-left: 0; }
    .m-page { padding: 24px 16px 60px; }
    .m-title { font-size: 30px; }
    .m-card { padding: 20px 16px; }
    .m-avatar { width: 54px; height: 54px; font-size: 24px; }
    .m-hero h1 { font-size: 24px; }
    .m-stat-value { font-size: 26px; }
    .m-stat.wide .m-stat-value { font-size: 36px; }
    .m-recent-row { grid-template-columns: 80px 1fr 40px; gap: 8px; font-size: 13px; }
}
