:root {
    --bg: #040033;
    --bg-center: #201782;
    --nav-bg: #191953;
    --hero-bg: #2a2a7e;
    --card-img: #26266e;
    --card-body: #03030add;
    --cyan: #35bdf2;
    --white: #ffffff;
    --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--white);
    font-family: "Gabarito", Arial, sans-serif;
}

/* Radial background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at center, var(--bg-center) 0%, var(--bg) 100%);
    pointer-events: none;
}

a { color: inherit; text-decoration: none; }

p {
    font-weight: 400;
}

/* ============ TOP NAV (sticky) ============ */
.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 10px 40px;
    background: var(--nav-bg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo { height: 44px; width: auto; }

.brand-name {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: .5px;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: .85rem;
    font-weight: 400;
    letter-spacing: .5px;
}

.nav-links a { transition: opacity .2s; }
.nav-links a:hover { opacity: .7; }

.dot { opacity: .6; }

/* --- burger mobile --- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 8px;
    border: none;
    background: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: var(--white);
    transition: transform .25s ease, opacity .2s ease;
}

/* barres -> croix */
.topnav.open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.topnav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.topnav.open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* texte présent uniquement pour le SEO / lecteurs d'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============ HERO ============ */
.hero {
    background: var(--hero-bg);
}

.hero-img {
    display: block;
    width: 100%;
    height: auto;
}

/* ============ BIENVENUE + RÉSEAUX ============ */
.welcome {
    padding: 50px 20px 60px;
    text-align: center;
}

.welcome h2 {
    margin: 0 0 18px;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 900;
}

.welcome h2 + .welcome-text { margin-bottom: 50px; }

.welcome-logo {
    display: block;
    width: 180px;
    max-width: 60%;
    height: auto;
    margin: 20px auto 30px;
}

.welcome-text {
    max-width: 640px;
    margin: 0 auto 20px;
    line-height: 1.5;
}

/* --- boutons réseaux sociaux (images, hover scale) --- */
.socials {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 30px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    transition: transform .25s ease;
}

.social-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.social-btn:hover { transform: scale(1.15); }

/* ============ SECTIONS (Nos jeux / ...) ============ */
.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 30px 40px;
    scroll-margin-top: 80px;
}

.section-title {
    margin: 0 0 25px;
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    font-weight: 900;
}

.section-intro {
    margin: -10px 0 30px;
    line-height: 1.5;
}

/* --- grilles de cartes --- */
.games-grid,
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.team-grid {
    row-gap: 50px;
}

.timed-row {
    margin-top: 40px;
}

.games-grid[hidden] {
    display: none;
}

@media (max-width: 650px) {
    .games-wrap {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .games-wrap .games-grid:not([hidden]) {
        display: contents;
    }

    .timed-row { margin-top: 0; }
}

.card {
    position: relative;
    aspect-ratio: 450 / 708;
    overflow: hidden;
    border-radius: 32px;
    cursor: pointer;
}

.team-grid .card { 
    aspect-ratio: 1 / 1; 
}

.card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-photos {
    position: absolute;
    inset: 0;
}

.card-photos .card-img {
    animation-timing-function: linear;
    will-change: opacity;
}

.card-photos .card-img:nth-child(1) { z-index: 1; opacity: 1; }
.card-photos .card-img:nth-child(2) { z-index: 2; opacity: 0; animation: staffFade2 15s infinite; }
.card-photos .card-img:nth-child(3) { z-index: 3; opacity: 0; animation: staffFade3 15s infinite; }

@keyframes staffFade2 {
    0%, 33.33%     { opacity: 0; }
    37.33%, 74%    { opacity: 1; }
    74.01%, 100%   { opacity: 0; }
}

@keyframes staffFade3 {
    0%             { opacity: 1; }
    4%, 66.67%     { opacity: 0; }
    70.67%, 100%   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .card-photos .card-img { animation: none; opacity: 0; }
    .card-photos .card-img:nth-child(1) { opacity: 1; }
}

.card-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 18px 20px;
    z-index: 5;
    background: var(--card-body);
    max-height: 100%;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .3s ease;
}

@media (hover: hover) {
    .card:hover .card-body {
        transform: translateY(0);
    }
}

.card.open .card-body {
    transform: translateY(0);
}

.team-grid .card-body {
    --peek: 48px;
    transform: translateY(calc(100% - var(--peek)));
}

.team-grid .card-body h4 {
    margin-bottom: 10px;
}

.card-body h4 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 900;
}

.card-body p {
    margin: 0;
    font-size: .92rem;
    line-height: 1.45;
}

/* ============ PARTENAIRES ============ */
.partners-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 25px 35px;
    margin-bottom: 35px;
}

.partners-line img {
    height: auto;
}

/* ============ NEWSLETTER ============ */
.newsletter-text {
    margin: 0 0 20px;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.newsletter-input {
    flex: 1 1 260px;
    max-width: 380px;
    padding: 12px 16px;
    border: 2px solid var(--card-img);
    border-radius: 10px;
    background: var(--card-body);
    color: var(--white);
    font-family: inherit;
    font-size: 1rem;
}

.newsletter-input::placeholder { color: rgba(255, 255, 255, .45); }

.newsletter-input:focus {
    outline: none;
    border-color: var(--cyan);
}

.newsletter-btn {
    padding: 12px 26px;
    border: none;
    border-radius: 10px;
    background: var(--cyan);
    color: var(--nav-bg);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform .2s ease;
}

.newsletter-btn:hover { transform: scale(1.05); }

.newsletter-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

/* case à cocher RGPD : passe sous le champ + bouton */
.newsletter-consent {
    flex: 1 1 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 4px;
    font-size: .75rem;
    line-height: 1.5;
    cursor: pointer;
}

.newsletter-consent input {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--cyan);
    cursor: pointer;
}

.newsletter-consent a { text-decoration: underline; }

.newsletter-msg { margin: 12px 0 0; font-size: .9rem; min-height: 1.2em; }
.newsletter-msg.ok { color: #7dffa8; }
.newsletter-msg.ko { color: #ff8a8a; }

.newsletter-rgpd {
    margin: 14px 0 0;
    font-size: .75rem;
    line-height: 1.5;
    color: var(--white);
}

.newsletter-rgpd a { text-decoration: underline; }

/* ============ PRESSE ============ */
.page-presse {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-presse .footer { margin-top: auto; }

.press-links {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.press-links a {
    color: var(--cyan);
    text-decoration: underline;
}

.press-links a:hover { color: var(--white); }

/* honeypot */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ============ FOOTER ============ */
.footer {
    background: var(--cyan);
    color: var(--white);
    padding: 25px 40px 15px;
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px 20px;
    font-weight: 400;
    letter-spacing: .5px;
}

.footer-link:hover { opacity: .7; }

.socials-small {
    margin-top: 0;
    gap: 15px;
}

.socials-small .social-btn {
    width: 42px;
    height: 42px;
}

.copyright {
    margin: 20px 0 0;
    font-size: .8rem;
}

/* ============ RESPONSIVE ============ */

html { font-size: clamp(14px, 1.5vw, 16px); }

/* cadres jeux & équipe : 2 par ligne sur mobile */
@media (max-width: 650px) {
    .games-grid,
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* menu burger : liens en déroulé vertical sous la barre */
    .nav-toggle { display: flex; }

    .nav-links {
        flex-basis: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }

    .topnav.open .nav-links { max-height: 300px; }

    .nav-links a {
        width: 100%;
        padding: 11px 0;
    }

    .nav-links .dot { display: none; }
}
