/* ============================================================
   World Cup 2026 — Styles globaux
   ============================================================ */

/* ---- Variables ------------------------------------------- */
:root {
    --bg-dark:       #0A1628;
    --bg-dark-2:     #0E2040;
    --bg-light:      #F8FAFC;
    --bg-card:       #FFFFFF;
    --bg-card-2:     #F1F5F9;
    --blue:          #1D6FCA;
    --blue-light:    #60A5F5;
    --blue-faint:    #DBEAFE;
    --gold:          #C9A227;
    --gold-dark:     #A8841A;
    --green:         #22C55E;
    --red:           #EF4444;
    --orange:        #F59E0B;
    --purple:        #8B5CF6;
    --text-primary:  #0F172A;
    --text-secondary:#64748B;
    --border:        #E2E8F0;
    --radius:        10px;
    --radius-lg:     14px;
    --shadow:        0 1px 3px rgba(0,0,0,0.08);
}

/* ---- Reset & base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ---- Topbar ---------------------------------------------- */
.topbar {
    background: var(--bg-dark);
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(29,111,202,0.2);
}
.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-badge {
    width: 36px; height: 36px;
    background: var(--blue);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.logo-text span {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
}
.logo-text small {
    display: block;
    font-size: 11px;
    color: var(--gold);
}
.topbar-nav {
    display: flex;
    gap: 4px;
}
.nav-item {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s, color 0.15s;
}
.nav-item:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.05); }
.nav-item.active { background: rgba(29,111,202,0.25); color: var(--blue-light); }
.nav-admin { color: rgba(252,165,165,0.7) !important; }
.nav-admin.active { background: rgba(239,68,68,0.2); color: #FCA5A5 !important; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.avatar-sm {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    display: flex; align-items: center; justify-content: center;
    cursor: default;
}
.logout-btn { color: rgba(255,255,255,0.4); font-size: 18px; display: flex; align-items: center; }
.logout-btn:hover { color: #fff; }

/* ---- Bottom nav (mobile) --------------------------------- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-dark);
    border-top: 1px solid rgba(29,111,202,0.2);
    padding: 8px 0 16px;
    justify-content: space-around;
    z-index: 100;
}
.bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    padding: 0 12px;
}
.bn-item i { font-size: 20px; }
.bn-item.active { color: var(--blue-light); }

/* ---- Page content ---------------------------------------- */
.page-content { min-height: calc(100vh - 56px); }

/* ---- Hero band ------------------------------------------- */
.hero-band {
    background: var(--bg-dark);
    padding: 20px 20px 0;
}
.hero-label {
    font-size: 11px;
    color: var(--blue-light);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.hero-title { font-size: 22px; font-weight: 500; color: #fff; margin-bottom: 2px; }
.hero-sub { font-size: 13px; color: rgba(255,255,255,0.45); margin-bottom: 16px; }

/* ---- Live scroll ----------------------------------------- */
.live-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: none;
}
.live-scroll::-webkit-scrollbar { display: none; }
.live-card {
    background: var(--bg-dark-2);
    border: 0.5px solid rgba(29,111,202,0.35);
    border-radius: 12px;
    padding: 12px 14px;
    min-width: 200px;
    flex-shrink: 0;
}
.live-card.upcoming { border-color: rgba(255,255,255,0.1); opacity: 0.7; }
.live-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.live-pill { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--green); font-weight: 500; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }
.upcoming-pill { font-size: 10px; color: rgba(255,255,255,0.35); }
.group-badge { font-size: 10px; color: var(--blue-light); }
.match-display { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.match-team { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: rgba(255,255,255,0.8); min-width: 52px; }
.match-team img { width: 24px; height: 24px; object-fit: contain; }
.match-flag { font-size: 22px; }
.match-score-center { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.match-score { font-size: 22px; font-weight: 500; color: #fff; letter-spacing: 2px; }
.match-time { font-size: 11px; color: var(--green); font-weight: 500; }
.match-time.up { color: rgba(255,255,255,0.35); }
.no-matches { font-size: 13px; color: rgba(255,255,255,0.3); padding: 12px 0; }

/* ---- Main ------------------------------------------------- */
.main { padding: 16px 20px; }

/* ---- Stat cards ------------------------------------------ */
.stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 16px; }
.stat-card {
    background: var(--bg-card);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    box-shadow: var(--shadow);
}
.stat-lbl { font-size: 11px; color: var(--text-secondary); margin-bottom: 3px; }
.stat-val { font-size: 20px; font-weight: 500; color: var(--text-primary); }
.stat-chip { font-size: 11px; margin-top: 3px; }

/* ---- Section headers ------------------------------------- */
.section-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-ttl { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.section-link { font-size: 12px; color: var(--blue); }

/* ---- Cards ----------------------------------------------- */
.card {
    background: var(--bg-card);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card-2);
    border-bottom: 0.5px solid var(--border);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ---- Two col --------------------------------------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }

/* ---- Leaderboard table ----------------------------------- */
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th {
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    background: var(--bg-card-2);
    border-bottom: 0.5px solid var(--border);
    font-weight: 500;
}
.rank-table th:nth-child(2) { text-align: left; }
.rank-table td { padding: 10px 16px; font-size: 13px; text-align: right; border-bottom: 0.5px solid var(--border); }
.rank-table td:nth-child(2) { text-align: left; }
.rank-table tr:last-child td { border-bottom: none; }
.rank-table tr:hover td { background: var(--bg-card-2); }
.rank-table tr.me td { background: rgba(29,111,202,0.05); }
.rank-table tr.gold td { background: rgba(234,179,8,0.05); }
.rank-table tr.silver td { background: rgba(148,163,184,0.05); }
.rank-table tr.bronze td { background: rgba(180,83,9,0.04); }
.player-cell { display: flex; align-items: center; gap: 8px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 500; flex-shrink: 0; }
.player-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.me-badge { font-size: 10px; background: rgba(29,111,202,0.1); color: var(--blue); padding: 1px 5px; border-radius: 3px; margin-left: 4px; }
.pts-cell { font-weight: 500; font-size: 14px; color: var(--text-primary); }
.trend-up { color: var(--green); font-size: 11px; }
.trend-dn { color: var(--red); font-size: 11px; }
.trend-eq { color: var(--text-secondary); font-size: 11px; }

/* ---- Match list ------------------------------------------ */
.match-list { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.match-day-hdr {
    padding: 7px 14px;
    background: var(--bg-card-2);
    border-bottom: 0.5px solid var(--border);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.match-row { display: flex; align-items: center; padding: 10px 14px; border-bottom: 0.5px solid var(--border); gap: 10px; }
.match-row:last-child { border-bottom: none; }
.match-time-col { font-size: 12px; color: var(--text-secondary); width: 42px; flex-shrink: 0; }
.match-time-col.live { color: var(--green); font-weight: 500; }
.match-teams-col { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-primary); }
.flag-sm { font-size: 16px; }
.vs-sep { font-size: 11px; color: var(--text-secondary); }
.match-result { font-size: 13px; font-weight: 500; color: var(--text-primary); width: 40px; text-align: center; }
.match-result.live { color: var(--green); }
.match-result.pending { color: var(--text-secondary); font-size: 11px; }
.grp-badge { font-size: 10px; color: var(--blue); background: var(--blue-faint); padding: 2px 6px; border-radius: 4px; }
.prono-col { font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; gap: 3px; }
.prono-ok { color: var(--green); }
.prono-ko { color: var(--red); }

/* ---- Profile hero ---------------------------------------- */
.profile-hero { background: var(--bg-dark); padding: 20px; }
.profile-card {
    background: var(--bg-dark-2);
    border: 0.5px solid rgba(29,111,202,0.3);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.big-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.profile-info .profile-name { font-size: 18px; font-weight: 500; color: #fff; margin-bottom: 2px; }
.profile-info .profile-meta { font-size: 12px; color: var(--blue-light); }
.profile-stats { display: flex; gap: 20px; margin-left: auto; }
.pstat { text-align: center; }
.pstat-val { font-size: 22px; font-weight: 500; color: #fff; }
.pstat-lbl { font-size: 11px; color: var(--blue-light); margin-top: 1px; }
.pstat-sub { font-size: 11px; color: var(--gold); margin-top: 1px; }

/* ---- Points badge ---------------------------------------- */
.pts-badge { font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 10px; }
.pts-ok  { background: #DCFCE7; color: #166534; }
.pts-ko  { background: #FEE2E2; color: #991B1B; }
.pts-pnd { background: #FEF9C3; color: #854D0E; }
.pts-lck { background: var(--bg-card-2); color: var(--text-secondary); }

/* ---- Progress bars --------------------------------------- */
.progress-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--blue); }

/* ---- Admin ----------------------------------------------- */
.admin-band {
    background: var(--bg-dark);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0.5px solid rgba(239,68,68,0.2);
    flex-wrap: wrap;
    gap: 10px;
}
.admin-title { font-size: 18px; font-weight: 500; color: #fff; display: flex; align-items: center; gap: 8px; }
.admin-sub { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.badge-admin { font-size: 10px; background: rgba(239,68,68,0.2); color: #FCA5A5; padding: 2px 8px; border-radius: 4px; border: 0.5px solid rgba(239,68,68,0.3); }

/* ---- Buttons --------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; border: none; font-family: inherit; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-warning { background: rgba(245,158,11,0.1); color: #92400E; border: 0.5px solid rgba(245,158,11,0.3); }
.btn-danger  { background: rgba(239,68,68,0.08); color: #991B1B; border: 0.5px solid rgba(239,68,68,0.25); }
.btn-purple  { background: rgba(139,92,246,0.1); color: #6D28D9; border: 0.5px solid rgba(139,92,246,0.3); }
.btn-sm { font-size: 11px; padding: 3px 9px; border-radius: 5px; }

/* ---- Status dots ----------------------------------------- */
.dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-ok  { background: var(--green); }
.dot-warn{ background: var(--orange); }
.dot-err { background: var(--red); }

/* ---- Alerts ---------------------------------------------- */
.alert { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.alert-error { background: #FEE2E2; color: #991B1B; }
.alert-success { background: #DCFCE7; color: #166534; }

/* ---- Login page ------------------------------------------ */
.login-body { background: var(--bg-dark); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-wrap { width: 100%; max-width: 400px; }
.login-card { background: var(--bg-dark-2); border: 0.5px solid rgba(29,111,202,0.3); border-radius: 18px; padding: 32px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.login-title { font-size: 22px; font-weight: 500; color: #fff; text-align: center; margin-bottom: 4px; }
.login-sub { font-size: 12px; color: var(--gold); text-align: center; margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; color: rgba(255,255,255,0.6); }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.3); font-size: 16px; pointer-events: none; }
.input-wrap input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 0.5px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 10px 12px 10px 38px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.input-wrap input:focus { border-color: var(--blue); }
.input-wrap input::placeholder { color: rgba(255,255,255,0.2); }
.btn-login {
    width: 100%;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
    transition: background 0.15s;
}
.btn-login:hover { background: #1858A0; }
.login-footer { font-size: 11px; color: rgba(255,255,255,0.2); text-align: center; margin-top: 20px; }

/* ---- Log rows -------------------------------------------- */
.log-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px; border-bottom: 0.5px solid var(--border); font-size: 12px; }
.log-row:last-child { border-bottom: none; }
.log-time { color: var(--text-secondary); white-space: nowrap; font-size: 11px; width: 42px; flex-shrink: 0; }
.log-msg { color: var(--text-primary); flex: 1; }
.log-tag { font-size: 10px; padding: 1px 5px; border-radius: 3px; margin-left: 4px; flex-shrink: 0; }
.tag-api   { background: #DBEAFE; color: #1E40AF; }
.tag-ls    { background: #FEF9C3; color: #854D0E; }
.tag-admin { background: #FCE7F3; color: #9D174D; }
.tag-score { background: #DCFCE7; color: #166534; }

/* ---- Danger zone ----------------------------------------- */
.danger-zone { background: var(--bg-card); border: 0.5px solid #FECACA; border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 16px; }
.danger-title { font-size: 13px; font-weight: 500; color: var(--red); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.danger-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Responsive ------------------------------------------ */
@media (max-width: 640px) {
    .topbar-nav { display: none; }
    .bottom-nav { display: flex; }
    .page-content { padding-bottom: 72px; }
    .stat-row { grid-template-columns: repeat(2,1fr); }
    .two-col { grid-template-columns: 1fr; }
    .profile-stats { display: none; }
    .rank-table .col-hide { display: none; }
}

/* ============================================================
   Dashboard
   ============================================================ */
.dash-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}
.dash-card-title i { color: var(--blue); font-size: 16px; }

/* Barre de progression */
.dash-progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.dash-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}
.stat-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* Tableau joueurs */
.dash-players-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.dash-players-table th {
    padding: 8px 12px;
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card-2);
    border-bottom: 0.5px solid var(--border);
    white-space: nowrap;
}
.dash-players-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 0.5px solid var(--border);
    color: var(--text-primary);
}
.dash-players-table tbody tr:last-child td { border-bottom: none; }
.dash-players-table tbody tr:hover { background: rgba(29,111,202,0.03); }
.dash-row-me { background: rgba(201,162,39,0.05) !important; }
.dash-row-me:hover { background: rgba(201,162,39,0.08) !important; }

/* Barre taux de réussite */
.dash-rate-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}
.dash-rate-bar {
    width: 48px;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.dash-rate-fill {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.6s ease;
}
.dash-rate-pct { font-size: 11px; color: var(--text-secondary); min-width: 28px; }

/* ---- Dashboard v2 : layout graphiques -------------------- */
.dash-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.dash-chart-card {
    padding: 20px;
}
@media (max-width: 768px) {
    .dash-charts-row { grid-template-columns: 1fr; }
}

/* ---- Tableau participants aéré --------------------------- */
.dash-players-card {
    margin-bottom: 20px;
    padding: 0;
    overflow: hidden;
}
.dash-players-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.dash-players-table thead tr {
    background: var(--bg-card-2);
    border-bottom: 1px solid var(--border);
}
.dash-players-table th {
    padding: 14px 24px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    text-align: center;
}
.dash-players-table td {
    padding: 18px 24px;
    text-align: center;
    border-bottom: 0.5px solid var(--border);
}
.dash-players-table tbody tr:last-child td { border-bottom: none; }
.dash-players-table tbody tr:hover { background: rgba(29,111,202,0.03); }
.dpt-row-me { background: rgba(201,162,39,0.06) !important; }
.dpt-row-me:hover { background: rgba(201,162,39,0.1) !important; }

/* Colonnes spécifiques */
.dpt-rank { width: 60px; text-align: center !important; }
.dpt-player { text-align: left !important; min-width: 180px; }
.dpt-phase { min-width: 90px; }
.dpt-bonus { }
.dpt-success { min-width: 150px; }
.dpt-total { min-width: 90px; font-size: 16px; font-weight: 700; color: var(--text-primary); }

/* Joueur */
.dpt-player-inner { display: flex; align-items: center; gap: 12px; }
.dpt-avatar { width: 36px; height: 36px; font-size: 12px; flex-shrink: 0; }
.dpt-name { font-weight: 500; font-size: 14px; color: var(--text-primary); }

/* Points */
.dpt-pts { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.dpt-pts-bonus { color: var(--gold); }
.dpt-dash { color: var(--text-secondary); font-size: 13px; }

/* Point de couleur dans header */
.dpt-phase-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

/* Taux de réussite */
.dpt-rate-wrap { display: flex; align-items: center; gap: 8px; justify-content: center; }
.dpt-rate-bar { width: 64px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.dpt-rate-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.6s ease; }
.dpt-rate-pct { font-size: 12px; color: var(--text-secondary); min-width: 32px; text-align: left; }
