﻿/* =========================
   home.css (index.html)
   ========================= */

.home-root {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-width: none;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.home-top-card {
    background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(30,64,175,0.70));
    border-radius: var(--border-radius);
    padding: 5px 12px 7px 12px;
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: 0 15px 40px rgba(15,23,42,0.8);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media screen and (max-width: 500px) {
    .home-top-card {
        box-shadow: none;
    }
}

.home-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.profile-block {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2,6,23,0.55);
    border: 1px solid rgba(129,140,248,0.55);
    box-shadow: 0 0 18px rgba(168,85,247,0.18);
    font-size: 1.4rem;
}

.profile-meta {
    min-width: 0;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-name {
    font-weight: 900;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.profile-rank {
    margin-top: 2px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.5);
    background: rgba(2,6,23,0.45);
    color: #e5e7eb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

    .icon-btn:active {
        transform: scale(0.97);
    }

.icon-btn-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.credits-block {
    display: flex;
    align-items: center;
    gap: 6px;
}

.credits-label-mini {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 0.06em;
    align-self: center;
}

.home-stats-row {
    gap: 8px;
}

.stat-chip {
    flex: 1;
    border-radius: 16px;
    border: 1px solid rgba(129,140,248,0.35);
    background: rgba(2,6,23,0.35);
    padding: 8px 10px;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-label {
    font-size: 0.60rem;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 0.06em;
}

.stat-value {
    margin-top: 2px;
    font-size: 1.05rem;
    font-weight: 900;
    color: #e5e7eb;
    text-shadow: 0 0 10px rgba(34,211,238,0.25);
}

/* ===== HOME : tuile TOP DU JOUR ===== */
/* =========================================================
   HOME – Unification des 3 tuiles (gauche / milieu / droite)
   + Scan uniquement sur la tuile BONUS (milieu)
   ========================================================= */

/* Base commune pour les 3 tuiles */
.home-stats-row .stat-chip {
    position: relative;
    text-align: center;
    overflow: hidden;
    border: 1px solid rgba(129,140,248,0.35);
    background: rgba(2,6,23,0.35);
    border-radius: 16px;
    box-shadow: none;
    transition: transform .15s ease, border-color .15s ease, filter .15s ease;
}

    /* Fond dynamique commun (glow doux) pour les 3 tuiles */
    .home-stats-row .stat-chip::before {
        content: "";
        position: absolute;
        inset: -40%;
        background: radial-gradient(circle at 28% 28%, rgba(34,211,238,0.10), transparent 60%), radial-gradient(circle at 78% 82%, rgba(168,85,247,0.08), transparent 60%);
        pointer-events: none;
    }

    /* Par défaut : PAS de scan sur les tuiles */
    .home-stats-row .stat-chip::after {
        content: none;
    }

/* =========================
   HOME — Polish néon (sans margin/padding)
   Tuile: #stat-chip-max-level
   ========================= */

#stat-chip-max-level {
    /* Bordure plus néon */
    border-color: rgba(34,211,238,0.55);
    /* Glow externe léger (ne change pas la taille) */
    box-shadow: 0 0 12px rgba(34,211,238,0.14), 0 0 20px rgba(168,85,247,0.10), inset 0 0 0 1px rgba(255,255,255,0.04);
    /* Fond un peu plus "arcade" */
    background: radial-gradient(circle at 20% 25%, rgba(34,211,238,0.12), transparent 55%), radial-gradient(circle at 85% 80%, rgba(168,85,247,0.10), transparent 60%), rgba(2,6,23,0.38);
}

    /* Libellés un peu plus lumineux (sans changer les espacements) */
    #stat-chip-max-level .stat-label {
        color: rgba(203,213,225,0.92);
        text-shadow: 0 0 10px rgba(34,211,238,0.10);
    }

    /* Valeurs plus "punchy" */
    #stat-chip-max-level .stat-value {
        color: rgba(248,250,252,0.98);
        text-shadow: 0 0 10px rgba(34,211,238,0.22), 0 0 14px rgba(168,85,247,0.12);
    }

    /* Option: mini-scan très discret, uniquement sur cette tuile */
    #stat-chip-max-level::after {
        content: "";
        position: absolute;
        inset: -40%;
        background: linear-gradient( 120deg, transparent 35%, rgba(34,211,238,0.08) 45%, rgba(168,85,247,0.06) 55%, transparent 65% );
        transform: translateX(-40%);
        animation: prMaxLevelScan 4.8s linear infinite;
        pointer-events: none;
        mix-blend-mode: screen;
    }

