/* ══════════════════════════════════════════════════════════════════════════
   Thème « forestier » — reprend l'univers graphique des applications
   (Crazy Rummy / Triomy) : clairière ensoleillée en fond, panneaux parchemin,
   menu latéral vert sous-bois, panneaux parchemin, pancartes en bois, boutons verts cerclés d'or.
   ══════════════════════════════════════════════════════════════════════════ */
:root {
    color-scheme: light;

    /* Parchemin (panneaux de contenu) */
    --parchment: #f8eecd;
    --parchment-deep: #efdcae;
    --parchment-light: #fcf6e1;
    --parchment-border: #d6bb80;

    /* Texte sur parchemin */
    --ink: #2e2613;
    --muted: #6b5f3f;
    --forest: #1f5a1c;
    --link: #1f6b1c;

    /* Bois (menu, pied de page, pancartes) */
    --bark: #2e1809;
    --wood-dark: #44260f;
    --wood: #6b3d1c;
    --wood-light: #a86a32;
    --cream: #fff6dc;
    --cream-muted: #ead9b0;

    /* Feuillage & or */
    --leaf: #6aa722;
    --leaf-dark: #2f6b12;
    --leaf-shadow: #1e4a0c;
    --gold: #e9b436;
    --gold-deep: #c98a1b;

    --danger: #b3261e;
    --radius: 18px;
    --sidebar-w: clamp(220px, 18vw, 268px);
    --shadow: 0 10px 28px rgba(31, 46, 12, 0.28);

    --wood-grain-h:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 6px, rgba(255, 220, 160, 0.035) 6px 7px, transparent 7px 15px),
        linear-gradient(180deg, #7a4620, #4a2a11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, Roboto, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #8ec63f;
}

/* Fond : la clairière (format paysage), fixe, à droite du menu latéral pour que
   les arbres encadrent le contenu. Recadrée si besoin, jamais déformée. */
body::before {
    position: fixed;
    inset: 0 0 0 var(--sidebar-w);
    z-index: -1;
    content: "";
    background: #8ec63f url("/assets/images/bg-forest.webp") center / cover no-repeat;
}
@media (max-width: 860px) {
    body::before { left: 0; }
}
/* Écran en portrait (mobile) : version verticale de la même clairière. */
@media (max-aspect-ratio: 4/5) {
    body::before { background-image: url("/assets/images/bg-forest-portrait.webp"); }
}

a { color: var(--link); }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: 0; }

/* ── Ossature : menu latéral gauche + colonne principale ──────────────────── */
.app-shell {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
}
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Menu latéral : vert sous-bois liseré d'or (tuiles du menu de l'app) ───── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    flex: 0 0 auto;
    width: var(--sidebar-w);
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 22px clamp(14px, 1.3vw, 20px);
    color: var(--cream);
    background:
        radial-gradient(160% 55% at 50% 0%, rgba(140, 190, 40, 0.32), transparent 70%),
        linear-gradient(180deg, #2f5a14, #17330b);
    border-right: 3px solid var(--gold-deep);
    box-shadow: inset -1px 0 0 rgba(255, 226, 140, 0.3), 6px 0 22px rgba(20, 40, 8, 0.4);
}
.brand {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: var(--cream);
    text-decoration: none;
    font-weight: 900;
    font-size: 1.25rem;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}
.brand img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45)); }
nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--cream-muted);
    text-decoration: none;
    font-weight: 750;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
nav a:hover,
nav a[aria-current="page"] {
    color: #fff;
    background: rgba(255, 246, 220, 0.14);
    border-color: rgba(255, 226, 140, 0.35);
}
nav a[aria-current="page"] { font-weight: 900; }

.header-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: auto;
    padding: 14px;
    border-radius: var(--radius);
    background: rgba(8, 22, 4, 0.4);
    border: 1px solid rgba(233, 180, 54, 0.45);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}
.header-actions .button { width: 100%; }
.header-link {
    color: var(--cream);
    text-decoration: none;
    font-weight: 800;
    text-align: center;
    padding: 10px 14px;
    border-radius: 14px;
    border: 2px solid rgba(255, 246, 220, 0.4);
    transition: border-color .12s ease, background .12s ease;
}
.header-link:hover { border-color: var(--gold); background: rgba(233, 180, 54, 0.14); }
.header-actions .locale-form { margin-top: 2px; }
.header-actions select { width: 100%; max-width: none; }

