/* --- VARIABLES & SYSTÈME DE DESIGN --- */
:root {
    --bg-dark: #07060f;
    --bg-surface: rgba(18, 16, 36, 0.6);
    --bg-surface-solid: #121024;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #f3f2f8;
    --text-muted: #8c89a0;
    
    /* Couleurs Néons */
    --neon-p1: #00ffcc;
    --neon-p1-glow: rgba(0, 255, 204, 0.3);
    --neon-p2: #ff007f;
    --neon-p2-glow: rgba(255, 0, 127, 0.3);
    --neon-accent: #9d4edd;
    --neon-accent-glow: rgba(157, 78, 221, 0.3);
    --neon-gold: #ffd700;
    --neon-gold-glow: rgba(255, 215, 0, 0.25);
    --neon-success: #39ff14;
    --neon-danger: #ff3333;

    /* Typographie */
    --font-outfit: 'Outfit', sans-serif;
    --font-grotesk: 'Space Grotesk', sans-serif;
    
    /* Effets */
    --glass-blur: blur(14px);
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- BASES & RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-drag: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-outfit);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #15122d 0%, #07060f 100%);
}

/* --- BOUTON MUTE FIXE --- */
#btn-mute {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(18, 16, 36, 0.6);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* --- TEXTES & TYPOGRAPHIE --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-grotesk);
    letter-spacing: 0.5px;
}

.glow-text {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1), 0 0 20px currentColor;
}

.accent-color {
    color: var(--neon-p1);
    text-shadow: 0 0 10px var(--neon-p1-glow);
}

.p1-text { color: var(--neon-p1); }
.p2-text { color: var(--neon-p2); }
.win-text { color: var(--neon-success); text-shadow: 0 0 10px rgba(57, 255, 20, 0.3); }
.loss-text { color: var(--neon-danger); text-shadow: 0 0 10px rgba(255, 51, 51, 0.3); }

/* --- COMPOSANTS DE VERRE (GLASSMORPHISM) --- */
.glass {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* --- BOUTONS --- */
.btn {
    font-family: var(--font-grotesk);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-p1) 0%, #00b386 100%);
    color: #030307;
    box-shadow: 0 4px 15px var(--neon-p1-glow);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--neon-p1-glow), 0 0 15px var(--neon-p1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--neon-accent) 0%, #7b2cbf 100%);
    color: var(--text-main);
    box-shadow: 0 4px 15px var(--neon-accent-glow);
}
.btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--neon-accent-glow), 0 0 15px var(--neon-accent);
}

.btn-secondary-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.btn-secondary-outline:hover {
    color: var(--text-main);
    border-color: var(--text-main);
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

.btn-back {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 10;
}

/* --- ÉCRANS (SCREENS) --- */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.98);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
    z-index: 2;
}

.screen.active.click-cooldown {
    cursor: wait;
}

.screen.active.click-cooldown * {
    pointer-events: none !important;
}

/* --- ÉCRAN 1 : ACCUEIL --- */
#screen-home {
    justify-content: flex-start;
    padding-top: 80px;
    overflow-y: auto;
}

.logo-container {
    text-align: center;
    position: relative;
    margin-bottom: 20px;
}

.game-title {
    font-size: 4.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-main) 30%, #a29bb8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    letter-spacing: -2px;
    z-index: 2;
}

.game-tagline {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-top: 5px;
}

.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--neon-p1-glow) 0%, transparent 70%);
    filter: blur(30px);
    z-index: 1;
    pointer-events: none;
}

/* PANEL PROFIL ELO */
.profile-panel {
    max-width: 1200px;
    width: 100%;
    padding: 20px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.profile-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-select {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2.5px solid var(--neon-p1);
    background: var(--neon-p1-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 10px var(--neon-p1-glow);
}

.profile-inputs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#input-nickname {
    background: transparent;
    border: none;
    border-bottom: 1.5px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-grotesk);
    font-size: 1.2rem;
    font-weight: 700;
    padding: 2px 5px;
    width: 160px;
    transition: var(--transition-smooth);
}

#input-nickname:focus {
    outline: none;
    border-color: var(--neon-p1);
}

.elo-badge {
    font-family: var(--font-grotesk);
    font-size: 0.85rem;
    color: var(--neon-gold);
    font-weight: 700;
}

