﻿html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

:root {
    --bg-dark: #111; /* fond sombre */
    --bg-card: #1e1e1e; /* cartes joueurs */
    --accent-red: #d32f2f; /* vote / élimination */
    --accent-yellow: #fbc02d; /* avertissements */
    --text-light: #eee; /* texte */
    --text-muted: #aaa; /* sous-texte */
    --text-on-light: #212529;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Roboto Condensed', sans-serif; /* lisible, "jeu" */
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ===== Blazor / erreurs ===== */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJod...==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ====== Tchat ====== */
.ps-chat-flyout {
    position: fixed;
    right: 16px;
    bottom: 72px;
    width: 380px;
    max-width: calc(100vw - 32px);
    z-index: 10010;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: .75rem;
    box-shadow: 0 10px 28px rgba(0,0,0,.2);
    overflow: hidden;
}

.ps-chat-body {
    height: 320px;
    padding: .25rem;
    overflow: auto;
}

.ps-chat-toolbar {
    display: flex;
    padding: .5rem;
    background: #fff;
    border-top: 1px solid #eee;
}

.ps-chat-fab {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 10015;
    border-radius: 999px;
    padding: .6rem 1rem;
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
}

/* Carte flyout */
.chat-flyout {
    width: min(420px, 96vw);
    max-height: min(640px, calc(var(--vvh, 100vh) - 24px));
    padding-right: env(safe-area-inset-right, 0);
    padding-top: env(safe-area-inset-top, 0);
}

@supports (height: 1dvh) {
    .chat-flyout {
        max-height: calc(85dvh - 16px - env(safe-area-inset-bottom, 0));
    }
}

.chat-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    max-height: inherit;
    overflow: hidden;
}

.chat-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* ====== Animations ====== */
@keyframes blink-soft {
    0%,100% {
        opacity: 1
    }

    50% {
        opacity: .35
    }
}

.blink {
    animation: blink-soft 1.2s linear infinite;
}

@keyframes bl {
    0% {
        opacity: 1
    }

    50% {
        opacity: .25
    }

    100% {
        opacity: 1
    }
}

.blink2 {
    animation: bl 1s linear infinite;
}

/* ====== UI Gamer Prime Suspect ====== */
.game-title {
    font-family: 'Special Elite', cursive;
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-light);
    text-align: center;
}

.btn-menu {
    display: block;
    width: min(320px, 92vw);
    margin: 12px auto;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-light);
    background: transparent;
    border: 2px solid var(--accent-red);
    border-radius: 10px;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

    .btn-menu:hover {
        background: var(--accent-red);
        transform: translateY(-1px);
        box-shadow: 0 8px 24px rgba(0,0,0,.35);
    }

    .btn-menu:active {
        transform: translateY(0);
    }

.texture-bg {
    background-image: radial-gradient(transparent 60%, rgba(255,255,255,.02) 61%), linear-gradient(0deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
    background-blend-mode: overlay;
}

.vote-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.vote-name {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-light);
    max-width: 120px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ====== Avatars (choix en modal) ====== */
.avatar-tile {
    position: relative;
    display: inline-block;
    border-radius: 50%;
    border: 2px solid transparent;
    line-height: 0;
    cursor: pointer;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}

    .avatar-tile:hover {
        transform: scale(1.06);
    }

    .avatar-tile.selected {
        border-color: var(--accent-red);
        box-shadow: 0 6px 18px rgba(0,0,0,.25);
    }

        .avatar-tile.selected::after {
            content: "✓";
            position: absolute;
            right: -4px;
            bottom: -4px;
            width: 24px;
            height: 24px;
            font-weight: 800;
            font-size: 14px;
            display: grid;
            place-items: center;
            color: #fff;
            background: var(--accent-red);
            border-radius: 50%;
            border: 2px solid #111;
        }

.avatar-choice {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    transition: transform 0.15s;
}

    .avatar-choice:hover {
        transform: scale(1.1);
    }

/* ===== Fix contraste sur surfaces claires ===== */
.card,
.card .card-header,
.card .card-body,
.modal-content,
.modal-header,
.modal-body,
.modal-footer,
.list-group-item,
.alert,
.table,
.bg-light,
.bg-light-subtle {
    color: var(--text-on-light) !important;
}

.form-label, .form-check-label, .form-text {
    color: var(--text-on-light) !important;
}

.form-check-input:checked + .form-check-label {
    font-weight: 600;
}

/* ===== Logo ===== */
.home-logo {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    display: block;
}
/* === Clamp du board de vote === */
.ps-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    align-items: start; /* évite l'étirement vertical */
}

