:root{--accent-color:#1976ff;--accent-color-soft:#1976ff22;--accent-color-strong:#1976ff;}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, Helvetica, sans-serif;
}

body{
    background:#111;
    color:white;
    min-height:100vh;
}

.topbar{
    background:#000;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:20px 40px;
    border-bottom:2px solid var(--accent-color);
}

.logo{font-size:24px;font-weight:bold;color:white;text-decoration:none;}
.brand-logo{display:flex;align-items:center;gap:10px;}
.brand-logo img{width:38px;height:38px;object-fit:contain;border-radius:9px;background:#1b1b1b;}

nav{
    display:flex;
    gap:20px;
}

nav a{
    color:white;
    text-decoration:none;
    font-weight:bold;
    transition:0.3s;
}

nav a:hover{
    color:var(--accent-color);
}


/* Titres : suivent la couleur choisie dans Admin */
h1:not(.hero h1),
h2,
h3 {
    color: var(--accent-color);
}

.hero{
    text-align:center;
    padding:80px 20px;
    /* La couleur du bandeau suit directement la couleur choisie dans Admin */
    background:var(--accent-color);
    transition:background .25s ease;
}

.hero h1{
    color:#fff;
    font-size:48px;
    margin-bottom:15px;
}

.hero p{
    font-size:20px;
}

.cards{
    width:90%;
    max-width:1200px;
    margin:30px auto;
    display:grid;
    grid-template-columns:
    repeat(auto-fit,minmax(300px,1fr));
    gap:20px;
}

.card{
    background:#1b1b1b;
    border-radius:15px;
    padding:25px;
    box-shadow:
    0 0 15px rgba(25,118,255,.2);
}

.card h2{
    margin-bottom:20px;
    color:var(--accent-color);
}

.player-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px;
    margin-bottom:10px;
    background:#262626;
    border-radius:10px;
}

table{
    width:100%;
    border-collapse:collapse;
}

th{
    background:var(--accent-color);
    padding:12px;
}

td{
    padding:12px;
    text-align:center;
    border-bottom:1px solid #333;
}

tr:hover{
    background:#222;
}

input,
select{
    width:100%;
    padding:12px;
    margin-bottom:15px;
    border:none;
    border-radius:10px;
    background:#2a2a2a;
    color:white;
}

button{
    width:100%;
    padding:12px;
    border:none;
    border-radius:10px;
    background:var(--accent-color);
    color:white;
    font-weight:bold;
    cursor:pointer;
    transition:0.3s;
}

button:hover{
    background:#0d5bd7;
}

#matchStatus{
    font-size:22px;
    font-weight:bold;
    text-align:center;
}

.live{
    color:#00ff66;
}

.wait{
    color:#8ab8ff;
}

#liveScore{
    text-align:center;
    font-size:36px;
    margin-bottom:20px;
}

#timeline{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.timeline-event{
    background:#222;
    padding:12px;
    border-radius:10px;
    border-left:4px solid var(--accent-color);
}

footer{
    text-align:center;
    padding:30px;
    margin-top:50px;
    background:#000;
    border-top:2px solid var(--accent-color);
}

@media(max-width:768px){

    .topbar{
        flex-direction:column;
        gap:15px;
    }

    nav{
        flex-wrap:wrap;
        justify-content:center;
    }

    .hero h1{
        font-size:32px;
    }

}

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

    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 10px;

    padding: 12px;
    margin-bottom: 10px;

    cursor: pointer;
}

.player-card-select:hover {
    border-color: var(--accent-color);
    background: #242424;
}

.player-card-select input {
    width: 22px;
    height: 22px;
    accent-color: var(--accent-color);
    cursor: pointer;
    flex-shrink: 0;
}

.player-card-info {
    display: flex;
    flex-direction: column;
}

.player-card-info strong {
    color: #fff;
    font-size: 15px;
}

.player-card-info span {
    color: var(--accent-color);
    font-size: 13px;
    margin-top: 3px;
}

/* =============================== */
/* TABLEAUX RESPONSIVE MOBILE      */
/* Calendrier + Classement         */
/* =============================== */

.table-mobile {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    border: 1px solid #173d78;
    background: #111;
}

.table-mobile::before {
    content: "← Glisse pour voir tout le tableau →";
    display: none;
    text-align: center;
    padding: 10px;
    color: var(--accent-color);
    font-size: 13px;
    font-weight: bold;
    background: #1b1b1b;
    border-bottom: 1px solid #173d78;
}

