* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ff3f04 0%, #a11919 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding-bottom: 50px; /* Espace pour le footer fixe */
    position: relative;
}

/* Fond Lethal Company (image en couche, 10 % opacité, fixe sur toute la page) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('media/images/lethal_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

body > * {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1200px;
    width: 100%;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 50px;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Grilles de cartes (accueil : notions de jeu + compositions) */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 20px auto 30px;
    max-width: 900px;
}

.buttons-grid:first-of-type {
    margin-top: 30px;
}

.grid-title {
    grid-column: 1 / -1;
    color: white;
    font-size: 1.6rem;
    margin-bottom: 0;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.separator {
    width: 80%;
    margin: 30px auto 20px;
    border: none;
    border-top: 2px solid rgba(255, 255, 255, 0.4);
    background: none;
}

/* Cartes cliquables (même style doux que compositions/index.html) */
/* Image de fond optionnelle : définir --card-bg-image: url('...') sur la carte (petits boutons = centrée, 30% opacité) */
.button-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.button-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: var(--card-bg-image, none);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.button-card > * {
    position: relative;
    z-index: 1;
}

.button-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.button-card h2 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.button-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    line-height: 1.5;
}

/* Liens « Retour » (navigation secondaire) */
.back-link {
    color: white;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 20px;
    transition: opacity 0.3s ease;
}

.back-link:hover {
    opacity: 0.9;
}

/* Bloc plusieurs liens Retour (un sous l'autre) */
.back-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.back-links a,
.back-links .back-link {
    color: white;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.3s ease;
    margin-bottom: 0;
}

.back-links a:hover,
.back-links .back-link:hover {
    opacity: 0.9;
}

/* Carte de contenu cliquable (compositions, guides) */
.content-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.content-card h2 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.content-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.6;
}

/* Cartes de la page compositions (easy/medium/hard) : même rendu image que .composition-item (image en ::before, droite, 30% opacité) */
.composition-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
}

.composition-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: var(--card-bg-image, none);
    background-position: right 30%;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.composition-card > * {
    position: relative;
    z-index: 1;
}

/* Icônes composition (menus + pages détail) – base, hover, couleurs par coût (var dans :root) */
.composition-item-image {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.composition-item-image:hover {
    transform: scale(1.2);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.composition-item-image.c1 { border-color: var(--cost-1); }
.composition-item-image.c2 { border-color: var(--cost-2); }
.composition-item-image.c3 { border-color: var(--cost-3); }
.composition-item-image.c4 { border-color: var(--cost-4); }
.composition-item-image.c5 { border-color: var(--cost-5); }
.composition-item-image.c7 { border-color: var(--cost-7); }

/* Bouton type toggle (Voir/Masquer, Copier code, Masquer mémo, etc.) – base commune */
.toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .content-card {
        padding: 20px;
    }
    
    .content-card h2 {
        font-size: 1.5rem;
    }
    
    .content-card p {
        font-size: 0.9rem;
    }
}

#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 10px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

#footer p {
    margin: 5px 0;
    color: white;
}

#footer strong {
    color: white;
    font-weight: 600;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .grid-title {
        font-size: 1.4rem;
    }
    
    .buttons-grid {
        grid-template-columns: 1fr;
    }
    
    .separator {
        width: 95%;
        margin: 25px auto 15px;
    }
    
    #footer {
        font-size: 9px;
        padding: 10px 15px;
    }
    
    body {
        padding-bottom: 100px; /* Espace réduit pour mobile */
    }
}

/* Panneau Effets (mémo) rétractable à droite – partagé (champions + pages composition) */
.effects-panel-container {
    position: relative;
}

.effects-panel-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 16px 10px;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-right: none;
    border-radius: 12px 0 0 12px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

.effects-panel-tab:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.3);
}

.effects-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.06);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.effects-panel-container.effects-panel--open .effects-panel-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.effects-panel-container.effects-panel--open .effects-panel-tab {
    opacity: 0;
    pointer-events: none;
}

.effects-memo.effects-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.06);
}

.effects-panel-container.effects-panel--open .effects-memo.effects-panel {
    transform: translateX(0);
}

.effects-memo {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    color: white;
}

.effects-memo.effects-panel {
    margin-top: 0;
}

.effects-memo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.effects-memo h2 {
    margin: 0;
    font-size: 1.5rem;
}

.effects-list p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 10px;
}

.effects-list strong {
    color: white;
    font-weight: 600;
}

@media (max-width: 768px) {
    .effects-panel-tab {
        min-height: 44px;
        padding: 12px 14px;
        font-size: 0.9rem;
        -webkit-tap-highlight-color: transparent;
    }

    .effects-memo.effects-panel {
        width: 90%;
        max-width: 360px;
        padding: 20px 16px;
    }

    .effects-memo.effects-panel .effects-list p {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
}