/* ── Bascule en barre horizontale sur petit écran ─────────────────────────── */
@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .app-main { min-height: 0; width: 100%; }
    .site-header {
        position: static;
        width: 100%;
        height: auto;
        overflow: visible;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 18px;
        padding: 10px clamp(12px, 4vw, 40px);
        border-right: none;
        border-bottom: 3px solid var(--gold-deep);
        box-shadow: inset 0 -1px 0 rgba(255, 226, 140, 0.3), 0 6px 20px rgba(20, 40, 8, 0.4);
    }
    .site-header nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; order: 3; gap: 4px 6px; }
    nav a { padding: 6px 10px; gap: 8px; }
    .header-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        margin-top: 0;
        margin-left: auto;
        padding: 0;
        border: none;
        border-radius: 0;
        background: none;
        box-shadow: none;
    }
    .header-actions .button { width: auto; padding: 8px 14px; font-size: .95rem; }
    .header-actions .header-link { padding: 7px 14px; }
    .header-actions select { width: auto; max-width: 130px; }
}

select {
    max-width: 130px;
    padding: 9px 30px 9px 12px;
    color: var(--forest);
    font-weight: 800;
    font-family: inherit;
    background-color: var(--parchment);
    border: 2px solid var(--parchment-border);
    border-radius: 10px;
    cursor: pointer;
}
.locale-form { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Boutons ────────────────────────────────────────────────────────────── */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 16px;
    font-family: inherit;
    font-weight: 850;
    font-size: 1rem;
    text-decoration: none;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.button:hover { transform: translateY(-2px); filter: brightness(1.07); }
.button:active { transform: translateY(1px); }
/* Bouton vert cerclé d'or (le « Démarrer » de l'app). */
.button.primary {
    background: linear-gradient(180deg, var(--leaf), #3d7d15 60%, var(--leaf-dark));
    color: var(--cream);
    border-color: var(--gold);
    text-shadow: 0 2px 0 rgba(20, 50, 8, 0.55);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22), 0 4px 0 var(--leaf-shadow), 0 10px 18px rgba(31, 46, 12, 0.3);
}
/* Bouton secondaire : petite planche de bois. */
.button.ghost {
    background: var(--wood-grain-h);
    color: var(--cream);
    border-color: var(--wood-light);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
    box-shadow: inset 0 2px 0 rgba(255, 230, 180, 0.18), 0 4px 0 var(--bark), 0 10px 18px rgba(31, 46, 12, 0.25);
}
.button.block { width: 100%; }
a:focus-visible, button:focus-visible, select:focus-visible, .button:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* ── Panneaux parchemin ─────────────────────────────────────────────────── */
.auth-card, .panel, .intro, .policy-hero {
    position: relative;
    background: linear-gradient(180deg, var(--parchment), var(--parchment-deep));
    border: 3px solid var(--parchment-border);
    border-radius: var(--radius);
    padding: clamp(22px, 4vw, 38px);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), var(--shadow);
}
.auth-card h1, .panel h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 20px; color: var(--forest); }
.panel h2 { font-size: 1.3rem; margin-bottom: 16px; color: var(--forest); }
.muted { color: var(--muted); }

/* Séparateur doré à feuilles (celui de l'écran de bienvenue de l'app). */
.auth-card h1::after, .policy-hero h1::after {
    content: "";
    display: block;
    height: 22px;
    margin-top: 14px;
    background: url("/assets/images/sep-leaves.webp") center / contain no-repeat;
}