.stats-mini-grid {
    display: flex;
    gap: 20px;
}

.stat-mini {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-mini span {
    font-weight: 700;
    color: var(--text-main);
}

/* PALETTE DE COULEURS SKINS */
.skin-select-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
}

.skin-select-box label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
}

.skins-palette {
    display: flex;
    gap: 12px;
}

.skin-color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.skin-color-dot:hover {
    transform: scale(1.1);
}

.skin-color-dot.active {
    border-color: var(--text-main);
    box-shadow: 0 0 10px currentColor;
    transform: scale(1.1);
}

/* GRILLE DES MODES */
.modes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 1200px;
    width: 100%;
    gap: 20px;
    margin-bottom: 30px;
}

.mode-card {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
    border-radius: var(--border-radius-lg);
}

.mode-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

/* Card 1: Online (Blue-cyan neon glow) */
.mode-online-card:hover {
    border-color: var(--neon-p1);
    box-shadow: 0 10px 30px var(--neon-p1-glow), inset 0 0 15px var(--neon-p1-glow);
}
.mode-online-card .card-icon {
    transition: filter 0.3s ease;
}
.mode-online-card:hover .card-icon {
    filter: drop-shadow(0 0 12px var(--neon-p1));
}

/* Card 2: Campagne (Gold neon glow) */
.mode-campaign-card:hover {
    border-color: var(--neon-gold);
    box-shadow: 0 10px 30px var(--neon-gold-glow), inset 0 0 15px var(--neon-gold-glow);
}
.mode-campaign-card .card-icon {
    transition: filter 0.3s ease;
}
.mode-campaign-card:hover .card-icon {
    filter: drop-shadow(0 0 12px var(--neon-gold));
}

/* Card 3: Entraînement (Magenta-purple glow) */
.mode-training-card:hover {
    border-color: var(--neon-accent);
    box-shadow: 0 10px 30px var(--neon-accent-glow), inset 0 0 15px var(--neon-accent-glow);
}
.mode-training-card .card-icon {
    transition: filter 0.3s ease;
}
.mode-training-card:hover .card-icon {
    filter: drop-shadow(0 0 12px var(--neon-accent));
}

.card-icon {
    font-size: 2.8rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.mode-card h2 {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.mode-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.online-actions, .offline-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 10px;
}

.join-input-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
}

.join-input-group input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    color: var(--text-main);
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    text-align: center;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
}

.join-input-group input:focus {
    outline: none;
    border-color: var(--neon-p1);
    box-shadow: 0 0 10px var(--neon-p1-glow);
}

.controls-guide {
    max-width: 1200px;
    width: 100%;
    padding: 15px 30px;
}

.controls-guide h3 {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.control-item {
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-muted);
}

.control-item strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 4px;
}

.control-item span {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    padding: 2px 6px;
    font-family: var(--font-grotesk);
}

/* --- ÉCRAN 2 : LOBBY --- */
#screen-lobby {
    justify-content: flex-start;
    padding-top: 90px;
    max-width: 1100px;
    width: 100%;
    left: 0;
    right: 0;
    margin: 0 auto;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.lobby-badge {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid currentColor;
}

.lobby-badge.waiting {
    color: var(--neon-gold);
    background: rgba(255, 215, 0, 0.08);
}

.lobby-badge.connected {
    color: var(--neon-success);
    background: rgba(57, 255, 20, 0.08);
}

.lobby-container-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    width: 100%;
}

.lobby-settings, .lobby-players {
    padding: 30px;
}

.lobby-settings h3, .lobby-players h3 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.setting-row label {
    font-weight: 600;
    color: var(--text-muted);
}

.setting-row select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-main);
    font-family: var(--font-outfit);
    padding: 10px 20px;
    font-size: 0.95rem;
    width: 220px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.setting-row select:focus {
    outline: none;
    border-color: var(--neon-p1);
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.player-slot {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
}

.player-slot.active {
    border-color: rgba(255, 255, 255, 0.15);
}

.player-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 2px solid;
    transition: var(--transition-smooth);
}

.player-avatar.p1-color {
    border-color: var(--neon-p1);
    background: var(--neon-p1-glow);
    box-shadow: 0 0 10px var(--neon-p1-glow);
}

