/* ===================================
   VARIABLES & RESET
=================================== */

:root {
    --green: #2E7D32;
    --terracotta: #C96A3D;
    --yellow: #EFCB2F;
    --background: #F8F7F4;
    --card: #FFFFFF;
    --text: #1F2937;
    --text-light: #6B7280;
    --border: #E5E7EB;
    --radius: 18px;
    --shadow: 0 8px 30px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
}

a { text-decoration: none; }

ul { list-style: none; }

/* ===================================
   TOPBAR
=================================== */

.topbar {
    background: white;
    border-bottom: 1px solid var(--border);
}

.topbar-container {
    max-width: 1280px;
    margin: auto;
    padding: 12px 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.topbar a {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
    transition: .2s;
}

.topbar a:hover { color: var(--green); }

/* ===================================
   NAVBAR
=================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.navbar-container {
    max-width: 1280px;
    margin: auto;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--green);
}

.brand-name span { color: var(--terracotta); }
.brand-logo { width: 34px; height: 34px; flex: none; display: block; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text);
    font-weight: 600;
    transition: .2s;
}

.nav-links a:hover { color: var(--green); }

.cta-button {
    background: var(--green);
    color: white !important;
    padding: 10px 18px;
    border-radius: 12px;
}

.cta-button:hover { background: #246428; }

.mobile-menu-btn {
    display: none;
    border: none;
    background: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* ===================================
   HERO
=================================== */

.hero {
    max-width: 1280px;
    margin: auto;
    padding: 40px 20px 20px;
}

.hero-card {
    background: linear-gradient(135deg, var(--green), var(--terracotta));
    border-radius: 24px;
    color: white;
    padding: 40px;
    box-shadow: var(--shadow);
}

.hero-card h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.hero-card p {
    max-width: 700px;
    line-height: 1.6;
    opacity: 0.95;
}

/* ===================================
   LAYOUT
=================================== */

.content {
    max-width: 1280px;
    margin: auto;
    padding: 24px 20px 40px;
}

.card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

footer {
    margin-top: 50px;
    border-top: 1px solid var(--border);
    background: white;
}

.footer-container {
    max-width: 1280px;
    margin: auto;
    padding: 24px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* ===================================
   FIND PLAYER PAGE
=================================== */

.find-player-page { width: 100%; }

.player-distance{
    color:#666;
    font-size:13px;
    margin:6px;
}

.player-badges{
    display:flex;
    gap:6px;
    margin-top:8px;
    flex-wrap:wrap;
}

.badge-coach{
    padding:4px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
}

.badge-sparring{
    padding:4px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
}

.blurred-content{
    filter: blur(15px);
    user-select:none;
    pointer-events:none;
    opacity:60%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.page-header p {
    margin: 0;
    opacity: 0.75;
}

.btn-create-club {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 12px 22px;

    background: var(--terracotta);
    color: white;

    border-radius: 12px;

    font-weight: 600;
    text-decoration: none;

    transition: all 0.2s ease;

    white-space: nowrap;
}


.btn-create-club:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}


@media(max-width: 700px) {

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-create-club {
        width: 100%;
        justify-content: center;
    }

}

/* ===================================
   MAP
=================================== */

.map {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.map-wrapper--large {
    height: 75vh;
}

.map-wrapper--small {
    height: 40vh;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.map-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}
.map-btn {
    background: var(--green);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: .2s;
}
.map-btn:hover {
    background: #246428;
    transform: translateY(-2px);
}

.map-wrapper {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.view-container { position: relative; }

.view-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 900;
}

.view-switch button {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: white;
    padding: 12px 20px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
    transition: .25s;
}

.view-switch button:hover { transform: translateY(-2px); }

/* ===================================
   LEAFLET
=================================== */

.leaflet-popup-content-wrapper { border-radius: 18px; }

.leaflet-popup-content { font-family: Inter, sans-serif; }

.leaflet-control-zoom a { border-radius: 8px !important; z-index: 900 !important; }

.leaflet-top,
.leaflet-bottom { z-index: 800; }

/* ===================================
   PLAYERS GRID & CARD
=================================== */

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.player-card {
    background: white;
    border-radius: 24px;
    padding: 20px;
    display: flex;
    gap: 16px;
    color: inherit;
    box-shadow: var(--shadow);
    transition: .25s;
    position:relative;
}
.card-overlay{
    position:absolute;
    inset:0;
    background:rgba(255,255,255,.75);
    backdrop-filter:blur(2px);

    display:flex;
    align-items:center;
    justify-content:center;

    font-weight:700;
    color:#333;
    border-radius:16px;
}
.guest-banner{
    background: linear-gradient(135deg,#0f172a,#1e293b);
    color:white;
    padding:30px;
    border-radius:20px;
    text-align:center;
    margin-bottom:25px;
    box-shadow:0 10px 30px rgba(0,0,0,.15);
}

.guest-banner h2{
    margin:0 0 10px;
    font-size:28px;
    font-weight:700;
}

.guest-banner p{
    margin:0 0 20px;
    opacity:.9;
    font-size:15px;
}

.guest-banner .btn-register{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:#22c55e;
    color:white;
    text-decoration:none;
    padding:12px 24px;
    border-radius:999px;
    font-weight:700;
    transition:.2s;
}

.guest-banner .btn-register:hover{
    background:#16a34a;
    transform:translateY(-2px);
}

.guest-banner .players-count{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin-top:15px;
    padding:8px 14px;
    border-radius:999px;
    background:rgba(255,255,255,.15);
    font-size:14px;
}
.player-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 35px rgba(0,0,0,.08);
}

.player-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--terracotta));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.player-content { flex: 1; }

.player-content h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text);
}
.player-content h3 a {
    color: inherit;
    text-decoration: none;
}

