/*
  GamePulse — global styles
  ------------------------
  Objectif:
  - Styles communs à toute l'app (layout, topbar, drawer, primitives UI)
  - Chaque page gère SON rendu via /css/pages/*.css (ex: home.css)
*/

:root {
    /* Brand palette */
    --bg0: #0B0F14;
    --bg1: #0D1219;
    --text: rgba(255,255,255,.92);
    --muted: rgba(255,255,255,.70);
    --stroke: rgba(255,255,255,.12);
    --pulse: #6EE7FF; /* accent principal */
    --soft: #B7F7D8; /* accent secondaire */
    --lock: #FFD36E; /* accent lock / premium */
    /* Fonts */
    --font-main: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    /* iOS safe areas */
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    /* Layout */
    --radius-lg: 18px;
    --radius-md: 16px;
    --shadow: 0 10px 30px rgba(0,0,0,.22);
    --pumpkin: #FF5F19;
}

/* ---------- Baseline / reset ---------- */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--font-main);
    letter-spacing: .15px;
    color: var(--text);
    background-color: var(--bg0);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent; /* supprime le flash bleu iOS/Android au tap */
    overscroll-behavior-y: none; /* évite le "bounce" iOS non désiré */
}

/* Accessibilité: lien "aller au contenu" */
.skip {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

    .skip:focus {
        left: 12px;
        top: 12px;
        width: auto;
        height: auto;
        padding: 10px 12px;
        background: #111;
        border-radius: 12px;
        z-index: 9999;
    }

/* ---------- App shell ---------- */
.screen {
    min-height: 100%;
}

.content {
    padding: 14px 14px 22px;
    padding-bottom: calc(22px + var(--safe-bottom));
    max-width: 980px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(12px + var(--safe-top)) 14px 12px;
    backdrop-filter: blur(14px);
    background: rgba(11,15,20,.55);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.topbar__spacer {
    width: 40px;
    height: 40px;
}

.iconbtn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.06);
    color: var(--text);
    border-radius: 14px;
    display: grid;
    place-items: center;
}

.icon {
    font-size: 18px;
    line-height: 1;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--pulse);
    box-shadow: 0 0 0 6px rgba(110,231,255,.16);
}

.brand__text {
    font-weight: 700;
}

/* ---------- Typo helpers ---------- */
.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.thin {
    font-weight: 300;
}

/* ---------- Pills / tags ---------- */
.pill, .tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.08);
}

.pill--mini {
    padding: 4px 8px;
    font-size: 11px;
}

.pill--live {
    border-color: rgba(110,231,255,.25);
    background: rgba(110,231,255,.12);
}

.tag--lock {
    border-color: rgba(255,211,110,.35);
    background: rgba(255,211,110,.12);
}

/* ---------- Cards ---------- */
.card {
    border-radius: var(--radius-lg);
    padding: 14px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.06);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    height: 480px; /* <-- hauteur FIXE */
}

.card--tight {
    padding: 12px;
}

.cardTop {
  
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cardT {
    font-family: 'Black Ops One';
    margin-left: 10px;
    font-size: 44px;
    color: #eb6029;
    font-weight: 400;
}

/* ---------- Primary button ---------- */
.btnPrimary {
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(110,231,255,.16);
    border-color: rgba(110,231,255,.28);
    color: var(--text);
    border-radius: var(--radius-md);
    padding: 12px 12px;
    font-weight: 800;
    width: 100%;
}

/* ---------- Drawer (mobile nav) ---------- */
.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 60;
}

.drawer {
    position: fixed;
    top: var(--safe-top); /* ✅ pleine hauteur utile */
    bottom: var(--safe-bottom);
    left: 0; /* ✅ pas de marge à gauche */
    width: min(78vw, 320px);
    /* ✅ inverse: arrondi à droite seulement */
    border-radius: 0 5px 5px 0;
    /* ✅ pas de bordure */
    border: 0;
    background: rgba(245,246,247,1);
    color: rgba(0,0,0,.78);
    box-shadow: 0 24px 70px rgba(0,0,0,.45);
    transform: translateX(-120%);
    transition: transform .22s ease;
    z-index: 70;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .drawer.is-open {
        transform: translateX(0);
    }

    /* ✅ retire la barre gradient gauche de l’ancienne version */
    .drawer::before {
        content: none !important;
    }

/* ---------- Focus (clavier) ---------- */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid rgba(110,231,255,.65);
    outline-offset: 2px;
}