.player-avatar.p2-color {
    border-color: var(--neon-p2);
    background: var(--neon-p2-glow);
    box-shadow: 0 0 10px var(--neon-p2-glow);
}

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

.player-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.player-status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.invite-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-md);
    padding: 20px;
    text-align: center;
    margin-bottom: 30px;
}

.invite-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#room-code-text {
    font-family: var(--font-grotesk);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--neon-accent);
    text-shadow: 0 0 10px var(--neon-accent-glow);
}

/* --- ÉCRAN 3 : BOUTIQUE / SHOP --- */
#screen-shop {
    padding: 30px 40px;
    justify-content: space-between;
    overflow-y: auto;
}

.shop-header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.round-summary {
    padding: 10px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.round-summary h2 {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.round-summary h1 {
    font-size: 1.6rem;
    margin: 0;
}

.gold-counter {
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-grotesk);
    font-size: 1.8rem;
    font-weight: 700;
    border-color: var(--neon-gold);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.05);
}

#shop-gold-amount {
    color: var(--neon-gold);
    text-shadow: 0 0 10px var(--neon-gold-glow);
}

.gold-unit {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.shop-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    flex-grow: 1;
}

.shop-category {
    width: 100%;
}

.category-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-badge {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-outfit);
}

.shop-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* CARTE AMÉLIORATION */
.shop-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius-md);
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: var(--transition-smooth);
    cursor: pointer;
    overflow: hidden;
}

.shop-card:hover:not(.purchased):not(.disabled) {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.shop-card.purchased {
    border-color: var(--neon-success);
    background: rgba(57, 255, 20, 0.03);
}

@keyframes goldPulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.15), inset 0 0 5px rgba(255, 215, 0, 0.02);
        border-color: rgba(255, 215, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.35), inset 0 0 12px rgba(255, 215, 0, 0.08);
        border-color: rgba(255, 215, 0, 1);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.15), inset 0 0 5px rgba(255, 215, 0, 0.02);
        border-color: rgba(255, 215, 0, 0.6);
    }
}

.shop-card.maxed {
    animation: goldPulse 3s infinite ease-in-out;
    background: rgba(255, 215, 0, 0.02) !important;
    cursor: not-allowed !important;
}

.shop-card.maxed .card-price {
    color: var(--neon-gold) !important;
}

.shop-card.maxed .purchase-overlay {
    opacity: 1 !important;
    color: var(--neon-gold) !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    background: rgba(7, 6, 15, 0.9) !important;
}

.shop-card.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.card-upgrade-icon {
    font-size: 1.7rem;
    margin-bottom: 5px;
}

.shop-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.shop-card p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
    flex-grow: 1;
    margin-bottom: 8px;
}

.card-level-dots {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.level-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.level-dot.active {
    background: var(--neon-p1);
    box-shadow: 0 0 5px var(--neon-p1-glow);
}

.card-price {
    font-family: var(--font-grotesk);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--neon-gold);
    display: flex;
    align-items: center;
    gap: 4px;
}

.shop-card.purchased .card-price {
    color: var(--neon-success);
}

.purchase-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 6, 15, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-grotesk);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--neon-success);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.shop-card.purchased .purchase-overlay {
    opacity: 1;
}

.shop-footer {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    gap: 40px;
}

.shop-stats {
    flex-grow: 1;
    padding: 15px 25px;
}

.shop-stats h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.stats-grid {
    display: flex;
    gap: 20px;
}

.stat-bubble {
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
}

.stat-bubble span {
    font-weight: 700;
    color: var(--neon-p1);
}

/* SUPERPOSITION BOUTIQUE */
.shop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 6, 15, 0.85);
    backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.shop-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 204, 0.1);
    border-top: 3px solid var(--neon-p1);
    border-radius: 50%;
    margin: 0 auto 20px auto;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px var(--neon-p1-glow);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- ÉCRAN 4 : PLATEAU DE JEU HUD & CANVAS --- */
#screen-game {
    padding: 0;
    justify-content: flex-start;
}

#game-hud {
    width: 100%;
    height: 80px;
    background: rgba(18, 16, 36, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
}

.hud-player {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 320px;
}

.hud-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: var(--transition-smooth);
}

