/* =========================================================
   PAGE D'ACCUEIL
   ========================================================= */

.home-container {

    max-width: 950px;

    margin: 0 auto;

    padding: 40px 20px 60px;

}


.home-intro {

    text-align: center;

    margin-bottom: 35px;

}


.home-intro h1 {

    margin-bottom: 8px;

}


.home-intro p {

    margin: 0;

    color: #64748b;

    font-size: 17px;

}


/* =========================================================
   LISTE DES TOURNOIS
   ========================================================= */

.tournaments-list {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );

    gap: 20px;

}

.mode-guide {

    margin: 0 0 22px;

    padding: 20px;

    border: 1px solid #dbe6f4;

    border-radius: 16px;

    background: linear-gradient(140deg, #ffffff 0%, #f6f9ff 100%);

    box-shadow: 0 5px 18px rgba(31, 65, 115, .07);

}

.mode-guide-heading {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 15px;

}

.mode-guide-icon {

    display: grid;

    flex: 0 0 42px;

    width: 42px;

    height: 42px;

    place-items: center;

    border-radius: 12px;

    background: #e8f0ff;

    font-size: 21px;

}

.mode-guide-heading h2 {

    margin: 0 0 3px;

    color: #173b70;

    font-size: 18px;

}

.mode-guide-heading p {

    margin: 0;

    color: #65758b;

    font-size: 13px;

    line-height: 1.45;

}

.mode-guide-options {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 12px;

}

.mode-guide-option {

    min-width: 0;

    padding: 14px 15px;

    border: 1px solid;

    border-radius: 12px;

}

.mode-guide-option-libre {

    border-color: #bfe8d8;

    background: linear-gradient(135deg, #f0fbf6, #fbfffd);

}

.mode-guide-option-organise {

    border-color: #cbdcf8;

    background: linear-gradient(135deg, #f1f6ff, #fcfdff);

}

.mode-guide-badge {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    margin-bottom: 7px;

    font-size: 14px;

    font-weight: 800;

}

.mode-guide-option-libre .mode-guide-badge { color: #087653; }

.mode-guide-option-organise .mode-guide-badge { color: #174ea6; }

.mode-guide-option p {

    margin: 0;

    color: #465a73;

    font-size: 13px;

    line-height: 1.55;

}


/* =========================================================
   CARTE TOURNOI
   ========================================================= */

.tournament-card {

    background: #fff;

    border: 1px solid #e2e8f0;

    border-radius: 14px;

    padding: 24px;

    box-shadow:
        0 3px 10px
        rgba(15, 23, 42, .06);

}


.tournament-card h2 {

    margin-top: 0;

    margin-bottom: 8px;

    font-size: 22px;

}


.tournament-subtitle {

    color: #64748b;

    margin-bottom: 14px;

}

.tournament-fees {
    display:flex;
    flex-wrap:wrap;
    gap:8px 18px;
    color:#475569;
    font-size:14px;
    margin:12px 0;
}

.tournament-meta {

    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 8px;

}


.tournament-dates {

    background: #eef5ff;

    border: 1px solid #b9d3ff;

    border-radius: 10px;

    padding: 11px 13px;

    margin-bottom: 13px;

    color: #163b70;

}

.tournament-date-line {

    display: flex;

    align-items: center;

    gap: 7px;

    font-size: 15px;

    font-weight: 800;

}

.tournament-time-line {

    display: flex;

    align-items: center;

    gap: 7px;

    margin-top: 5px;

    font-size: 16px;

    font-weight: 800;

    color: #0f3f86;

}

.tournament-period {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    margin-top: 7px;

    padding: 4px 11px;

    border-radius: 999px;

    background: #2563eb;

    color: #fff;

    font-weight: 800;

    font-size: 12px;

    letter-spacing: .2px;

}

.tournament-levels {

    display: flex;

    flex-wrap: wrap;

    align-items: center;

    gap: 7px;

    margin: 0 0 16px;

    padding: 9px 11px;

    background: #f0f6ff;

    border: 1px solid #c7dcff;

    border-radius: 9px;

}

.tournament-levels-label {

    color: #163b70;

    font-size: 13px;

    font-weight: 800;

    margin-right: 2px;

}

.level-pill {

    display: inline-block;

    padding: 5px 9px;

    border-radius: 7px;

    background: #dbeafe;

    color: #174ea6;

    font-size: 12px;

    font-weight: 800;

}

.format-pill {

    display: inline-flex;

    align-items: center;

    min-height: 34px;

    margin: 0;

    padding: 7px 11px;

    border-radius: 999px;

    background: #eef5ff;

    border: 1px solid #c7dcff;

    color: #174ea6;

    font-size: 15px;

    font-weight: 800;

}

.mode-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.mode-pill-libre {
    border: 1px solid #a7e4d0;
    background: #eafaf4;
    color: #087653;
}

.mode-pill-organise {
    border: 1px solid #bfd5ff;
    background: #edf4ff;
    color: #174ea6;
}

.mode-description {
    position: relative;
    margin: 0 0 16px;
    padding: 13px 15px 13px 17px;
    border: 1px solid;
    border-radius: 12px;
}

.mode-description::before {
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 3px;
    border-radius: 0 4px 4px 0;
    content: '';
}

.mode-description strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.35;
}

.mode-description p {
    margin: 0;
    color: #52647d;
    font-size: 13px;
    line-height: 1.5;
}

.mode-description-libre {
    border-color: #c6ecdf;
    background: linear-gradient(135deg, #f2fcf8, #fbfffd);
}

.mode-description-libre::before {
    background: #13a67b;
}

.mode-description-libre strong {
    color: #087653;
}

.mode-description-organise {
    border-color: #d1e0f8;
    background: linear-gradient(135deg, #f3f7ff, #fbfdff);
}

.mode-description-organise::before {
    background: #3478e5;
}

.mode-description-organise strong {
    color: #174ea6;
}


.tournament-info {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 10px;

    margin-bottom: 20px;

}


.info-box {

    background: #eff6ff;

    border-radius: 8px;

    padding: 12px;

    text-align: center;

}


.info-box strong {

    display: block;

    font-size: 20px;

    color: #2563eb;

}


.info-box span {

    display: block;

    margin-top: 3px;

    color: #64748b;

    font-size: 13px;

}


/* =========================================================
   BOUTONS
   ========================================================= */

.tournament-buttons {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 9px;

    flex-wrap: wrap;

    margin-top: 14px;

}


/* Boutons d'action compacts : icône + libellé */
.tournament-action {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    padding: 9px 13px;

    border-radius: 8px;

    background: #fff;

    color: #1d4ed8 !important;

    border: 1px solid #bfdbfe;

    text-decoration: none !important;

    font-size: 14px;

    font-weight: 700;

    line-height: 1.1;

    box-sizing: border-box;

    transition: .15s ease;

}


.tournament-action:hover {

    background: #eff6ff;

    border-color: #2563eb;

    transform: translateY(-1px);

}


.tournament-action.organize {

    color: #334155 !important;

    border-color: #cbd5e1;

}


.tournament-action.organize:hover {

    background: #f8fafc;

    border-color: #64748b;

}


.tournament-action .action-icon {

    font-size: 17px;

    line-height: 1;

}


.tournament-button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    padding: 9px 13px;

    border-radius: 8px;

    background: #fff;

    color: #1d4ed8 !important;

    border: 1px solid #bfdbfe;

    text-decoration: none !important;

    text-align: center;

    font-size: 14px;

    font-weight: 700;

    box-sizing: border-box;

}


.tournament-button:hover {

    background: #eff6ff;

    border-color: #2563eb;

}


/* =========================================================
   STATUTS
   ========================================================= */

.tournament-status,
.tournament-button {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 11px 14px;
    border-radius: 8px;
}

.tournament-status {

    width: 100%;

    box-sizing: border-box;

    padding: 13px 18px;

    border-radius: 8px;

    text-align: center;

    font-weight: 800;

    margin-bottom: 10px;

}


/* INSCRIT */

.status-inscrit {

    background: #dcfce7;

    color: #166534;

    border: 2px solid #22c55e;

}


/* PARTENAIRE MANQUANT */

.status-partenaire {

    background: #fef3c7;

    color: #92400e;

    border: 2px solid #f59e0b;

}


/* LISTE D'ATTENTE */

/* Inscriptions pas encore ouvertes : texte informatif, pas un bouton */
.inscriptions-a-venir {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    margin-top: 0;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.status-attente {

    background: #f3e8ff;

    color: #6b21a8;

    border: 2px solid #a855f7;

}


/* =========================================================
   LIENS DU BAS
   ========================================================= */

.home-links {

    margin-top: 35px;

    text-align: center;

}


.home-links a {

    color: #2563eb;

    text-decoration: none;

    font-weight: 600;

    margin: 0 10px;

}


.home-links a:hover {

    text-decoration: underline;

}


/* =========================================================
   AUCUN TOURNOI
   ========================================================= */

.no-tournament {

    background: #fff;

    border: 1px solid #e2e8f0;

    border-radius: 12px;

    padding: 30px;

    text-align: center;

    color: #64748b;

}


/* =========================================================
   BOUTON CRÉER UN TOURNOI
   ========================================================= */

.create-tournament-wrap {
    text-align:center;
    margin: 0 0 18px;
}

.create-tournament-button {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    border-radius:8px;
    background:#0b3d91;
    color:#fff !important;
    text-decoration:none;
    font-size:28px;
    font-weight:700;
    box-shadow:0 3px 8px rgba(0,0,0,.15);
}

.create-tournament-button:hover {
    background:#082f70;
}

/* =========================================================
   ADMINISTRATION
   ========================================================= */

.admin-bottom {
    width:100%;
    display:flex;
    justify-content:center;
    align-items:center;
    margin:28px 0 8px;
}

.admin-gear {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:40px;
    height:40px;
    border-radius:8px;
    background:#0b3d91;
    color:#fff;
    text-decoration:none;
    font-size:20px;
    line-height:1;
    box-shadow:0 3px 8px rgba(0,0,0,.15);
}

.admin-gear:hover {
    background:#082f70;
}

/* =========================================================
   DATE LIMITE D'INSCRIPTION / COMPTE À REBOURS
   ========================================================= */

.registration-deadline {
    margin: 0 0 13px;
    padding: 10px 12px;
    border-radius: 9px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    text-align:center;
}

.registration-not-open {
    background: #eef4ff;
    border-color: #9fc2ff;
    color: #174a8b;
}

.registration-not-open span {
    display: block;
    margin-top: 4px;
}

.registration-deadline strong {
    display:block;
    font-size:14px;
}

.registration-countdown {
    margin-top:4px;
    font-size:16px;
    font-weight:800;
}

.registration-closed {
    background:#fee2e2;
    border-color:#fca5a5;
    color:#991b1b;
}

/* Couleurs des niveaux */
.level-n1 { background:#A8D08D; color:#16351a; }
.level-n2 { background:#4DB6AC; color:#073b36; }
.level-n3 { background:#64B5F6; color:#0b3154; }
.level-n4 { background:#1976D2; color:#fff; }
.level-n5 { background:#F5A623; color:#4a2a00; }
.level-n6 { background:#E53935; color:#fff; }
.level-n7 { background:#8E44AD; color:#fff; }
.level-n8 { background:#6C3483; color:#fff; }
.level-n9 { background:#C2185B; color:#fff; }
.level-n10 { background:#374151; color:#fff; }

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .home-container {

        padding-top: 25px;

    }

    .mode-guide {
        padding: 16px;
    }

    .mode-guide-options {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .mode-guide-option {
        padding: 12px 13px;
    }


    .tournament-info {

        grid-template-columns: 1fr;

    }


    .tournament-action {

        padding: 8px 11px;

    }

    .tournament-period {

        margin-left: 0;

        margin-top: 5px;

    }

}


/* Harmonisation des actions d'inscription */
.tournament-button,
.tournament-status.status-attente {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
}

.tournament-button {
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Bouton d'inscription : clairement visible en vert */
.tournament-button {
    background: #22a447 !important;
    border: 1px solid #22a447 !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    min-height: 44px;
}

.tournament-button:hover {
    background: #198a39 !important;
    border-color: #198a39 !important;
    color: #ffffff !important;
}

.tournament-button .action-icon {
    font-size: 16px;
}

.home-admin-access {
    display:inline-flex; align-items:center; justify-content:center; gap:8px;
    min-height:44px; padding:8px 12px; border:1px solid currentColor;
    border-radius:8px; color:inherit; text-decoration:none; font-weight:700;
}
.home-admin-access:hover { background:rgba(255,255,255,.16); }
.home-admin-access:focus-visible { outline:3px solid #fbbf24; outline-offset:3px; }
.home-admin-access svg { flex-shrink:0; }

.logout-form { margin: 0; }
.logout-form button { border: 0; cursor: pointer; font-size: inherit; }
