:root {
    color-scheme: dark;
    --bg: #081019;
    --surface: #101a27;
    --surface-2: #152233;
    --border: #26384d;
    --border-strong: #3d526b;
    --text: #edf4fb;
    --muted: #91a4ba;
    --accent: #69a9ff;
    --accent-soft: rgba(105, 169, 255, .12);
    --danger: #ef6b73;
    --shadow: 0 24px 70px rgba(0, 0, 0, .32);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


* {
    box-sizing: border-box;
}


html {
    background: var(--bg);
}


body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 0%, rgba(52, 112, 184, .18), transparent 34rem),
        radial-gradient(circle at 82% 86%, rgba(34, 77, 128, .11), transparent 30rem),
        var(--bg);
    color: var(--text);
}


button,
input {
    font: inherit;
}


.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 28px;
    border-bottom: 1px solid rgba(145, 164, 186, .14);
    background: rgba(8, 16, 25, .88);
    backdrop-filter: blur(18px);
}


.brand {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}


.brand-logo {
    display: block;
    width: 154px;
    max-height: 46px;
    object-fit: contain;
}


.header-actions,
.user-chip {
    display: flex;
    align-items: center;
}


.header-actions {
    gap: 10px;
}


.user-chip {
    gap: 8px;
    min-width: 0;
}


.user-avatar {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 50%;
    object-fit: cover;
}


.user-name {
    max-width: 190px;
    overflow: hidden;
    color: #dce7f2;
    font-size: .78rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.header-actions form {
    margin: 0;
}


.access-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(105, 169, 255, .2);
    border-radius: 999px;
    background: rgba(105, 169, 255, .055);
    color: #b8c9dc;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .02em;
}


.ghost-button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 760;
}


.ghost-button:hover {
    border-color: var(--border-strong);
    color: var(--text);
}


.page-shell {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}


.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

@media (max-width: 800px) {
    .site-header {
        padding: 0 16px;
    }


    .brand-logo {
        width: 132px;
        max-height: 40px;
    }


    .page-shell {
        width: min(100% - 24px, 640px);
    }


}

@media (max-width: 560px) {
    .user-name {
        display: none;
    }


    .page-shell {
        width: min(100% - 18px, 560px);
    }


}


/* Navigation authentifiée — V3.0.3 */
.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 22px;
}


.site-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #9fb1c5;
    font-size: .76rem;
    font-weight: 780;
    text-decoration: none;
    white-space: nowrap;
    transition: color .14s ease, border-color .14s ease, background .14s ease;
}


.site-nav-link:hover {
    border-color: rgba(105, 169, 255, .16);
    background: rgba(105, 169, 255, .06);
    color: #e4eef9;
}


.site-nav-link.is-active {
    border-color: rgba(105, 169, 255, .28);
    background: rgba(105, 169, 255, .10);
    color: #dbeafe;
}


.placeholder-page {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 68px);
    padding: 64px 0;
    text-align: center;
}

@media (max-width: 980px) {
    .site-header {
        gap: 10px;
    }


    .site-nav {
        margin: 0 6px;
        gap: 2px;
    }


    .site-nav-link {
        padding: 0 9px;
        font-size: .72rem;
    }


    .user-name {
        display: none;
    }


}

@media (max-width: 720px) {
    .site-header {
        min-height: 60px;
        padding: 0 10px;
    }


    .brand-logo {
        max-width: 116px;
    }


    .site-nav {
        flex: 1 1 auto;
        justify-content: center;
        min-width: 0;
        margin: 0;
    }


    .site-nav-link {
        min-height: 34px;
        padding: 0 7px;
        font-size: .66rem;
    }


    .user-chip {
        display: none;
    }


    .header-actions {
        gap: 4px;
    }


    .header-actions form .ghost-button {
        min-height: 34px;
        padding: 0 8px;
        font-size: .66rem;
    }


    .placeholder-page {
        min-height: calc(100vh - 60px);
    }


}

@media (max-width: 520px) {
    .brand {
        display: none;
    }


    .site-header {
        justify-content: space-between;
    }


    .site-nav {
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }


    .site-nav::-webkit-scrollbar {
        display: none;
    }


    .site-nav-link {
        padding: 0 6px;
    }


}


/* Cadre générique des pages internes. */
.section-page {
    padding: 42px 0 72px;
}


.section-heading,
.profile-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}


.section-heading {
    margin-bottom: 24px;
}


.section-page h2,
.placeholder-page h2 {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    line-height: 1.08;
    letter-spacing: -.035em;
}


.placeholder-page {
    min-height: calc(100vh - 68px);
}


.placeholder-page h2 {
    color: #dce8f5;
}


.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 15px;
    border: 1px solid rgba(105, 169, 255, .34);
    border-radius: 10px;
    background: rgba(105, 169, 255, .13);
    color: #e4f0ff;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
}


.primary-button:hover {
    border-color: rgba(105, 169, 255, .55);
    background: rgba(105, 169, 255, .19);
}


.profile-popup h3 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: -.015em;
}


.empty-state,
.muted-line {
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    font-size: .82rem;
}


.empty-state.is-error,
.form-feedback.is-error {
    color: #ff9fa5;
}


.profile-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 7, 12, .72);
    backdrop-filter: blur(7px);
}


.profile-popup-backdrop[hidden] {
    display: none;
}


.profile-popup {
    width: min(470px, 100%);
    max-height: min(680px, calc(100vh - 36px));
    overflow: auto;
    padding: 22px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: #101a27;
    box-shadow: var(--shadow);
}


.panel-kicker {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}


.icon-button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.3rem;
}


.profile-alias-list {
    display: grid;
    gap: 7px;
    margin: 18px 0;
}


.alias-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(8, 16, 25, .4);
}


.alias-chip span {
    color: var(--muted);
    font-size: .7rem;
}


.alias-chip strong {
    overflow: hidden;
    font-size: .8rem;
    text-overflow: ellipsis;
}


.profile-alias-form {
    align-items: end;
}


.profile-alias-form label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: .67rem;
    font-weight: 800;
}


.profile-alias-form input,
.profile-alias-form select {
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #0a121c;
    color: var(--text);
}


.form-feedback {
    min-height: 1.2em;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .72rem;
}


body.has-overlay {
    overflow: hidden;
}

@media (max-width: 640px) {
    .section-page {
        padding-top: 28px;
    }


    .section-heading {
        align-items: flex-end;
    }


}


/* Largeur commune des pages internes. */
.page-shell {
    width: min(1320px, calc(100% - 32px));
}


.section-page h2,
.placeholder-page h2 {
    font-size: 1.15rem;
    line-height: 1.15;
    letter-spacing: -.015em;
}

@media (max-width: 650px) {
    .page-shell {
        width: min(100% - 20px, 1320px);
    }


}


/* ================================================================
   Convention globale des cartes — V3.0.8
   Pique noir, cœur rouge, carreau bleu, trèfle vert.
   ================================================================ */
:root {
    --card-spade: #111827;
    --card-heart: #b4232f;
    --card-diamond: #2458b8;
    --card-club: #19733d;
    --card-ink: #f8fbff;
}


.poker-card,
.playing-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .34);
    color: var(--card-ink);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .42);
    box-shadow: 0 3px 9px rgba(0, 0, 0, .28);
}


.poker-card.suit-s,
.playing-card.suit-s { background: var(--card-spade); }

.poker-card.suit-h,
.playing-card.suit-h { background: var(--card-heart); }

.poker-card.suit-d,
.playing-card.suit-d { background: var(--card-diamond); }

.poker-card.suit-c,
.playing-card.suit-c { background: var(--card-club); }