.hud-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hud-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.round-dots {
    display: flex;
    gap: 6px;
}

.round-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-p1 .round-dot.won {
    background: var(--neon-p1);
    box-shadow: 0 0 8px var(--neon-p1);
}

.hud-p2 .round-dot.won {
    background: var(--neon-p2);
    box-shadow: 0 0 8px var(--neon-p2);
}

.hud-bar-container {
    height: 16px;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.hud-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-p1) 0%, #00b386 100%);
    box-shadow: 0 0 10px var(--neon-p1-glow);
    transition: width 0.3s ease-out;
}

.p2-hp-color {
    background: linear-gradient(90deg, #ff007f 0%, #cc0066 100%) !important;
    box-shadow: 0 0 10px var(--neon-p2-glow) !important;
}

.hud-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.hud-extra {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.8rem;
}

.hud-gold {
    font-family: var(--font-grotesk);
    font-weight: 700;
    color: var(--neon-gold);
}

.hud-ability {
    color: var(--text-muted);
}

.hud-ability.active {
    color: var(--neon-accent);
    font-weight: 700;
    text-shadow: 0 0 5px var(--neon-accent-glow);
}

.hud-ability.cooldown {
    color: var(--text-muted);
    opacity: 0.5;
}

.hud-center {
    padding: 10px 25px;
    text-align: center;
    border-radius: var(--border-radius-md);
    background: rgba(7, 6, 15, 0.6);
}

#hud-timer {
    font-family: var(--font-grotesk);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1px;
}

#hud-round-number {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.text-right { text-align: right; }
.flex-reverse { flex-direction: row-reverse; }

/* CANVAS ET ZONE DE RENDU */
#canvas-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1;
    background-color: #030206;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#game-canvas {
    background-color: #050409;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 120px);
    object-fit: contain;
}

/* OVERLAYS DE JEU */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 4, 9, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.game-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.overlay-content {
    text-align: center;
}

.overlay-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

#preview-map-name {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--neon-accent);
    margin-bottom: 25px;
}

.map-loading-bar {
    width: 250px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    margin: 0 auto;
    overflow: hidden;
}

.map-loading-bar .fill {
    height: 100%;
    width: 0%;
    background: var(--neon-accent);
    box-shadow: 0 0 10px var(--neon-accent);
    animation: fillProgress 3s linear forwards;
}

@keyframes fillProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

#countdown-overlay {
    background: rgba(5, 4, 9, 0.4);
    backdrop-filter: blur(2px);
}

#countdown-text {
    font-family: var(--font-grotesk);
    font-size: 8rem;
    font-weight: 800;
    color: var(--neon-p1);
    transform: scale(0.5);
    opacity: 0;
}

#countdown-text.pulse {
    animation: countdownPulse 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes countdownPulse {
    0% { transform: scale(0.3); opacity: 0; }
    30% { transform: scale(1.1); opacity: 1; }
    80% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

.error-text {
    color: var(--neon-danger);
    font-size: 2rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

.mt-20 { margin-top: 20px; }

/* --- ÉCRAN 5 : FIN DE JEU / GAME OVER --- */
#screen-gameover {
    background: radial-gradient(circle at 50% 50%, #15091a 0%, #07060f 100%);
}

.gameover-container {
    max-width: 750px;
    width: 100%;
    padding: 50px;
    text-align: center;
    border-color: rgba(157, 78, 221, 0.15);
    box-shadow: 0 0 40px rgba(157, 78, 221, 0.1);
}

.trophy-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: floatTrophy 4s ease-in-out infinite;
    filter: drop-shadow(0 0 20px var(--neon-gold-glow));
}

@keyframes floatTrophy {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.gameover-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--neon-gold);
}

.gameover-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.stats-table-wrapper {
    margin-bottom: 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px 30px;
}

.stats-table-wrapper h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-align: left;
}

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

