:root {
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --card-border: #DEE2E6;
    --text-main: #2D2D2D;
    --text-muted: #6C757D;
    --primary: #004691; /* Bleu Panini */
    --accent: #E20613; /* Rouge Éclat */
    --success: #28A745; /* Vert Pelouse */
    --gold: #D4AF37; /* Or Trophée */
    --missing: #E9ECEF; /* Gris Clair Cartes */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    padding: 60px 20px;
}

h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    color: var(--primary);
    letter-spacing: -0.5px;
}

#main-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.actions-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.action-btn {
    background: var(--accent);
    border: none;
    color: #FFFFFF;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.1s ease;
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    background: #C80511;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.action-btn:active {
    transform: translateY(0);
}

/* STARTUP OVERLAY */
#startup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(248, 249, 250, 0.95);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

#startup-overlay.overlay-active {
    display: flex;
}

.startup-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    border-top: 4px solid var(--primary);
}

.startup-card h2 {
    color: var(--primary);
    margin-top: 0;
    font-size: 1.8rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.startup-card p {
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.5;
    font-size: 1rem;
}

.startup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.full-width {
    grid-column: 1 / -1;
}

.group-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.teams-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1;
    position: relative;
    width: 100%;
}

.team-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.team-ind {
    font-size: 0.75rem;
    padding: 3px 8px;
    background: var(--missing);
    border-radius: 4px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.group-letter {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5rem;
    font-weight: 900;
    color: #000;
    opacity: 0.7; /* Nettement plus visible */
    user-select: none;
    z-index: 2; /* Au-dessus du fond blanc des cartes */
    pointer-events: none;
    mix-blend-mode: multiply; /* Se fond bien avec le fond */
}

.group-card.full-width .group-letter {
    position: absolute;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    font-size: 5.5rem;
    opacity: 0.04; /* Très discret pour PRE/AFTER */
}

@media (max-width: 768px) {
    #main-container {
        grid-template-columns: 1fr;
    }
    .group-letter { font-size: 3.5rem; }
    .group-card.full-width .group-letter { font-size: 4rem; }
}

/* Nettoyage style pour PRE/AFTER */
.group-card.full-width .team-item {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    justify-content: center !important;
    width: 100%;
}
.group-card.full-width .team-item .team-name {
    font-size: 1.6rem !important; /* Plus grand comme demandé */
}
.group-card.full-width .team-item:hover {
    background: rgba(0,0,0,0.02) !important;
}

.team-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    border: 1px solid transparent;
    background: #FDFDFD;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.team-item:hover {
    background: #F1F3F5;
    border-color: var(--card-border);
}

/* MODAL STYLES */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    width: 95%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
    box-shadow: var(--shadow-lg);
}

.modal.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--missing);
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

#modal-title {
    margin-top: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--missing);
    padding-bottom: 12px;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.sticker-item {
    background: var(--missing);
    border-radius: 6px;
    padding: 16px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.sticker-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    filter: brightness(0.9);
}

.sticker-item.obtained {
    /* fallback color if not group set */
    background: var(--success);
    color: #FFFFFF;
}

.sticker-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--gold);
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.sticker-minus {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

/* COMPLETED VISUALS */
.team-item.is-completed {
    border: 1.5px solid var(--gold) !important;
}

.team-item.is-completed::after {
    content: '✓';
    margin-left: auto;
    background: var(--gold);
    color: white;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* COMPLETED VISUALS FOR GROUP CARD IF FULL GROUP DONE */
.group-card.is-completed {
    border-color: var(--gold);
}

/* HAMBURGER MENU */
.hamburger-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-md);
}

.hamburger-btn .bar {
    width: 22px;
    height: 3px;
    background: #FFFFFF;
    border-radius: 2px;
}

.hamburger-btn.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open .bar:nth-child(2) { opacity: 0; }
.hamburger-btn.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.menu-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.menu-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.side-menu {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -300px;
    width: 280px;
    box-sizing: border-box;
    overflow-y: auto;
    background: var(--primary);
    z-index: 1000;
    padding: 70px 16px 16px;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.side-menu.open {
    left: 0;
}

.menu-title {
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.menu-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.menu-item {
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #FFFFFF;
    transition: background 0.2s ease;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
}

.menu-item.active {
    background: #FFFFFF;
    color: var(--primary);
}

.menu-actions {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* VIEW TOGGLE BUTTONS */
.view-toggle-container {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.view-toggle-btn svg {
    stroke: var(--text-muted);
}

.view-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.view-toggle-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}

.view-toggle-btn.active svg {
    stroke: #FFFFFF;
}