.player-content h3 a:hover {
    text-decoration: underline;
}

.player-affiliation {
    color: var(--text-light);
    margin-bottom: 10px;
}

.player-ranking {
    display: inline-block;
    background: var(--yellow);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
}

.player-email {
    color: var(--text-light);
    font-size: .9rem;
}

/* ===================================
   PLAYER DETAIL
=================================== */

.profile-page {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

.profile-card {
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom:24px;
}

.profile-header {
    display: flex;
    gap: 24px;
    align-items: center;
}

.profile-avatar img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 8px 30px rgba(0,0,0,.10);
}

.avatar-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--green), var(--terracotta));
    color: white;
}

.profile-identity { flex: 1; }

.profile-identity h1 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.ranking-badge {
    display: inline-block;
    background: var(--yellow);
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    margin-bottom: 12px;
}

.subscription-badge {
    display: inline-block;
    font-weight: 700;
    margin-bottom: 12px;
}


.club-name {
    color: var(--text-light);
    font-size: 1rem;
}

.card-link:hover {
    transform: translateY(-2px);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-sidebar {
    top: 100px;
}

/* ===================================
   BUTTONS
=================================== */

.btn-primary {
    background: var(--green);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 700;
    position: relative;
}

.btn-primary:hover { opacity: .9; }

.btn-primary-btn{
    background: var(--green);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 700;
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: .2s;
}
.btn-primary-btn:hover {
    opacity: .9;
}

.btn-secondary {
    background: var(--terracotta);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 700;
}

.btn-secondary:hover {
    opacity: .9;
}

.btn-ter{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    background:linear-gradient(
        135deg,
        var(--green),
        var(--terracotta)
    );
    color:white;
    padding:12px 20px;
    border-radius:12px;
    font-weight:700;
    border:none;
    cursor:pointer;
    margin-top:10px;
    transition:.2s;
}

.btn-ter:hover {
    background: #256728;
    transform: translateY(-2px);
    opacity: .9;
}


    .edit-icon{
        display:flex;
        align-items:center;
        justify-content:center;
        width:36px;
        height:36px;
        border-radius:50%;
        background:#f8fafc;
        border:1px solid var(--border);
        color:var(--text);
        text-decoration:none;
        transition:.2s;
    }

    .edit-icon:hover{
        background:var(--green);
        color:white;
        transform:scale(1.05);
    }

    .create-icon{
        display:flex;
        align-items:center;
        justify-content:center;
        width:36px;
        height:36px;
        border-radius:50%;
        background:#f8fafc;
        border:1px solid var(--border);
        color:var(--text);
        text-decoration:none;
        transition:.2s;
    }

    .create-icon:hover{
        background:var(--terracotta);
        color:white;
        transform:scale(1.05);
    }


.load-more-container {
    width:100%;
}

.btn-danger {
    display: inline-block;
    background: #d32f2f;
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 700;
    transition: .2s;
}

.btn-danger:hover {
    background: #b71c1c;
    transform: translateY(-2px);
}

.btn-auth {
    width: 100%;
    border: none;
    background: linear-gradient(135deg, var(--green), var(--terracotta));
    color: white;
    padding: 16px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: .2s;
}

.btn-auth:hover {
    background: #256728;
    transform: translateY(-2px);
}

/* ===================================
   INFO CARDS
=================================== */

.info-card {
    margin-bottom: 24px;
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.info-card h2 {
    margin-bottom: 20px;
    font-size: 1.25rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-item {
    background: #f8f8f8;
    padding: 16px;
    border-radius: 16px;
}

.info-item span {
    display: block;
    color: var(--text-light);
    font-size: .85rem;
    margin-bottom: 6px;
}

.info-item strong { color: var(--text); }

.player-description {
    line-height: 1.8;
    color: var(--text);
}

/* ===================================
   AUTH
=================================== */

.auth-page {
    min-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px 20px;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: 28px;
    padding: 40px;
    box-shadow: var(--shadow);
    margin-top:15px;
}

.auth-card-large { max-width: 700px; }

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--green), var(--terracotta));
    color: white;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-light);
    line-height: 1.6;
}

