/* Présentation du jeu (views/presentation.html) : la page des ordinateurs, avec le QR code, et sur téléphone
   l'écran qui recouvre l'accueil à l'arrivée sur le site, avec le bouton Play.
   Tout est rangé sous .presentation pour ne rien changer à l'accueil du jeu. */

html, body {
    margin: 0;
    padding: 0;
}

.presentation {
    background: #f6f7fa;
    color: #1d2b2a;
    font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
    font-weight: 500;
    line-height: 1.5;
}

.presentation :where(h1, h2, p, ul, ol) {
    margin: 0;
    padding: 0;
}

.presentation :where(ul, ol) {
    list-style: none;
}

/* Bandeau : présentation à gauche, QR code à droite */
.hero {
    background: #10817D;
    color: #fff;
    padding: 64px 32px 170px 32px;
}

/* Choix de la langue, en haut à droite du bandeau */
.langs {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    max-width: 1040px;
    margin: -40px auto 16px auto;
}

.langs a {
    padding: 4px 10px;
    border-radius: 999px;
    color: #e6f4f3;
    font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.langs a:hover {
    background: #fff2;
}

.langs a[aria-current] {
    background: #fff;
    color: #10817D;
}

.hero-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 56px;
}

.logo {
    width: 1.3em;
    height: auto;
    flex-shrink: 0;
}

.presentation h1 {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 0.3em;
}

.lead {
    max-width: 30em;
    margin-top: 18px;
    font-size: 1.2rem;
    color: #e6f4f3;
}

.stats {
    display: flex;
    gap: 36px;
    margin-top: 32px;
    font-size: 0.95rem;
    color: #e6f4f3;
}

.stats b {
    display: block;
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
}

.qr-card {
    flex-shrink: 0;
    width: 240px;
    padding: 16px 18px;
    background: #fff;
    color: #1d2b2a;
    border-radius: 28px;
    box-shadow: 0 16px 48px #0004;
    text-align: center;
}

.qr-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #10817D;
}

#qr {
    width: 150px;
    margin: 8px auto;
}

#qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.qr-card p {
    font-size: 0.85rem;
    color: #4d5b5a;
}

#qr-url {
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #10817D;
    overflow-wrap: anywhere;
}

/* Bouton Play, en bas de la page sur téléphone et tablette (le QR code, lui, n'y est pas affiché) */
.play-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 18px 60px 18px 46px;
    background: #10817D;
    color: #fff;
    border: none;
    border-radius: 999px;
    box-shadow: 0 8px 24px #10817d59;
    font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    cursor: pointer;
}

.play-btn:active {
    transform: scale(0.96);
}

.play-btn svg {
    width: 1.4em;
    height: 1.4em;
    fill: currentColor;
}

.play-again {
    display: flex;
    justify-content: center;
    margin-top: 64px;
}

.presentation.desktop .only-mobile,
.presentation.mobile .only-desktop {
    display: none;
}

/* Sur téléphone, la présentation recouvre l'accueil du jeu, y compris l'écran « tournez votre appareil » :
   elle se lit dans les deux sens. L'accueil ne charge Montserrat qu'en gras : le texte courant passe
   dans la police du téléphone. */
.presentation.mobile {
    position: fixed;
    inset: 0;
    z-index: 10000;
    overflow-y: auto;
    overscroll-behavior: contain;
    font-family: system-ui, 'Segoe UI', 'Arial', sans-serif;
    font-weight: 400;
}

.presentation.mobile :is(h1, h2, b, .worlds li) {
    font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
}

/* Aperçu du jeu : téléphone en paysage, à cheval sur le bandeau */
.phone {
    max-width: 860px;
    margin: -110px auto 0 auto;
    padding: 12px;
    box-sizing: border-box;
    background: #1b1f1f;
    border-radius: 40px;
    box-shadow: 0 24px 64px #0005;
}

.screen {
    position: relative;
    aspect-ratio: 12 / 5;
    border-radius: 28px;
    overflow: hidden;
    background: #1b1f1f;
}

/* Trois mondes se succèdent en fondu ; chacun glisse lentement, comme quand on l'explore */
.slide {
    position: absolute;
    inset: 0;
    background: 0% 50% / 135% auto no-repeat;
    opacity: 0;
    animation: monde 24s linear infinite;
}

.slide-1 { background-image: url(../images/apercu.jpg); }
.slide-2 { background-image: url(../images/apercu2.jpg); animation-delay: 8s; }
.slide-3 { background-image: url(../images/apercu3.jpg); animation-delay: 16s; }

@keyframes monde {
    0% { opacity: 0; background-position: 0% 50%; }
    4% { opacity: 1; }
    33.3% { opacity: 1; }
    37.5% { opacity: 0; background-position: 100% 50%; }
    100% { opacity: 0; background-position: 100% 50%; }
}

/* La loupe cherche dans la foule, puis s'arrête sur ce qu'elle a trouvé juste avant le changement de monde */
.loupe {
    position: absolute;
    left: 20%;
    top: 72%;
    width: 0;
    height: 0;
    animation: cherche 8s ease-in-out infinite;
}