@keyframes prMaxLevelScan {
    0% {
        transform: translateX(-45%);
    }

    100% {
        transform: translateX(45%);
    }
}

/* =========================
   HOME — Tuile "TOP DU JOUR" Podium (v2) — CLEAN + néon Or/Argent/Bronze
   ========================= */

#tile-daily-best.dailybest-v2 {
    text-align: left;
}

    /* Titre centré */
    #tile-daily-best.dailybest-v2 .stat-label {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    /* Séparateur (hr) dans la tuile "Top du jour" — sans marge/padding */
    #tile-daily-best.dailybest-v2 hr {
        margin: 0;
        padding: 0;
        border: 0;
        height: 1px;
        /* ligne néon subtile */
        background: linear-gradient( 90deg, rgba(34,211,238,0), rgba(34,211,238,0.45), rgba(168,85,247,0.38), rgba(34,211,238,0) );
        box-shadow: 0 0 10px rgba(34,211,238,0.18), 0 0 12px rgba(168,85,247,0.12);
        opacity: 0.95;
    }

    /* Option : séparateurs légèrement différents selon rang (sans toucher au layout) */
    #tile-daily-best.dailybest-v2 .podium-row--gold + hr {
        background: linear-gradient( 90deg, rgba(249,215,84,0), rgba(249,215,84,1), rgba(34,211,238,0.22), rgba(249,215,84,0) );
        box-shadow: 0 0 10px rgba(249,215,84,0.16), 0 0 10px rgba(34,211,238,0.10);
    }

    #tile-daily-best.dailybest-v2 .podium-row--silver + hr {
        background: linear-gradient( 90deg, rgba(226,232,240,0), rgba(226,232,240,1), rgba(34,211,238,0.16), rgba(226,232,240,0) );
        box-shadow: 0 0 10px rgba(226,232,240,0.10), 0 0 10px rgba(34,211,238,0.08);
    }

.podium-row {
    white-space: nowrap;
}

    /* Pseudo sur 1 ligne, tronqué si trop long */
    #tile-daily-best.dailybest-v2 .podium-rank {
        display: flex;
        align-items: baseline;
        gap: 6px;
        min-width: 0; /* indispensable pour ellipsis en flex */
    }

    #tile-daily-best.dailybest-v2 .podium-name {
        display: inline-block;
        min-width: 0;
        flex: 1 1 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        overflow-wrap: normal;
        word-break: normal;
    }

    /* Le "1er/2e/3e" coloré néon */
    #tile-daily-best.dailybest-v2 .podium-row--gold .podium-rank {
        color: #f9d754;
        text-shadow: 0 0 10px rgba(249,215,84,0.35), 0 0 18px rgba(249,215,84,0.22);
    }

    #tile-daily-best.dailybest-v2 .podium-row--silver .podium-rank {
        color: #e2e8f0;
        text-shadow: 0 0 10px rgba(226,232,240,0.28), 0 0 18px rgba(226,232,240,0.18);
    }

    #tile-daily-best.dailybest-v2 .podium-row--bronze .podium-rank {
        color: #ea9956;
        text-shadow: 0 0 10px rgba(234,153,86,0.30), 0 0 18px rgba(234,153,86,0.20);
    }

    /* Pseudo : doit s’afficher en entier */
    #tile-daily-best.dailybest-v2 .podium-name {
        font-weight: 950;
        font-size: 0.74rem;
        line-height: 1.10;
        color: #f8fafc;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* 2e ligne : Score + reward (sur la même ligne, alignés) */
#tile-daily-best.dailybest-v2 .podium-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 1000;
    font-size: 0.72rem;
    color: rgba(226,232,240,0.92);
    letter-spacing: 0.02em;
}

    /* Reward pill */
    #tile-daily-best.dailybest-v2 .podium-reward {
        font-weight: 1100;
        font-size: 0.72rem;
        letter-spacing: 0.02em;
        color: #fff;
    }