/* === Feedback vote : hover + sélection === */

/* taille compacte (déjà posée), on ajoute les transitions/positionnement */
.vote-item {
    position: relative;
    width: 120px;
    justify-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    transition: transform .12s ease, box-shadow .15s ease, outline-color .15s ease, background .15s ease;
    border-radius: 14px;
    padding: 6px 6px 8px;
}

    /* Petit zoom de l’avatar au survol */
    .vote-item:hover :is(img, .pcard-avatar, .player-avatar, .vote-avatar) {
        transform: scale(1.06);
    }

    .vote-item :is(img, .pcard-avatar, .player-avatar, .vote-avatar) {
        width: 96px;
        height: 96px;
        max-width: 96px;
        max-height: 96px;
        border-radius: 50%;
        object-fit: cover;
        display: block;
        margin: 0 auto;
        transition: transform .12s ease;
    }

    /* État sélectionné : fond rouge subtil + halo */
    .vote-item.is-selected {
        background: linear-gradient(180deg, rgba(211,47,47,.18), rgba(211,47,47,.06));
        box-shadow: 0 8px 28px rgba(211,47,47,.25);
        outline: 2px solid rgba(211,47,47,.65);
        outline-offset: 2px;
    }

/* Badge ✓ (masqué par défaut, visible quand sélectionné) */
.vote-check {
    position: absolute;
    right: 4px;
    bottom: 22px; /* juste au-dessus du pseudo */
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-red);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    line-height: 22px;
    text-align: center;
    border: 2px solid #111;
    transform: scale(0);
    transition: transform .12s ease;
    pointer-events: none;
}

.vote-item.is-selected .vote-check {
    transform: scale(1);
}


/* Si PlayerCard est un <button> ou une <div>, on le force à la largeur de l'item */
.ps-grid .vote-item > :is(button, a, div) {
    width: 100%;
    max-width: 120px;
    box-sizing: border-box;
}

/* Contrainte générique sur l'image avatar rendue par PlayerCard */
.ps-grid .vote-item img {
    width: 96px;
    height: 96px;
    max-width: 96px;
    max-height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

/* Si le composant expose des classes d’avatar, on les rabat aussi */
.ps-grid .vote-item :is(.pcard-avatar, .player-avatar, .vote-avatar) {
    width: 96px !important;
    height: 96px !important;
    border-radius: 50%;
    object-fit: cover;
}

/* Nom affiché sous l’avatar (Option A) */
.vote-name {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-light);
    max-width: 120px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Évite qu’un style interne prenne plus que 120px */
.ps-grid .vote-item * {
    max-width: 120px;
    box-sizing: border-box;
}

/* Animation pulse */
@keyframes vote-pulse {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.15);
    }

    70% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

/* Quand un avatar est sélectionné → pulse */
.vote-item.is-selected :is(img, .pcard-avatar, .player-avatar, .vote-avatar) {
    animation: vote-pulse 0.35s ease;
}
/* État désactivé : non cliquable + atténué */
.vote-item.is-disabled {
    pointer-events: none;
    opacity: .55;
    filter: grayscale(.2);
}

/* --- Avatars compacts --- */
.mini-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    display: block;
}

.mini-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(180deg, #151515, #0b0b0b);
    border: 1px solid #2a2a2a;
    color: var(--text-light);
    flex: 0 0 auto;
}

