
/* Base */
body {
  font-family: Inter, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  background-color: #f8fafc;
  color: #0f172a;
}

h1 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 10px;
}

.container img {
    float: left;
    width: 15%;
}

/* Bouton reset */
button.reset {
    font-size: 1.5rem;
    color: #fafafa;
    text-transform: uppercase;
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid #fafafa;
    background: #252525;
    box-shadow: 3px 3px #fafafa;
    cursor: pointer;
}

button.reset:active {
    box-shadow: none;
    transform: translate(3px, 3px);
}

/* Barre de contrôle */
.controls {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
}

.sorts, .filters {
    display: flex;
    gap: 10px;
}

.controls button {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.controls button:hover {
    background-color: #f1f5f9;
}

.controls button.active {
    background-color: #1f2937;
    color: white;
    border-color: #1f2937;
}

/* Barre recherche + compteur */
.search-counter {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    position: relative;
}

.search-counter input {
    flex: 1;
    padding: 8px 32px 8px 12px; /* place pour la croix */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

#clear-search {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    display: none; /* caché si champ vide */
}

#clear-search:hover {
    color: #0f172a;
}


.search-counter #counter {
    font-size: 1rem;
    color: #475569;
    margin-right: 10px;
    text-decoration: underline;
}

#counter {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

/* Barre de progression */
.progress-bar-container {
    width: 100%;
    background-color: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    height: 12px;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background-color: #4caf50;
    width: 0;
    transition: width 0.3s ease;
}

/* Grille des champions */
.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.card {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s, opacity 0.2s;
    width: calc(22% - 10px);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card.selected {
    background-color: #adbdd3;
    opacity: 0.8;
}

.card img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-right: 12px;
    border-radius: 8px;
}

.card .name {
    font-size: 1rem;
    font-weight: 500;
    color: #0f172a;
}

/* Recent highlight */
.recent {
    box-shadow: 0 0 10px 2px rgba(255, 215, 0, 0.8);
}

/* Responsive */
@media (max-width: 600px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls button,
    .search-counter input {
        width: 100%;
        flex: unset;
    }

    .card {
        width: 100%;
    }

    .card img {
        width: 40px;
        height: 40px;
    }
}