/* =========================
   HOME — Tuile "BONUS stock" (mini inventaire)
   ========================= */

.stat-chip--inv {
    text-align: center;
}

    /* Ligne d’icônes compactes */
    .stat-chip--inv .home-inv {
        margin-top: 6px;
        display: flex;
        justify-content: center;
        align-items: flex-end;
        flex-wrap: wrap;
        gap: 2px;
    }

/* Un item = icône + count en dessous */
.stat-chip--inv .inv-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

    /* Pastille néon */
    .stat-chip--inv .inv-badge {
        width: 30px;
        height: 30px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        line-height: 1;
        background: rgba(2,6,23,0.55);
        border: 1px solid rgba(148,163,184,0.45);
        box-shadow: 0 0 10px rgba(34,211,238,0.18), 0 0 16px rgba(168,85,247,0.12);
    }

    /* Le chiffre */
    .stat-chip--inv .inv-count {
        font-weight: 1000;
        font-size: 0.75rem;
        letter-spacing: 0.02em;
        color: #e5e7eb;
        text-shadow: 0 0 10px rgba(34,211,238,0.22);
    }

    /* Sous-titre discret */
    .stat-chip--inv .inv-sub {
        margin-top: 4px;
        font-size: 0.62rem;
        letter-spacing: 0.10em;
        text-transform: uppercase;
        color: rgba(148,163,184,0.85);
    }

    /* --- Couleurs par bonus (néon) --- */
    .stat-chip--inv .inv-item--life .inv-badge {
        border-color: rgba(255,77,122,0.55);
        box-shadow: 0 0 10px rgba(255,77,122,0.22), 0 0 18px rgba(255,77,122,0.16);
    }

    .stat-chip--inv .inv-item--slowmo .inv-badge {
        border-color: rgba(34,211,238,0.55);
        box-shadow: 0 0 10px rgba(34,211,238,0.22), 0 0 18px rgba(34,211,238,0.14);
    }

    .stat-chip--inv .inv-item--magnet .inv-badge {
        border-color: rgba(168,85,247,0.55);
        box-shadow: 0 0 10px rgba(168,85,247,0.22), 0 0 18px rgba(168,85,247,0.14);
    }

    .stat-chip--inv .inv-item--shield .inv-badge {
        border-color: rgba(77,255,181,0.50);
        box-shadow: 0 0 10px rgba(77,255,181,0.20), 0 0 18px rgba(77,255,181,0.12);
    }

    /* --- Zéro stock : grisé mais visible --- */
    .stat-chip--inv .inv-item--zero {
        opacity: 0.55;
        filter: grayscale(0.35);
    }

        .stat-chip--inv .inv-item--zero .inv-count {
            color: rgba(148,163,184,0.95);
            text-shadow: none;
        }

/* Petit ajustement si la tuile est très étroite */
@media (max-width: 380px) {
    .stat-chip--inv .inv-item {
        width: 32px;
    }

    .stat-chip--inv .inv-badge {
        width: 28px;
        height: 28px;
        border-radius: 11px;
        font-size: 15px;
    }
}

/* ✅ Scan UNIQUEMENT sur la tuile BONUS (milieu) */
#tile-partner-level::after {
    content: "";
    position: absolute;
    left: -40%;
    top: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
    transform: skewX(-18deg);
    animation: prBonusScan 2.6s linear infinite;
    pointer-events: none;
}

@keyframes prBonusScan {
    0% {
        left: -50%;
        opacity: 0;
    }

    10% {
        opacity: .55;
    }

    60% {
        opacity: .25;
    }

    100% {
        left: 120%;
        opacity: 0;
    }
}

/* Mise en avant BONUS (milieu) : un poil plus "premium" */
#tile-partner-level {
    border: 2px solid rgba(255, 214, 107, 0.5);
    filter: saturate(1.05);
}

    #tile-partner-level:hover {
        transform: translateY(-2px) scale(1.01);
    }

/* Hover léger pour les autres tuiles */
#tile-daily-best:hover,
#tile-next-bonus:hover {
    transform: translateY(-1px);
}