.auth-form p { margin-bottom: 20px; }

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 14px;
    font-size: 1rem;
    transition: .2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(46,125,50,.12);
}

.auth-links {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.auth-links a {
    color: var(--green);
    font-weight: 600;
}

.auth-links a:hover { text-decoration: underline; }

.auth-errors {
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 12px;
    background: #fff3f3;
    color: #d32f2f;
    font-size: .9rem;
}

/* ===================================
   FORMS
=================================== */

.form-page {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* CARD */
.form-card {
    width: 100%;
    max-width: 650px;
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.form-card h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text);
}

/* GROUP */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

/* INPUTS */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #dcdcdc;
    border-radius: 14px;
    background: white;
    font-size: 1rem;
    transition: .2s;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* FOCUS */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(46,125,50,.12);
}

/* SPECIAL INPUTS */
.form-group input[type="file"] {
    padding: 12px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}
.form-group > label {
    display : flex;
    margin-bottom: 8px;
}

.checkbox-card{
    display:flex;
    align-items:center;
    gap:12px;

    padding:14px 18px;

    background:#f8f8f8;
    border-radius:12px;

    cursor:pointer;
}

.checkbox-card span{
    display:flex;
    align-items:center;
    gap:8px;
    font-weight:600;
}

/* HELP TEXT */
.field-help {
    margin-top: 6px;
    color: var(--text-light);
    font-size: .85rem;
}

/* ERRORS */
.field-error {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff1f1;
    color: #d32f2f;
    font-size: .9rem;
} */

.full-width {
    width: 100%;
}

/* ===================================
   PHOTO UPLOAD
=================================== */

.photo-upload {
    margin-bottom: 30px;
    text-align: center;
}

.photo-preview {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.photo-upload input[type="file"] {
    border: 1px dashed #d6d6d6;
    background: #fafafa;
    padding: 14px;
    border-radius: 14px;
    width: 100%;
}

/* ===================================
   SETTINGS
=================================== */

.settings-links {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-link {
    background: #f8f8f8;
    padding: 14px 18px;
    border-radius: 14px;
    color: var(--text);
    font-weight: 600;
    transition: .2s;
}

.settings-link:hover { background: #f0f0f0; }

.danger-zone {
    margin-top: 32px;
    border: 1px solid #ffd6d6;
    background: #fff8f8;
    border-radius: 20px;
    padding: 24px;
}

.danger-zone h3 {
    color: #c62828;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.danger-zone p {
    color: var(--text-light);
    margin-bottom: 18px;
    line-height: 1.6;
}
.review-modal {
    max-width: 600px;
    padding: 15px;
}

/* Champ "Note" dans le formulaire (renommé pour ne plus entrer en conflit) */
.rating-field {
    margin-bottom: 20px;
}

.rating-field > label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.review-card {
    background: white;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

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

.review-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.review-rating {
    color: #fbbf24;
    font-size: 1.1rem;
}

.review-comment {
    color: #374151;
    line-height: 1.5;
}

.review-date {
    margin-top: 10px;
    color: #9ca3af;
    font-size: .85rem;
}

.rating-summary {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fbbf24;
}

.rating-summary span {
    color: #6b7280;
    font-size: 1rem;
    font-weight: 400;
}

/* Pills de sélection de note dans le formulaire */
.stars-group #id_rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

.stars-group #id_rating > div {
    margin: 0;
}

.stars-group label {
    font-size: 32px;
    line-height: 1;
    color: #e0e0e0;
    cursor: pointer;
    transition: color 0.15s, transform 0.1s;
    display: inline-block;
}

.stars-group label:hover {
    transform: scale(1.15);
}

.stars-group label::before {
    content: "★";
}

.stars-group input[type="radio"] {
    display: none;
}

/* survol : colore le div survolé + tous les div frères précédents (visuellement, à gauche grâce à row-reverse) */
.stars-group #id_rating > div:hover label,
.stars-group #id_rating > div:hover ~ div label {
    color: #fbbf24;
}

/* sélection validée, seulement si on ne survole pas le groupe */
.stars-group #id_rating:not(:hover) > div:has(input:checked) label,
.stars-group #id_rating:not(:hover) > div:has(input:checked) ~ div label {
    color: #fbbf24;
}

.review-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 12px;
    resize: vertical;
    font-family: inherit;
}