/* --- Lobby chips (salle d’attente) --- */
.lobby-chip {
    width: 88px; /* fixe → grille fluide */
}

.chip-avatar, .chip-initials {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 6px;
}

.chip-initials {
    display: grid;
    place-items: center;
    font-weight: 900;
    background: linear-gradient(180deg, #1a1a1a, #0d0d0d);
    border: 1px solid #2a2a2a;
    color: var(--text-light);
}

.chip-name {
    max-width: 100%;
    font-size: .85rem;
    line-height: 1.1;
}
/* ===== MiniAvatar – taille fixe et contenu contraint ===== */
.miniavatar-root {
    position: relative;
    display: inline-block;
    overflow: hidden;
    border-radius: 50%;
    /* la taille vient inline via style="width:Npx;height:Npx" */
    flex: 0 0 auto; /* ne pas s'étirer dans les flex */
    line-height: 0; /* évite espaces fantômes */
}

.miniavatar-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover; /* recadrage propre dans le cercle */
    max-width: none; /* neutralise d'éventuels styles globaux */
}

.miniavatar-initials {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(180deg, #151515, #0b0b0b);
    border: 1px solid #2a2a2a;
    color: var(--text-light);
    font-weight: 800;
    font-size: 0.7rem; /* lisible pour 28px; ajuste si Size plus grand */
    user-select: none;
}

/* ===== Drawer Témoignage ===== */
/* Overlay derrière le drawer */
.ps-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.45);
    z-index: 1040;
    animation: fadeIn .25s ease;
}