.stats-table th, .stats-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-table th {
    font-family: var(--font-grotesk);
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stats-table td {
    font-size: 0.95rem;
}

.stats-table td:nth-child(2), .stats-table td:nth-child(3) {
    font-weight: 700;
    font-family: var(--font-grotesk);
    font-size: 1.05rem;
    text-align: center;
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.gameover-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* --- ÉCRAN 6 : ÉDITEUR INTERACTIF --- */
#screen-editor {
    justify-content: flex-start;
    padding-top: 80px;
}

.editor-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 30px;
    padding: 25px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.editor-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-controls h3 {
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.editor-help-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.brush-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brush-btn {
    justify-content: flex-start;
    padding: 10px 15px;
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: 0.5px;
}

.brush-btn.active {
    border-color: var(--neon-accent);
    background: rgba(157, 78, 221, 0.1);
    box-shadow: 0 0 10px var(--neon-accent-glow);
}

.brush-preview {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
}

.editor-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-meta label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.editor-meta input {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 10px 14px;
    color: var(--text-main);
    font-family: var(--font-outfit);
    font-size: 0.95rem;
}

.editor-meta input:focus {
    outline: none;
    border-color: var(--neon-accent);
}

.editor-actions-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.editor-canvas-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#editor-canvas {
    background-color: #050409;
    display: block;
    cursor: crosshair;
    max-width: 100%;
    max-height: calc(100vh - 180px);
    object-fit: contain;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.spawn-badge {
    position: absolute;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-grotesk);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: 1.5px solid;
}

.spawn-badge.p1-badge {
    color: var(--neon-p1);
    border-color: var(--neon-p1);
    background: var(--neon-p1-glow);
}

.spawn-badge.p2-badge {
    color: var(--neon-p2);
    border-color: var(--neon-p2);
    background: var(--neon-p2-glow);
}

/* CLASSEMENT MODAL */
.leaderboard-container {
    max-width: 600px;
    width: 100%;
    padding: 40px;
    text-align: center;
}

.leaderboard-container h2 {
    font-size: 1.8rem;
    color: var(--neon-gold);
    margin-bottom: 8px;
}

.leaderboard-container .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.leaderboard-table-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 10px 20px;
    max-height: 380px;
    overflow-y: auto;
}

/* RESPONSIVE HACKS */
@media (max-width: 1240px) {
    .modes-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 720px;
    }
}

@media (max-width: 768px) {
    .modes-grid {
        grid-template-columns: 1fr;
        max-width: 440px;
    }
    .lobby-container-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .editor-layout {
        grid-template-columns: 1fr;
    }
    .editor-canvas-wrapper {
        overflow-x: auto;
    }
    .campaign-stages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .campaign-stages-grid {
        grid-template-columns: 1fr;
    }
}

/* --- BOUTON CAMPAGNE --- */
.btn-campaign {
    background: linear-gradient(135deg, var(--neon-accent) 0%, #b5179e 100%);
    color: var(--text-main);
    box-shadow: 0 4px 15px var(--neon-accent-glow);
    padding: 24px 24px; /* Double la hauteur verticale de padding */
    font-size: 1.1rem;   /* Harmonisation de la taille du texte */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.btn-campaign:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--neon-accent-glow), 0 0 15px var(--neon-accent);
}

/* --- BOUTON INFINI --- */
.btn-infinite {
    background: linear-gradient(135deg, var(--neon-accent) 0%, #8b5cf6 100%);
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    padding: 24px 24px; /* Même taille verticale que le bouton de la campagne */
    font-size: 1.1rem;   /* Harmonisation de la taille du texte */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: none;
}
.btn-infinite:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6), 0 0 15px var(--neon-accent);
}

/* --- ÉCRAN SELECTION CAMPAGNE --- */
#screen-campaign-menu {
    justify-content: flex-start;
    padding-top: 80px;
    overflow-y: auto;
}

.campaign-header {
    width: 100%;
    max-width: 1100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 30px;
}

.campaign-progress-container {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.95rem;
}

.progress-label {
    color: var(--text-muted);
    font-weight: 600;
}

.progress-bar-wrapper {
    width: 120px;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-gold) 0%, #ffa200 100%);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.campaign-stages-grid-wrapper {
    width: 100%;
    max-width: 1100px;
    padding-bottom: 40px;
}

.campaign-stages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* CARTES ETAPES */
.stage-card {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    background: var(--bg-surface);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    height: 340px;
}