.review-submit {
    margin-top: 20px;
    width: 100%;
}
.dashboard-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(450px,1fr));
    gap:20px;
}

.dashboard-card{
    background:white;
    border-radius:18px;
    padding:20px;
    box-shadow:0 2px 10px rgba(0,0,0,.05);
}

.dashboard-card.cancelled{
    border-left:5px solid #ef4444;
}

.calendar-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}

.calendar-wrapper {
    background: white;
    border-radius: 24px;
    padding: 16px;
    box-shadow: var(--shadow);
}

/* =========================
   CALENDAR MODAL
========================= */

.calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 2000;
}

.calendar-modal-content {
    background: white;
    padding: 24px;
    border-radius: 20px;
    width: 300px;
    text-align: center;
    box-shadow: var(--shadow);
}

.calendar-modal-content h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 800;
}

.calendar-modal-content button {
    width: 100%;
    margin: 6px 0;
    padding: 10px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}

.match-details-overlay{
    display:none;
    position:fixed;
    inset:0;
    z-index:9999;
    align-items:center;
    justify-content:center;
    padding:20px;
    background:rgba(15,23,42,.5);
}

.match-details-visible{
    display:flex;
}

.match-details-panel{
    position:relative;
    width:min(100%,500px);
    padding:28px;
    border-radius:20px;
    background:#fff;
    box-shadow:0 20px 60px rgba(0,0,0,.25);
    text-align:left;
}

.match-details-close{
    position:absolute;
    top:16px;
    right:16px;
    width:34px;
    height:34px;
    border:0;
    border-radius:50%;
    background:#f3f4f6;
    color:#374151;
    font-size:18px;
    cursor:pointer;
}

.match-details-heading{
    padding-right:45px;
    padding-bottom:20px;
    border-bottom:1px solid #e5e7eb;
}

.match-details-kicker{
    display:block;
    margin-bottom:6px;
    color:#6b7280;
    font-size:.8rem;
    font-weight:700;
    text-transform:uppercase;
}

.match-details-heading h3{
    margin:0 0 12px;
    color:#1f2937;
    font-size:1.5rem;
    text-align:left;
}

.match-details-status{
    display:inline-block;
    padding:6px 10px;
    border-radius:20px;
    background:#e8f5e9;
    color:#2e7d32;
    font-size:.75rem;
    font-weight:700;
}

.match-details-opponent{
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:22px 0;
}

.match-details-opponent span,
.match-details-item span{
    color:#6b7280;
    font-size:.8rem;
    font-weight:600;
}

.match-details-opponent strong{
    color:#1f2937;
    font-size:1.2rem;
}

.match-details-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:12px;
    margin-bottom:24px;
}

.match-details-item{
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:14px;
    border-radius:12px;
    background:#f8fafc;
}

.match-details-item strong{
    color:#1f2937;
    font-size:.95rem;
}

.match-details-location{
    grid-column:1/-1;
}

#matchDetailsCloseButton{
    width:100%;
}

/* Event button */
#createEvent {
    background: var(--green);
    color: white;
}

#createEvent:hover {
    background: #246428;
}

/* Availability button */
#createAvailability {
    background: var(--terracotta);
    color: white;
}

#createAvailability:hover {
    background: #a8552f;
}

