/**
 * Cartes de jeux - LAN RAPAS — charger variables.css avant ce fichier.
 * Design unifié (info-jeux, liste-jeux)
 */

/* Grille et espacement entre cartes jeux */
.games-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/*
 * Carte extérieure : neutre (pas de « cadre » coloré catégorie).
 * La couleur de jeu reste sur la zone logo (.game-card-banner).
 */
.game-card {
    --game-cat-rgb: 187, 134, 252;
    background: rgba(22, 22, 34, 0.98);
    border-radius: 12px;
    padding: 18px 20px 20px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.26);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    width: 100%;
    box-sizing: border-box;
}

/* FPS : rouge tir (distinct du jaune ambre des alertes / sections) */
.game-card--fps { --game-cat-rgb: 239, 68, 68; }
.game-card--course { --game-cat-rgb: 3, 218, 198; }
.game-card--divers { --game-cat-rgb: 192, 132, 252; }
.game-card--strategie { --game-cat-rgb: 96, 165, 250; }

.game-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
    border-color: rgba(255, 255, 255, 0.11);
}

/* En-tête : titre + boutons */
.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

/* Variante avec bannière : logo en haut, boutons en dessous (pas de titre texte : le logo suffit) */
.game-card-header.has-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
}

.game-card-header.has-banner .game-card-banner {
    margin: 0;
    align-self: stretch;
}

.game-card-meta--banner-actions {
    justify-content: flex-end;
}

.game-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.game-card-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.game-card-title {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Image du jeu : vignette (liste-jeux ou sans bannière) */
.game-card-image {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(187, 134, 252, 0.2);
    position: relative;
}
.game-card .game-card-image {
    border-color: rgba(var(--game-cat-rgb), 0.3);
}
.game-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.game-card-image-placeholder {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    color: var(--text-lighter);
    font-size: 1.5rem;
    opacity: 0.6;
}
.game-card-image-placeholder.show {
    display: flex;
}

/* Espaceurs pour centrer la bannière entre badge et boutons */
.game-card-banner-spacer {
    flex: 1;
    min-width: 0;
}

/*
 * Bannière logo : cadre « plateau » avec teinte catégorie (là où la couleur doit vivre).
 */
.game-card-banner {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 188px;
    flex-shrink: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 22px;
    box-sizing: border-box;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background:
        radial-gradient(ellipse 92% 85% at 50% 38%, rgba(255, 255, 255, 0.09), transparent 64%),
        radial-gradient(ellipse 110% 90% at 50% 118%, rgba(var(--game-cat-rgb), 0.24), transparent 52%),
        linear-gradient(185deg, rgba(14, 14, 22, 0.98) 0%, rgba(5, 5, 10, 0.94) 100%);
    border: 3px solid rgba(var(--game-cat-rgb), 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -18px 36px rgba(0, 0, 0, 0.3),
        0 5px 18px rgba(0, 0, 0, 0.26),
        0 0 32px rgba(var(--game-cat-rgb), 0.38);
}

.game-card:hover .game-card-banner {
    border-color: rgba(var(--game-cat-rgb), 0.92);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -18px 36px rgba(0, 0, 0, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.32),
        0 0 42px rgba(var(--game-cat-rgb), 0.48);
}

.game-card-banner img {
    max-width: 100%;
    max-height: 178px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55))
        drop-shadow(0 0 26px rgba(var(--game-cat-rgb), 0.28));
    transition: filter 0.28s ease, transform 0.28s ease;
}

.game-card:hover .game-card-banner img {
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.58))
        drop-shadow(0 0 32px rgba(var(--game-cat-rgb), 0.36));
    transform: scale(1.02);
}

@media (prefers-reduced-motion: reduce) {
    .game-card-banner img {
        transition: none;
    }
    .game-card:hover .game-card-banner img {
        transform: none;
    }
}
.game-card-banner-placeholder {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    color: var(--text-lighter);
    font-size: 1.5rem;
    opacity: 0.6;
}
.game-card-banner-placeholder.show {
    display: flex;
}

/* Nom du jeu masqué visuellement quand la bannière est affichée (accessibilité) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Icône catégorie (carré arrondi) — couleur = carte parent */
.game-card-title .game-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: rgb(var(--game-cat-rgb));
    background: rgba(var(--game-cat-rgb), 0.14);
    border: 1px solid rgba(var(--game-cat-rgb), 0.35);
    border-radius: 10px;
}

/* Badge genre : palette violet/teal cohérente */
.game-card .game-category-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 8px;
    margin: 0;
}

/* FPS : orange / corail (action, tir) – bien distinct du violet */
.game-category-badge.fps {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.42);
}

.game-category-badge.course {
    background: rgba(3, 218, 198, 0.18);
    color: #03dac6;
    border: 1px solid rgba(3, 218, 198, 0.3);
}