.stage-card.unlocked {
    border-color: rgba(157, 78, 221, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stage-card.unlocked:hover {
    transform: translateY(-5px);
    border-color: var(--neon-accent);
    box-shadow: 0 10px 25px var(--neon-accent-glow), 0 0 10px rgba(157, 78, 221, 0.15);
}

.stage-card.locked {
    opacity: 0.45;
    background: rgba(5, 4, 9, 0.4);
    cursor: not-allowed;
}

.stage-card.completed {
    border-color: rgba(255, 215, 0, 0.3);
}

.stage-card.completed::before {
    content: '🏆 COMPLÉTÉ';
    position: absolute;
    top: 10px;
    right: -25px;
    background: var(--neon-gold);
    color: #000;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 3px 25px;
    transform: rotate(45deg);
    letter-spacing: 0.5px;
}

.stage-number {
    font-family: var(--font-grotesk);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stage-card.unlocked .stage-number {
    color: var(--neon-accent);
}

.stage-name {
    font-family: var(--font-grotesk);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.stage-info-badge {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.stage-card.unlocked .stage-info-badge {
    color: var(--neon-gold);
    border-color: rgba(255, 215, 0, 0.2);
}

.stage-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 15px;
    flex-grow: 1;
}

.stage-threat {
    font-size: 0.75rem;
    color: var(--neon-danger);
    background: rgba(255, 51, 51, 0.05);
    border: 1px solid rgba(255, 51, 51, 0.15);
    border-radius: 4px;
    padding: 5px 8px;
    width: 100%;
    margin-bottom: 15px;
    font-weight: 600;
}

.stage-lock-icon {
    font-size: 2rem;
    margin: 30px 0;
    color: var(--text-muted);
}

/* --- ÉCRAN VICTOIRE CAMPAGNE --- */
.campaign-victory-container {
    max-width: 650px;
    width: 100%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 215, 0, 0.25);
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.08);
}

.campaign-victory-story {
    width: 100%;
    padding: 25px;
    margin: 25px 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--border-radius-lg);
    text-align: center;
    border: 1px solid var(--border-color);
}

.campaign-victory-story h3 {
    font-size: 1.1rem;
    color: var(--neon-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.campaign-victory-story p {
    font-style: italic;
    color: var(--text-main);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Vignette d'herbe camouflée (Radial-Gradient Premium - Ultra Discret & Harmonieux) */
#grass-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    background: radial-gradient(circle, rgba(0, 40, 10, 0) 65%, rgba(0, 80, 20, 0.03) 85%, rgba(0, 100, 25, 0.13) 100%);
    opacity: 0;
    transition: opacity 0.45s ease-in-out;
    border-radius: 4px;
}

#grass-vignette.active {
    opacity: 1;
}

/* Vignette de dégâts (Flash Rouge Gradient - Ultra Discret & Rapide) */
#damage-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 6;
    background: radial-gradient(circle, rgba(139, 0, 0, 0) 58%, rgba(200, 0, 10, 0.04) 80%, rgba(220, 0, 25, 0.14) 100%);
    opacity: 0;
    transition: opacity 0.06s ease-out;
    border-radius: 4px;
}

#damage-vignette.active {
    opacity: 1;
}

/* ==========================================================================
   STYLE DES ELEMENTS DU MODE INFINI (SURVIE) & AUDIO
   ========================================================================== */

/* Carte Mode Infini sur l'accueil */
.mode-infinite-card {
    border-color: var(--neon-accent) !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2), inset 0 0 10px rgba(139, 92, 246, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mode-infinite-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.45), inset 0 0 15px rgba(139, 92, 246, 0.2);
    border-color: #a78bfa !important;
}

/* Carte Mode Campagne sur l'accueil */
.mode-campaign-card {
    border-color: var(--neon-gold) !important;
    box-shadow: 0 0 15px var(--neon-gold-glow), inset 0 0 10px rgba(255, 215, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mode-campaign-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.45), inset 0 0 15px rgba(255, 215, 0, 0.2);
    border-color: #ffe066 !important;
}

/* Modale de Configuration */
#infinite-setup-overlay .leaderboard-container {
    background: rgba(10, 8, 20, 0.85) !important;
    border: 2px solid rgba(139, 92, 246, 0.3) !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(139, 92, 246, 0.15) !important;
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

#infinite-setup-overlay .leaderboard-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6, var(--neon-accent), #ec4899);
}