.availability-grid{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.availability-row{
    display:grid;
    grid-template-columns:
        100px
        1fr
        30px
        1fr
        140px
        40px; /* bouton reset */

    align-items:center;
    gap:12px;
}

.availability-row label{
    margin:0;
    font-weight:600;
}

.availability-row input[type="checkbox"]{
    width:20px;
    height:20px;
}

.availability-row input[type="time"]{
    width:100%;
}


.all-day-toggle{
    display:flex;
    align-items:center;
    gap:8px;

    padding:8px 14px;

    background:#f8fafc;
    border:1px solid var(--border);
    border-radius:10px;

    font-size:.85rem;
    font-weight:600;

    cursor:pointer;
    white-space:nowrap;
}

.all-day-toggle:hover{
    border-color:var(--green);
    background:#f0fdf4;
}

.all-day-toggle input{
    width:18px;
    height:18px;
    cursor:pointer;
    margin:0;
}

.time-picker{
    width:100%;
    height:42px;
    border:1px solid var(--border);
    border-radius:10px;
    padding:0 10px;
}

.time-separator{
    font-weight:700;
    color:var(--text-light);
}
.availability-reset{
    width:40px;
    height:40px;

    display:flex;
    align-items:center;
    justify-content:center;

    border:none;
    border-radius:10px;

    background:#fef2f2;
    color:#dc2626;

    cursor:pointer;
    transition:.2s;
}

.availability-reset:hover{
    background:#dc2626;
    color:white;
}

.availabilities-summary{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:15px;
}

.availability-badge{
    display:flex;
    align-items:center;
    gap:6px;

    padding:10px 14px;

    background:#f8fafc;
    border:1px solid var(--border);
    border-radius:999px;

    font-size:.9rem;
}

.availability-badge strong{
    color:var(--green);
}

.empty-availability{
    color:var(--text-light);
    font-style:italic;
}
/* Cancel */
#closeModal {
    background: #eee;
}

#closeModal:hover {
    background: #ddd;
}

/* =========================
   FULLCALENDAR COMPACT UI
========================= */

.fc {
    font-size: 0.85rem;
}

/* HEADER (mois + boutons) */
.fc .fc-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.fc .fc-toolbar-title {
    font-size: 1.1rem !important;
    font-weight: 800;
    color: var(--text);
}

/* BUTTONS */
.fc .fc-button {
    background: white !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
    box-shadow: none !important;
    text-transform: none !important;
}

.fc .fc-button:hover {
    background: #f5f5f5 !important;
}

/* active button */
.fc .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--green) !important;
    color: white !important;
    border-color: var(--green) !important;
}

/* GRID spacing */
.fc .fc-daygrid-day-number {
    font-size: 0.8rem;
}

.fc .fc-col-header-cell-cushion {
    font-size: 0.85rem;
    font-weight: 600;
}
.fc-event-title,
.fc-list-event-title,
.fc-event-main {
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: break-word;
}
.fc-daygrid-event-harness{
    margin-bottom:2px;
}

.fc-daygrid-event{
    white-space: normal !important;
}

.fc-event-title{
    line-height:1.2;
}
.fc-list-event-title{
    white-space: normal !important;
    line-height:1.3;
}
/* FullCalendar container */
#calendar {
    max-width: 100%;
}

/* ===================================
   FILTERS
=================================== */

.filters-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.filters-header {
    margin-bottom: 24px;
}

.filters-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
}

/* ===================================
   GRID
=================================== */

.filters-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit,minmax(240px,1fr));
    gap: 20px;
}

.filter-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-block label {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-light);
}

/* ===================================
   CHIPS
=================================== */

.btn-group-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    border: none;
    background: #f4f4f4;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: .2s;
}

.filter-btn:hover {
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--green);
    color: white;
}

/* ===================================
   INPUTS
=================================== */

.filter-block input,
.filter-block select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 14px;
    background: white;
    font-size: .95rem;
}

.filter-block input:focus,
.filter-block select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow:
        0 0 0 4px rgba(46,125,50,.10);
}
input[type="time"] {
    width: 90%;
    box-sizing: border-box;
}

.range-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ===================================
   ACTIONS
=================================== */

.filters-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.filters-actions button {
    width: auto;
    flex: 0 0 auto;
}