/* ---------- App shell (wrapper) ---------- */
/* Mobile : transparent, layout natif. Desktop : frame phone-like centré. */
.gp-app-shell {
    width: 100%;
    min-height: 100dvh;
    position: relative;
}

/* ---------- Desktop ≥ 900px : frame phone-like ---------- */
/* Le wrapper .gp-app-shell devient un "écran de téléphone" centré avec
   un fond extérieur sombre. Topbar, drawer, backdrop et content sont
   contenus dedans → rendu cohérent avec mobile. */
@media (min-width: 900px) {
    body {
        background:
            radial-gradient(ellipse at top, rgba(255, 95, 25, 0.06), transparent 60%),
            linear-gradient(135deg, #050810 0%, #0c0f17 60%, #050810 100%);
        background-attachment: fixed;
        min-height: 100dvh;
    }

    .gp-app-shell {
        width: 480px;
        max-width: 480px;
        margin: 0 auto;
        background: var(--bg0, #0a0e14);
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.05),
            0 30px 80px rgba(0, 0, 0, 0.55),
            0 8px 30px rgba(0, 0, 0, 0.40);
        border-radius: 0;
        overflow: hidden; /* indispensable pour clipper le drawer translaté à -120% */
    }

    /* Topbar : sticky relative au wrapper, prend toute sa largeur */
    .gp-app-shell .topbar {
        position: sticky;
        top: 0;
        width: 100%;
    }

    /* Screen prend toute la largeur du wrapper (480px) au lieu d'être ré-fixé à 480px */
    .gp-app-shell .screen {
        width: 100%;
        min-height: calc(100dvh - 60px);
    }

    /* Backdrop : couvre l'intérieur du frame uniquement (pas le viewport entier) */
    .gp-app-shell .backdrop {
        position: absolute;
        inset: 0;
        z-index: 60;
    }

    /* Drawer : slide depuis la gauche DU FRAME (transform: translateX(-120%) hide → 0 show
       conservé via la classe .is-open déjà gérée en JS). */
    .gp-app-shell .drawer {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(78%, 320px);
        max-width: 100%;
        z-index: 70;
        /* transform et transition héritées de la règle générale .drawer */
    }

    /* Banner PWA install : aligné dans le frame */
    .gp-app-shell .gp-pwa-install-banner,
    .gp-app-shell #blazor-error-ui {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }

    /* ── Exception : /test-matchsheet (admin) → reste full-width desktop ── */
    /* Cette page contient .ms-root et a besoin de l'espace pour ses tableaux. */
    .gp-app-shell:has(.ms-root) {
        width: 100%;
        max-width: 100%;
        margin: 0;
        background: transparent;
        box-shadow: none;
    }
    .gp-app-shell:has(.ms-root) .topbar { width: 100%; }
    .gp-app-shell:has(.ms-root) .screen { width: 100%; min-height: 100dvh; }
    .gp-app-shell:has(.ms-root) .backdrop,
    .gp-app-shell:has(.ms-root) .drawer { position: fixed; }
}

/* ---------- Amélioration tactile globale ---------- */
button, [role="button"] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* supprime le délai 300ms iOS */
    user-select: none;
    -webkit-user-select: none;
}