#infinite-setup-overlay label {
    color: var(--text-color);
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#infinite-setup-overlay select, 
#select-shop-music {
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
}

#infinite-setup-overlay select:focus, 
#select-shop-music:focus {
    outline: none;
    border-color: var(--neon-accent) !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

#infinite-setup-overlay select option {
    background: #0c091f;
    color: #fff;
    padding: 10px;
}

/* Styles des curseurs de Volume (Range sliders) */
#infinite-volume,
#shop-volume {
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    border-radius: 1.5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.3s;
}

#infinite-volume::-webkit-slider-thumb,
#shop-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--neon-accent);
    cursor: pointer;
    box-shadow: 0 0 6px var(--neon-accent);
    transition: transform 0.1s, background-color 0.2s;
}

#infinite-volume::-webkit-slider-thumb:hover,
#shop-volume::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #a78bfa;
}

/* Compatibilité Firefox */
#infinite-volume::-moz-range-thumb,
#shop-volume::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border: none;
    border-radius: 50%;
    background: var(--neon-accent);
    cursor: pointer;
    box-shadow: 0 0 6px var(--neon-accent);
    transition: transform 0.1s, background-color 0.2s;
}

#infinite-volume::-moz-range-thumb:hover,
#shop-volume::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: #a78bfa;
}

#infinite-volume::-moz-range-track,
#shop-volume::-moz-range-track {
    height: 3px;
    border-radius: 1.5px;
    background: rgba(255, 255, 255, 0.1);
}

/* Case à cocher Mute */
#infinite-mute,
#shop-mute {
    position: relative;
    cursor: pointer;
}

/* Panneau Audio dans la Boutique */
#shop-audio-controls {
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(139, 92, 246, 0.05) !important;
    background: rgba(12, 9, 31, 0.75) !important;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
    flex-grow: 0 !important;
    width: 260px !important;
    max-width: 260px !important;
}

#shop-special-container {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
}

#shop-audio-controls:hover {
    border-color: rgba(139, 92, 246, 0.35) !important;
    box-shadow: 0 4px 25px rgba(139, 92, 246, 0.1) !important;
}

#shop-audio-controls h4 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Grille de sélection des cartes */
.map-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    width: 100%;
    max-height: 440px;
    overflow-y: auto;
    padding-right: 5px;
    margin-top: 15px;
}

/* Scrollbar stylisée pour la grille */
.map-selection-grid::-webkit-scrollbar {
    width: 6px;
}
.map-selection-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}
.map-selection-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 0, 128, 0.25);
    border-radius: 4px;
}
.map-selection-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 0, 128, 0.45);
}

/* Carte de sélection individuelle */
.map-card-item {
    background: rgba(12, 9, 31, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.map-card-item:hover {
    transform: translateY(-4px);
    border-color: var(--neon-accent);
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.25), inset 0 0 10px rgba(255, 0, 128, 0.08);
    background: rgba(255, 0, 128, 0.04);
}

/* Canvas miniature */
.map-card-canvas {
    background: #050409;
    border-radius: 4px;
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    display: block;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.map-card-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-family: var(--font-outfit), sans-serif;
}

/* Miniature aléatoire */
.map-card-random-preview {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #15091a 0%, #07060f 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 8px;
    border: 1px dashed rgba(255, 0, 128, 0.25);
    position: relative;
    color: #ff0080;
    text-shadow: 0 0 10px #ff0080;
    animation: randomGlow 3s infinite alternate;
}

@keyframes randomGlow {
    0% { border-color: rgba(255, 0, 128, 0.25); box-shadow: 0 0 5px rgba(255, 0, 128, 0.08); }
    100% { border-color: rgba(0, 240, 255, 0.4); box-shadow: 0 0 12px rgba(0, 240, 255, 0.25); color: #00f0ff; text-shadow: 0 0 10px #00f0ff; }
}

/* --- SÉLECTEUR DE LANGUE I18N --- */
.i18n-selector {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 2000;
    display: flex;
    gap: 6px;
    background: rgba(18, 16, 36, 0.45);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.btn-lang {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-family: var(--font-grotesk), sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.btn-lang:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.btn-lang.active {
    color: var(--neon-accent) !important;
    background: rgba(139, 92, 246, 0.14) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.2);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    opacity: 1;
}