.btn-search {
    border: none;
    background:
        linear-gradient(
            135deg,
            var(--green),
            var(--terracotta)
        );
    color: white;
    padding: 14px 22px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-reset {
    border: none;
    background: #f3f3f3;
    padding: 14px 22px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-reset:hover {
    background: #e9e9e9;
}

/* ===================================
   CHAT
=================================== */

/* ===========================
   MESSENGER
=========================== */

.messenger-page {
    height: calc(100vh - 150px);
    display: flex;
    background: var(--background);
}

.messenger-container {
    width: 100%;
    height: 100%;
    display: flex;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* SIDEBAR */
.messenger-sidebar {
    width: 300px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.messenger-sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.messenger-sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.new-btn {
    width: 100%;
    padding: 10px;
    border: none;
    background: var(--green);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: .2s;
}

.new-btn:hover { background: #246428; }

/* CONVERSATIONS */
.conversations {
    flex: 1;
    overflow-y: auto;
}

.conversation.unread .conv-name,
.conversation.unread .conv-msg {
    font-weight: bold;
}

.conv {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid #f3f4f6;
    transition: .15s;
}

.conv:hover { background: #f9fafb; }

.conv.active { background: #f0fdf4; border-left: 3px solid var(--green); }

.conv-name { font-weight: 600; margin-bottom: 4px; }

.conv-msg { font-size: 12px; color: var(--text-light); }

/* CHAT */
.chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    min-width: 0;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--terracotta));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.chat-header-name {
    font-weight: 700;
    color: var(--text);
}

/* MESSAGES */
.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.conv-date{
    font-size:.75rem;
    color:var(--text-light);
    margin-top:2px;
}

.msg-row{
    display:flex;
    flex-direction:column;
    margin-bottom:12px;
}

.msg-row.sent{
    align-items:flex-end;
}

.msg-row.received{
    align-items:flex-start;
}

.message-date{
    margin-top:4px;
    font-size:.75rem;
    color:#9ca3af;
    padding:0 6px;
}

.bubble {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: .95rem;
    line-height: 1.5;
}

.sent .bubble {
    background: var(--green);
    color: white;
    border-bottom-right-radius: 4px;
}

.received .bubble {
    background: white;
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

/* FORM */
.chat-form {
    display: flex;
    padding: 12px 16px;
    gap: 10px;
    background: white;
    border-top: 1px solid var(--border);
}

.chat-form textarea {
    flex: 1;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 10px 14px;
    resize: none;
    height: 44px;
    font-family: 'Inter', sans-serif;
    font-size: .95rem;
    transition: .2s;
}

.chat-form textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(46,125,50,.1);
}

.send-btn {
    background: var(--green);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}

.send-btn:hover { background: #246428; }

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1rem;
}

/* MODAL */
.custom-modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.5);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    z-index:9999;
}

.custom-modal-content{
    width:100%;
    max-width:550px;

    max-height:90vh;
    overflow-y:auto;

    background:white;
    border-radius:20px;
    box-shadow:0 20px 60px rgba(0,0,0,.25);
}
#gameModal select,
#gameModal input{
    width:100%;
}

#gameModal select[multiple]{
    min-height:100px;
    max-height:140px;
}

.custom-modal.hidden { display: none; }

.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-search {
    margin: 14px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: .95rem;
    width: calc(100% - 28px);
    transition: .2s;
}

.modal-search:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(46,125,50,.1);
}

.modal-results {
    padding: 0 14px 14px;
    overflow-y: auto;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: .9rem;
}