.dailybest-line {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dailybest-crown {
    filter: drop-shadow(0 0 10px rgba(250,204,21,0.35));
}

.dailybest-name {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 10px 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(129,140,248,0.45);
    background: rgba(2,6,23,0.35);
    color: #e5e7eb;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-shadow: 0 0 8px rgba(168,85,247,0.30), 0 0 14px rgba(34,211,238,0.20);
}

.dailybest-score {
    margin-top: 6px;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    text-shadow: 0 0 10px rgba(34,211,238,0.25), 0 0 18px rgba(168,85,247,0.18);
}

.dailybest-sub {
    margin-top: 4px;
    font-size: 0.72rem;
    color: rgba(148,163,184,0.92);
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* --- Tuile "Niveau BONUS" (Home) --- */
.stat-chip--bonus {
    cursor: pointer;
    user-select: none;
    height: 100%;
}

    .stat-chip--bonus:focus-visible {
        outline: 2px solid rgba(34, 211, 238, 0.9);
        outline-offset: 3px;
    }

/* Structure interne */
.bonus-tile-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.bonus-tile-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bonus-tile-level {
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-size: 0.78rem;
    opacity: 0.95;
    white-space: nowrap;
}

.bonus-tile-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.25rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 0 18px rgba(168,85,247,0.18);
}

/* BONUS en doré */
.bonus-gold {
    margin-left: 4px;
    font-weight: 1000;
    color: #ffd66b;
    text-shadow: 0 0 10px rgba(255, 214, 107, 0.45), 0 0 18px rgba(255, 214, 107, 0.25);
}

/* Petite pastille récompense */
.bonus-tile-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 0.85rem;
    background: rgba(34, 211, 238, 0.10);
    border: 1px solid rgba(34, 211, 238, 0.22);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.18);
}

.bonus-tile-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.bonus-tile-sub {
    font-weight: 900;
    opacity: 0.9;
}

.bonus-tile-score {
    opacity: 0.9;
    font-size: 0.95rem;
    align-self: center;
}

/* --- Tuile mini "Prochain bonus" (120x120 friendly) --- */
.stat-chip--nextmini {
    position: relative;
    overflow: hidden;
    padding: 10px;
    min-height: 112px; /* laisse respirer dans 120x120 */
}

.nextmini-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nextmini-title {
    font-weight: 1000;
    letter-spacing: .6px;
    font-size: .60rem;
    opacity: .95;
}

.nextmini-lvl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 1000;
    font-size: .78rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 0 14px rgba(34,211,238,0.14);
}

.nextmini-mid {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

/* "tac tac tac" visuel */
.nextmini-arrows {
    display: flex;
    gap: 5px;
    font-size: 1.05rem;
    font-weight: 900;
    opacity: .9;
}

    .nextmini-arrows span {
        display: inline-block;
        filter: drop-shadow(0 0 10px rgba(34,211,238,0.18));
        animation: nextminiTick 1.05s ease-in-out infinite;
    }

        .nextmini-arrows span:nth-child(2) {
            animation-delay: .12s;
            opacity: .75;
        }

        .nextmini-arrows span:nth-child(3) {
            animation-delay: .24s;
            opacity: .55;
        }

@keyframes nextminiTick {
    0%,100% {
        transform: translateX(0) scale(1);
        filter: brightness(1);
    }

    50% {
        transform: translateX(2px) scale(1.06);
        filter: brightness(1.25);
    }
}

/* Icône bonus : gros, simple, néon */
.nextmini-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 1.2rem;
    background: rgba(34,211,238,0.10);
    border: 1px solid rgba(34,211,238,0.22);
    box-shadow: 0 0 18px rgba(34,211,238,0.18);
    animation: nextminiPulse 1.8s ease-in-out infinite;
}

@keyframes nextminiPulse {
    0%,100% {
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }

    50% {
        transform: translateY(-1px) scale(1.04);
        filter: brightness(1.15);
    }
}

/* Badge bas ultra court */
.nextmini-badge {
    position: relative;
    margin-top: 10px;
    width: 100%;
    text-align: center;
    padding: 6px 8px;
    border-radius: 12px;
    font-weight: 1000;
    font-size: .78rem;
    letter-spacing: .7px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    text-shadow: 0 0 12px rgba(168,85,247,0.18);
}

/* =========================
   HOME — Tuile Mission Streak
   - Aucun margin/padding ajouté ici
   ========================= */

