:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --google-blue: #4285F4;
    --radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Segoe UI', sans-serif; }

body { background-color: var(--bg-color); color: var(--text-main); min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--text-main); 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    gap: 8px;
}
.brand span { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.header-controls { display: flex; align-items: center; gap: 15px; }

/* Language Selector */
.lang-select {
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

/* User Dropdown / Profile Button */
.btn-profile {
    background: transparent;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s;
}
.btn-profile:hover { background: #f1f5f9; border-color: var(--primary-color); }
.btn-profile i { color: var(--primary-color); font-size: 1.1rem; }

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 8px rgba(79, 70, 229, 0.3); }

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-outline:hover { background: var(--primary-color); color: white; }

.btn-google {
    background: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    width: 100%;
    margin-bottom: 1.2rem;
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
}
.btn-google:hover { background: #f7f8f8; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.btn-google img { width: 18px; margin-right: 8px; }

/* Main Catalog */
main { flex: 1; padding: 3rem 1rem; max-width: 1200px; margin: 0 auto; width: 100%; }

h1 { margin-bottom: 2rem; text-align: center; font-weight: 800; font-size: 2.2rem; color: var(--text-main); }

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Game Card */
.game-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
}

.game-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

.card-thumb { height: 180px; background-color: #cbd5e1; background-size: cover; background-position: center; position: relative; }

.card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.game-title { font-size: 1.25rem; margin-bottom: 0.5rem; font-weight: 700; color: var(--text-main); }
.game-desc { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.5; flex: 1; }

.game-stats {
    display: flex;
    justify-content: space-around;
    background: #f1f5f9;
    padding: 0.8rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}
.stat-item { display: flex; flex-direction: column; align-items: center; font-size: 0.8rem; color: var(--text-muted); }
.stat-val { font-weight: 700; font-size: 1.1rem; color: var(--text-main); margin-bottom: 2px; }

/* Bouton vert + pour les vies */
.lives-container { position: relative; display: flex; flex-direction: column; align-items: center; }
.btn-add-life {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    position: absolute;
    top: 0; right: -15px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.btn-add-life:hover { transform: scale(1.1); background: #059669; }

.card-actions { display: flex; gap: 0.8rem; }
.btn-play { flex: 2; text-decoration: none; text-align: center; background: var(--success); color: white; border: none; padding: 0.8rem; border-radius: 10px; font-weight: 700; transition: 0.2s; }
.btn-play:hover { background: #059669; }
.btn-details { flex: 1; background: white; border: 2px solid #e2e8f0; color: var(--text-muted); border-radius: 10px; cursor: pointer; transition: 0.2s; font-size: 1.2rem; }
.btn-details:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.modal.active { display: flex; }

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal { 
    position: absolute; top: 20px; right: 25px; 
    font-size: 1.5rem; color: #94a3b8; 
    cursor: pointer; transition: 0.2s; 
}
.close-modal:hover { color: var(--text-main); }

h2 { margin-bottom: 1.5rem; text-align: center; color: var(--text-main); }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--text-main); }
.form-group input, .form-group select { 
    width: 100%; padding: 0.8rem 1rem; 
    border: 2px solid #e2e8f0; border-radius: 10px; 
    font-size: 1rem; transition: 0.2s; outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary-color); }

.btn-full { width: 100%; padding: 1rem; font-size: 1rem; margin-top: 0.5rem; }

.switch-auth { margin-top: 1.5rem; text-align: center; font-size: 0.9rem; color: var(--primary-color); cursor: pointer; font-weight: 500; }
.switch-auth:hover { text-decoration: underline; }

/* Social Share */
.social-share-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px;
}
.social-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-decoration: none; color: var(--text-main); font-size: 0.8rem; gap: 5px;
    padding: 10px; border-radius: 10px; transition: background 0.2s;
}
.social-btn:hover { background: #f1f5f9; }
.social-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.2rem; }
.bg-fb { background: #1877F2; }
.bg-wa { background: #25D366; }
.bg-tw { background: #000000; }
.bg-li { background: #0A66C2; }

.hidden { display: none; }
footer { text-align: center; padding: 3rem; color: var(--text-muted); font-size: 0.9rem; margin-top: auto; border-top: 1px solid #e2e8f0; }

/* --- NEW PAYMENT MODAL STYLES --- */
.payment-card-wrapper {
    position: relative;
    text-align: center;
}
.close-payment-btn {
    position: absolute; top: 15px; right: 20px; font-size: 24px; cursor: pointer; border: none; background: none; color: #aaa;
}
.close-payment-btn:hover { color: #333; }
.subtitle { color: #666; margin-bottom: 25px; margin-top: -10px; font-size: 0.95rem; }
.plans-container { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.plan-card {
    background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 16px; padding: 20px; width: 140px;
    display: flex; flex-direction: column; align-items: center; transition: all 0.3s; cursor: pointer;
}
.plan-card:hover { border-color: var(--primary-color); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.plan-card.popular { border-color: var(--secondary-color); background: #fffbeb; position: relative; }
.badge-pop {
    position: absolute; top: -10px; background: var(--secondary-color); color: white; font-size: 0.7rem;
    padding: 4px 10px; border-radius: 12px; font-weight: bold; text-transform: uppercase;
}
.plan-lives { font-size: 1.2rem; font-weight: 800; color: #333; margin-bottom: 5px; }
.plan-price { font-size: 1rem; color: #666; margin-bottom: 15px; }
.btn-buy {
    background: var(--text-main); color: white; border: none; padding: 8px 16px; border-radius: 8px;
    font-weight: 600; cursor: pointer; width: 100%; transition: background 0.2s;
}
.btn-buy:hover { background: #000; }
.secure-info { font-size: 0.8rem; color: #888; margin-top: 25px; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* Responsive Mobile */
@media (max-width: 600px) {
    header { padding: 1rem; flex-direction: column; gap: 1rem; }
    .brand { font-size: 1.4rem; width: 100%; justify-content: center; }
    .header-controls { width: 100%; justify-content: center; flex-wrap: wrap; gap: 10px; }
    .user-info { width: 100%; justify-content: center; }
    .modal-content { padding: 1.5rem; margin: 1rem; max-height: 90vh; overflow-y: auto; }
}