.loupe svg {
    position: absolute;
    left: -22.5px;
    top: -22.5px;
    width: 60px;
    filter: drop-shadow(0 3px 5px #0006);
    transform-origin: 22.5px 22.5px;
    animation: touche 8s ease-in-out infinite;
}

.ripple {
    position: absolute;
    left: -34px;
    top: -34px;
    width: 68px;
    height: 68px;
    box-sizing: border-box;
    border: 5px solid #fff;
    border-radius: 50%;
    opacity: 0;
    animation: onde 8s ease-out infinite;
}

@keyframes cherche {
    0% { left: 20%; top: 72%; }
    16% { left: 34%; top: 34%; }
    32% { left: 58%; top: 58%; }
    48% { left: 74%; top: 30%; }
    62% { left: 52%; top: 26%; }
    76%, 90% { left: 44%; top: 56%; }
    100% { left: 20%; top: 72%; }
}

@keyframes touche {
    0%, 78%, 86%, 100% { transform: scale(1); }
    82% { transform: scale(0.85); }
}

@keyframes onde {
    0%, 81% { opacity: 0; transform: scale(0.2); }
    83% { opacity: 1; transform: scale(0.4); }
    93%, 100% { opacity: 0; transform: scale(1.6); }
}

@media (prefers-reduced-motion: reduce) {
    .slide, .loupe, .loupe svg, .ripple {
        animation: none;
    }

    .slide-1 {
        opacity: 1;
    }

    .loupe {
        display: none;
    }
}

.find-card {
    position: absolute;
    right: 4%;
    bottom: 8%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px 8px 10px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px #0005;
    font-weight: 700;
    color: #10817D;
}

.find-card img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.presentation main {
    padding: 0 32px;
}

.presentation section {
    max-width: 1040px;
    margin: 72px auto 0 auto;
}

.presentation section h2 {
    margin-bottom: 28px;
    font-size: 1.8rem;
    font-weight: 800;
    color: #10817D;
    text-align: center;
}

/* Les trois étapes */
.steps ol {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    counter-reset: etape;
}

.steps li {
    counter-increment: etape;
    padding: 28px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 2px 16px #10817d1a;
    color: #4d5b5a;
}

.steps li::before {
    content: counter(etape);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    background: #10817D;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
}

.steps b {
    display: block;
    margin-bottom: 6px;
    font-size: 1.15rem;
    color: #1d2b2a;
}

/* Les mondes */
.worlds ul {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 28px 16px;
}

.worlds li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #10817D;
}

/* cadre carré du dessin, animé par mondes-animes.css comme sur l'accueil du jeu */
.worlds .world-art {
    position: relative;
    width: 120px;
    max-width: none;
    aspect-ratio: 1;
}

.worlds .world-art img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.presentation footer {
    margin-top: 80px;
    padding: 32px;
    text-align: center;
    font-size: 0.85rem;
}

.presentation footer a {
    color: #6b7877;
}

.presentation footer a:hover {
    color: #10817D;
}

/* Fenêtre étroite : tout sur une colonne */
@media (max-width: 640px) {
    .hero {
        padding-top: 40px;
    }

    .hero-inner {
        flex-direction: column;
        text-align: center;
    }

    .presentation h1 {
        justify-content: center;
    }

    .stats {
        justify-content: center;
        gap: 24px;
    }

    .steps ol {
        grid-template-columns: 1fr;
    }

    .worlds ul {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Téléphone */
@media (max-width: 600px) {
    .hero {
        padding: 32px 20px 150px 20px;
    }

    .hero-inner {
        gap: 36px;
    }

    .presentation h1 {
        font-size: 1.9rem;
    }

    .langs {
        justify-content: center;
        margin-top: -14px;
    }

    .lead {
        font-size: 1.05rem;
    }

    .stats b {
        font-size: 1.9rem;
    }

    .presentation main {
        padding: 0 16px;
    }

    .phone {
        padding: 7px;
        border-radius: 22px;
    }

    .screen {
        border-radius: 16px;
    }

    .loupe {
        transform: scale(0.55);
    }

    .find-card {
        gap: 6px;
        padding: 4px 10px 4px 6px;
        border-radius: 10px;
        font-size: 0.75rem;
    }

    .find-card img {
        width: 30px;
        height: 30px;
    }

    .presentation section {
        margin-top: 56px;
    }

    .worlds .world-art {
        width: 96px;
    }
}

/* Téléphone tenu en paysage : le bandeau est resserré pour que le bouton Play reste visible sans défiler */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 24px 24px 130px 24px;
    }

    .langs {
        margin: -12px 0 4px 0;
    }

    .hero-inner {
        gap: 24px;
    }

    .presentation h1 {
        font-size: 1.8rem;
    }

    .lead {
        margin-top: 10px;
        font-size: 1rem;
    }

    .stats {
        margin-top: 16px;
    }

    .stats b {
        font-size: 1.6rem;
    }

    .play-btn {
        padding: 14px 44px 14px 32px;
        font-size: 1.4rem;
    }
}
