* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #7fb3ff 0%, #4a90e2 100%);
    min-height: 100vh;
    padding: 0 0 130px 0; /* MODIFIÉ : Ajout padding-bottom pour la pub sticky */
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    overflow-x: hidden;
    width: 100%;
}

/* Header moderne avec bords arrondis */
.top-header {
    background: linear-gradient(135deg, 
        #1e3a5f 0%, 
        #2a529869 50%, 
        #1e3a5f 100%);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    border-radius: 30px;
    margin-bottom: 40px;
    border: 2px solid rgba(127, 179, 255, 0.4);
    position: relative;
    overflow: visible; 
}

.top-header::before {
    content: '';
    position: absolute;
    top: -25%;
    left: -25%;
    width: 150%;
    height: 150%;
    background: 
        radial-gradient(ellipse 500px 350px at center, 
            rgba(255, 230, 0, 0.6) 0%,
            rgba(255, 215, 0, 0.5) 8%,
            rgba(255, 193, 7, 0.4) 15%,
            rgba(255, 165, 0, 0.3) 22%,
            rgba(74, 144, 226, 0.15) 30%,
            transparent 40%);
    animation: spotlightSlow 18s ease-in-out infinite;
    pointer-events: none;
}

@keyframes spotlightSlow {
    0% { transform: translate(15%, 10%) rotate(0deg); }
    15% { transform: translate(20%, 12%) rotate(45deg); }
    30% { transform: translate(18%, 8%) rotate(90deg); }
    45% { transform: translate(12%, 5%) rotate(135deg); }
    60% { transform: translate(10%, 10%) rotate(180deg); }
    75% { transform: translate(13%, 12%) rotate(225deg); }
    90% { transform: translate(17%, 9%) rotate(315deg); }
    100% { transform: translate(15%, 10%) rotate(360deg); }
}

.top-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.2) 0%, transparent 2%),
        radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 1.5%),
        radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.18) 0%, transparent 3%),
        radial-gradient(circle at 25% 70%, rgba(255, 223, 0, 0.25) 0%, transparent 4%),
        radial-gradient(circle at 75% 60%, rgba(135, 206, 235, 0.2) 0%, transparent 3%);
    animation: twinkle 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.header-content {
    max-width: 100%;
    padding: 40px 50px;
    display: grid;
    grid-template-columns: 220px 1fr 300px;
    align-items: center;
    gap: 50px;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-link:hover {
    transform: translateY(-5px) scale(1.05);
    filter: drop-shadow(0 10px 20px rgba(42, 82, 152, 0.3));
}

.main-logo {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 5px 15px rgba(42, 82, 152, 0.2));
}

.header-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.header-center h1 {
    font-size: 3.5em;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    letter-spacing: -1px;
    text-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.7),
        0 0 20px rgba(255, 255, 255, 0.3);
}

.game-icon {
    font-size: 1em;
    filter: drop-shadow(0 4px 10px rgba(102, 51, 153, 0.4));
}

.title-text {
    background: linear-gradient(135deg, 
        #ffffff 0%, 
        #e3f2fd 30%, 
        #bbdefb 60%, 
        #90caf9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.5));
}

.gamer-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1e3a5f;
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 900;
    font-size: 0.9em;
    letter-spacing: 3px;
    box-shadow: 
        0 10px 30px rgba(255, 215, 0, 0.6),
        inset 0 2px 0 rgba(255, 255, 255, 0.6),
        0 0 40px rgba(255, 215, 0, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    border: 3px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.gamer-badge::before {
    content: '⚡';
    font-size: 1.3em;
    background: linear-gradient(135deg, #FFA500 0%, #FF6347 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(255, 165, 0, 1)) 
            drop-shadow(0 0 3px rgba(0, 0, 0, 0.8));
}

.gamer-badge:hover {
    box-shadow: 
        0 12px 35px rgba(255, 165, 0, 0.7),
        inset 0 2px 0 rgba(255, 255, 255, 0.6);
    transform: translateY(-3px) scale(1.05);
}

.header-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
}

.header-tagline {
    margin: 0;
    text-align: center;
    line-height: 1.5;
    padding: 22px 30px;
    border-radius: 25px;
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 10px 35px rgba(0, 0, 0, 0.5),
        inset 0 2px 10px rgba(255, 255, 255, 0.9),
        0 0 0px rgba(255, 215, 0, 0.7);
    position: relative;
}

#page-subtitle {
    font-size: 1.45em;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(74, 144, 226, 0.6);
}

.header-tagline::before {
    content: '✨';
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2em;
    filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 1));
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { 
        transform: translateY(-50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: translateY(-50%) scale(1.3) rotate(20deg);
        opacity: 0.7;
    }
}

/* Language Selector */
.language-selector {
    position: relative;
    z-index: 1000;
}

.lang-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 10px 18px;
    color: white;
    font-weight: 700;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1001;
}