.player-result-btn {
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: #f8f8f8;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
    transition: .15s;
}
.conv {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-result-btn:hover { background: #f0fdf4; color: var(--green); }

.chat-header-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    transition: .2s;
}

.chat-header-link:hover {
    color: var(--green);
}

.chat-header {
    padding: 14px 20px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.back-btn {
    color: var(--text);
    font-size: 1.2rem;
    padding: 4px 12px 4px 0;
    text-decoration: none;
    transition: .2s;
    flex-shrink: 0;
}

.back-btn:hover { color: var(--green); }
.btn-propose-game {
    margin-top: 12px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: var(--terracotta);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}

.btn-propose-game:hover {
    opacity: .9;
    transform: translateY(-1px);
}
.game-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.game-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: .85rem;
    transition: .2s;
}

.game-btn.accept { background: #dcfce7; color: #16a34a; }
.game-btn.accept:hover { background: #16a34a; color: white; }

.game-btn.decline { background: #fee2e2; color: #dc2626; }
.game-btn.decline:hover { background: #dc2626; color: white; }

.game-btn.counter { background: #fef3c7; color: #d97706; }
.game-btn.counter:hover { background: #d97706; color: white; }

.game-card-status{
    padding:6px 12px;
    border-radius:999px;
    font-size:.8rem;
    font-weight:700;
    flex-shrink:0;
    text-align:center;
}

/* Planifié */
.status-planned{
    background:#dbeafe;
    color:#1d4ed8;
}

/* En cours */
.status-inprogress{
    background:#dcfce7;
    color:#15803d;
}

/* Terminé */
.status-finished{
    background:#f3f4f6;
    color:#4b5563;
}

/* Annulé */
.status-cancelled{
    background:#fee2e2;
    color:#b91c1c;
}

/* En attente de confirmation */
.status-tobeconfirmed{
    background:#fef3c7;
    color:#b45309;
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--terracotta);
    color: white;
    font-size: .7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8f8f8;
    border-radius: 16px;
    padding: 16px;
    transition: .2s;
}

.game-card:hover {
    background: #f0fdf4;
    transform: translateX(4px);
}

.game-card-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--green);
    color: white;
    border-radius: 12px;
    flex-shrink: 0;
}

.game-day {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
}

.game-month {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.game-card-content {
    flex: 1;
    min-width: 0;
}

.game-players {
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.game-players a {
    color: var(--text);
    transition: .2s;
}

.game-players a:hover { color: var(--green); }

.game-vs {
    margin: 0 8px;
    color: var(--text-light);
    font-weight: 400;
}

.game-meta {
    display: flex;
    gap: 12px;
    font-size: .85rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.game-card-status {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.status-tobeconfirmed {
    background: #fef3c7;
    color: #d97706;
}

.status-inprogress {
    background: #dcfce7;
    color: #16a34a;
}

.status-played {
    background: #e0f2fe;
    color: #0284c7;
}

.status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}
.game-btn.score {
    background: #ede9fe;
    color: #7c3aed;
}

.game-btn.score:hover {
    background: #7c3aed;
    color: white;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 16px;
    transition: .2s;
}

.section-header h2{
    margin:0;
}

.section-card{
    background:#fff;
    border-radius:16px;
    padding:24px;
    box-shadow:0 4px 16px rgba(0,0,0,.06);
    margin-bottom:20px;
}


.section-header:hover h2 { color: var(--green); }
.preferences-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.preference-line{
    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:12px 16px;

    border:1px solid var(--border);
    border-radius:12px;

    background:white;
}

.preference-line span{
    display:flex;
    align-items:center;
    gap:10px;

    color:var(--text-light);
    font-size:.9rem;
}

.preference-line strong{
    color:var(--text);
    font-weight:700;
}

.section-actions{
    margin-top:20px;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.empty-state p {
    margin: 0;
    flex: 1;
}

.empty-icon{
    font-size:2rem;
    margin-bottom:10px;
}

.toggle-arrow {
    font-size: .9rem;
    color: var(--text-light);
    transition: .2s;
}
.gender-select ul {
    list-style: none;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0;
    margin-top: 8px;
}

.gender-select li {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f8f8;
    padding: 12px 18px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: .2s;
}

.gender-select li:has(input:checked) {
    border-color: var(--green);
    background: #f0fdf4;
}

.gender-select input[type="radio"] {
    accent-color: var(--green);
    width: 16px;
    height: 16px;
}

.type-btn {
    padding: 10px 16px;
    border: 2px solid var(--border);
    background: #f8f8f8;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}

.type-btn.active {
    border-color: var(--green);
    background: #f0fdf4;
    color: var(--green);
}

.type-btn:hover {
    border-color: var(--green);
}

.filters-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #374151;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.filters-toggle-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.filters-toggle-btn i {
    font-size: 15px;
}

.filters-card.collapsed .filters-toggle-btn {
    margin-bottom: 0;
}

.courts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.court-card {
    background: rgba(0,0,0,0.03);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(0,0,0,0.08);
    transition: opacity .2s ease;
}

.court-card--deleted {
    opacity: 0.45;
}

.court-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.court-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.section-description {
    margin-top: 5px;
    opacity: 0.7;
}


/* OPTIONS DU TERRAIN */

.court-options {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.08);
}


/* LIGHTING SWITCH */

.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.switch-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    width: 46px;
    height: 24px;
    background: #ccc;
    border-radius: 20px;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    transition: .25s;
}

.switch-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: .25s;
}

.switch-label input[type="checkbox"]:checked + .switch-slider {
    background: #2ecc71;
}

.switch-label input[type="checkbox"]:checked + .switch-slider::before {
    transform: translateX(22px);
}

.switch-text {
    white-space: nowrap;
}



/* DELETE */

.delete-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: #e74c3c;
    font-weight: 600;
}

.delete-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.delete-toggle span {
    padding: 8px 14px;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    transition: .2s;
}

.delete-toggle:hover span {
    background: rgba(231, 76, 60, 0.1);
}

.delete-toggle input[type="checkbox"]:checked + span {
    background: #e74c3c;
    color: white;
}


/* CACHE LES CHAMPS TECHNIQUES DU FORMSET */

.court-card input[type="hidden"] {
    display: none;
}



/* MOBILE */

@media(max-width: 700px) {

    .form-grid {
        grid-template-columns: 1fr;
    }

    .court-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

}
/* ===================================
   RESPONSIVE (≤ 900px)
=================================== */

@media (max-width: 900px) {

    /* NAVBAR */
    .navbar-container { flex-wrap: wrap; }
    .mobile-menu-btn { display: block; }
    .nav-links {
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid var(--border);
    }
    .nav-links.active { display: flex; }

    /* TOPBAR */
    .topbar-container { justify-content: center; flex-wrap: wrap; }

    /* HERO */
    .hero-card { padding: 28px; }
    .hero-card h1 { font-size: 1.8rem; }

    /* MAP */
    #map { height: 100%; }
    .page-header h1 { font-size: 1.8rem; }

    /* PLAYERS GRID */
    .players-grid { grid-template-columns: 1fr;     width: 100%;
    max-width: 100%;}
    .player-card { padding: 16px; flex-wrap: wrap; }

    /* PROFILE */
    .profile-page { grid-template-columns: 1fr; row-gap:0px; }
    .profile-sidebar { position: static; }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-actions { width: 100%; }
    .info-grid { grid-template-columns: 1fr; }
    .profile-avatar img,
    .avatar-placeholder { width: 120px; height: 120px; text-align:center;}
    .profile-identity h1 { font-size: 1.6rem; }

    /* AUTH */
    .auth-card { padding: 28px; }
    .auth-header h1 { font-size: 1.7rem; }
    .auth-logo { width: 70px; height: 70px; }
    .auth-card-large { padding: 24px; }

    /* FORMS */
    .form-group input,
    .form-group select,
    .form-group textarea { padding: 12px; }

    /* SETTINGS */
    .danger-zone { padding: 18px; }
    .settings-link { padding: 12px 14px; }
    .section-actions{
    display:flex;
    justify-content:flex-end;
}

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .filters-actions {
        flex-direction: column;
    }

    .filters-card {
        transition: .3s;
        overflow: hidden;
    }

    .btn-search,
    .btn-reset {
        width: 100%;
    }

    .range-group {
        grid-template-columns: 1fr;
    }
     .messenger-container {
        position: relative;
    }

    /* Sur mobile, la sidebar prend toute la largeur par défaut */
    .messenger-sidebar {
        width: 100%;
    }

    /* Sur mobile, le chat prend toute la largeur */
    .chat {
        position: absolute;
        inset: 0;
        width: 100%;
        background: white;
        display: none; /* caché par défaut sur mobile */
    }

    /* Quand on est dans la detail view, affiche le chat et cache la sidebar */
    .show-chat .chat {
        display: flex;
    }

    .show-chat .messenger-sidebar {
        display: none;
    }

    /* Le bouton retour visible uniquement sur mobile */
    .back-btn {
        display: flex;
    }
    .game-card {
        flex-wrap: wrap;
    }

    .game-card-status {
        width: 100%;
        text-align: center;
    }


}

@media (min-width: 901px) {
    .back-btn { display: none; }
    .chat { display: flex; }
}
@media(max-width:768px){

    .custom-modal{
        padding:0;
        align-items:flex-end;
    }

    .custom-modal-content{
        width:100%;
        max-width:none;

        max-height:85vh;

        border-radius:20px 20px 0 0;
    }

    .modal-header{
        position:sticky;
        top:0;
        z-index:2;
        background:white;
    }

}

@media(max-width:768px){

    .availability-row{
        grid-template-columns:1fr;
        gap:8px;
    }

    .time-separator{
        display:none;
    }

}

