/* ============================================================
   IMPORTS & VARIABLES
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Bebas+Neue&display=swap');

:root {
    --vert:        #1a6b3a;
    --vert-fonce:  #0d4a28;
    --vert-clair:  #f0faf4;
    --or:          #c8a800;
    --or-clair:    #FAEEDA;
    --rouge:       #c0392b;
    --bleu-clair:  #E6F1FB;
    --bleu:        #0C447C;
    --gris-bg:     #f6f5f2;
    --gris-card:   #ffffff;
    --gris-border: #e8e6e1;
    --gris-texte:  #6b6b68;
    --texte:       #1a1a18;
    --radius:      12px;
    --radius-sm:   8px;
    --ombre:       0 2px 12px rgba(0,0,0,0.08);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Figtree', sans-serif;
    background: var(--gris-bg);
    color: var(--texte);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   ÉCRANS DE CONNEXION / INSCRIPTION
   ============================================================ */
.ecran {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--vert-fonce) 0%, var(--vert) 50%, #2d8a50 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
    font-size: 48px;
    text-align: center;
    margin-bottom: 1rem;
    animation: spin 1s ease;
}

@keyframes spin {
    from { transform: rotate(-20deg) scale(0.8); }
    to   { transform: rotate(0deg) scale(1); }
}

.login-titre {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    letter-spacing: 0.03em;
    text-align: center;
    color: var(--texte);
    line-height: 1.2;
    margin-bottom: 6px;
}

.login-sous-titre {
    font-size: 13px;
    color: var(--gris-texte);
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-box input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gris-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'Figtree', sans-serif;
    color: var(--texte);
    margin-bottom: 10px;
    transition: border-color 0.2s;
    background: #fafaf9;
}

.login-box input:focus {
    outline: none;
    border-color: var(--vert);
    background: white;
}

.btn-principal {
    width: 100%;
    padding: 13px;
    background: var(--vert);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Figtree', sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 4px;
}

.btn-principal:hover  { background: var(--vert-fonce); }
.btn-principal:active { transform: scale(0.98); }

.login-lien {
    text-align: center;
    font-size: 13px;
    color: var(--gris-texte);
    margin-top: 1rem;
}

.login-lien a {
    color: var(--vert);
    font-weight: 600;
    text-decoration: none;
}

.erreur-msg {
    background: #FCEBEB;
    color: #791F1F;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
}