.table-mobile table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.table-mobile::-webkit-scrollbar {
    height: 8px;
}

.table-mobile::-webkit-scrollbar-track {
    background: #222;
    border-radius: 20px;
}

.table-mobile::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 20px;
}

/* MOBILE */

@media(max-width: 768px) {

    .table-mobile::before {
        display: block;
    }

    .card {
        overflow: hidden;
    }

    .table-mobile table {
        min-width: 680px;
    }

    th,
    td {
        font-size: 13px;
        padding: 10px;
        white-space: nowrap;
    }

    /* Classement : Pos + Équipe restent visibles */
    .classement-table th:nth-child(1),
    .classement-table td:nth-child(1) {
        position: sticky;
        left: 0;
        z-index: 3;
        min-width: 50px;
        background: #1b1b1b;
    }

    .classement-table th:nth-child(2),
    .classement-table td:nth-child(2) {
        position: sticky;
        left: 50px;
        z-index: 3;
        min-width: 130px;
        text-align: left;
        background: #1b1b1b;
        box-shadow: 8px 0 15px rgba(0,0,0,0.35);
    }

    .classement-table th:nth-child(1),
    .classement-table th:nth-child(2) {
        background: var(--accent-color);
    }

    /* Calendrier : le match reste visible */
    .calendrier-table th:nth-child(3),
    .calendrier-table td:nth-child(3) {
        position: sticky;
        left: 0;
        z-index: 3;
        min-width: 190px;
        text-align: left;
        background: #1b1b1b;
        box-shadow: 8px 0 15px rgba(0,0,0,0.35);
    }

    .calendrier-table th:nth-child(3) {
        background: var(--accent-color);
    }
}

/* PETITS TÉLÉPHONES */

@media(max-width: 480px) {

    .cards {
        width: 96%;
    }

    .card {
        padding: 14px;
    }

    .table-mobile table {
        min-width: 620px;
    }

    th,
    td {
        font-size: 12px;
        padding: 9px;
    }

    .classement-table th:nth-child(2),
    .classement-table td:nth-child(2) {
        min-width: 115px;
    }

    .calendrier-table th:nth-child(3),
    .calendrier-table td:nth-child(3) {
        min-width: 165px;
    }
}

/* TRÈS PETITS ÉCRANS */

@media(max-width: 360px) {

    .table-mobile table {
        min-width: 590px;
    }

    th,
    td {
        font-size: 11px;
        padding: 8px;
    }

    .classement-table th:nth-child(1),
    .classement-table td:nth-child(1) {
        min-width: 42px;
    }

    .classement-table th:nth-child(2),
    .classement-table td:nth-child(2) {
        left: 42px;
        min-width: 105px;
    }
}

/* THEME OVERRIDE: la couleur choisie dans Admin remplace l'ancien orange */
.hero{background:var(--accent-color) !important;}
.topbar{border-bottom-color:var(--accent-color) !important;}
footer{border-top-color:var(--accent-color) !important;}
button, th{background:var(--accent-color) !important;}
h1:not(.hero h1), h2, h3, .card h2{color:var(--accent-color) !important;}
nav a:hover{color:var(--accent-color) !important;}
.timeline-event{border-left-color:var(--accent-color) !important;}
.player-card-select:hover{border-color:var(--accent-color) !important;}
.player-card-select input{accent-color:var(--accent-color) !important;}
.result{color:var(--accent-color) !important;}

/* THEME FINAL: toutes les couleurs d'accent passent par le choix Admin */

button.primary,.btn-primary,.primary-btn,.active,.nav-link.active,.tab.active,.result,.score,.accent,.accent-color,
h1.accent,h2.accent,h3.accent,.card-title,.section-title,.competition-title,.page-title{color:var(--accent-color) !important;}
button.primary,.btn-primary,.primary-btn,.active-bg,.accent-bg{background:var(--accent-color) !important;}
.border-accent,.accent-border{border-color:var(--accent-color) !important;}

.player-name-cell{display:flex!important;align-items:center;gap:9px;text-align:left!important}
.player-avatar{width:34px;height:34px;border-radius:50%;object-fit:cover;border:2px solid var(--accent-color);background:#252525;display:inline-flex;align-items:center;justify-content:center}
.player-avatar-empty{font-size:18px}

/* Récompenses : mise en page propre et responsive */
.trophies-grid, .season-trophies, .rewards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .trophies-grid, .season-trophies, .rewards-grid { grid-template-columns: 1fr; }
}