/* Drawer latéral */
.ps-drawer {
    position: fixed;
    top: 0;
    right: -420px; /* caché par défaut */
    width: 400px;
    max-width: 92vw;
    height: 100%;
    background: #fff;
    color: var(--text-on-light);
    box-shadow: -4px 0 16px rgba(0,0,0,.35);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

    .ps-drawer.open {
        right: 0;
    }

.ps-drawer-header {
    flex: 0 0 auto;
    padding: .75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ps-drawer-body {
    flex: 1 1 auto;
    padding: 1rem;
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.ps-drawer-body.chat-body-offset {
    padding-bottom: 72px; /* 56px bouton + 16px marge */
}


.ps-announcement {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    font-size: 1.8rem;
    font-weight: 900;
    text-align: center;
    animation: pop 0.5s ease, fadeOut 0.5s ease 3.5s forwards;
}

    .ps-announcement.victory {
        background: linear-gradient(135deg, #28a745, #5cd65c);
        color: white;
        box-shadow: 0 0 25px rgba(40,167,69,.7);
    }

    .ps-announcement.penalty {
        background: linear-gradient(135deg, #d32f2f, #ff5252);
        color: white;
        box-shadow: 0 0 25px rgba(211,47,47,.7);
    }

    .ps-announcement.info {
        background: #444;
        color: #fff;
        box-shadow: 0 0 20px rgba(0,0,0,.5);
    }

    .ps-announcement.static {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
    }


@keyframes pop {
    0% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(-50%) scale(0.9);
    }
}

/* variables globales pour RecapModal */
:root {
    --bg: #0f1220;
    --panel: #181c2f;
    --panel-2: #1f2440;
    --muted: #9aa3b2;
    --line: #2a3155;
    --ok: #30c48d;
    --danger: #ff5c5c;
    --warn: #ffb74d;
    --text: #e9ecf5;
    --shadow: 0 10px 30px rgba(0,0,0,.35);
    --radius: 16px;
}

/* Optionnel : si d'autres overlays existent, garantir la superposition */
.recap-modal-backdrop {
    z-index: 2000;
}

/* Bouton orange, assorti à l'annonce "vous êtes appelés à voter" */
.btn-ps-orange {
    --ps-orange: #ff8c00; /* base */
    --ps-orange-dark: #ff7a00; /* hover */
    --ps-orange-darker: #e56e00; /* active */

    color: #fff;
    background-color: var(--ps-orange);
    border-color: var(--ps-orange);
}

    .btn-ps-orange:hover {
        color: #fff;
        background-color: var(--ps-orange-dark);
        border-color: var(--ps-orange-dark);
    }

    .btn-ps-orange:focus {
        color: #fff;
        background-color: var(--ps-orange-dark);
        border-color: var(--ps-orange-dark);
        box-shadow: 0 0 0 .25rem rgba(255,140,0,.35);
    }

    .btn-ps-orange:active,
    .btn-ps-orange.active {
        color: #fff;
        background-color: var(--ps-orange-darker);
        border-color: var(--ps-orange-darker);
    }

    .btn-ps-orange:disabled,
    .btn-ps-orange.disabled {
        color: #fff;
        background-color: #ffb266;
        border-color: #ffb266;
    }



/* Bandeau CTA orangé */
.ps-turn-cta {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .7rem;
    background: rgba(255,140,0,.12);
    box-shadow: 0 0 0 3px rgba(255,140,0,.25) inset, 0 6px 18px rgba(0,0,0,.08);
    line-height: 1.1;
}

.ps-turn-text {
    font-weight: 700;
    white-space: nowrap;
}

/* Flèche  */
.ps-arrow {
    flex: 0 0 auto;
    width: 56px;
    height: 28px; /* courte & épaisse */
    background: url("/images/fleche.png") center/contain no-repeat;
    filter: drop-shadow(0 0 1px rgba(255,140,0,.85));
    pointer-events: none;
    opacity: .98;
}

/* Bouton CTA mis en avant */
.ps-turn-cta .btn-cta {
    box-shadow: 0 4px 0 rgba(0,0,0,.15);
    transition: transform .08s, box-shadow .08s;
}

    .ps-turn-cta .btn-cta:active {
        transform: translateY(1px);
        box-shadow: 0 2px 0 rgba(0,0,0,.15);
    }

/* Mobile */
@media (max-width:576px) {
    .ps-arrow {
        width: 44px;
        height: 22px
    }
}

/* Override plus spécifique que .sidebar[b-xxxx] */
.page .sidebar.sidebar {

    background-image: linear-gradient(180deg, #0b0b0f 0%, #000000 100%);
/*
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
*/
    background-color: #000;
    box-shadow: inset -1px 0 0 #12121a;
}

/************************************   Side bar maison */


/* =========================
   Thème & variables globales
   ========================= */
:root {
    --bg: #0b0e12; /* fond global */
    --panel: #0f1318; /* panneaux */
    --line: #1a2129; /* séparateurs */
    --fg: #e7eef6; /* texte principal */
    --muted: #9fb0c2; /* texte atténué */
    --accent: #5aa9ff; /* bleu accent */
    --accent-soft: rgba(90,169,255,.18);
    --sw: 280px; /* largeur sidebar desktop */
    --th: 56px; /* hauteur topbar */
    --r: 14px; /* rayon arrondi */
    --shadow: 0 10px 40px rgba(0,0,0,.45);
}

/* =========================
   Anti-scroll horizontal + plein écran mobile
   ========================= */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* évite la barre horizontale */
    background: var(--bg);
}

/* Ces conteneurs ne doivent pas imposer de min-width */
.ps-app-shell, .ps-content, main {
    min-width: 0;
}

/* Les textes longs ne doivent pas pousser */
.ps-brand span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================
   Grille générale (layout)
   ========================= */
.ps-toggle { /* checkbox caché : contrôle menu */
    position: fixed;
    width: 1px;
    height: 1px;
    inset: -9999px;
    opacity: 0;
    pointer-events: none;
}

.ps-app-shell {
    display: grid;
    grid-template-columns: var(--sw) 1fr;
    grid-template-rows: var(--th) 1fr;
    grid-template-areas:
        "sidebar topbar"
        "sidebar main";
    min-height: 100dvh;
    background: var(--bg);
    color: var(--fg);
}

/* =========================
   Sidebar
   ========================= */
.ps-sidebar {
    grid-area: sidebar;
    position: sticky;
    top: 0;
    height: 100dvh;
    background: linear-gradient(180deg,#0e1116 0%,#0b0e12 100%);
    border-right: 1px solid var(--line);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform .25s ease, padding .2s ease;
    z-index: 20;
    /* Si Bootstrap est présent, re-thème à l’intérieur du sidebar */
    --bs-link-color: var(--fg);
    --bs-link-hover-color: #ffffff;
    --bs-body-color: var(--fg);
}

.ps-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700
}

.ps-logo {
    width: 28px;
    height: 28px;
    stroke: #8cc7ff;
    fill: none;
    stroke-width: 2;
    filter: drop-shadow(0 2px 8px rgba(90,169,255,.35))
}

.ps-logo-img {
    width: 28px;
    height: 28px
}

.ps-menu {
    display: flex;
    flex-direction: column;
    gap: 6px
}

/* Liens du menu (avec icône) */
.ps-sidebar .ps-menu a,
.ps-sidebar .ps-menu a:link,
.ps-sidebar .ps-menu a:visited {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r);
    color: var(--fg) !important;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid transparent;
    opacity: .95;
}

    .ps-sidebar .ps-menu a:hover {
        background: rgba(255,255,255,.06);
        color: #fff !important;
        opacity: 1;
    }

    .ps-sidebar .ps-menu a.active {
        background: var(--accent-soft);
        border-color: rgba(90,169,255,.35);
        box-shadow: 0 6px 22px rgba(90,169,255,.2);
        color: #fff !important;
    }

/* Icônes (héritent de la couleur du lien) */
.ps-ico {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    opacity: .95
}

.ps-section {
    margin-top: 6px;
    padding: 6px 12px;
    color: var(--muted);
    font-size: .9rem;
    border-top: 1px dashed var(--line)
}

.ps-form-logout {
    padding: 2px 6px
}

.ps-linkbtn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: var(--fg);
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
}

    .ps-linkbtn:hover {
        background: rgba(255,255,255,.06)
    }

.ps-footer {
    margin-top: auto;
    border-top: 1px dashed var(--line);
    padding-top: 10px;
    color: var(--muted)
}

/* =========================
   Content + Topbar
   ========================= */
.ps-content {
    grid-area: topbar / topbar / main / main;
    display: grid;
    grid-template-rows: var(--th) 1fr;
    min-width: 0;
}

.ps-topbar {
    grid-row: 1;
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    background: #0e1216cc;
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
    z-index: 10;
}

.ps-title {
    font-size: 16px;
    margin: 0
}

.ps-spacer {
    flex: 1
}

/* Burger = vrai “≡” (3 traits) */
.ps-burger {
    width: 38px;
    height: 38px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

    .ps-burger span {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--fg);
    }

main {
    grid-row: 2;
    padding: 16px
}

/* Backdrop pour le drawer mobile */
.ps-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 15;
}

/* =========================
   Desktop : mini-rail quand coché
   ========================= */
@media (min-width: 993px) {
    .ps-toggle:checked ~ .ps-app-shell {
        grid-template-columns: 76px 1fr;
    }

        .ps-toggle:checked ~ .ps-app-shell .ps-sidebar {
            padding-inline: 8px;
        }

        .ps-toggle:checked ~ .ps-app-shell .ps-brand span {
            display: none;
        }

        .ps-toggle:checked ~ .ps-app-shell .ps-section,
        .ps-toggle:checked ~ .ps-app-shell .ps-footer {
            display: none;
        }

        .ps-toggle:checked ~ .ps-app-shell .ps-menu a span {
            display: none;
        }

        .ps-toggle:checked ~ .ps-app-shell .ps-menu a {
            justify-content: center;
        }
}

/* =========================
   Mobile : drawer + anti-débordement + marges réduites
   ========================= */
@media (max-width: 992px) {
    .ps-app-shell {
        grid-template-columns: 1fr;
        grid-template-areas: "topbar" "main";
        overflow-x: hidden; /* ceinture + bretelles */
    }

    /* Réduire les marges latérales perçues */
    .ps-topbar {
        padding-left: 8px;
        padding-right: 8px;
    }

    .ps-content main {
        padding-left: 8px;
        padding-right: 8px;
    }

    .ps-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(86vw, var(--sw));
        max-width: 100vw; /* ne dépasse jamais le viewport */
        box-sizing: border-box; /* bordures incluses */
        transform: translate3d(-100%, 0, 0); /* hors écran sans impacter la mise en page */
        box-shadow: var(--shadow);
        border-right: none;
        border-inline-end: 1px solid var(--line);
        overflow-y: auto; /* scroll interne si menu long */
        overscroll-behavior: contain; /* évite l’élasticité qui “tire” la page */
    }

    /* Ouvert : menu visible + on bloque le scroll de la page */
    .ps-toggle:checked ~ .ps-app-shell .ps-sidebar {
        transform: translate3d(0, 0, 0);
    }

    .ps-toggle:checked ~ .ps-app-shell {
        overflow: hidden;
    }

        .ps-toggle:checked ~ .ps-app-shell .ps-backdrop {
            display: block;
        }

    /* “Bleed guard” Bootstrap : neutralise les gouttières négatives */
    .ps-content main .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

        .ps-content main .row > [class^="col-"],
        .ps-content main .row > [class*=" col-"] {
            padding-left: .75rem;
            padding-right: .75rem;
            box-sizing: border-box;
        }

    /* Contenus larges */
    .ps-content main img,
    .ps-content main video,
    .ps-content main canvas,
    .ps-content main .card,
    .ps-content main .table-responsive {
        max-width: 100%;
    }

    /* Boutons : jamais rognés */
    .ps-content main .btn {
        max-width: 100%;
    }
}