.ok-msg {
    background: #EAF3DE;
    color: #27500A;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* ============================================================
   HEADER APPLICATION
   ============================================================ */
.app-header {
    background: linear-gradient(135deg, var(--vert-fonce) 0%, var(--vert) 65%, var(--or) 100%);
    padding: 1.25rem 1rem 1rem;
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 150px; height: 150px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 680px;
    margin: 0 auto 1rem;
}

.header-badge {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.header-titre {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 26px;
    letter-spacing: 0.03em;
    color: white;
    line-height: 1.1;
    margin-bottom: 4px;
}

.header-sous {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.header-nom {
    font-size: 13px;
    color: white;
    font-weight: 500;
}

.deconnexion {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
}

.deconnexion:hover { color: white; }

.header-stats {
    display: flex;
    gap: 1rem;
    max-width: 680px;
    margin: 0 auto;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.hstat { text-align: center; flex: 1; }
.hstat-val { font-size: 18px; font-weight: 700; color: white; }
.hstat-lbl { font-size: 10px; color: rgba(255,255,255,0.65); margin-top: 2px; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.app-nav {
    display: flex;
    gap: 4px;
    padding: 10px;
    background: white;
    border-bottom: 1px solid var(--gris-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.nav-btn {
    flex: 1;
    padding: 9px 4px;
    border: 1.5px solid var(--gris-border);
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Figtree', sans-serif;
    color: var(--gris-texte);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.nav-btn:hover  { border-color: var(--vert); color: var(--vert); }
.nav-btn.active { background: var(--vert); color: white; border-color: var(--vert); }

/* ============================================================
   CONTENU PRINCIPAL
   ============================================================ */
.app-main {
    max-width: 680px;
    margin: 0 auto;
    padding: 1,25rem;
	padding-top: 1,25rem;
}

#page-classement {
    padding-top: 0.5rem;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

#page-classement {
    padding-top: 1rem;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gris-texte);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 10px;
}

.vide {
    text-align: center;
    color: var(--gris-texte);
    font-size: 13px;
    padding: 2rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gris-border);
}

/* ============================================================
   PODIUM
   ============================================================ */
.podium {
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}

.podium-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    height: 160px;
}

.pod-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.couronne { font-size: 20px; margin-bottom: 4px; }

.pod-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--vert-clair);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--vert);
    margin-bottom: 5px;
}

.pod-name {
    font-size: 11px;
    color: var(--gris-texte);
    margin-bottom: 3px;
    text-align: center;
}

.pod-name.moi { color: var(--vert); font-weight: 600; }

.pod-pts {
    font-size: 13px;
    font-weight: 700;
    color: var(--texte);
    margin-bottom: 6px;
}

.pod-barre {
    width: 100%;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
}

.pod-rang {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    color: rgba(255,255,255,0.9);
}

/* ============================================================
   TABLEAU CLASSEMENT
   ============================================================ */
.rank-table {
    background: white;
    border: 1px solid var(--gris-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--ombre);
}

.rank-row {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    border-top: 1px solid var(--gris-border);
    gap: 10px;
    transition: background 0.15s;
}

.rank-row:first-child { border-top: none; }
.rank-row:hover { background: #fafaf9; }
.rank-row.moi { background: var(--vert-clair); }

.rank-num {
    font-size: 13px;
    color: var(--gris-texte);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.rank-num.moi { color: var(--vert); font-weight: 700; }

.rank-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gris-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--gris-texte);
    flex-shrink: 0;
}

.rank-name { flex: 1; font-size: 14px; color: var(--texte); }
.rank-name.moi { color: var(--vert); font-weight: 600; }
.rank-exact { font-size: 12px; color: var(--gris-texte); flex-shrink: 0; }
.rank-pts { font-size: 15px; font-weight: 700; color: var(--vert); flex-shrink: 0; }

/* ============================================================
   CARTES MATCHS
   ============================================================ */
.match-card {
    background: white;
    border: 1px solid var(--gris-border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: var(--ombre);
    transition: transform 0.15s;
}

.match-card:hover { transform: translateY(-1px); }

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: var(--gris-bg);
    border-bottom: 1px solid var(--gris-border);
}

.match-phase { font-size: 11px; color: var(--gris-texte); }
.match-time  { font-size: 11px; font-weight: 500; color: var(--gris-texte); }

.match-body {
    display: flex;
    align-items: center;
    padding: 16px 14px;
}

.team-side {
    flex: 1;
    text-align: center;
}

.flag-img {
    width: 40px;
    height: 28px;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.team-name { font-size: 13px; font-weight: 600; color: var(--texte); }
.team-code { font-size: 11px; color: var(--gris-texte); margin-top: 2px; }

.match-center {
    padding: 0 12px;
    text-align: center;
    min-width: 90px;
}

.match-vs    { font-size: 20px; font-weight: 700; color: var(--gris-border); }
.match-score { font-size: 26px; font-weight: 700; color: var(--texte); }

.match-prono-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 6px;
    font-weight: 500;
}

.prono-ok   { background: #EAF3DE; color: #27500A; }
.prono-mid  { background: var(--bleu-clair); color: var(--bleu); }
.prono-bad  { background: #FCEBEB; color: #791F1F; }
.prono-open { background: var(--or-clair); color: #633806; }

.match-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--gris-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.prono-preview { font-size: 12px; color: var(--gris-texte); }
.prono-pts     { font-size: 14px; font-weight: 700; color: var(--vert); }

.btn-prono {
    padding: 7px 16px;
    background: var(--vert);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: 'Figtree', sans-serif;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-prono:hover { background: var(--vert-fonce); }

/* ============================================================
   FORMULAIRE PRONOSTIC
   ============================================================ */
.prono-card {
    background: white;
    border: 1px solid var(--gris-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--ombre);
}

.prono-card-header {
    background: linear-gradient(90deg, var(--vert-fonce), var(--vert));
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prono-card-header span  { color: rgba(255,255,255,0.8); font-size: 12px; }
.prono-card-header strong { color: white; font-size: 13px; }

.prono-teams {
    display: flex;
    align-items: center;
    padding: 20px 16px;
    gap: 8px;
}

.prono-team { flex: 1; text-align: center; }

.flag-img-lg {
    width: 52px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.prono-tname { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.prono-sep   { font-size: 22px; color: var(--gris-border); padding-top: 20px; }

.score-ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.score-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--gris-border);
    background: var(--gris-bg);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--texte);
    font-family: 'Figtree', sans-serif;
    transition: all 0.15s;
    line-height: 1;
    padding: 0;
}

.score-btn:hover {
    border-color: var(--vert);
    background: var(--vert-clair);
    color: var(--vert);
}

.score-val {
    font-size: 32px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
    color: var(--texte);
    font-family: 'Bebas Neue', sans-serif;
}

.prono-rules {
    display: flex;
    gap: 6px;
    padding: 0 16px 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.rule-chip {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.rule-gold { background: var(--or-clair); color: #633806; }
.rule-blue { background: var(--bleu-clair); color: var(--bleu); }
.rule-gray { background: var(--gris-bg); color: var(--gris-texte); }

.prono-submit {
    padding: 0 16px 16px;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--vert);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Figtree', sans-serif;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn-submit:hover  { background: var(--vert-fonce); }
.btn-submit:active { transform: scale(0.98); }

.confirm-msg {
    margin: 0 16px 16px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================================
   HISTORIQUE PRONOSTICS
   ============================================================ */
.history-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-top: 1px solid var(--gris-border);
    gap: 10px;
    font-size: 13px;
}

.history-row:first-child { border-top: none; }
.h-teams  { flex: 1; color: var(--texte); }
.h-prono  { color: var(--gris-texte); min-width: 44px; text-align: center; }
.h-result { font-weight: 600; min-width: 44px; text-align: center; }
.h-pts    { min-width: 80px; text-align: right; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-card {
    background: white;
    border: 1px solid var(--gris-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--ombre);
}

.admin-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.admin-card p  { font-size: 13px; color: var(--gris-texte); margin-bottom: 12px; }

/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */
@media (max-width: 480px) {
    .header-stats { gap: 0.5rem; }
    .hstat-val    { font-size: 16px; }
    .nav-btn      { font-size: 11px; padding: 8px 2px; }
    .match-body   { padding: 12px 8px; }
    .flag-img     { width: 32px; height: 22px; }
    .prono-teams  { padding: 14px 8px; }
    .flag-img-lg  { width: 42px; height: 30px; }
    .score-val    { font-size: 26px; }
    .match-score  { font-size: 22px; }
    .header-titre { font-size: 22px; }
}
/* ============================================================
   FILTRES MATCHS
   ============================================================ */
.filtres-wrap {
    background: white;
    border: 1px solid var(--gris-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--ombre);
}

.filtre-groupe {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.filtre-groupe:last-child { margin-bottom: 0; }

.filtre-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gris-texte);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 70px;
    flex-shrink: 0;
}

.filtre-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filtre-btn {
    padding: 5px 12px;
    border: 1.5px solid var(--gris-border);
    border-radius: 20px;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Figtree', sans-serif;
    color: var(--gris-texte);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.filtre-btn:hover  { border-color: var(--vert); color: var(--vert); }
.filtre-btn.active { background: var(--vert); color: white; border-color: var(--vert); }

.filtre-select {
    padding: 6px 10px;
    border: 1.5px solid var(--gris-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Figtree', sans-serif;
    color: var(--texte);
    background: white;
    cursor: pointer;
    flex: 1;
    max-width: 250px;
}

.filtre-select:focus { outline: none; border-color: var(--vert); }

.filtre-date {
    padding: 6px 10px;
    border: 1.5px solid var(--gris-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Figtree', sans-serif;
    color: var(--texte);
    background: white;
    cursor: pointer;
}

.filtre-date:focus { outline: none; border-color: var(--vert); }

.filtre-reset {
    padding: 5px 14px;
    border: 1.5px solid var(--gris-border);
    border-radius: 20px;
    background: transparent;
    font-size: 12px;
    color: var(--gris-texte);
    cursor: pointer;
    font-family: 'Figtree', sans-serif;
    transition: all 0.15s;
}

.filtre-reset:hover { border-color: var(--rouge); color: var(--rouge); }

.filtre-count {
    font-size: 12px;
    color: var(--gris-texte);
    margin-bottom: 10px;
    padding-left: 2px;
}
.pts-chip {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.exaequo-badge {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--or-clair);
    color: #633806;
    font-weight: 600;
    margin-left: 4px;
}
.podium-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    height: 160px;
    margin-top: 50px;
}
#page-classement {
    padding-top: 2rem;
}