input, select, textarea {
    font-size: 16px; /* évite le zoom auto iOS sur focus */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------------------------------------
   Home — Stats filter (select pro)
   --------------------------------------- */
.gpSelect {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    box-shadow: 0 10px 25px rgba(0,0,0,.18);
    max-width: 190px;
}

.gpSelect__ico {
    width: 18px;
    text-align: center;
    opacity: .9;
}

.gpSelect__chev {
    opacity: .75;
    margin-left: 2px;
    pointer-events: none;
}

.gpSelect__native {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 0;
    outline: none;
    background: transparent;
    color: rgba(255,255,255,.92);
    font-weight: 700;
    letter-spacing: .1px;
    padding: 0;
    margin: 0;
    min-width: 110px;
}

.gpSelect:focus-within {
    outline: 2px solid rgba(110,231,255,.65);
    outline-offset: 2px;
}

.gpSelect__native option {
    background: #0D1219;
    color: rgba(255,255,255,.92);
}
.brand {
    display: flex;
    align-items: center;
}

.brand__logo {
    height: 60px; /* ajuste selon ton design */
    width: auto;
    display: block;
}

/* Surbrillance brève de la cible d'un scroll (deep-link prono → historique).
   Confirme visuellement où on a scrollé, utile surtout sur mobile. */
.gpFlash {
    animation: gpFlashAnim 1.1s ease-out;
}
@keyframes gpFlashAnim {
    0%   { box-shadow: 0 0 0 0 rgba(235,96,41,.0); }
    18%  { box-shadow: 0 0 0 3px rgba(235,96,41,.85); }
    100% { box-shadow: 0 0 0 0 rgba(235,96,41,.0); }
}

/* ====== NOT CONNECTED LANDING ====== */

.landing {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 24px 14px;
    padding-top:2px !important;
    overflow: hidden;
    background: #071012;
    flex-direction: column;
    font-family: "Antonio", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    align-items: center;
    justify-content: flex-start !important; /* ← c’est ça */
}

/* ballon : remonte + vers la droite + hors écran */
.landing__ball {
    position: fixed;
    opacity: .28;
    pointer-events: none;
    filter: blur(.2px);
    z-index: 2;
    overflow: hidden;
}

/* container téléphone */
.phone {
    position: relative;
    width: 360px;
    padding: 18px 18px 22px;
    padding-top:7px !important;
    z-index:3;
}

/* titre hors card */
.phone__slogan {
    font-family: 'Antonio';
    text-align: center;
    font-size: 34px;
    line-height: 1.05;
    margin: 8px 0 14px;
    color: #eb6029;
    letter-spacing: .6px;
    font-weight: 700;
}

/* card remontée + couleur demandée + semi-transparence */
.card {
    background-color: rgba(210, 229, 230, 0.75); /* 75% visible */
    border-radius: 18px;
    padding: 20px 18px;
    min-height: 480px;
    margin-top: 0px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.20);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
}
.card3 {
    background-color: #d2e5e6; /* 75% visible */
    border-radius: 18px;
    padding: 20px 18px;
    min-height: 480px;
    margin-top: 0px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.20);
    backdrop-filter: blur(2px);
}

/* titre “citation” */
.card__title {
    padding: 14px 16px 0;
    font-size: clamp(28px, 7.5vw, 41px);
    line-height: 1.12;
    color: #103033;
    font-weight: 400;
    margin-bottom: 12px;
}

    .card__title .quote {
        font-size: 44px;
        vertical-align: -10px;
        opacity: .75;
        margin-right: 6px;
    }

    .card__title .quote--end {
        margin-left: 6px;
        margin-right: 0;
    }

/* body */
.card__body {
    text-align: center;
    color: #103033;
    font-size: clamp(16px, 4.6vw, 24px);
    line-height: 1.3;
    opacity: .92;
    padding: 0 12px 6px;
}
.card__footer {
    margin-top: auto; /* <-- clé du problème */
}

/* dots */
.dots {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 14px 0 12px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 0;
    background: rgba(255,255,255,.28);
    cursor: pointer;
}

    .dot.is-active {
        background: #eb6029;
    }

/* actions + boutons orange */
.actions {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

.gpBtn {
    width: 100%;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(235,96,41,.55);
    background: transparent;
    color: #eb6029 !important;
    font-weight: 700;
    cursor: pointer;
    font-size: 20px;
    text-transform: uppercase;
}

    .gpBtn:hover {
        background: rgba(235,96,41,.12);
    }

.gpBtn--ghost {
    background: transparent;
}
.card__content {
    transition: transform 220ms ease, opacity 220ms ease;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

    .card__content.is-anim {
        animation: slideFade 220ms ease;
    }

@keyframes slideFade {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.dot.is-active {
    background: #eb6029;
    transform: scale(1.2);
    transition: transform 180ms ease, background 180ms ease;
}

.dot {
    transition: transform 180ms ease, background 180ms ease;
}

.HomeHeroImg {
    height: 140px;
    object-fit: cover !important;
    width: 100% !important;
    margin-left: -6px;
}

/* Placeholder silhouette (home + profil) */
.homeHeroPlaceholder {
    height: 140px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(180,200,210,.45);
}
.homeHeroPlaceholder svg {
    width: 80px;
    height: 80px;
}

.profilePhotoBox {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: center;
}
.profilePhoto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.profilePhotoPlaceholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(180,200,210,.40);
}
.profilePhotoPlaceholder svg {
    width: 52px;
    height: 52px;
}

.defHeroPhoto2 {
    background-color: red;
    border-radius: var(--radius-lg);
    padding: 7px;
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: var(--shadow);
    background-color: rgba(210, 229, 230, 0.75) !important;
}
.card-Profil-home {
    z-index:3 !important;
    width:190px !important;
}
.blackops {
    font-family: "Black Ops One", system-ui, sans-serif;
}

.card--connected {
    margin-top: 14px;
}

.gainCard {
    margin: 12px 10px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 30, 38, 0.5);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 4 !important;
}

.gainCard__title {
    font-family: "Antonio", system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: .5px;
    margin-bottom: 10px;
    font-size: 24px;
    text-transform: uppercase;
    color: #d2e5e6;
    color: white;
}

.gainList {
    display: grid;
    gap: 10px;
}

.gainRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.06);
}