/* =========================
   Utilitaires
   ========================= */
.ps-no-bleed > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

    .ps-no-bleed > .row > [class^="col-"],
    .ps-no-bleed > .row > [class*=" col-"] {
        padding-left: .75rem;
        padding-right: .75rem;
    }

/* Safe areas iOS : utilise totalement les coins si présents */
@supports (padding: max(0px)) {
    .ps-topbar {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .ps-content main {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}
/* Bloc d’appel "À ton tour..." + bouton */
.ps-turn-cta {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap; /* permet le retour à la ligne sur mobile */
    max-width: 100%;
    overflow: hidden; /* rien ne dépasse du conteneur */
}

.ps-turn-text {
    flex: 1 1 auto; /* prend la place dispo */
    min-width: 0; /* autorise le shrink */
}

/* Flèche simple, non positionnée (évite tout débordement) */
.ps-arrow {
    position: static !important; /* au cas où tu l’avais en absolute */
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 8px solid currentColor;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    opacity: .9;
}

/* Bouton : reste compact, sans forcer la ligne à déborder */
.btn-cta {
    flex: 0 0 auto;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Mobile : le bouton passe pleine largeur si besoin (jamais rogné) */
@media (max-width:576px) {
    .btn-cta {
        width: 100%;
    }

    .ps-turn-cta {
        gap: .5rem;
    }
}

/* Sécurité supplémentaire : neutralise les saignements de .row sous ce bloc */
.ps-no-bleed > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

    .ps-no-bleed > .row > [class^="col-"],
    .ps-no-bleed > .row > [class*=" col-"] {
        padding-left: .75rem;
        padding-right: .75rem;
        box-sizing: border-box;
    }
/* Blink doux, compatible perf */
@keyframes ps-blink {
    0%, 60%, 100% {
        opacity: 1;
    }

    30% {
        opacity: .35;
    }
}

.blink2 {
    animation: ps-blink 1.4s ease-in-out infinite;
    will-change: opacity;
}
/* Respecte l’accessibilité : désactive si l’utilisateur réduit les animations */
@media (prefers-reduced-motion: reduce) {
    .blink2 {
        animation: none;
    }
}


/******************* F I N    Side bar maison */