.stat-chip--streak {
    text-align: center;
    isolation: isolate;
}

    /* Glow léger de fond (sans changer vos paddings existants sur .stat-chip) */
    .stat-chip--streak::before {
        content: "";
        position: absolute;
        inset: -30%;
        background: radial-gradient(circle at 30% 25%, rgba(249,115,22,0.18), transparent 55%), radial-gradient(circle at 75% 70%, rgba(34,211,238,0.12), transparent 60%), radial-gradient(circle at 50% 90%, rgba(168,85,247,0.10), transparent 60%);
        pointer-events: none;
        filter: blur(0.2px);
        z-index: 0;
    }

    .stat-chip--streak > * {
        position: relative;
        z-index: 1;
    }

    /* Ligne titre */
    .stat-chip--streak .streak-title {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-weight: 1000;
        letter-spacing: 0.10em;
        text-transform: uppercase;
        color: rgba(226,232,240,0.95);
        text-shadow: 0 0 10px rgba(34,211,238,0.20), 0 0 14px rgba(168,85,247,0.14);
    }

    .stat-chip--streak .streak-ico {
        font-size: 0.95rem;
        filter: drop-shadow(0 0 8px rgba(249,115,22,0.30)) drop-shadow(0 0 10px rgba(249,115,22,0.18));
    }

    /* Valeur principale */
    .stat-chip--streak .streak-value {
        display: flex;
        align-items: baseline;
        justify-content: center;
        gap: 6px;
    }

    .stat-chip--streak .streak-num {
        font-size: 1.15rem;
        font-weight: 1100;
        color: #f8fafc;
        text-shadow: 0 0 10px rgba(34,211,238,0.25), 0 0 16px rgba(34,211,238,0.18);
    }

    .stat-chip--streak .streak-unit {
        font-size: 0.66rem;
        font-weight: 900;
        letter-spacing: 0.08em;
        color: rgba(148,163,184,0.95);
        text-transform: uppercase;
    }

    /* CTA + reward */
    .stat-chip--streak .streak-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 0.68rem;
        font-weight: 900;
        letter-spacing: 0.06em;
        color: rgba(226,232,240,0.92);
        white-space: nowrap;
    }

    .stat-chip--streak .streak-reward {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        border: 1px solid rgba(249,115,22,0.55);
        background: rgba(2,6,23,0.40);
        color: #fff;
        font-weight: 1100;
        letter-spacing: 0.04em;
        text-shadow: 0 0 10px rgba(249,115,22,0.22);
        box-shadow: 0 0 12px rgba(249,115,22,0.18), 0 0 18px rgba(249,115,22,0.12);
    }

.streak-reward {
    font-size: 1rem;
    margin: 5px;
}
/* Mini barre (sans marges/paddings) */
.stat-chip--streak .streak-bar {
    height: 8px;
    border-radius: 999px;
    border: 1px solid rgba(129,140,248,0.35);
    background: rgba(2,6,23,0.45);
    overflow: hidden;
}

    .stat-chip--streak .streak-bar-fill {
        height: 100%;
        border-radius: 999px;
        background: linear-gradient(90deg, rgba(34,211,238,0.85), rgba(168,85,247,0.85), rgba(249,115,22,0.85));
        box-shadow: 0 0 12px rgba(34,211,238,0.22), 0 0 16px rgba(168,85,247,0.16), 0 0 16px rgba(249,115,22,0.14);
        animation: streakPulse 1.4s ease-in-out infinite;
    }

@keyframes streakPulse {
    0%,100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.25);
    }
}

/* Ultra compact si la tuile est vraiment étroite */
@media (max-width: 380px) {
    .stat-chip--streak .streak-num {
        font-size: 1.05rem;
    }

    .stat-chip--streak .streak-unit {
        font-size: 0.62rem;
    }

    .stat-chip--streak .streak-cta {
        font-size: 0.64rem;
        margin-top: 10px;
    }
}

/* ===== HOME : coupon-card compact ===== */