/* DIVERS : violet / mauve (polyvalent) */
.game-category-badge.divers {
    background: rgba(168, 85, 247, 0.22);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.game-category-badge.strategie {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

/* Titre du jeu : plus marqué */
.game-card-title h3 {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 0.02em;
}

/* Séparateur optionnel entre titre et boutons (fine ligne) */
.game-card-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

/*
 * Boutons d’action carte : « HUD » compact (icône en pastille + libellé + chevron).
 * Astuces = palette fixe teal (lisible partout) ; Clefs / Guide / Modifs = sémantique.
 */
.game-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px 9px 10px;
    border-radius: 11px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    color: var(--text-light);
    font-family: inherit;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 2px 10px rgba(0, 0, 0, 0.22);
}

.game-toggle-btn .btn-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.game-toggle-btn .btn-text {
    padding-right: 2px;
}

/* Chevron intégré au bouton — pas de sous-cadre */
.game-toggle-btn i.fa-chevron-down {
    transition: transform 0.32s ease;
    margin-left: 6px;
    padding: 0 2px 0 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0;
    font-size: 0.72rem;
    opacity: 0.88;
    background: transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

.game-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 5px 16px rgba(0, 0, 0, 0.28);
}

.game-toggle-btn[aria-expanded="true"] i.fa-chevron-down {
    transform: rotate(180deg);
}

/*
 * Astuces : teal fixe (aligné --secondary-accent), texte très clair — pas la couleur catégorie.
 */
.game-card .game-toggle-btn--astuces {
    border-color: rgba(45, 212, 191, 0.55);
    background: linear-gradient(
        165deg,
        rgba(17, 94, 89, 0.96) 0%,
        rgba(6, 38, 36, 0.99) 100%
    );
    color: #ecfdf5;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 2px 12px rgba(0, 0, 0, 0.3);
}

.game-card .game-toggle-btn--astuces .btn-icon {
    background: rgba(45, 212, 191, 0.12);
    border: 1px solid rgba(94, 234, 212, 0.28);
    color: #ccfbf1;
}

.game-card .game-toggle-btn--astuces i.fa-chevron-down {
    border-left-color: rgba(167, 243, 208, 0.35);
    color: inherit;
}

.game-card .game-toggle-btn--astuces:hover {
    border-color: rgba(94, 234, 212, 0.75);
    background: linear-gradient(
        165deg,
        rgba(19, 122, 115, 0.98) 0%,
        rgba(8, 56, 53, 0.99) 100%
    );
    color: #ffffff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 5px 18px rgba(15, 118, 110, 0.28);
}

.game-card .game-toggle-btn--astuces:hover .btn-icon {
    background: rgba(45, 212, 191, 0.28);
    border-color: rgba(167, 243, 208, 0.55);
    color: #ffffff;
}

.game-card .game-toggle-btn--astuces:hover i.fa-chevron-down {
    border-left-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.game-card .game-toggle-btn--astuces[aria-expanded="true"] {
    border-color: rgba(153, 246, 228, 0.65);
    background: linear-gradient(
        165deg,
        rgba(22, 101, 96, 0.98) 0%,
        rgba(8, 61, 58, 0.99) 100%
    );
    color: #ffffff;
}

.game-card .game-toggle-btn--astuces[aria-expanded="true"] .btn-icon {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(167, 243, 208, 0.45);
    color: #ffffff;
}

/* Clefs CD */
.game-toggle-btn--secondary {
    border-color: rgba(192, 132, 252, 0.48) !important;
    background: linear-gradient(
        165deg,
        rgba(147, 51, 234, 0.22) 0%,
        rgba(59, 7, 100, 0.14) 100%
    ) !important;
    color: #e9d5ff !important;
}

.game-toggle-btn--secondary .btn-icon {
    background: rgba(126, 34, 206, 0.35) !important;
    border: 1px solid rgba(192, 132, 252, 0.42) !important;
    color: #f3e8ff !important;
}

.game-toggle-btn--secondary i.fa-chevron-down {
    background: transparent !important;
    border-left: 1px solid rgba(192, 132, 252, 0.35) !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    color: inherit !important;
}

.game-toggle-btn--secondary:hover {
    border-color: rgba(216, 180, 254, 0.65) !important;
    background: linear-gradient(
        165deg,
        rgba(147, 51, 234, 0.35) 0%,
        rgba(59, 7, 100, 0.22) 100%
    ) !important;
    color: #fff !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 5px 18px rgba(147, 51, 234, 0.22) !important;
}

.game-toggle-btn--secondary:hover .btn-icon {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
}

/* Modifications à faire */
.game-toggle-btn--red {
    border-color: rgba(248, 113, 113, 0.55) !important;
    background: linear-gradient(
        165deg,
        rgba(185, 28, 28, 0.35) 0%,
        rgba(69, 10, 10, 0.2) 100%
    ) !important;
    color: #fecaca !important;
}

.game-toggle-btn--red .btn-icon {
    background: rgba(185, 28, 28, 0.4) !important;
    border: 1px solid rgba(248, 113, 113, 0.45) !important;
    color: #fecaca !important;
}

.game-toggle-btn--red i.fa-chevron-down {
    background: transparent !important;
    border-left: 1px solid rgba(248, 113, 113, 0.35) !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    color: inherit !important;
}

.game-toggle-btn--red:hover {
    border-color: rgba(252, 165, 165, 0.65) !important;
    background: linear-gradient(
        165deg,
        rgba(220, 38, 38, 0.42) 0%,
        rgba(69, 10, 10, 0.28) 100%
    ) !important;
    color: #fff !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 5px 18px rgba(239, 68, 68, 0.2) !important;
}

.game-toggle-btn--red:hover .btn-icon {
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
}

/* Lien Guide */
a.game-toggle-btn--guide {
    text-decoration: none;
    border-color: rgba(96, 165, 250, 0.5) !important;
    background: linear-gradient(
        165deg,
        rgba(37, 99, 235, 0.28) 0%,
        rgba(23, 37, 84, 0.18) 100%
    ) !important;
    color: #bfdbfe !important;
}

a.game-toggle-btn--guide .btn-icon {
    background: rgba(29, 78, 216, 0.38) !important;
    border: 1px solid rgba(96, 165, 250, 0.45) !important;
    color: #dbeafe !important;
}

a.game-toggle-btn--guide:hover {
    border-color: rgba(147, 197, 253, 0.65) !important;
    background: linear-gradient(
        165deg,
        rgba(37, 99, 235, 0.42) 0%,
        rgba(23, 37, 84, 0.26) 100%
    ) !important;
    color: #fff !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 5px 18px rgba(59, 130, 246, 0.22) !important;
}

a.game-toggle-btn--guide:hover .btn-icon {
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
}

/* Plusieurs guides : liste déroulante (style proche du bouton Guide) */
.game-guide-dropdown-wrap {
    display: inline-flex;
    align-items: center;
}

.game-guide-select {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px 10px 12px;
    border-radius: 11px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid rgba(96, 165, 250, 0.5) !important;
    background: linear-gradient(
        165deg,
        rgba(37, 99, 235, 0.28) 0%,
        rgba(23, 37, 84, 0.18) 100%
    ) !important;
    color: #bfdbfe !important;
    max-width: min(280px, 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-guide-select:hover,
.game-guide-select:focus {
    background: linear-gradient(
        165deg,
        rgba(37, 99, 235, 0.4) 0%,
        rgba(23, 37, 84, 0.26) 100%
    ) !important;
    border-color: rgba(147, 197, 253, 0.65) !important;
    color: #fff !important;
    outline: none;
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 5px 18px rgba(59, 130, 246, 0.22) !important;
}

.game-guide-select option {
    background: #1a1628;
    color: var(--text-light);
}

/* Panneaux dépliables (astuces, clés CD, modifs) */
.game-astuces {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.game-astuces.is-open {
    max-height: min(2000px, 85vh);
    opacity: 1;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(187, 134, 252, 0.16);
}

.game-astuces h4 {
    color: var(--secondary-accent);
    font-size: 1rem;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-astuces h4 i {
    color: var(--primary-accent);
}

.game-astuces ul {
    margin: 0;
    padding-left: 24px;
    color: var(--text-lighter);
    font-size: 0.95rem;
    line-height: 1.8;
}

.game-astuces li {
    margin-bottom: 6px;
}

/* Avertissement : icône + texte uniquement (pas de bloc / fond — repose sur la carte) */
.game-card-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #fde047;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0.01em;
    box-shadow: none;
}

.game-card-warning i {
    font-size: 1.4rem;
    flex-shrink: 0;
    color: #fde047;
}

/* Focus accessibilité */
.game-toggle-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(187, 134, 252, 0.55),
        0 4px 14px rgba(0, 0, 0, 0.22);
}

.game-card .game-toggle-btn--astuces:focus-visible {
    box-shadow:
        0 0 0 2px rgba(45, 212, 191, 0.75),
        0 4px 14px rgba(0, 0, 0, 0.28);
}

.game-toggle-btn--secondary:focus-visible {
    box-shadow:
        0 0 0 2px rgba(192, 132, 252, 0.55),
        0 4px 14px rgba(0, 0, 0, 0.22);
}

.game-toggle-btn--red:focus-visible {
    box-shadow:
        0 0 0 2px rgba(248, 113, 113, 0.6),
        0 4px 14px rgba(0, 0, 0, 0.22);
}

a.game-toggle-btn--guide:focus-visible {
    box-shadow:
        0 0 0 2px rgba(96, 165, 250, 0.6),
        0 4px 14px rgba(0, 0, 0, 0.22);
}

@media (max-width: 768px) {
    .game-card {
        padding: 14px 16px;
    }
    .game-card-banner {
        width: 100%;
        max-width: none;
        min-height: 148px;
    }
    .game-card-title .game-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    .game-card-title h3 {
        font-size: 1.05rem;
    }
    .game-card-header {
        gap: 12px;
    }
    .game-toggle-btn {
        padding: 8px 11px 8px 8px;
        font-size: 0.82rem;
        gap: 9px;
    }
    .game-toggle-btn .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.88rem;
    }
}