/* Ligne de gain cliquable → détail de la performance.
   On force la couleur héritée sur toutes les pseudo-classes de lien (sinon le bleu
   par défaut des liens s'applique au texte) + sur les enfants. */
a.gainRow,
a.gainRow:link,
a.gainRow:visited,
a.gainRow:hover,
a.gainRow:active {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

a.gainRow .gainGame,
a.gainRow .gainMeta,
a.gainRow .gainWhen {
    color: inherit;
}

a.gainRow:hover {
    background: rgba(255,255,255,.10);
    transform: translateX(2px);
}

.gainChevron {
    flex: 0 0 auto;
    margin-left: 2px;
    opacity: .5;
    font-size: 1.05rem;
}

.gainGame {
    font-weight: 700;
}

.gainMeta {
    opacity: .8;
    font-size: .92rem;
}

.gainValue.is-pos {
    color: #6EE7FF;
}

.gainValue.is-neg {
    color: #FF6E6E;
}

.gainWhen {
    opacity: .7;
    font-size: .85rem;
    text-align: right;
}

/* "toile" qui change selon CanvasKey */
.homeCanvas {
    margin-top: 12px;
    height: 110px;
    border-radius: 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
}

/* variations */
.homeCanvas--action {
    background: rgba(110,231,255,.10);
}

.homeCanvas--streak {
    background: rgba(255,211,110,.10);
}

.homeCanvas--challenge {
    background: rgba(160,110,255,.10);
}

/* Variante compacte (carte connectée par-dessus le hero).
   Hauteur pilotée par le contenu : min-height plancher, pas de max-height ni clip
   (sinon le texte long déborde / se superpose). */
.card.MinCard {
    min-height: 240px !important;
    max-height: none !important;
    overflow: visible;
    z-index: 2;
}

/* Carte connectée : titre/corps plus compacts (passe par-dessus le ballon) */
.card--connected .card__title {
    font-size: clamp(22px, 6.2vw, 30px);
    line-height: 1.1;
    margin-bottom: 8px;
    padding-top: 4px;
}
.card--connected .card__body {
    font-size: clamp(14px, 4.1vw, 19px);
    line-height: 1.28;
}

.Rank-home{
    font-size:36px;
    margin-bottom:10px !important;
    position:absolute;
}
.card-Profil-home {
    position: relative; /* référence pour le positionnement */
}
/* Badge ROOKIE */
.Rank-home {
    position: absolute;
    bottom: -3px; /* ← distance au-dessus de la card */
    left: 50%;
    transform: translateX(-50%);
    padding: 1px;
    border-radius: 2px;
    font-family: Antonio, sans-serif;
    font-size: 33px;
    text-align:center !important;
    letter-spacing: 1px;
    width:100% !important;
    background: #0f1e26; /* adapte à ton thème */
    color: white;
    z-index: 5; /* au-dessus de l’image */
    padding-top:1px !important;
    padding-bottom:2px !important;
}
.gpAvatarImg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* ---- AuthGuard : écran "non connecté" ---- */
.authGate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 24px;
}

.authGate__card {
    background: var(--bg1);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    max-width: 340px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.authGate__icon {
    font-size: 48px;
    line-height: 1;
}

.authGate__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.authGate__sub {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}

.authGate__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}