.coupon-card {
    border-radius: 16px;
    border: 1px solid rgba(34,211,238,0.28);
    background: radial-gradient(circle at top, rgba(2,6,23,0.75), rgba(15,23,42,0.55));
    box-shadow: 0 0 16px rgba(34,211,238,0.12);
    padding: 8px 10px; /* ✅ plus compact */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.coupon-left {
    min-width: 0;
}

.coupon-title {
    font-weight: 900;
    letter-spacing: 0.02em;
    font-size: 0.92rem; /* ✅ un peu plus petit */
}

.coupon-line {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap; /* reste safe sur mobile */
}

.coupon-sub {
    margin-top: 6px;
    font-size: 0.78rem; /* ✅ plus petit */
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

    .coupon-sub a {
        color: #38bdf8;
        text-decoration: none;
        font-weight: 900;
        border-bottom: 1px dashed rgba(56,189,248,0.55);
        padding-bottom: 1px;
    }

        .coupon-sub a:hover {
            border-bottom-color: rgba(56,189,248,0.95);
        }

/* Le code promo devient un “pill” + icône copier dedans */
.highlight-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0; /* ✅ plus de gros margin */
    padding: 2px 10px 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(129,140,248,0.75);
    background: radial-gradient(circle at top, #1e293b, #020617);
    color: #e5e7eb;
    letter-spacing: 0.10em;
    font-weight: 800;
    font-size: 0.82rem; /* ✅ plus petit */
    text-shadow: 0 0 6px rgba(129,140,248,0.75), 0 0 14px rgba(59,130,246,0.55);
    box-shadow: 0 0 12px rgba(129,140,248,0.55);
}

/* Bouton icône copier (dans le pill) */
.coupon-copy-icon {
    appearance: none;
    border: 1px solid rgba(34,211,238,0.45);
    background: rgba(2,6,23,0.35);
    color: #38bdf8;
    border-radius: 999px;
    width: 30px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

    .coupon-copy-icon:active {
        transform: scale(0.97);
    }

    .coupon-copy-icon i {
        font-size: 0.95rem;
        line-height: 1;
    }

/* Toast compact (reste cohérent) */
.tiny-toast {
    font-size: 0.78rem;
    color: #22c55e;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(34,197,94,0.25);
}

.levels-card {
    /*flex: 1;*/
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 20px 20px 15px 15px;
    border: 1px solid rgba(55,65,81,0.8);
    background: radial-gradient(circle at top, rgba(2,6,23,0.85), rgba(2,6,23,0.65));
    box-shadow: 0 30px 80px rgba(15,23,42,0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media screen and (max-width: 500px) {
    .levels-card {
        box-shadow: none;
    }
}

/* Le scroll prend tout l'espace dispo, mais ne force jamais le CTA à sortir */
#levels-scroll.levels-scroll {
    flex: 1 1 auto;
    min-height: 140px; /* garde un minimum “comme aujourd'hui” (ajustez si besoin) */
    overflow-y: auto;
}

.levels-header {
    padding: 5px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(148,163,184,0.18);
}

.levels-title {
    font-weight: 900;
    letter-spacing: 0.03em;
}

.levels-testlink {
    font-size: 0.85rem;
    color: #38bdf8;
    text-decoration: none;
    font-weight: 900;
    border: 1px solid rgba(56,189,248,0.35);
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(2,6,23,0.35);
}

    .levels-testlink:active {
        transform: scale(0.98);
    }

.levels-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden; /* ✅ jamais de scroll horizontal */
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* ✅ toujours 3 tuiles */
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

    /* ✅ Scrollbar stylisée (WebKit: Chrome/Edge/Safari) */
    .levels-scroll::-webkit-scrollbar {
        width: 10px;
    }

    .levels-scroll::-webkit-scrollbar-track {
        background: rgba(2,6,23,0.35);
        border-radius: 999px;
    }

    .levels-scroll::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, rgba(34,211,238,0.65), rgba(168,85,247,0.65));
        border-radius: 999px;
        border: 2px solid rgba(2,6,23,0.55);
    }

        .levels-scroll::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, rgba(34,211,238,0.85), rgba(168,85,247,0.85));
        }

/* ✅ Firefox */
.levels-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(168,85,247,0.75) rgba(2,6,23,0.35);
}