/* ── Accueil : bannière & intro ─────────────────────────────────────────── */
main { flex: 1; }
/* Bannière RummyWorld (PNG détouré) : posée au-dessus du panneau d'intro, qu'elle chevauche légèrement. */
.site-banner {
    position: relative;
    z-index: 1;
    max-width: 680px;
    width: calc(100% - 2 * clamp(16px, 5vw, 40px));
    margin: clamp(14px, 2.5vw, 26px) auto -18px;
}
.site-banner img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 12px rgba(31, 46, 12, 0.4));
}
.intro {
    max-width: 980px;
    margin: 0 auto;
    width: calc(100% - 2 * clamp(16px, 5vw, 40px));
}
.eyebrow {
    margin: 0 0 14px;
    color: var(--forest);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 1rem;
}
.intro p:not(.eyebrow) {
    font-size: clamp(1.02rem, 1.6vw, 1.15rem);
    line-height: 1.65;
    margin: 0 0 14px;
}
.intro .eyebrow { text-align: center; font-size: clamp(1.05rem, 1.8vw, 1.3rem); margin-bottom: 20px; }
.intro .eyebrow::after {
    content: "";
    display: block;
    height: 22px;
    margin-top: 12px;
    background: url("/assets/images/sep-leaves.webp") center / contain no-repeat;
}
.intro strong { color: var(--forest); font-weight: 800; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.intro .hero-actions { justify-content: center; gap: 18px; margin-top: 24px; }
.intro .hero-actions .button {
    padding: 15px 32px;
    font-size: clamp(1.08rem, 1.5vw, 1.22rem);
    border-radius: 18px;
}

/* ── Sections : titre sur pancarte de bois ──────────────────────────────── */
.games, .news { padding: clamp(28px, 5vw, 56px) 0 0; }
.news { padding-bottom: clamp(28px, 5vw, 56px); }
.section-title {
    width: fit-content;
    max-width: calc(100% - 2 * clamp(16px, 5vw, 40px));
    margin: 0 auto;
    padding: 12px clamp(24px, 5vw, 46px);
    font-size: clamp(1.35rem, 2.6vw, 1.9rem);
    color: var(--cream);
    text-align: center;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
    background: var(--wood-grain-h);
    border: 3px solid var(--bark);
    border-radius: 16px;
    box-shadow: inset 0 0 0 2px rgba(233, 180, 54, 0.4), 0 6px 0 rgba(46, 24, 9, 0.55), var(--shadow);
}
/* Message « vide » posé directement sur le fond : petite étiquette parchemin. */
.news > .muted, .games > .muted {
    width: fit-content;
    max-width: calc(100% - 2 * clamp(16px, 5vw, 40px));
    margin: 22px auto 0;
    padding: 12px 22px;
    background: var(--parchment);
    border: 2px solid var(--parchment-border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

/* ── Jeux : bannière du jeu posée sur un panneau parchemin ───────────────── */
.game-showcase {
    max-width: 1100px;
    margin: 28px auto 0;
    padding: 0 clamp(16px, 5vw, 60px);
    display: flex;
    flex-direction: column;
    gap: clamp(28px, 5vw, 52px);
}
.game-block { display: flex; flex-direction: column; }
/* La bannière chevauche le haut du panneau, comme le logo sur la carte joueur de l'app. */
.game-banner {
    position: relative;
    z-index: 1;
    width: auto;
    max-width: min(100%, 460px);
    height: auto;
    max-height: clamp(150px, 22vw, 230px);
    margin: 0 clamp(8px, 2vw, 24px) -26px;
    align-self: flex-start;
    filter: drop-shadow(0 10px 12px rgba(31, 46, 12, 0.4));
}
/* Alternance : 1er jeu à gauche, 2e à droite, etc. */
.game-block:nth-child(even) .game-banner { align-self: flex-end; }
/* Bannière Crazy Rummy : posée juste au-dessus du panneau (seule l'ombre portée le touche), calée à gauche. */
.game-banner-crazyrummy { margin: 0 0 -10px -6px; }
.game-banner-triomy { margin: 0 -6px -18px 0; } /* l'image a une marge transparente sous la pancarte */
.game-banner-lexikub { margin: 0 0 -22px -6px; } /* le tronc de la bannière chevauche le haut du panneau */
.game-feature {
    width: 100%;
    display: grid;
    gap: clamp(18px, 2.5vw, 28px);
    background: linear-gradient(180deg, var(--parchment), var(--parchment-deep));
    border: 3px solid var(--parchment-border);
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), var(--shadow);
    padding: clamp(18px, 3vw, 36px);
    padding-top: calc(clamp(18px, 3vw, 36px) + 18px);
}
/* Aperçu du jeu en pleine largeur du panneau ; le texte vient en dessous. */
.game-feature-media {
    border-radius: 12px;
    overflow: hidden;
    background: #17330b;
    border: 3px solid var(--parchment-border);
    box-shadow: 0 8px 20px rgba(31, 46, 12, 0.3);
}
.game-feature-media picture { display: block; }
.game-feature-media img {
    display: block;
    width: 100%;
    height: auto;
}
.game-feature-body { min-width: 0; }
.game-feature-body h3 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin: 0 0 12px;
    color: var(--forest);
}
.game-feature-body p {
    font-size: clamp(1.02rem, 1.6vw, 1.2rem);
    line-height: 1.6;
    margin: 0 0 14px;
}
.game-feature-body p:last-of-type { margin-bottom: 22px; }
/* Bouton « Jouer » : grand, centré sous la description. */
.game-feature-body > .button {
    display: flex;
    width: fit-content;
    min-width: min(100%, 240px);
    margin: 4px auto 0;
    padding: 16px 48px;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    letter-spacing: .02em;
    border-radius: 18px;
    text-shadow: 0 1px 0 rgba(20, 50, 8, 0.6);}
.game-feature-body strong { color: var(--forest); font-weight: 800; }
.badge-soon {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 12px;
    background: var(--parchment-light);
    border: 2px solid var(--parchment-border);
    color: var(--muted);
    font-weight: 800;
    font-size: .9rem;
}

/* ── Actualités ─────────────────────────────────────────────────────────── */
.news-list {
    max-width: 900px;
    margin: 24px auto 0;
    padding: 0 clamp(16px, 5vw, 40px);
    display: grid;
    gap: 12px;
}
.news-item {
    padding: 14px 20px;
    background: linear-gradient(180deg, var(--parchment), var(--parchment-deep));
    border: 2px solid var(--parchment-border);
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(31, 46, 12, 0.22);
    display: flex;
    align-items: baseline;
    gap: 16px;
}
.news-item time { color: #a4560d; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.news-item h3 { font-size: 1.05rem; font-weight: 700; }

/* ── Pages à panneaux (auth, compte, abonnement, classement) ────────────── */
.auth-page, .account-page, .sub-page, .ranking-page {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(28px, 6vw, 64px) clamp(16px, 5vw, 40px);
    display: grid;
    gap: 24px;
    align-content: start;
}
.auth-page { max-width: 640px; }
.auth-page .auth-card { padding: clamp(26px, 5vw, 48px); }
.auth-card h1 { text-align: center; }
.auth-page .form { gap: 20px; }
.auth-page .form input[type="text"],
.auth-page .form input[type="email"],
.auth-page .form input[type="password"] { padding: 14px 16px; font-size: 1.05rem; }
.auth-page .form label { font-size: 1.02rem; }
.auth-page .button.block { padding: 15px 22px; font-size: 1.05rem; margin-top: 6px; }

.play-panel .play-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 16px;
}
.play-panel .play-actions .button { flex: 0 1 auto; }

/* Page de présentation d'un jeu */
.game-page {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 40px) clamp(16px, 5vw, 60px) 0;
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 3vw, 26px);
}
.game-page-banner {
    align-self: center;
    width: auto;
    max-width: min(100%, 460px);
    height: auto;
    max-height: clamp(150px, 22vw, 230px);
    margin-bottom: -14px;
    filter: drop-shadow(0 10px 12px rgba(31, 46, 12, 0.4));
}
.game-page .section-title { font-size: clamp(1.15rem, 2.4vw, 1.6rem); text-align: center; }
.game-page .game-feature { padding-top: clamp(18px, 3vw, 36px); }
.game-info h2 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); margin-bottom: 14px; }
.game-info ol, .game-info ul { margin: 0; padding-left: 24px; display: grid; gap: 10px; line-height: 1.6; font-size: clamp(1rem, 1.5vw, 1.1rem); }
.game-info h3 { font-size: 1.1rem; margin: 22px 0 10px; color: var(--forest); }
.game-info h2 + h3 { margin-top: 0; }
/* Illustrations des règles (jetons repris du tutoriel des applications) */
.rule-figures { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 0; }
.rule-figure { margin: 0; padding: 14px 16px; display: grid; gap: 10px; align-content: start; max-width: 100%; background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(109, 76, 47, 0.3); border-radius: 12px; }
.rule-figure.is-ok { border-color: #57975e; }
.rule-figure.is-bad { border-color: #c62828; }
.rule-figure-art { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.rule-figure-art img { max-width: 100%; height: auto; }
.rule-figure figcaption { display: grid; gap: 4px; max-width: 34ch; font-size: 0.95rem; line-height: 1.45; }
.rule-figure.is-ok figcaption strong { color: #2e7d32; }
.rule-figure.is-bad figcaption strong { color: #c62828; }
.tile-grid, .tile-row { display: flex; gap: 5px; }
.tile-grid { flex-direction: column; }
.tile-row { align-items: center; }
.tile { --tile: 38px; flex: none; width: var(--tile); height: var(--tile); display: grid; place-items: center; border-radius: 6px; color: #fff; font-weight: 700; font-size: calc(var(--tile) * 0.5); line-height: 1; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25); }
.rule-figure.is-small .tile { --tile: 26px; border-radius: 5px; }
.tile-blue { background: #1565c0; }
.tile-red { background: #c62828; }
.tile-orange { background: #e65100; }
.tile-black { background: #212121; }
.tile-joker { background: #6a1b9a; }
.tile-empty { background: none; box-shadow: none; }
.tile-invalid { outline: 3px solid #d50000; outline-offset: 1px; }
.tile-note { font-weight: 700; color: var(--forest); }
.game-other { margin: 18px 0 0; font-weight: 700; }
.game-more { display: block; width: fit-content; margin: 14px auto 0; font-weight: 700; }

/* Page charte / CGU */
.policy-page { width: 100%; max-width: 900px; margin: 0 auto; padding: clamp(28px, 6vw, 64px) clamp(16px, 5vw, 40px); }
.policy-hero { margin-bottom: 18px; text-align: center; }
.policy-hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); margin: 6px 0 14px; color: var(--forest); }
.policy { display: grid; gap: 18px; }
.policy .panel h2 { font-size: 1.2rem; margin-bottom: 12px; }
.policy .panel p { line-height: 1.6; margin: 0 0 10px; }
.policy .panel p:last-child { margin-bottom: 0; }
.policy .panel ul { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 8px; line-height: 1.55; }
.policy .panel ul:last-child { margin-bottom: 0; }
.policy-updated { margin-top: 10px; font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.contact-card { text-align: center; }
.contact-email { font-size: clamp(1.1rem, 3.2vw, 1.5rem); font-weight: 800; overflow-wrap: anywhere; }

/* ── Formulaires ────────────────────────────────────────────────────────── */
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 700; color: var(--forest); }
.form label.checkbox { grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; font-weight: 600; color: var(--muted); }
.form input[type="text"],
.form input[type="email"],
.form input[type="password"] {
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid var(--parchment-border);
    background: var(--parchment-light);
    color: var(--ink);
    font-family: inherit;
    font-size: 1rem;
    box-shadow: inset 0 2px 4px rgba(107, 61, 28, 0.12);
}
.form input:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(106, 167, 34, 0.28); }
.form input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--leaf-dark); }

.field-hint { min-height: 1.1em; font-size: .9rem; font-weight: 700; color: var(--muted); }
.field-hint.hint-ok { color: var(--leaf-dark); }
.field-hint.hint-err { color: var(--danger); }
.field-hint.hint-checking { color: var(--muted); font-weight: 600; }

.pw-rules { list-style: none; margin: -6px 0 0; padding: 0; display: grid; gap: 3px; font-size: .85rem; }
.pw-rules li { color: var(--muted); padding-left: 20px; position: relative; }
.pw-rules li::before { content: "○"; position: absolute; left: 0; opacity: .6; }
.pw-rules li.rule-ok { color: var(--leaf-dark); }
.pw-rules li.rule-ok::before { content: "✓"; opacity: 1; }
.pw-rules li.rule-ko { color: var(--danger); }
.pw-rules li.rule-ko::before { content: "✗"; opacity: 1; }

.auth-links { margin-top: 20px; display: grid; gap: 8px; color: var(--muted); font-size: .95rem; text-align: center; }
.auth-links a { color: var(--link); font-weight: 700; }
.linklike { background: none; border: none; padding: 0; color: var(--link); font-weight: 700; cursor: pointer; font-size: inherit; font-family: inherit; text-decoration: underline; }

/* ── Compte ─────────────────────────────────────────────────────────────── */
.account-info { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
.account-info dt { color: var(--muted); font-weight: 700; }
.account-info dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 480px) {
    .account-info { grid-template-columns: 1fr; gap: 2px; }
    .account-info dd { margin-bottom: 10px; }
}

.badge-ok { color: var(--leaf-dark); font-weight: 800; }
.badge-off { color: var(--muted); font-weight: 700; }

/* ── Classement ─────────────────────────────────────────────────────────── */
.ranking-page { max-width: 980px; }
.ranking h1 { text-align: center; }
/* Onglets (jeux + archives) : petites tuiles, l'onglet actif en vert cerclé d'or. */
.rank-tabs, .rank-types { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.rank-tabs a, .rank-types a {
    padding: 10px 20px;
    border-radius: 14px;
    border: 2px solid var(--parchment-border);
    background: var(--parchment-light);
    color: var(--forest);
    font-weight: 800;
    text-decoration: none;
    transition: border-color .12s ease, background .12s ease;
}
.rank-tabs a:hover, .rank-types a:hover { border-color: var(--leaf); }
.rank-tabs a[aria-current="page"] {
    background: linear-gradient(180deg, var(--leaf), var(--leaf-dark));
    border-color: var(--gold);
    color: var(--cream);
}
.rank-types { justify-content: flex-start; gap: 8px; margin-bottom: 16px; }
.rank-types a { padding: 6px 14px; border-radius: 999px; font-size: .95rem; }
.rank-types a[aria-current="page"] { background: var(--forest); border-color: var(--forest); color: var(--cream); }
.rank-intro { margin: 20px 0 18px; line-height: 1.55; }
.rank-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; margin-bottom: 18px; }
.rank-filters label { display: grid; gap: 4px; font-weight: 800; font-size: .9rem; color: var(--muted); }
.rank-filters select { max-width: none; }
.rank-filters input[type="text"] {
    width: min(100%, 260px);
    padding: 9px 12px;
    font: inherit;
    color: var(--ink);
    background: var(--parchment-light);
    border: 2px solid var(--parchment-border);
    border-radius: 10px;
}
.rank-filters input[type="text"]:focus { outline: none; border-color: var(--leaf); }
.rank-filters .button { padding: 9px 20px; }
.rank-count { margin: 0 0 8px; font-size: .92rem; }
.rank-message {
    margin: 8px 0 0;
    padding: 22px;
    text-align: center;
    font-weight: 700;
    color: var(--muted);
    background: var(--parchment-light);
    border: 2px dashed var(--parchment-border);
    border-radius: 14px;
}
.rank-table-wrap { overflow-x: auto; border: 2px solid var(--parchment-border); border-radius: 14px; }
.rank-table { width: 100%; border-collapse: collapse; background: var(--parchment-light); }
.rank-table th, .rank-table td { padding: 10px 14px; text-align: left; white-space: nowrap; }
.rank-table th {
    background: var(--forest);
    color: var(--cream);
    font-size: .88rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.rank-table tbody tr:nth-child(even) { background: rgba(214, 190, 130, 0.22); }
.rank-table tbody tr + tr td { border-top: 1px solid rgba(160, 130, 70, 0.25); }
.rank-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-table .rank { width: 1%; font-weight: 800; color: var(--muted); }
.rank-table .name { font-weight: 750; }
.rank-table .strong { font-weight: 850; color: var(--forest); }
.rank-table .podium .rank { color: var(--gold-deep); font-size: 1.1rem; }
.rank-table tr.is-me { background: rgba(106, 167, 34, 0.25) !important; box-shadow: inset 4px 0 0 var(--leaf); }
.rank-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; font-weight: 800; color: var(--muted); }
.rank-pager .button { padding: 8px 18px; font-size: .95rem; }

/* ── Actualités ─────────────────────────────────────────────────────────── */
.news-page {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(28px, 6vw, 64px) clamp(16px, 5vw, 40px);
    display: grid;
    gap: 22px;
}
.news-page .section-title { margin-bottom: 6px; }
.news-article { scroll-margin-top: 20px; }
.news-article h2 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); margin-bottom: 14px; }
.news-article:target { border-color: var(--leaf); }
.news-body { line-height: 1.65; overflow-wrap: anywhere; }
.news-body img { max-width: 100%; height: auto; }
.news-body a { font-weight: 700; }
.news-signature { margin: 16px 0 0; text-align: right; font-size: .9rem; font-weight: 700; font-style: italic; color: var(--muted); }
.news-pager { margin-top: 0; }
.news-item h3 a { color: inherit; text-decoration: none; }
.news-item h3 a:hover { text-decoration: underline; }
.news-more { margin: 18px 0 0; text-align: center; }
/* Page « Mon compte » : dernières actualités dans un panneau. */
.account-news .news-list { max-width: none; margin-top: 14px; padding: 0; }
.account-news .news-more { margin-top: 14px; font-weight: 700; }

/* ── Messagerie ─────────────────────────────────────────────────────────── */
.messaging-page {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(28px, 6vw, 64px) clamp(16px, 5vw, 40px);
}
.messaging h1 { text-align: center; }
.msg-tabs { margin-bottom: 22px; }
/* Pastille « non lus » (menu latéral et onglet). */
.msg-badge {
    display: inline-block;
    min-width: 1.5em;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--gold);
    color: #3a2607;
    font-size: .8rem;
    font-weight: 900;
    text-align: center;
    text-shadow: none;
}
nav a .msg-badge { margin-left: auto; }
.msg-table td { white-space: normal; }
.msg-table .msg-status, .msg-table .msg-actions { width: 1%; }
.msg-table .msg-subject a { color: var(--forest); text-decoration: none; font-weight: 600; }
.msg-table .msg-subject a:hover { text-decoration: underline; }
.msg-table tr.is-unread .msg-subject a, .msg-table tr.is-unread .name { font-weight: 900; }
.msg-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 0 2px rgba(106, 167, 34, 0.3); }
.msg-dot.read { background: transparent; box-shadow: inset 0 0 0 2px var(--parchment-border); }
.msg-table form { margin: 0; }
.msg-del {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 2px solid var(--parchment-border);
    background: var(--parchment);
    color: var(--danger);
    font-weight: 900;
    cursor: pointer;
}
.msg-del:hover { border-color: var(--danger); }
.msg-read-subject { font-size: 1.35rem; margin-bottom: 14px; }
.msg-read-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.msg-read-actions form { margin: 0; }
.msg-read-actions .button { padding: 9px 18px; font-size: .95rem; }
.msg-thread { display: grid; gap: 14px; }
.msg-item {
    background: var(--parchment-light);
    border: 2px solid var(--parchment-border);
    border-radius: 14px;
    padding: 14px 18px;
}
.msg-item header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; color: var(--forest); }
.msg-item time { color: var(--muted); font-size: .9rem; font-weight: 700; }
.msg-body { line-height: 1.6; overflow-wrap: anywhere; }
.msg-form { max-width: 640px; margin: 0 auto; }
.msg-form textarea {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    line-height: 1.5;
    color: var(--ink);
    background: var(--parchment-light);
    border: 2px solid var(--parchment-border);
    border-radius: 12px;
    resize: vertical;
}
.msg-form textarea:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(106, 167, 34, 0.28); }
.msg-smileys { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-smileys button {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 10px;
    border: 2px solid var(--parchment-border);
    background: var(--parchment-light);
    cursor: pointer;
}
.msg-smileys button:hover { border-color: var(--leaf); }
.msg-form > .button { justify-self: center; }
.msg-history-title { margin: 28px 0 14px; }

/* ── Flash ──────────────────────────────────────────────────────────────── */
.flash {
    width: calc(100% - 2 * clamp(16px, 5vw, 40px));
    max-width: 720px;
    margin: 16px auto 0;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 700;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
}
.flash-success { background: #e6f4c4; border-color: #7fb432; color: #1f4d10; }
.flash-error { background: #fbe0d6; border-color: #d2634f; color: #7c1a12; }

/* ── Pied de page : même vert sous-bois que le menu latéral ──────────────── */
.site-footer {
    margin-top: auto;
    padding: 16px clamp(20px, 6vw, 54px);
    background: linear-gradient(180deg, #2f5a14, #17330b);
    border-top: 3px solid var(--gold-deep);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    color: var(--cream-muted);
    font-size: .92rem;
}
main + .site-footer { margin-top: clamp(28px, 5vw, 56px); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--cream-muted); text-decoration: none; font-weight: 700; }
.footer-links a:hover { color: #fff; }

/* ── Abonnement : offres PayPal ─────────────────────────────────────────── */
.sub-note { margin: 4px 0 18px; }
.sub-offers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.sub-offer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 12px;
    border: 3px solid var(--parchment-border);
    border-radius: 16px;
    background: var(--parchment-light);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.sub-offer:hover { border-color: var(--gold-deep); }
.sub-offer input { position: absolute; opacity: 0; pointer-events: none; }
.sub-offer:has(input:checked) {
    border-color: var(--leaf);
    background: #e8d6a4;
}
.sub-offer:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.sub-offer-dur { font-weight: 800; color: var(--forest); }
.sub-offer-price { font-weight: 800; color: #a4560d; font-size: 1.1rem; }
.sub-paypal { max-width: 380px; }
.sub-feedback { margin-top: 14px; font-weight: 700; min-height: 1.2em; }
.sub-feedback.ok { color: var(--leaf-dark); }
.sub-feedback.err { color: var(--danger); }

/* ── Encart « email / accès à l'app » : bannière compacte dépliable ───────── */
.access-panel {
    background: linear-gradient(180deg, var(--parchment), var(--parchment-deep));
    border: 3px solid var(--parchment-border);
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), var(--shadow);
}
.access-panel summary {
    display: flex; align-items: center; gap: 14px; cursor: pointer; list-style: none;
    padding: 12px 18px;
}
.access-panel summary::-webkit-details-marker { display: none; }
.access-panel .access-icon { font-size: 1.6rem; line-height: 1; }
.access-panel .access-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.access-panel .access-text strong { color: var(--forest); font-size: 1.05rem; }
.access-panel .access-text small { color: var(--muted); font-size: .88rem; line-height: 1.3; }
.access-panel .access-cta { flex: 0 0 auto; padding: 8px 18px; font-size: .95rem; }
.access-panel[open] .access-cta { display: none; }
.access-panel .access-body { padding: 4px clamp(18px, 4vw, 30px) 22px; }
@media (max-width: 560px) {
    .access-panel summary { flex-wrap: wrap; }
    .access-panel .access-cta { width: 100%; text-align: center; }
}

/* Applications mobiles : boutons des stores, page /mobile, encart de /bienvenue */
.store-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.store-badge { display: inline-flex; align-items: center; gap: 9px; min-width: 150px; padding: 7px 14px 7px 12px; border-radius: 10px; background: #111; border: 1px solid #a6a6a6; color: #fff; text-decoration: none; line-height: 1.15; font-size: 1.05rem; font-weight: 700; }
.store-badge:hover, .store-badge:focus-visible { background: #2a2a2a; color: #fff; }
.store-badge svg { width: 22px; height: 22px; flex: none; }
.store-badge small { display: block; font-size: 0.68rem; font-weight: 500; letter-spacing: 0.02em; }
.store-soon { margin: 0; font-style: italic; color: var(--muted); }
.mobile-games { display: grid; gap: 18px; }
.mobile-game { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px; }
.mobile-game-logo { width: min(240px, 100%); height: auto; }
.mobile-game-body { flex: 1 1 260px; display: grid; gap: 12px; justify-items: start; }
.mobile-game-body h2 { margin: 0; }
.mobile-game-link { font-weight: 700; }
.mobile-promo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-block: 16px; }
.mobile-promo-text { flex: 1 1 260px; }
.mobile-promo-text h2 { font-size: 1.15rem; margin: 0 0 4px; }
.mobile-promo-text p { margin: 0; }
.mobile-promo-game { display: grid; gap: 6px; }
.legacy-promo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-block: 16px; }
.legacy-promo-text { flex: 1 1 260px; }
.legacy-promo-text h2 { font-size: 1.15rem; margin: 0 0 4px; }
.legacy-promo-text p { margin: 0; }
.game-feature-body .game-mobile-note { margin: 20px 0 8px; font-weight: 700; }
@media (max-width: 560px) {
    .store-badges { gap: 8px; }
    .store-badge { min-width: 0; padding: 6px 10px; font-size: 0.92rem; gap: 7px; }
    .store-badge svg { width: 18px; height: 18px; }
    .store-badge small { font-size: 0.6rem; }
}