.lang-button:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.flag-icon {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.lang-arrow {
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.lang-button.active .lang-arrow {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: linear-gradient(135deg, #1e3a5f 0%, #2a5298 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 8px;
    min-width: 180px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1002;
}

.lang-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: white;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-weight: 600;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.lang-option.current {
    background: rgba(255, 215, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.lang-option .flag-icon {
    width: 28px;
    height: 21px;
}

.lang-menu::-webkit-scrollbar {
    width: 6px;
}

.lang-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.lang-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.lang-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 35px;
    margin-bottom: 50px;
}

.game-card {
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    border: 3px solid transparent;
}

.game-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
    border-color: #FFD700;
}

.game-image-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: linear-gradient(135deg, #7fb3ff 0%, #4a90e2 100%);
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.game-card:hover .game-image {
    transform: scale(1.15);
}

.game-info {
    padding: 30px;
}

.game-title {
    font-size: 1.8em;
    font-weight: 800;
    color: #2a5298;
    margin-bottom: 15px;
}

.game-description {
    color: #555;
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 20px;
}

.game-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 0.9em;
    color: #888;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.game-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.play-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #7fb3ff 0%, #4a90e2 100%);
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 1.2em;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.play-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.play-button:hover::before {
    width: 300px;
    height: 300px;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(74, 144, 226, 0.6);
    background: linear-gradient(135deg, #6ba3ff 0%, #3880d8 100%);
}

.play-button:active {
    transform: scale(0.98);
}

/* Ad Modal */
.ad-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    padding: 20px;
    overflow-y: auto;
}

.ad-modal.show {
    opacity: 1;
    visibility: visible;
}

.ad-modal::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: -1;
}

.ad-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 750px;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: auto;
}

.ad-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(238, 90, 82, 0.4);
    z-index: 10002;
    flex-shrink: 0;
}

.ad-modal-close:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(238, 90, 82, 0.6);
}

.ad-modal-title {
    color: #2a5298;
    font-size: 1.5em;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: center;
    padding-right: 40px;
    flex-shrink: 0;
}

.ad-container {
    width: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex: 1;
}

.ad-container .adsbygoogle {
    max-width: 100% !important;
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

.ad-container ins {
    max-width: 100% !important;
}

.ad-container iframe {
    max-width: 100% !important;
}

.ad-modal .ad-container {
    width: 100%;
    max-width: 728px;
    margin: 0 auto;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-modal .adsbygoogle {
    display: block;
    min-height: 90px;
    width: 100%;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    padding: 40px 30px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.08) 100%);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    margin-top: 60px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.footer a {
    color: white;
    text-decoration: none;
    font-weight: 800;
    transition: all 0.3s;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid transparent;
}

.footer a:hover {
    border-bottom-color: white;
}

/* Responsive */
@media (max-width: 1200px) {
    .header-content {
        grid-template-columns: 200px 1fr 280px;
        gap: 40px;
        padding: 35px 40px;
    }
    
    .main-logo {
        height: 90px;
    }
    
    .header-center h1 {
        font-size: 3em;
    }
    
    #page-subtitle {
        font-size: 1.25em;
    }
}

@media (max-width: 1024px) {
    body {
        padding-bottom: 110px; /* Réduit sur tablette */
    }

    .container {
        padding: 20px 15px;
    }

    .header-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
        padding: 35px 30px;
    }
    
    .logo-link {
        justify-content: center;
    }
    
    .main-logo {
        height: 85px;
    }
    
    .header-right {
        align-items: center;
    }
    
    .header-tagline::before {
        display: none;
    }
    
    .header-center h1 {
        font-size: 2.8em;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 100px; /* Réduit sur mobile */
    }

    .top-header {
        border-radius: 20px;
    }

    .header-content {
        padding: 30px 25px;
        gap: 25px;
    }
    
    .main-logo {
        height: 75px;
    }
    
    .header-center h1 {
        font-size: 2.2em;
        flex-direction: column;
        gap: 12px;
    }
    
    #page-subtitle {
        font-size: 1.15em;
    }
    
    .header-tagline {
        padding: 15px 20px;
    }
    
    .gamer-badge {
        font-size: 0.85em;
        padding: 8px 22px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .game-image-container {
        height: 250px;
    }
    
    .gamer-badge::before {
        color: #1e3a5f;
        text-shadow: 0 0 5px rgba(255, 165, 0, 0.8);
    }
    
    .ad-modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .ad-modal-content {
        width: 100%;
        max-width: 100%;
        padding: 20px 15px;
        border-radius: 15px;
        max-height: 85vh;
    }
    
    .ad-modal-title {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .ad-modal-close {
        width: 35px;
        height: 35px;
        font-size: 20px;
        top: 8px;
        right: 8px;
    }
    
    .ad-container {
        min-height: 200px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 90px; /* Encore plus réduit sur petit mobile */
    }

    .top-header {
        border-radius: 15px;
        margin-bottom: 25px;
    }

    .header-content {
        padding: 25px 20px;
    }
    
    .main-logo {
        height: 65px;
    }
    
    .header-center h1 {
        font-size: 1.9em;
    }
    
    #page-subtitle {
        font-size: 1.05em;
    }
    
    .header-tagline {
        padding: 12px 18px;
    }
    
    .gamer-badge {
        font-size: 0.75em;
        padding: 7px 18px;
        letter-spacing: 2px;
    }
    
    .gamer-badge::before {
        font-size: 1.2em;
        color: #1e3a5f;
    }

    .game-info {
        padding: 25px;
    }

    .footer {
        border-radius: 20px;
        padding: 30px 20px;
    }
    
    .ad-modal {
        padding: 5px;
    }
    
    .ad-modal-content {
        padding: 15px 10px;
        border-radius: 10px;
    }
    
    .ad-modal-title {
        font-size: 1.1em;
        margin-bottom: 10px;
        padding-right: 35px;
    }
    
    .ad-container {
        min-height: 150px;
    }
}

/* Actions des jeux (boutons Play et Leaderboard) */
.game-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.game-card .play-button,
.game-card .leaderboard-button {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-card .play-button {
    background: #6366f1;
    color: white;
}

.game-card .play-button:hover {
    background: #4f46e5;
    border-color: #6366f1;
}

.game-card .leaderboard-button {
    background: transparent;
    color: #ec4899;
    border-color: #ec4899;
}

.game-card .leaderboard-button:hover {
    background: #ec4899;
    color: white;
}

/* Mobile */
@media (max-width: 768px) {
    .game-actions {
        flex-direction: column;
    }
    
    .game-card .play-button,
    .game-card .leaderboard-button {
        width: 100%;
    }
}