.level-tile {
    position: relative;
    text-align: left;
    border-radius: 18px;
    padding: 10px 12px 15px 12px;
    border: 1px solid rgba(129,140,248,0.25);
    background: rgba(15,23,42,0.65);
    cursor: pointer;
    color: var(--text-main);
    box-shadow: 0 0 14px rgba(168,85,247,0.12);
    -webkit-tap-highlight-color: transparent;
}

    .level-tile:active {
        transform: scale(0.99);
    }

    .level-tile.locked {
        cursor: not-allowed;
        position: relative;
    }

        .level-tile.locked::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: 18px; /* même radius que la tuile */
            background: rgba(2,6,23,0.55); /* “opacification” visuelle */
            pointer-events: none;
            z-index: 2;
        }

    .level-tile.current {
        border-color: rgba(74,222,128,0.65);
        box-shadow: 0 0 18px rgba(74,222,128,0.18);
        animation: pr-home-pulse 0.95s ease-in-out infinite;
    }

@keyframes pr-home-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.01);
    }

    100% {
        transform: scale(1);
    }
}

.tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tile-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tile-level {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 900;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    opacity: 0.95;
}

.tile-level-num {
    color: #22d3ee;
    text-shadow: 0 0 10px rgba(34,211,238,0.45);
}

.tile-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(74,222,128,0.35);
    background: rgba(2,6,23,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.tile-medal {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.tile-title {
    margin-top: 8px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-sub {
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 700;
}

.tile-bottom {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tile-score {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
    color: #e5e7eb;
    opacity: 0.9;
}

.home-cta-bar {
    display: flex;
    flex: 0 0 auto;
    margin-top: 5px;
    justify-content: center;
    align-items: center;
    padding: 0px 8px 20px 8px;
}

.home-cta {
    width: 100%;
    border-radius: 999px;
}

/* Bottom sheet */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,0.70);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 999;
}

.sheet {
    width: min(520px, 96vw);
    border-radius: 22px 22px 0 0;
    border: 1px solid rgba(129,140,248,0.45);
    background: rgba(15,23,42,0.97);
    box-shadow: 0 0 28px rgba(168,85,247,0.25);
    padding: 12px;
}

.sheet-grabber {
    width: 64px;
    height: 6px;
    border-radius: 999px;
    background: rgba(148,163,184,0.35);
    margin: 2px auto 10px auto;
}

.sheet-title {
    font-weight: 900;
    letter-spacing: 0.02em;
}

.sheet-sub {
    margin-top: 4px;
    color: var(--text-muted);
    font-weight: 700;
}

.sheet-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sheet-warning {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,77,122,0.35);
    background: rgba(255,77,122,0.10);
    color: #fecdd3;
    font-weight: 800;
}

/* Age gate modal */
/* ✅ utilitaire manquant : utilisé partout (age gate, etc.) */
.hidden {
    display: none !important;
}

/* ✅ Age Gate / modal générique : au-dessus du jeu + cliquable */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5000; /* au-dessus de #overlay (10) et même #chat-modal (999) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(2,6,23,0.78);
    pointer-events: auto;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    border-radius: 18px;
    border: 1px solid rgba(129,140,248,0.55);
    background: rgba(15,23,42,0.96);
    box-shadow: 0 0 28px rgba(168,85,247,0.35);
    padding: 14px;
}

.modal-title {
    font-weight: 900;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.modal-text {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.35;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

    /* ✅ aide iOS/Android : clics plus fiables */
    .modal-actions button {
        touch-action: manipulation;
    }

.modal-hint {
    margin-top: 10px;
    color: #fca5a5;
    font-size: 0.9rem;
    text-align: center;
}

/* anti sélection */
.home-root, .home-root * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* ===== HOME : cadenas déblocage ===== */

/* petit bouton cadenas */
.tile-lockbtn {
    position: relative;
    z-index: 3;
    right: 5px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.35);
    background: rgba(2,6,23,0.45);
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* important mobile */
}

    /* cadenas fermé “déblocable” (pulse néon bleu/violet) */
    .tile-lockbtn.locked.unlockable {
        border-color: rgba(34,211,238,0.65);
        box-shadow: 0 0 12px rgba(34,211,238,0.22);
        animation: pr-lock-pulse 0.95s ease-in-out infinite;
    }

    /* cadenas ouvert */
    .tile-lockbtn.unlocked {
        appearance: none;
        border: none;
        background: transparent;
    }

@keyframes pr-lock-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(34,211,238,0.18), 0 0 0 rgba(168,85,247,0);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 18px rgba(34,211,238,0.55), 0 0 28px rgba(168,85,247,0.18);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(34,211,238,0.18), 0 0 0 rgba(168,85,247,0);
    }
}

/* HOME : lien Winety dans le coupon */
.coupon-sub {
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .coupon-sub a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 10px;
        border-radius: 999px;
        text-decoration: none;
        font-weight: 900;
        letter-spacing: 0.04em;
        color: #38bdf8;
        border: 1px solid rgba(56,189,248,0.45);
        background: rgba(2,6,23,0.35);
        box-shadow: 0 0 12px rgba(34,211,238,0.18);
        -webkit-tap-highlight-color: transparent;
    }

        .coupon-sub a:hover {
            border-color: rgba(34,211,238,0.85);
            box-shadow: 0 0 12px rgba(34,211,238,0.35), 0 0 22px rgba(168,85,247,0.20);
            transform: translateY(-1px);
        }

        .coupon-sub a:active {
            transform: translateY(0) scale(0.98);
            box-shadow: 0 0 16px rgba(34,211,238,0.30);
        }

        .coupon-sub a:focus-visible {
            outline: none;
            box-shadow: 0 0 0 3px rgba(34,211,238,0.25), 0 0 18px rgba(34,211,238,0.35);
        }

@media (max-width: 420px) {
    .coupon-sub {
        font-size: 0.78rem;
    }

        .coupon-sub a {
            padding: 4px 9px;
        }
}

/* ===== HOME : header niveaux + barre progression remise ===== */

.levels-header {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid rgba(148,163,184,0.18);
}

.levels-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.levels-title {
    font-weight: 900;
    letter-spacing: 0.03em;
}

/* Wrap à droite */
.levels-progress-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    min-width: 160px;
}

/* Track */
.levels-progress-track {
    position: relative;
    width: min(260px, 52vw);
    height: 12px;
    border-radius: 999px;
    background: rgba(2,6,23,0.55);
    border: 1px solid rgba(129,140,248,0.35);
    overflow: hidden;
    box-shadow: 0 0 16px rgba(168,85,247,0.12);
}

/* Fill néon (dégradé animé) */
.levels-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient( 90deg, rgba(34,211,238,0.95), rgba(168,85,247,0.95), rgba(77,255,181,0.95) );
    background-size: 220% 100%;
    animation: pr-progress-shift 1.6s linear infinite;
    box-shadow: 0 0 12px rgba(34,211,238,0.35), 0 0 18px rgba(168,85,247,0.20);
}

/* Glitter overlay (pétillant) */
.levels-progress-glitter {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient( 110deg, rgba(255,255,255,0) 0%, rgba(56,189,248,0.22) 30%, rgba(255,255,255,0) 60%, rgba(168,85,247,0.18) 85%, rgba(255,255,255,0) 100% );
    transform: translateX(-40%);
    animation: pr-progress-glitter 1.15s ease-in-out infinite;
    opacity: 0.55;
}

/* Spark (point lumineux à l’avancement) */
.levels-progress-spark {
    position: absolute;
    top: 50%;
    left: -20px; /* sera repositionné en JS */
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(34,211,238,0.65) 35%, rgba(168,85,247,0.0) 70%);
    box-shadow: 0 0 10px rgba(34,211,238,0.85), 0 0 18px rgba(168,85,247,0.55), 0 0 26px rgba(77,255,181,0.35);
    animation: pr-progress-spark 0.85s ease-in-out infinite;
    pointer-events: none;
}

/* Animations */
@keyframes pr-progress-shift {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

@keyframes pr-progress-glitter {
    0% {
        transform: translateX(-55%);
        opacity: 0.35;
    }

    50% {
        opacity: 0.85;
    }

    100% {
        transform: translateX(55%);
        opacity: 0.35;
    }
}

@keyframes pr-progress-spark {
    0% {
        transform: translateY(-50%) scale(0.92);
    }

    50% {
        transform: translateY(-50%) scale(1.10);
    }

    100% {
        transform: translateY(-50%) scale(0.92);
    }
}
